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

Public Member Functions

 ParserStateRewriter (ParserStructure *parserStructure, ParserStateInfo *state, ValueMap *valueMap, ReferenceMap *refMap, TypeMap *typeMap, ExpressionEvaluator *afterExec, StatesVisitedMap &visitedStates)
 Default constructor.
 
bool checkError ()
 
size_t getIndex ()
 
bool isOutOfBound ()
 
IR::Node * postorder (IR::Member *expression)
 Eliminates header stack acces next, last operations.
 
IR::Node * postorder (IR::PathExpression *expression)
 Adds a new index for transition if it is required by algorithm.
 
IR::Node * preorder (IR::ArrayIndex *expression)
 Updates indexes of a header stack.
 

Protected Member Functions

bool calledWithNoChanges (IR::ID id, const ParserStateInfo *state)
 
bool checkIndexes (const StackVariableIndexMap &prev, const StackVariableIndexMap &cur)
 Checks values of the headers stacks which were evaluated.
 
IR::ID genNewName (IR::ID id)
 Generated new state name.
 
const IR::Type * getTypeArray (const IR::Node *element)
 
bool was_called (cstring nm, IR::ID &id)
 

Member Function Documentation

◆ calledWithNoChanges()

bool P4::ParserStructureImpl::ParserStateRewriter::calledWithNoChanges ( IR::ID id,
const ParserStateInfo * state )
inlineprotected

Returns true for current id if indexes of the headers stack are the same before previous call of the same parser state.

◆ was_called()

bool P4::ParserStructureImpl::ParserStateRewriter::was_called ( cstring nm,
IR::ID & id )
inlineprotected

Checks if this state was called previously with the same state of header stack indexes. If it was called then it returns true and generates a new name with the stored index.