P4C
The P4 Compiler
 
Loading...
Searching...
No Matches
P4::ParseAnnotations Class Reference
Inheritance diagram for P4::ParseAnnotations:

Public Types

typedef std::function< bool(IR::Annotation *) Handler)
 
typedef std::unordered_map< cstring, HandlerHandlerMap
 Keyed on annotation names.
 

Public Member Functions

 ParseAnnotations (bool warn=false)
 Produces a pass that rewrites the spec-defined annotations.
 
 ParseAnnotations (const char *targetName, bool includeStandard, HandlerMap handlers, bool warn=false)
 Produces a pass that rewrites a custom set of annotations.
 
void addHandler (cstring name, Handler h)
 
void postorder (IR::Annotation *annotation) final
 

Static Public Member Functions

static bool parseConstantList (IR::Annotation *annotation)
 
static bool parseConstantOrStringLiteralList (IR::Annotation *annotation)
 
static bool parseEmpty (IR::Annotation *annotation)
 
static bool parseExpressionList (IR::Annotation *annotation)
 
static bool parseKvList (IR::Annotation *annotation)
 
static bool parseP4rtTranslationAnnotation (IR::Annotation *annotation)
 
static bool parseSkip (IR::Annotation *annotation)
 
static bool parseStringLiteralList (IR::Annotation *annotation)
 
static HandlerMap standardHandlers ()
 

Member Typedef Documentation

◆ Handler

typedef std::function<bool(IR::Annotation *) P4::ParseAnnotations::Handler)

A handler returns true when the body of the given annotation is parsed successfully.