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

Public Member Functions

 DoExpandLookahead (ReferenceMap *refMap, TypeMap *typeMap, bool expandHeader=true)
 
const IR::Node * postorder (IR::AssignmentStatement *statement) override
 
const IR::Node * postorder (IR::MethodCallStatement *statement) override
 
const IR::Node * postorder (IR::P4Parser *parser) override
 
const IR::Node * preorder (IR::P4Control *control) override
 
const IR::Node * preorder (IR::P4Parser *parser) override
 

Detailed Description

Given an assignment like a = lookahead<T>(); this is transformed into bit<sizeof(T)> tmp = lookahead<bit<sizeof(T)>>(); a.setValid(); // for header fields a.m0 = tmp[f1,f0]; a.m1 = tmp[f2, f1+1]; ...

Optional constructor argument expandHeader sets the expandHeader flag which determines whether headers (IR::Type_Header) are expanded or not. Default value for the flag (when optional constructor argument is not used) is true, which means that by default headers are expanded.