123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252(******************************************************************************)(* *)(* Menhir *)(* *)(* Copyright Inria. All rights reserved. This file is distributed under *)(* the terms of the GNU Library General Public License version 2, with a *)(* special exception on linking, as described in the file LICENSE. *)(* *)(******************************************************************************)(**This module defines a signature that describes the result of {!Cmly_read}. *)(* The following signatures describe the API offered by the functor
[Cmly_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=stringtypeidentifier=stringmoduleRange:sigtypetvalstartp:t->Lexing.positionvalendp:t->Lexing.positionendtype'alocated='a*Range.tmoduleAttribute:sigtypetvallabel:t->stringvalhas_label:string->t->boolvalpayload:t->stringvalposition:t->Range.tendmoduleAction:sigtypetvalexpr:t->ocamlexprvalkeywords:t->Keyword.keywordlistendmoduleSurface:sigtypefilename=stringtypename=stringmodulePriority_level:sigtypetvalinput_file:t->filenamevallevel:t->intendmoduleProducer:sigtype'symtvalsymbol:'symt->'symvalidentifier:_t->identifiervalattributes:_t->Attribute.tlistendmoduleBranch:sigtype'symtvalposition:_t->Range.tvalproducers:'symt->'symProducer.tlistvalaction:_t->Action.tvalprec_annotation:_t->namelocatedoptionvalproduction_level:_t->Priority_level.tvalattributes:_t->Attribute.tlistendmoduleParameter:sigtypettypedesc=|Varofname|Appofname*tlist|AnonymousoftBranch.tlistvaldesc:t->descvallocated:t->Range.tendmoduleRule:sigtype('param,'sym)tvalparameters:('param,_)t->'paramvalbranches:(_,'sym)t->'symBranch.tlistvalinline:_t->boolvalpositions:_t->Range.tlistvalpublic:_t->boolvalattributes:_t->Attribute.tlistendmoduleToken:sigtypettypeassociativity=|LeftAssoc|RightAssoc|NonAssoc|UndefinedAssocvalocamltype:t->ocamltypeoptionvalposition:t->Range.tvalalias:t->stringoptionvalattributes:t->Attribute.tlistvalassociativity:t->associativityvalprecedence:t->Priority_level.tlocatedoptionvalis_declared:t->boolendmoduleSyntax:sigtype('param,'sym)tvaltypes:(_,'sym)t->('sym*ocamltype)listvaltokens:_t->(name*Token.t)listvalrules:('param,'sym)t->(name*('param,'sym)Rule.t)listtypeground=(unit,name)ttypehigher=(namelist,Parameter.t)tendvalstart_symbols:namelistvalon_error_reduce:(name*Priority_level.t)listvalbefore_expansion:Syntax.highervalbefore_inlining:Syntax.groundend(* Surface *)moduleGrammar: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->stringmoduleProduction: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(* GRAMMAR *)