P4C
The P4 Compiler
 
Loading...
Searching...
No Matches
P4::DoSimplifyParsers Class Reference

Remove unreachable parser states, and collapse simple chains of states. More...

Inheritance diagram for P4::DoSimplifyParsers:

Public Member Functions

 DoSimplifyParsers (ReferenceMap *refMap)
 
const IR::Node * preorder (IR::P4Control *control) override
 
const IR::Node * preorder (IR::P4Parser *parser) override
 

Detailed Description

Remove unreachable parser states, and collapse simple chains of states.

Does not remove the "accept" state, even if it is not reachable. A transition between states s1 and s2 is part of a "simple" chain if:

  • there are no other outgoing edges from s1,
  • there are no other incoming edges to s2,
  • and s2 does not have annotations.