Info.TransitionSourcegoto g is the cardinality of the set of goto transitions in grammar g
any g is the cardinality of the set of all transitions (goto + shift) in grammar g
shift g is the cardinality of the set of shift transitions in grammar g
val of_goto :
'g grammar ->
'g goto_transition Fix.Indexing.index ->
'g transition Fix.Indexing.indexInject a goto transition index into the combined transition index space
val of_shift :
'g grammar ->
'g shift_transition Fix.Indexing.index ->
'g transition Fix.Indexing.indexInject a shift transition index into the combined transition index space
val split :
'g grammar ->
'g transition Fix.Indexing.index ->
('g goto_transition Fix.Indexing.index,
'g shift_transition Fix.Indexing.index)
Fix.Indexing.eitherProject a transition index into either a goto or shift transition index
val find_goto :
'g grammar ->
'g lr1 Fix.Indexing.index ->
'g nonterminal Fix.Indexing.index ->
'g goto_transition Fix.Indexing.indexfind_goto s nt finds the goto transition from state s labelled by nonterminal nt. Raises Invalid_argument if no such transition exists.
val find_goto_target :
'g grammar ->
'g lr1 Fix.Indexing.index ->
'g nonterminal Fix.Indexing.index ->
'g lr1 Fix.Indexing.indexfind_goto_target s nt returns the target state of the goto transition from s labelled by nt. Raises Invalid_argument if no such transition exists.
source tr returns the source (origin) state of transition tr
target tr returns the target (destination) state of transition tr
symbol tr returns the grammar symbol that labels transition tr
val goto_symbol :
'g grammar ->
'g goto_transition Fix.Indexing.index ->
'g nonterminal Fix.Indexing.indexgoto_symbol tr returns the nonterminal that labels goto transition tr
val shift_symbol :
'g grammar ->
'g shift_transition Fix.Indexing.index ->
'g terminal Fix.Indexing.indexshift_symbol tr returns the terminal that labels shift transition tr
successors g s returns the set of outgoing transitions from state s
val predecessors :
'g grammar ->
'g lr1 Fix.Indexing.index ->
'g transition Utils.Misc.indexsetpredecessors g s returns the set of incoming transitions to state s
accepting g is the set of accepting transitions in grammar g. These are goto transitions from an initial state to an accepting state, recognizing completion of a grammar entrypoint.
Converts a transition to a debug string of the form "source -> target"
val find :
'g grammar ->
'g lr1 Fix.Indexing.index ->
'g lr1 Fix.Indexing.index ->
'g transition Fix.Indexing.index optionfind g src tgt finds the transition from src to tgt, if one exists. Returns None if there is no direct transition between the two states.