P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::SplitFlowVisit_base Class Referenceabstract

#include <visitor.h>

Inheritance diagram for P4::SplitFlowVisit_base:
[legend]

Public Member Functions

virtual void dbprint (std::ostream &) const =0
 
virtual void do_visit ()=0
 
bool finished ()
 
void pause ()
 
virtual bool ready ()
 
virtual void run_visit ()
 
void unpause ()
 

Protected Member Functions

 SplitFlowVisit_base (Visitor &v)
 
void * operator new (size_t)
 

Protected Attributes

friend ControlFlowVisitor
 
bool paused = false
 
SplitFlowVisit_baseprev
 
int start_index = 0
 
Visitorv
 
int visit_next = 0
 
std::vector< Visitor * > visitors
 

Friends

void dump (const SplitFlowVisit_base *split)
 

Detailed Description

SplitFlowVisit_base is base class for doing coroutine-like processing of of flows in a visitor. A visit_children method (or a preorder override) can instantiate a local SplitFlowVist subclass to record the various children that need to be visited, and the chain of currently in existence SplitFlowVisit objects will be recorded in split_link. When flows need to be joined (to visit a Dag node with mulitple parents), processing of the node can be 'paused' and other children from the SplitFlowVist can be visited, in order to visit all parents before the child is visited.