package ppx_nanocaml
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=f9f6772ff2e53d8fb3c22b459e9eb1fd68aefff381c121c0588ea3d0791cf5ae
md5=38877f4878af035303e02b3c9a399e98
doc/nanocaml/Nanocaml/Lang/index.html
Module Nanocaml.Lang
type np_type = | NP_term of Ast.core_type(*external types are "terminals" *
*)| NP_nonterm of string(*named nonterminal *
*)| NP_tuple of np_type list(*
*)t * u * ...*| NP_list of np_type(*
*)t 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 *