Up

module Grammar

: sig
#
module Nonterminal : sig
#
type t
#
val n : int
#
val lookup : string -> t
#
val n2i : t -> int
#
val print : bool -> t -> string
#
val ocamltype : t -> Stretch.ocamltype option
#
val ocamltype_of_start_symbol : t -> Stretch.ocamltype
#
val iter : (t -> unit) -> unit
#
val fold : (t -> 'a -> 'a) -> 'a -> 'a
#
val map : (t -> 'a) -> 'a list
#
val iterx : (t -> unit) -> unit
#
val foldx : (t -> 'a -> 'a) -> 'a -> 'a
#
val tabulate : (t -> 'a) -> t -> 'a
#
val positions : t -> Positions.t list
#
val is_start : t -> bool
end
#
module Terminal : sig
#
type t
#
val n : int
#
val equal : t -> t -> bool
#
val lookup : string -> t
#
val t2i : t -> int
#
val print : t -> string
#
val ocamltype : t -> Stretch.ocamltype option
#
val sharp : t
#
val error : t
#
val eof : t option
#
val pseudo : t -> bool
#
val iter : (t -> unit) -> unit
#
val fold : (t -> 'a -> 'a) -> 'a -> 'a
#
val map : (t -> 'a) -> 'a list
#
val mapx : (t -> 'a) -> 'a list
end
#
module TerminalSet : sig
include GSet.S with type element = Terminal.t
#
val print : t -> string
#
val universe : t
end
#
module TerminalMap : GMap.S with type key = Terminal.t
#
module Symbol : sig
#
type t =
# | N of Nonterminal.t
# | T of Terminal.t
#
val equal : t -> t -> bool
#
val lequal : t list -> t list -> bool
#
val print : t -> string
#
val printl : t list -> string
#
val printa : t array -> string
#
val printao : int -> t array -> string
#
val printaod : int -> int -> t array -> string
end
#
module SymbolSet : Set.S with type elt = Symbol.t
#
module SymbolMap : sig
include Map.S with type key = Symbol.t
#
val domain : 'a t -> key list
#
val purelynonterminal : 'a t -> bool
end
#
module Production : sig
#
type index
#
val p2i : index -> int
#
val i2p : int -> index
#
val n : int
#
val def : index -> Nonterminal.t * Symbol.t array
#
val nt : index -> Nonterminal.t
#
val rhs : index -> Symbol.t array
#
val length : index -> int
#
val identifiers : index -> Syntax.identifier array
#
val used : index -> bool array
#
val action : index -> Syntax.action
#
val positions : index -> Positions.t list
#
val iter : (index -> unit) -> unit
#
val fold : (index -> 'a -> 'a) -> 'a -> 'a
#
val map : (index -> 'a) -> 'a list
#
val iterx : (index -> unit) -> unit
#
val foldx : (index -> 'a -> 'a) -> 'a -> 'a
#
val startsymbol2startprod : Nonterminal.t -> index
#
val iternt : Nonterminal.t -> (index -> unit) -> unit
#
val foldnt : Nonterminal.t -> 'a -> (index -> 'a -> 'a) -> 'a
#
val classify : index -> Nonterminal.t option
#
val is_start : index -> bool
#
val print : index -> string
#
val tabulate : (index -> 'a) -> index -> 'a
#
val tabulateb : (index -> bool) -> (index -> bool) * int
end
#
module ProductionMap : sig
include GMap.S with type key = Production.index
#
val start : (Production.index -> 'a) -> 'a t
end
#
module Analysis : sig
#
val nullable_first_rhs : Symbol.t array -> int -> bool * TerminalSet.t
#
val explain_first_rhs : Terminal.t -> Symbol.t array -> int -> string
#
val follow : Nonterminal.t -> TerminalSet.t
end
#
module Precedence : sig
#
type choice =
# | ChooseShift
# | ChooseReduce
# | ChooseNeither
# | DontKnow
#
val shift_reduce : Terminal.t -> Production.index -> choice
#
val reduce_reduce : Production.index -> Production.index -> Production.index option
end
#
val diagnostics : unit -> unit
end