123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142(******************************************************************************)(* *)(* Menhir *)(* *)(* François Pottier, Inria Paris *)(* Yann Régis-Gianas, PPS, Université Paris Diderot *)(* *)(* 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->intvaliter:(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.tlistendtypesymbol=|Tofterminal|Nofnonterminalvalsymbol_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.tlistendmoduleLr0:sigincludeINDEXEDwithtypet=lr0valincoming:t->symboloptionvalitems:t->itemlistendmoduleLr1:sigincludeINDEXEDwithtypet=lr1vallr0:t->lr0valtransitions:t->(symbol*t)listvalreductions:t->(terminal*productionlist)listendmodulePrint: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