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

Public Member Functions

 ExpressionConverter (ProgramStructure *structure)
 
const IR::Expression * convert (const IR::Node *node)
 
const IR::Type * getFieldType (const IR::Type_StructLike *ht, cstring fieldName)
 
const IR::Node * postorder (IR::ActionArg *arg) override
 
const IR::Node * postorder (IR::ConcreteHeaderRef *nhr) override
 
const IR::Node * postorder (IR::Constant *expression) override
 
const IR::Node * postorder (IR::Equ *equ) override
 
const IR::Node * postorder (IR::FieldList *fl) override
 
const IR::Node * postorder (IR::GlobalRef *gr) override
 
const IR::Node * postorder (IR::HeaderStackItemRef *ref) override
 
const IR::Node * postorder (IR::Mask *expression) override
 
const IR::Node * postorder (IR::Member *field) override
 
const IR::Node * postorder (IR::Neq *neq) override
 And the Neq.
 
const IR::Node * postorder (IR::PathExpression *ref) override
 
const IR::Node * postorder (IR::Primitive *primitive) override
 

Static Public Member Functions

static void addConverter (cstring type, funcType)
 
static funcType get (cstring type)
 

Public Attributes

bool replaceNextWithLast
 

Protected Types

using funcType = std::function<const IR::Node *(const IR::Node *)>
 

Protected Attributes

P4::P4CoreLibraryp4lib
 
ProgramStructurestructure
 

Static Protected Attributes

static std::map< cstring, funcType > * cvtForType = nullptr
 

Member Function Documentation

◆ postorder()

const IR::Node * P4V1::ExpressionConverter::postorder ( IR::Equ * equ)
override

P4_16 is stricter on comparing booleans with ints Therefore we convert such expressions into simply the boolean test