DIRECTORY
GrammarBasic USING[Grammar],
ParserGraphs USING[Graph, Node],
Rope USING[ROPE];
BEGIN OPEN GrammarBasic, ParserGraphs, Rope;
Event: TYPE = {choosingStage1Node, propagatingItem, freezingOldSet, freezingNewSet, nodeBecomesDirty, choosingDirtyNode};
CreateLR0CanonicalParser: PROC[Grammar, PROC[Event]] RETURNS[Graph];
CreateLALR1Parser: PROC[LR0Parser: Graph, noteEvent: PROC[Event]] RETURNS[Graph];
MarkRingNumbers: PROC[LALR1Parser: Graph] RETURNS[maxRingNumber: CARDINAL];
-- LAST[CARDINAL] if consistent
SplitUpToRing: PROC[LALR1Parser: Graph, ring: CARDINAL, noteEvent: PROC[Event]] RETURNS[Graph];
SplitMarkedNodes: PROC[LALR1Parser: Graph, noteEvent: PROC[Event]] RETURNS[Graph];
TestSplitNodeGraphConsistency: PROC[splitGraph: Graph] RETURNS[consistent: BOOLEAN];
TestConsistencyOfNode: PROCEDURE[node: Node] RETURNS[--consistent-- BOOLEAN];
GenerateParseActions: PROC[graph: Graph,
symbol: PROC[text: ROPE],
uniqueToken: PROC[name: ROPE, spelling: ROPE],
genericToken: PROC[name: ROPE, class: ROPE],
shift: PROC[state: CARDINAL, terminalSeq: ROPE, newState: CARDINAL],
reduction: PROC[state: CARDINAL, terminalSeq: ROPE, leftSide: ROPE, ruleNumber: CARDINAL, ruleSize: CARDINAL],
acceptance: PROC[state: CARDINAL, terminalSeq: ROPE],
start: PROC[state: CARDINAL]];
CheckAGraph: PROC[Graph]; -- looks for the existence of duplicate LR1 sets.
END..