123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166(******************************************************************************)(* *)(* Menhir *)(* *)(* Copyright Inria. All rights reserved. This file is distributed under *)(* the terms of the GNU General Public License version 2, as described in *)(* the file LICENSE. *)(* *)(******************************************************************************)(* The following signatures describe the API offered by the functor
[Cfmly_read.Read]. This functor reads in a .cmly file and gives
access to the description of the grammar and automaton contained
in this file. *)(* This API is currently entirely self-contained, except for a reference
to the module [Keyword], which is also part of [MenhirSdk]. *)(**The module type [INDEXED] describes a type [t] whose elements are
in a bijection with an integer interval of the form [\[0..count)]. *)moduletypeINDEXED=sigtypetvalcount:intvalof_int:int->tvalto_int:t->int(* Hashing, equality and ordering. *)valhash:t->intvalequal:t->t->boolvalcompare:t->t->int(* Iteration and tabulation. *)valiter:(t->unit)->unitvalfold:(t->'a->'a)->'a->'avaltabulate:(t->'a)->t->'aend(**The module type [GRAMMAR] describes the grammar and automaton. *)moduletypeGRAMMAR=sigtypeterminal=privateinttypenonterminal=privateinttypeproduction=privateinttypelr0=privateinttypelr1=privateinttypeitem=production*inttypeocamltype=stringtypeocamlexpr=stringmoduleRange:sigtypetvalstartp:t->Lexing.positionvalendp:t->Lexing.positionendmoduleAttribute:sigtypetvallabel:t->stringvalhas_label:string->t->boolvalpayload:t->stringvalposition:t->Range.tendmoduleGrammar:sigvalbasename:stringvalpreludes:stringlistvalpostludes:stringlistvalparameters:stringlistvalentry_points:(nonterminal*production*lr1)listvalattributes:Attribute.tlistendmoduleTerminal:sigincludeINDEXEDwithtypet=terminalvalname:t->stringvalkind:t->[`REGULAR|`ERROR|`EOF|`PSEUDO]valtyp:t->ocamltypeoptionvalattributes:t->Attribute.tlistendmoduleNonterminal:sigincludeINDEXEDwithtypet=nonterminalvalname:t->stringvalmangled_name:t->stringvalkind:t->[`REGULAR|`START]valtyp:t->ocamltypeoptionvalpositions:t->Range.tlistvalnullable:t->boolvalfirst:t->terminallistvalattributes:t->Attribute.tlistendmoduleSymbol:sigtypet=|Tofterminal|Nofnonterminalvalname:?mangled:bool->t->string(* Hashing, equality and ordering. *)valhash:t->intvalequal:t->t->boolvalcompare:t->t->intend(**The type [symbol] is a synonym for [Symbol.t]. *)typesymbol=Symbol.t=|Tofterminal|Nofnonterminal(**[symbol_name] is a synonym for [Symbol.name]. *)valsymbol_name:?mangled:bool->symbol->stringtypeidentifier=stringmoduleAction:sigtypetvalexpr:t->ocamlexprvalkeywords:t->Keyword.keywordlistendmoduleProduction:sigincludeINDEXEDwithtypet=productionvalkind:t->[`REGULAR|`START]vallhs:t->nonterminalvalrhs:t->(symbol*identifier*Attribute.tlist)arrayvalpositions:t->Range.tlistvalaction:t->Action.toptionvalattributes:t->Attribute.tlist(* Before 2023/08/02, these were the attributes of the left-hand
side of the production. Now, these are the attributes of the
production itself. *)endmoduleLr0:sigincludeINDEXEDwithtypet=lr0valincoming:t->symboloptionvalitems:t->itemlistendmoduleLr1:sigincludeINDEXEDwithtypet=lr1vallr0:t->lr0valtransitions:t->(symbol*t)listvalget_reductions:t->(terminal*production)listvaldefault_reduction:t->productionoptionvalreductions:t->(terminal*productionlist)list[@@ocaml.deprecated"Please use [get_reductions]"]endmodulePrint:sigopenFormatvalterminal:formatter->terminal->unitvalnonterminal:formatter->nonterminal->unitvalsymbol:formatter->symbol->unitvalmangled_nonterminal:formatter->nonterminal->unitvalmangled_symbol:formatter->symbol->unitvalproduction:formatter->production->unitvalitem:formatter->item->unitvalitemset:formatter->itemlist->unitvalannot_item:stringlist->formatter->item->unitvalannot_itemset:stringlistlist->formatter->itemlist->unitendend