P4C
The P4 Compiler
BaseCompileContext Class Reference
Inheritance diagram for BaseCompileContext:
[legend]

Public Member Functions

virtual ErrorReportererrorReporter ()
 
virtual DiagnosticAction getDefaultErrorDiagnosticAction ()
 
virtual DiagnosticAction getDefaultInfoDiagnosticAction ()
 
virtual DiagnosticAction getDefaultWarningDiagnosticAction ()
 
virtual DiagnosticAction getDiagnosticAction (cstring diagnostic, DiagnosticAction defaultAction)
 

Static Public Member Functions

static BaseCompileContextget ()
 

Protected Member Functions

 BaseCompileContext (const BaseCompileContext &other)=default
 
BaseCompileContextoperator= (const BaseCompileContext &other)=default
 

Detailed Description

A base compilation context which provides members needed by code in libp4ctoolkit. Compilation context types should normally inherit from BaseCompileContext.

Member Function Documentation

◆ errorReporter()

ErrorReporter & BaseCompileContext::errorReporter ( )
virtual
Returns
the error reporter for this compilation context.

◆ get()

BaseCompileContext & BaseCompileContext::get ( )
static
Returns
the current compilation context, which must inherit from BaseCompileContext.

◆ getDefaultErrorDiagnosticAction()

DiagnosticAction BaseCompileContext::getDefaultErrorDiagnosticAction ( )
virtual
Returns
the default diagnostic action for calls to ::error().

◆ getDefaultInfoDiagnosticAction()

DiagnosticAction BaseCompileContext::getDefaultInfoDiagnosticAction ( )
virtual
Returns
the default diagnostic action for calls to ::info().

Reimplemented in P4CContext.

◆ getDefaultWarningDiagnosticAction()

DiagnosticAction BaseCompileContext::getDefaultWarningDiagnosticAction ( )
virtual
Returns
the default diagnostic action for calls to ::warning().

Reimplemented in P4CContext.

◆ getDiagnosticAction()

DiagnosticAction BaseCompileContext::getDiagnosticAction ( cstring  diagnostic,
DiagnosticAction  defaultAction 
)
virtual
Returns
the diagnostic action to use for @diagnosticName, or @defaultAction if no diagnostic action was found.

Reimplemented in P4CContext.