Module MenhirLib.EngineTypesSource
This module defines several types and module types that are used in the specification of the module Engine.
type ('state, 'semantic_value) stack = {state : 'state;(*The state that we should go back to if we pop this stack cell.
This convention means that the state contained in the top stack cell is not the current state
*)env.current. It also means that the state found within the sentinel is a dummy -- it is never consulted. This convention is the same as that adopted by the code-based back-end.semv : 'semantic_value;(*The semantic value associated with the chunk of input that this cell represents.
*)startp : Lexing.position;(*The start position of the chunk of input that this cell represents.
*)endp : Lexing.position;(*The end position of the chunk of input that this cell represents.
*)next : ('state, 'semantic_value) stack;(*The next cell down in the stack. If this is a self-pointer, then this cell is the sentinel, and the stack is conceptually empty.
*)
}A stack is a linked list of cells. A sentinel cell -- which is its own successor -- is used to mark the bottom of the stack. The sentinel cell itself is not significant -- it contains dummy values.
type ('state, 'semantic_value, 'token) env = {error : bool;(*If this flag is true, then the first component of
*)env.tripleshould be ignored, as it has been logically overwritten with theerrorpseudo-token.triple : 'token * Lexing.position * Lexing.position;(*The last token that was obtained from the lexer, together with its start and end positions. Warning: before the first call to the lexer has taken place, a dummy (and possibly invalid) token is stored here.
*)stack : ('state, 'semantic_value) stack;(*The stack.
*)current : 'state;(*The current state.
*)
}A parsing environment contains all of the parser's state (except for the current program point).
A number of logging hooks are used to (optionally) emit logging messages.
This signature describes the parameters that must be supplied to the LR engine.
This signature describes the monolithic (traditional) LR engine. When the engine is used in this mode, the parser controls the lexer.
This signature describes just the entry point of the incremental LR engine. It is a supplement to IncrementalEngine.INCREMENTAL_ENGINE.