package menhirCST
Library
Module
Module type
Parameter
Class
Class type
val number : state -> int
An injective mapping of states to integers.
A token is conceptually a pair of a terminal symbol and a semantic value. token2terminal
is the first pair projection: it maps a token to the corresponding terminal symbol.
val lhs : production -> nonterminal
lhs prod
returns the left-hand side of the production prod
.
maybe_shift_t s t
determines whether there exists a transition out of the state s
, labeled with the terminal symbol t
, to some state s'
. If so, it returns Some s'
. Otherwise, it returns None
.
val maybe_goto_nt : state -> nonterminal -> state option
maybe_goto_nt s nt
determines whether there exists a transition out of the state s
, labeled with the nonterminal symbol nt
, to some state s'
. If so, it returns Some s'
. Otherwise, it returns None
.
val may_reduce_prod : state -> terminal -> production -> bool
may_reduce_prod s t prod
determines whether in the state s
, with lookahead symbol t
, the automaton reduces production prod
. This test accounts for the possible existence of a default reduction.