Every statement contains some basic information about it (which really lives in the Statement class). Specific types of Statements are specialized by deriving them from the Statement class. The Statement class contains the type of the statement, pointers to the lexically next and previous statements, the original line number, a pointer to the immediately outer loop (if any) in which this statement is found, the set of expressions read, the set of expressions written, the set of predecessor and successor statements, the assertions associated with the statement, etc.
The Polaris base keeps the next, prev, predecessors, successors, follow, lead, outer, in_refs, out_refs, and act_refs incrementally correct throughout the compilation process. Th only exception to this is for the in_refs, out_refs, and act_refs when using the assign/pull operations. After those are done, the user must re-build the _refs explicitly.
The FLOWENTRY statement has all ENTRY statements in the ProgramUnit in its successor set. The FLOWEXIT has all STOP and RETURN statements in the ProgramUnit in its predecessor set.
There is always a then-part associated with the IF statement. The then-part always contains an IMPLIED GOTO statement just prior to the ENDIF statement. If an ELSE statement exists within the IF construct, then there will also be an IMPLIED GOTO statement placed just prior to the ELSE statement.
The IMPLIED GOTO statements exist to represent the implicit branch which interrupts the control flow at those two statements when the program executes. They are merely markers and contain no useful information. The flow of control change is reflected in the next_ref() and prev_ref() member functions for those statements.