Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Cfg_intf.CFGSourceInterface to context-free grammars
module ProdSet : Set.S with type elt = Spec.prod * Spec.symbol listmodule ProdMap : Map.S with type key = Spec.prod * Spec.symbol listval empty : grammarempty is the empty grammar.
val add_prod : grammar -> Spec.nt -> Spec.prod -> Spec.symbol list -> grammaradd_prod gr nt prod sl adds a production with tag prod that derives to symbol list sl to nonterminal nt in grammar gr.
remove_nt gr nt removes nonterminal nt from grammar gr.
val grammar_of_live : live_grammar -> grammargrammar_of_live gr converts a live grammar to a normal grammar.
prune_unproductive gr prunes all unproductive entitites in gr.
val prune_nonlive : grammar -> live_grammarprune_nonlive gr prunes all nonlive entities in gr.
prune_unreachable gr nt prunes all entities in grammar gr which cannot be reached from nonterminal nt.
val prune_unreachable_live : live_grammar -> Spec.nt -> live_grammarprune_unreachable_live gr nt prunes all entities in live grammar gr which cannot be reached from nonterminal nt. The resulting grammar contains derivation information.
make_sane gr nt prunes all useless entities in grammar gr using nonterminal nt as start symbol.
val make_sane_live : grammar -> Spec.nt -> live_grammarmake_sane_live gr nt prunes all useless entities in grammar gr using nonterminal nt as start symbol.
grammar_contents gr returns a traversable representation of grammar gr.
val deriv_depth_info : live_grammar -> (int * int ProdMap.t) NTMap.tderiv_depth_info gr returns a traversable representation of live grammar gr: the left part of the tuple to which nonterminals are mapped tells the minimum derivation depth needed to completely derive the corresponding nonterminal, the right part contains a map of productions which are mapped to their minimum derivation depth.
prods_in_grammar gr returns the set of all productions in gr.