P4C
The P4 Compiler
Loading...
Searching...
No Matches
BFN::AncestorStates Struct Reference

Public Member Functions

int getCurrentIndex (cstring header)
 
unsigned getCurrentIteration (cstring origName) const
 
void pop ()
 
void push (IR::BFN::ParserState *state)
 Encounter this state, push to stack.
 
bool visited (const IR::BFN::ParserState *state) const
 

Public Attributes

std::vector< IR::BFN::ParserState * > stack
 

Detailed Description

Keeps track of visited states which are all ancestors to the current state.

Member Function Documentation

◆ getCurrentIteration()

unsigned BFN::AncestorStates::getCurrentIteration ( cstring origName) const
inline

Given the state with the original name, check on the visited stack that how many times this state has been unrolled.

◆ pop()

void BFN::AncestorStates::pop ( )
inline

Done visiting this state and all of its descendants, pop it off the stack.

Member Data Documentation

◆ stack

std::vector<IR::BFN::ParserState *> BFN::AncestorStates::stack

We maintain the visited states in a stack as we visit in a DFS order.