`sig
type ('state, 'semantic_value) stack = {
state : 'state;
semv : 'semantic_value;
startp : Stdlib.Lexing.position;
endp : Stdlib.Lexing.position;
next : ('state, 'semantic_value) CamlinternalMenhirLib.EngineTypes.stack;
}
type ('state, 'semantic_value, 'token) env = {
error : bool;
triple : 'token * Stdlib.Lexing.position * Stdlib.Lexing.position;
stack : ('state, 'semantic_value) CamlinternalMenhirLib.EngineTypes.stack;
current : 'state;
}
module type TABLE =
sig
type state
val number : CamlinternalMenhirLib.EngineTypes.TABLE.state -> int
type token
type terminal
type nonterminal
type semantic_value
val token2terminal :
CamlinternalMenhirLib.EngineTypes.TABLE.token ->
CamlinternalMenhirLib.EngineTypes.TABLE.terminal
val token2value :
CamlinternalMenhirLib.EngineTypes.TABLE.token ->
CamlinternalMenhirLib.EngineTypes.TABLE.semantic_value
val error_terminal : CamlinternalMenhirLib.EngineTypes.TABLE.terminal
val error_value :
CamlinternalMenhirLib.EngineTypes.TABLE.semantic_value
val foreach_terminal :
(CamlinternalMenhirLib.EngineTypes.TABLE.terminal -> 'a -> 'a) ->
'a -> 'a
type production
val production_index :
CamlinternalMenhirLib.EngineTypes.TABLE.production -> int
val find_production :
int -> CamlinternalMenhirLib.EngineTypes.TABLE.production
val default_reduction :
CamlinternalMenhirLib.EngineTypes.TABLE.state ->
('env ->
CamlinternalMenhirLib.EngineTypes.TABLE.production -> 'answer) ->
('env -> 'answer) -> 'env -> 'answer
val action :
CamlinternalMenhirLib.EngineTypes.TABLE.state ->
CamlinternalMenhirLib.EngineTypes.TABLE.terminal ->
CamlinternalMenhirLib.EngineTypes.TABLE.semantic_value ->
('env ->
bool ->
CamlinternalMenhirLib.EngineTypes.TABLE.terminal ->
CamlinternalMenhirLib.EngineTypes.TABLE.semantic_value ->
CamlinternalMenhirLib.EngineTypes.TABLE.state -> 'answer) ->
('env ->
CamlinternalMenhirLib.EngineTypes.TABLE.production -> 'answer) ->
('env -> 'answer) -> 'env -> 'answer
val goto_nt :
CamlinternalMenhirLib.EngineTypes.TABLE.state ->
CamlinternalMenhirLib.EngineTypes.TABLE.nonterminal ->
CamlinternalMenhirLib.EngineTypes.TABLE.state
val goto_prod :
CamlinternalMenhirLib.EngineTypes.TABLE.state ->
CamlinternalMenhirLib.EngineTypes.TABLE.production ->
CamlinternalMenhirLib.EngineTypes.TABLE.state
val maybe_goto_nt :
CamlinternalMenhirLib.EngineTypes.TABLE.state ->
CamlinternalMenhirLib.EngineTypes.TABLE.nonterminal ->
CamlinternalMenhirLib.EngineTypes.TABLE.state option
val is_start :
CamlinternalMenhirLib.EngineTypes.TABLE.production -> bool
exception Error
type semantic_action =
(CamlinternalMenhirLib.EngineTypes.TABLE.state,
CamlinternalMenhirLib.EngineTypes.TABLE.semantic_value,
CamlinternalMenhirLib.EngineTypes.TABLE.token)
CamlinternalMenhirLib.EngineTypes.env ->
(CamlinternalMenhirLib.EngineTypes.TABLE.state,
CamlinternalMenhirLib.EngineTypes.TABLE.semantic_value)
CamlinternalMenhirLib.EngineTypes.stack
val semantic_action :
CamlinternalMenhirLib.EngineTypes.TABLE.production ->
CamlinternalMenhirLib.EngineTypes.TABLE.semantic_action
val may_reduce :
CamlinternalMenhirLib.EngineTypes.TABLE.state ->
CamlinternalMenhirLib.EngineTypes.TABLE.production -> bool
val log : bool
module Log :
sig
val state : CamlinternalMenhirLib.EngineTypes.TABLE.state -> unit
val shift :
CamlinternalMenhirLib.EngineTypes.TABLE.terminal ->
CamlinternalMenhirLib.EngineTypes.TABLE.state -> unit
val reduce_or_accept :
CamlinternalMenhirLib.EngineTypes.TABLE.production -> unit
val lookahead_token :
CamlinternalMenhirLib.EngineTypes.TABLE.terminal ->
Stdlib.Lexing.position -> Stdlib.Lexing.position -> unit
val initiating_error_handling : unit -> unit
val resuming_error_handling : unit -> unit
val handling_error :
CamlinternalMenhirLib.EngineTypes.TABLE.state -> unit
end
end
module type MONOLITHIC_ENGINE =
sig
type state
type token
type semantic_value
exception Error
val entry :
CamlinternalMenhirLib.EngineTypes.MONOLITHIC_ENGINE.state ->
(Stdlib.Lexing.lexbuf ->
CamlinternalMenhirLib.EngineTypes.MONOLITHIC_ENGINE.token) ->
Stdlib.Lexing.lexbuf ->
CamlinternalMenhirLib.EngineTypes.MONOLITHIC_ENGINE.semantic_value
end
module type INCREMENTAL_ENGINE_START =
sig
type state
type semantic_value
type 'a checkpoint
val start :
CamlinternalMenhirLib.EngineTypes.INCREMENTAL_ENGINE_START.state ->
Stdlib.Lexing.position ->
CamlinternalMenhirLib.EngineTypes.INCREMENTAL_ENGINE_START.semantic_value
CamlinternalMenhirLib.EngineTypes.INCREMENTAL_ENGINE_START.checkpoint
end
module type ENGINE =
sig
type state
type token
type semantic_value
exception Error
val entry :
state -> (Lexing.lexbuf -> token) -> Lexing.lexbuf -> semantic_value
type production
type 'a env
type 'a checkpoint = private
InputNeeded of 'a env
| Shifting of 'a env * 'a env * bool
| AboutToReduce of 'a env * production
| HandlingError of 'a env
| Accepted of 'a
| Rejected
val offer :
'a checkpoint ->
token * IncrementalEngine.position * IncrementalEngine.position ->
'a checkpoint
val resume : 'a checkpoint -> 'a checkpoint
type supplier =
unit ->
token * IncrementalEngine.position * IncrementalEngine.position
val lexer_lexbuf_to_supplier :
(Lexing.lexbuf -> token) -> Lexing.lexbuf -> supplier
val loop : supplier -> 'a checkpoint -> 'a
val loop_handle :
('a -> 'answer) ->
('a checkpoint -> 'answer) -> supplier -> 'a checkpoint -> 'answer
val loop_handle_undo :
('a -> 'answer) ->
('a checkpoint -> 'a checkpoint -> 'answer) ->
supplier -> 'a checkpoint -> 'answer
val shifts : 'a checkpoint -> 'a env option
val acceptable :
'a checkpoint -> token -> IncrementalEngine.position -> bool
type 'a lr1state = state
val number : 'a lr1state -> int
val production_index : production -> int
val find_production : int -> production
type element =
Element : 'a lr1state * 'a * IncrementalEngine.position *
IncrementalEngine.position -> element
type stack = element General.stream
val stack : 'a env -> stack
val top : 'a env -> element option
val pop_many : int -> 'a env -> 'a env option
val get : int -> 'a env -> element option
val current_state_number : 'a env -> int
val equal : 'a env -> 'a env -> bool
val positions :
'a env -> IncrementalEngine.position * IncrementalEngine.position
val env_has_default_reduction : 'a env -> bool
val state_has_default_reduction : 'a lr1state -> bool
val pop : 'a env -> 'a env option
val force_reduction : production -> 'a env -> 'a env
val input_needed : 'a env -> 'a checkpoint
val start : state -> Lexing.position -> semantic_value checkpoint
end
end`