Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Nanocaml.Langtype np_type = | NP_term of Ast.core_typeexternal types are "terminals" *
*)| NP_nonterm of stringnamed nonterminal *
*)| NP_tuple of np_type listt * u * ... *
| NP_list of np_typet list *
a type recognized by nanopass; usually a part of a production. e.g. string, stmt, (string * expr) list *
a production is one of the forms in a nonterminal -- essentially just a variant, e.g. `Var, `App. *
type np_nonterm = {npnt_loc : Nanocaml.Ast.Location.t;npnt_name : string;npnt_productions : np_production list;}a nonterminal is a type defined by a nanopass language, e.g. expr, stmt. *
type np_language = {npl_loc : Nanocaml.Ast.Location.t;npl_name : string;npl_nonterms : np_nonterm list;}a nanopass language, e.g. L0, L1 (as traditionally named) *
val string_of_type : np_type -> stringval languages : (string, np_language) Batteries.Hashtbl.tglobal table of all defined languages. *
val add_language : np_language -> unitglobally registers the given language. raises Location.Error if a language with the same name is already defined. *
val find_language : ?exn:exn -> string -> np_languagereturns the language with the given name. raises Not_found if no such language has been defined. *
val language_nonterm : ?exn:exn -> np_language -> string -> np_nontermlanguage_nonterm l name returns the nonterminal in language l with the given name. raises Not_found if no such nonterminal.
val type_of_core_type : nt_names:string list -> Ast.core_type -> np_typeconvert core_type into nanopass type. *
val production_of_row_field :
nt_names:string list ->
Ast.row_field ->
np_productionconvert row_field (from polymorphic variant) into nanopass production *
val nonterm_of_type_decl :
?extending:np_language ->
nt_names:string list ->
Ast.type_declaration ->
np_nontermconvert type_declaration into nanopass nonterminal *
val language_of_module : Ast.module_binding -> np_languageconvert module_binding into nanopass language *