sig
val version : string
type token_name = string
type nonterminal_name = string
type code = string
type token_declaration = {
mutable td_type : string option;
mutable td_names : Yacclib.token_name list;
}
type declaration =
Dec_token of Yacclib.token_declaration
| Dec_start of Yacclib.nonterminal_name list
| Dec_type of Yacclib.token_declaration
| Dec_left of Yacclib.token_name list
| Dec_right of Yacclib.token_name list
| Dec_nonassoc of Yacclib.token_name list
type symbol =
Token of Yacclib.token_name
| Nonterminal of Yacclib.nonterminal_name
type rule = {
mutable r_symbols : Yacclib.symbol list;
mutable r_prec : Yacclib.token_name option;
mutable r_action : Yacclib.code;
}
type nonterminal = {
mutable nt_name : Yacclib.nonterminal_name;
mutable nt_rules : Yacclib.rule list;
}
type parser = {
mutable p_header : string;
mutable p_declarations : Yacclib.declaration list;
mutable p_nonterms : Yacclib.nonterminal list;
mutable p_trailer : string;
}
exception Parse_error of int * int
val parse_file : string -> Yacclib.parser
val parse_string : string -> Yacclib.parser
val declaration_of_string : string -> Yacclib.declaration
val rule_symbols_of_string : string -> Yacclib.symbol list
val string_of_header : Yacclib.code -> string
val string_of_declaration : Yacclib.declaration -> string
val string_of_declarations : Yacclib.declaration list -> string
val string_of_symbol : Yacclib.symbol -> Yacclib.token_name
val string_of_rule : Yacclib.rule -> string
val string_of_rules : Yacclib.rule list -> string
val string_of_nonterm : Yacclib.nonterminal -> string
val string_of_nonterms : Yacclib.nonterminal list -> string
val string_of_trailer : 'a -> 'a
val string_of_parser : Yacclib.parser -> string
val print : Pervasives.out_channel -> Yacclib.parser -> unit
val print_file : string -> Yacclib.parser -> unit
val print_dot :
Pervasives.out_channel ->
?from:Yacclib.nonterminal_name -> Yacclib.parser -> unit
end