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

The main class for parsers' states key for visited checking. More...

Public Member Functions

 VisitedKey (const ParserStateInfo *stateInfo)
 
 VisitedKey (cstring name, StackVariableMap &indexes)
 
bool operator< (const VisitedKey &e) const
 

Public Attributes

StackVariableMap indexes
 
cstring name
 

Detailed Description

The main class for parsers' states key for visited checking.

Member Function Documentation

◆ operator<()

bool P4::VisitedKey::operator< ( const VisitedKey & e) const
inline

Checks of two states to be less. If name < e.name then it returns true. if name > e.name then it returns false. If name is equal e.name then it checks the values of the headers stack indexes. For both map of header stacks' indexes it creates map of pairs of values for each header stack index. If some indexes are missing then it cosiders them as -1. Next, it continues checking each pair in a intermidiate map with the same approach as for name and e.name.