P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::P4Tools::CompileContext< OptionsType > Class Template Reference

A compilation context for P4Tools that provides a custom compiler configuration. More...

#include <context.h>

Inheritance diagram for P4::P4Tools::CompileContext< OptionsType >:
[legend]

Public Member Functions

template<typename OptionsDerivedType >
 CompileContext (CompileContext< 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 CompileContextget ()
 
- Static Public Member Functions inherited from P4::P4CContext
static P4CContextget ()
 
static const P4CConfigurationgetConfig ()
 
- Static Public Member Functions inherited from P4::BaseCompileContext
static BaseCompileContextget ()
 

Protected Member Functions

const CompilerConfigurationgetConfigImpl () override
 
- Protected Member Functions inherited from P4::P4CContext
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::P4Tools::CompileContext< OptionsType >

A compilation context for P4Tools that provides a custom compiler configuration.

Member Function Documentation

◆ get()

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

◆ getConfigImpl()

template<typename OptionsType >
const CompilerConfiguration & P4::P4Tools::CompileContext< OptionsType >::getConfigImpl ( )
inlineoverrideprotectedvirtual
Returns
the compiler configuration associated with this type of compilation context.

Reimplemented from P4::P4CContext.

◆ options()

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

Implements P4::P4CContext.