P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::P4CContextWithOptions< OptionsType > Class Template Referencefinal

#include <parser_options.h>

Inheritance diagram for P4::P4CContextWithOptions< OptionsType >:
[legend]

Public Member Functions

template<typename OptionsDerivedType >
 P4CContextWithOptions (P4CContextWithOptions< OptionsDerivedType > &context)
 
template<typename OptionsDerivedType >
P4CContextWithOptionsoperator= (P4CContextWithOptions< OptionsDerivedType > &context)
 
OptionsType & options () override
 
- Public Member Functions inherited from P4::P4CContext
DiagnosticAction getDefaultInfoDiagnosticAction () final
 
DiagnosticAction getDefaultWarningDiagnosticAction () final
 
void setDefaultInfoDiagnosticAction (DiagnosticAction action)
 set the default diagnostic action for calls to P4::info().
 
void setDefaultWarningDiagnosticAction (DiagnosticAction action)
 set the default diagnostic action for calls to P4::warning().
 
void setDiagnosticAction (std::string_view diagnostic, DiagnosticAction action)
 Set the action to take for the given diagnostic.
 
- Public Member Functions inherited from P4::BaseCompileContext
virtual ErrorReportererrorReporter ()
 
virtual DiagnosticAction getDefaultErrorDiagnosticAction ()
 

Static Public Member Functions

static P4CContextWithOptionsget ()
 
- Static Public Member Functions inherited from P4::P4CContext
static P4CContextget ()
 
static const P4CConfigurationgetConfig ()
 
- Static Public Member Functions inherited from P4::BaseCompileContext
static BaseCompileContextget ()
 

Additional Inherited Members

- Protected Member Functions inherited from P4::P4CContext
virtual const P4CConfigurationgetConfigImpl ()
 
virtual bool isRecognizedDiagnostic (cstring diagnostic)
 
- Protected Member Functions inherited from P4::BaseCompileContext
 BaseCompileContext (const BaseCompileContext &other)=default
 
BaseCompileContextoperator= (const BaseCompileContext &other)=default
 
- Protected Member Functions inherited from P4::ICompileContext

Detailed Description

template<typename OptionsType>
class P4::P4CContextWithOptions< OptionsType >

A utility template which can be used to easily make subclasses of P4CContext which expose a particular subclass of CompilerOptions. This is provided as a convenience since this is all many backends need.

Member Function Documentation

◆ get()

template<typename OptionsType >
static P4CContextWithOptions & P4::P4CContextWithOptions< OptionsType >::get ( )
inlinestatic
Returns
the current compilation context, which must be of type P4CContextWithOptions<OptionsType>.

◆ options()

template<typename OptionsType >
OptionsType & P4::P4CContextWithOptions< OptionsType >::options ( )
inlineoverridevirtual
Returns
the compiler options for this compilation context.

Implements P4::P4CContext.