module Yacclib: sig .. end
Parsing and printing ocamlyacc .mly files.
Version
val version : string
Version of the library.
Types
type token_name = string
type nonterminal_name = string
type code = string
type token_declaration = {
|
mutable td_type : string option; |
|
mutable td_names : token_name list; |
}
type declaration =
type symbol =
type rule = {
}
type nonterminal = {
}
type parser = {
|
mutable p_header : string; |
|
mutable p_declarations : declaration list; |
|
mutable p_nonterms : nonterminal list; |
|
mutable p_trailer : string; |
}
Parsing
exception Parse_error of int * int
val parse_file : string -> parser
val parse_string : string -> parser
val declaration_of_string : string -> declaration
val rule_symbols_of_string : string -> symbol list
Printing
val string_of_header : code -> string
val string_of_declaration : declaration -> string
val string_of_declarations : declaration list -> string
val string_of_symbol : symbol -> token_name
val string_of_rule : rule -> string
val string_of_rules : rule list -> string
val string_of_nonterm : nonterminal -> string
val string_of_nonterms : nonterminal list -> string
val string_of_trailer : 'a -> 'a
val string_of_parser : parser -> string
val print : Pervasives.out_channel -> parser -> unit
val print_file : string -> parser -> unit
val print_dot : Pervasives.out_channel ->
?from:nonterminal_name -> parser -> unit