diff --git a/bootstrap/bin/hocc/Parse.hmh b/bootstrap/bin/hocc/Parse.hmh new file mode 100644 index 00000000..a050423b --- /dev/null +++ b/bootstrap/bin/hocc/Parse.hmh @@ -0,0 +1,1992 @@ +open Basis +open! Basis.Rudiments + +module Error = struct + module T = struct + type t = { + source: Hmc.Source.Slice.t; + msg: string; + } + + let cmp t0 t1 = + Hmc.Source.Slice.cmp t0.source t1.source + + let pp {source; msg} formatter = + formatter + |> Fmt.fmt "{source=" |> Hmc.Source.Slice.pp source + |> Fmt.fmt "; msg=" |> String.pp msg + |> Fmt.fmt "}" + + let fmt ?(alt=false) ({source; msg} as t) formatter = + match alt with + | false -> pp t formatter + | true -> begin + formatter + |> Fmt.fmt "hocc: At " + |> Hmc.Source.Slice.pp source + |> Fmt.fmt ": " + |> Fmt.fmt msg + |> Fmt.fmt "\n" + end + end + include T + include Cmpable.Make(T) + + let init_token token_ msg = + {source=Scan.Token.source token_; msg} + + let init_mal mal = + let open Hmc.Scan.AbstractToken.Rendition.Malformation in + {source=source mal; msg=description mal} + + let init_scanner scanner msg = + let cursor = Scan.cursor scanner in + let source = Hmc.Source.Slice.of_cursors ~base:cursor ~past:cursor in + {source; msg} + end + +module X = struct (* XXX Workaround for qualified type syntax limitation. *) +type token_hocc = + | HOCC of {token_: Scan.Token.t} +type token_nonterm = + | NONTERM of {token_: Scan.Token.t} +type token_epsilon = + | EPSILON of {token_: Scan.Token.t} +type token_start = + | START of {token_: Scan.Token.t} +type token_token = + | TOKEN of {token_: Scan.Token.t} +type token_neutral = + | NEUTRAL of {token_: Scan.Token.t} +type token_left = + | LEFT of {token_: Scan.Token.t} +type token_right = + | RIGHT of {token_: Scan.Token.t} +type token_prec = + | PREC of {token_: Scan.Token.t} +type token_uident = + | UIDENT of {token_: Scan.Token.t} +type token_cident = + | CIDENT of {token_: Scan.Token.t} +type token_uscore = + | USCORE of {token_: Scan.Token.t} +type token_istring = + | ISTRING of {token_: Scan.Token.t} +type token_colon_colon_eq = + | COLON_COLON_EQ of {token_: Scan.Token.t} +type token_of = + | OF of {token_: Scan.Token.t} +type token_colon = + | COLON of {token_: Scan.Token.t} +type token_dot = + | DOT of {token_: Scan.Token.t} +type token_arrow = + | ARROW of {token_: Scan.Token.t} +type token_bar = + | BAR of {token_: Scan.Token.t} +type token_lt = + | LT of {token_: Scan.Token.t} +type token_comma = + | COMMA of {token_: Scan.Token.t} +type token_semi = + | SEMI of {token_: Scan.Token.t} +type token_line_delim = + | LINE_DELIM of {token_: Scan.Token.t} +type token_indent = + | INDENT of {token_: Scan.Token.t} +type token_dedent = + | DEDENT of {token_: Scan.Token.t} +type token_lparen = + | LPAREN of {token_: Scan.Token.t} +type token_rparen = + | RPAREN of {token_: Scan.Token.t} +type token_lcapture = + | LCAPTURE of {token_: Scan.Token.t} +type token_rcapture = + | RCAPTURE of {token_: Scan.Token.t} +type token_lbrack = + | LBRACK of {token_: Scan.Token.t} +type token_rbrack = + | RBRACK of {token_: Scan.Token.t} +type token_larray = + | LARRAY of {token_: Scan.Token.t} +type token_rarray = + | RARRAY of {token_: Scan.Token.t} +type token_lcurly = + | LCURLY of {token_: Scan.Token.t} +type token_rcurly = + | RCURLY of {token_: Scan.Token.t} +type token_other_token = + | OTHER_TOKEN of {token_: Scan.Token.t} +type token_eoi = + | EOI of {token_: Scan.Token.t} + +type nonterm_uident = + | Uident of {uident: Scan.Token.t} + and nonterm_cident = + | Cident of {cident: Scan.Token.t} + and nonterm_ident = + | IdentUident of {uident: nonterm_uident} + | IdentCident of {cident: nonterm_cident} + | IdentUscore of {uscore: Scan.Token.t} + and nonterm_precs_tl = + | PrecsTlCommaUident of {comma: Scan.Token.t; uident: nonterm_uident; precs_tl: nonterm_precs_tl} + | PrecsTlEpsilon + and nonterm_precs = + | Precs of {uident: nonterm_uident; precs_tl: nonterm_precs_tl} + and nonterm_prec_rels = + | PrecRelsLtPrecs of {lt: Scan.Token.t; precs: nonterm_precs} + | PrecRelsEpsilon + and nonterm_prec_type = + | PrecTypeNeutral of {neutral_: Scan.Token.t} + | PrecTypeLeft of {left_: Scan.Token.t} + | PrecTypeRight of {right_: Scan.Token.t} + and nonterm_prec = + | Prec of {prec_type: nonterm_prec_type; uident: nonterm_uident; prec_rels: nonterm_prec_rels} + and nonterm_of_type = + | OfType of {of_: Scan.Token.t; type_module: nonterm_cident; dot: Scan.Token.t; + type_type: nonterm_uident} + and nonterm_of_type0 = + | OfType0OfType of {of_type: nonterm_of_type} + | OfType0Epsilon + and nonterm_prec_ref = + | PrecRefPrecUident of {prec_: Scan.Token.t; uident: nonterm_uident} + | PrecRefEpsilon + and nonterm_token_alias = + | TokenAlias of {alias: Scan.Token.t} + | TokenAliasEpsilon + and nonterm_token = + | Token of {token_: Scan.Token.t; cident: nonterm_cident; token_alias: nonterm_token_alias; + of_type0: nonterm_of_type0; prec_ref: nonterm_prec_ref} + and nonterm_sep = + | SepLineDelim of {line_delim: Scan.Token.t} + | SepSemi of {semi: Scan.Token.t} + | SepBar of {bar: Scan.Token.t} + and nonterm_codes_tl = + | CodesTlSepCode of {sep: nonterm_sep; code: nonterm_code; codes_tl: nonterm_codes_tl} + | CodesTlEpsilon + and nonterm_codes = + | Codes of {code: nonterm_code; codes_tl: nonterm_codes_tl} + and nonterm_codes0 = + | Codes0Codes of {codes: nonterm_codes} + | Codes0Epsilon + and nonterm_delimited = + | DelimitedBlock of {indent: Scan.Token.t; codes: nonterm_codes; dedent: Scan.Token.t} + | DelimitedParen of {lparen: Scan.Token.t; codes0: nonterm_codes0; rparen: Scan.Token.t} + | DelimitedCapture of {lcapture: Scan.Token.t; codes0: nonterm_codes0; rcapture: Scan.Token.t} + | DelimitedList of {lbrack: Scan.Token.t; codes0: nonterm_codes0; rbrack: Scan.Token.t} + | DelimitedArray of {larray: Scan.Token.t; codes0: nonterm_codes0; rarray: Scan.Token.t} + | DelimitedModule of {lcurly: Scan.Token.t; codes0: nonterm_codes0; rcurly: Scan.Token.t} + and nonterm_code_token = + | CodeToken of {token_: Scan.Token.t} + and nonterm_code_tl = + | CodeTlDelimited of {delimited: nonterm_delimited; code_tl: nonterm_code_tl} + | CodeTlToken of {token_: Scan.Token.t; code_tl: nonterm_code_tl} + | CodeTlEpsilon + and nonterm_code = + | CodeDelimited of {delimited: nonterm_delimited; code_tl: nonterm_code_tl} + | CodeCodeToken of {token_: Scan.Token.t; code_tl: nonterm_code_tl} + and nonterm_prod_param_symbol = + | ProdParamSymbolCident of {cident: nonterm_cident} + | ProdParamSymbolAlias of {alias: Scan.Token.t} + and nonterm_prod_param = + | ProdParamBinding of {ident: nonterm_ident; colon: Scan.Token.t; + prod_param_symbol: nonterm_prod_param_symbol} + | ProdParam of {prod_param_symbol: nonterm_prod_param_symbol} + and nonterm_prod_params_tl = + | ProdParamsTlProdParam of {prod_param: nonterm_prod_param; + prod_params_tl: nonterm_prod_params_tl} + | ProdParamsTlEpsilon + and nonterm_prod_params = + | ProdParamsProdParam of {prod_param: nonterm_prod_param; prod_params_tl: nonterm_prod_params_tl} + and nonterm_prod_pattern = + | ProdPatternParams of {prod_params: nonterm_prod_params} + | ProdPatternEpsilon of {epsilon_: Scan.Token.t} + and nonterm_prod = + | Prod of {prod_pattern: nonterm_prod_pattern; prec_ref: nonterm_prec_ref} + and nonterm_prods_tl = + | ProdsTlBarProd of {bar: Scan.Token.t; prod: nonterm_prod; prods_tl: nonterm_prods_tl} + | ProdsTlEpsilon + and nonterm_prods = + | ProdsBarProd of {bar: Scan.Token.t; prod: nonterm_prod; prods_tl: nonterm_prods_tl} + | ProdsProd of {prod: nonterm_prod; prods_tl: nonterm_prods_tl} + and nonterm_reduction = + | Reduction of {prods: nonterm_prods; arrow: Scan.Token.t; code: nonterm_code} + and nonterm_reductions_tl = + | ReductionsTlBarReduction of {bar: Scan.Token.t; reduction: nonterm_reduction; + reductions_tl: nonterm_reductions_tl} + | ReductionsTlEpsilon + and nonterm_reductions = + | ReductionsReduction of {reduction: nonterm_reduction; reductions_tl: nonterm_reductions_tl} + and nonterm_nonterm_type = + | NontermTypeNonterm of {nonterm_: Scan.Token.t} + | NontermTypeStart of {start_: Scan.Token.t} + and nonterm_nonterm = + | NontermProds of {nonterm_type: nonterm_nonterm_type; cident: nonterm_cident; + prec_ref: nonterm_prec_ref; cce: Scan.Token.t; prods: nonterm_prods} + | NontermReductions of {nonterm_type: nonterm_nonterm_type; cident: nonterm_cident; + of_type: nonterm_of_type; prec_ref: nonterm_prec_ref; cce: Scan.Token.t; + reductions: nonterm_reductions} + and nonterm_stmt = + | StmtPrec of {prec_: nonterm_prec} + | StmtToken of {token_: nonterm_token} + | StmtNonterm of {nonterm_: nonterm_nonterm} + | StmtCode of {code: nonterm_code} + and nonterm_stmts_tl = + | StmtsTl of {line_delim: Scan.Token.t; stmt: nonterm_stmt; stmts_tl: nonterm_stmts_tl} + | StmtsTlEpsilon + and nonterm_stmts = + | Stmts of {stmt: nonterm_stmt; stmts_tl: nonterm_stmts_tl} + and nonterm_hocc = + | Hocc of {hocc_: Scan.Token.t; indent: Scan.Token.t; stmts: nonterm_stmts; dedent: Scan.Token.t} + and nonterm_matter_token = + | MatterToken of {token_: Scan.Token.t} + and nonterm_matter = + | Matter of {token_: Scan.Token.t; matter: nonterm_matter} + | MatterEpsilon + and nonterm_hmh = + | Hmh of {prelude: nonterm_matter; hocc_: nonterm_hocc; postlude: nonterm_matter; + eoi: Scan.Token.t} + and nonterm_hmhi = + | Hmhi of {prelude: nonterm_matter; hocc_: Scan.Token.t; postlude: nonterm_matter; + eoi: Scan.Token.t} + end + +include hocc + (* hocc-specific keywords *) + token HOCC "hocc" of X.token_hocc + token NONTERM "nonterm" of X.token_nonterm + token EPSILON_ "epsilon" of X.token_epsilon + token START "start" of X.token_start + token TOKEN "token" of X.token_token + token NEUTRAL "neutral" of X.token_neutral + token LEFT "left" of X.token_left + token RIGHT "right" of X.token_right + token PREC "prec" of X.token_prec + + (* Identifiers *) + token UIDENT of X.token_uident # Uncapitalized + token CIDENT of X.token_cident # Capitalized + token USCORE "_" of X.token_uscore + + (* Token alias *) + token ISTRING of X.token_istring + + (* Punctuation/separators *) + token COLON_COLON_EQ "::=" of X.token_colon_colon_eq + token OF "of" of X.token_of + token COLON ":" of X.token_colon + token DOT "." of X.token_dot + token ARROW "->" of X.token_arrow + token BAR "|" of X.token_bar + token LT "<" of X.token_lt + token COMMA "," of X.token_comma + token SEMI ";" of X.token_semi + token LINE_DELIM of X.token_line_delim + + (* Left-right paired delimiters *) + token INDENT of X.token_indent + token DEDENT of X.token_dedent + token LPAREN "(" of X.token_lparen + token RPAREN ")" of X.token_rparen + token LCAPTURE "(|" of X.token_lcapture + token RCAPTURE "|)" of X.token_rcapture + token LBRACK "[" of X.token_lbrack + token RBRACK "]" of X.token_rbrack + token LARRAY "[|" of X.token_larray + token RARRAY "|]" of X.token_rarray + token LCURLY "{" of X.token_lcurly + token RCURLY "}" of X.token_rcurly + + (* Miscellaneous Hemlock token in embedded code *) + token OTHER_TOKEN of X.token_other_token + + (* End of input, used to terminate start symbols *) + token EOI of X.token_eoi + + nonterm Uident of X.nonterm_uident ::= + | uident:UIDENT -> + let X.(UIDENT {token_=uident}) = uident in + Uident {uident} + + nonterm Cident of X.nonterm_cident ::= + | cident:CIDENT -> + let X.(CIDENT {token_=cident}) = cident in + Cident {cident} + + nonterm Ident of X.nonterm_ident ::= + | uident:Uident -> IdentUident {uident} + | cident:Cident -> IdentCident {cident} + | uscore:"_" -> + let X.(USCORE {token_=uscore}) = uscore in + IdentUscore {uscore} + + nonterm PrecsTl of X.nonterm_precs_tl ::= + | comma:"," uident:Uident precs_tl:PrecsTl -> + let X.(COMMA {token_=comma}) = comma in + PrecsTlCommaUident {comma; uident; precs_tl} + | epsilon -> PrecsTlEpsilon + + nonterm Precs of X.nonterm_precs ::= + | uident:Uident precs_tl:PrecsTl -> Precs {uident; precs_tl} + + nonterm PrecRels of X.nonterm_prec_rels ::= + | lt:"<" precs:Precs -> + let X.(LT {token_=lt}) = lt in + PrecRelsLtPrecs {lt; precs} + | epsilon -> PrecRelsEpsilon + + nonterm PrecType of X.nonterm_prec_type ::= + | neutral_:"neutral" -> + let X.(NEUTRAL {token_=neutral_}) = neutral_ in + PrecTypeNeutral {neutral_} + | left_:"left" -> + let X.(LEFT {token_=left_}) = left_ in + PrecTypeLeft {left_} + | right_:"right" -> + let X.(RIGHT {token_=right_}) = right_ in + PrecTypeRight {right_} + + nonterm Prec of X.nonterm_prec ::= + | prec_type:PrecType uident:Uident prec_rels:PrecRels -> Prec {prec_type; uident; prec_rels} + + nonterm OfType of X.nonterm_of_type ::= + | of_:"of" type_module:Cident dot:"." type_type:Uident -> + let X.(OF {token_=of_}) = of_ in + let X.(DOT {token_=dot}) = dot in + OfType {of_; type_module; dot; type_type} + + nonterm OfType0 of X.nonterm_of_type0 ::= + | of_type:OfType -> OfType0OfType {of_type} + | epsilon -> OfType0Epsilon + + nonterm PrecRef of X.nonterm_prec_ref ::= + | prec_:"prec" uident:Uident -> + let X.(PREC {token_=prec_}) = prec_ in + PrecRefPrecUident {prec_; uident} + | epsilon -> PrecRefEpsilon + + nonterm TokenAlias of X.nonterm_token_alias ::= + | alias:ISTRING -> + let X.(ISTRING {token_=alias}) = alias in + TokenAlias {alias} + | epsilon -> TokenAliasEpsilon + + nonterm Token of X.nonterm_token ::= + | token_:"token" cident:Cident token_alias:TokenAlias of_type0:OfType0 prec_ref:PrecRef -> + let X.(TOKEN {token_}) = token_ in + Token {token_; cident; token_alias; of_type0; prec_ref} + + nonterm Sep of X.nonterm_sep ::= + | line_delim:LINE_DELIM -> + let X.(LINE_DELIM {token_=line_delim}) = line_delim in + SepLineDelim {line_delim} + | semi:";" -> + let X.(SEMI {token_=semi}) = semi in + SepSemi {semi} + | bar:"|" -> + let X.(BAR {token_=bar}) = bar in + SepBar {bar} + + nonterm CodesTl of X.nonterm_codes_tl ::= + | sep:Sep code:Code codes_tl:CodesTl -> CodesTlSepCode {sep; code; codes_tl} + | epsilon -> CodesTlEpsilon + + nonterm Codes of X.nonterm_codes ::= + | code:Code codes_tl:CodesTl -> Codes {code; codes_tl} + + nonterm Codes0 of X.nonterm_codes0 ::= + | codes:Codes -> Codes0Codes {codes} + | epsilon -> Codes0Epsilon + + nonterm Delimited of X.nonterm_delimited ::= + | indent:INDENT codes:Codes dedent:DEDENT -> + let X.(INDENT {token_=indent}) = indent in + let X.(DEDENT {token_=dedent}) = dedent in + DelimitedBlock {indent; codes; dedent} + | lparen:"(" codes0:Codes0 rparen:")" -> + let X.(LPAREN {token_=lparen}) = lparen in + let X.(RPAREN {token_=rparen}) = rparen in + DelimitedParen {lparen; codes0; rparen} + | lcapture:"(|" codes0:Codes0 rcapture:"|)" -> + let X.(LCAPTURE {token_=lcapture}) = lcapture in + let X.(RCAPTURE {token_=rcapture}) = rcapture in + DelimitedCapture {lcapture; codes0; rcapture} + | lbrack:"[" codes0:Codes0 rbrack:"]" -> + let X.(LBRACK {token_=lbrack}) = lbrack in + let X.(RBRACK {token_=rbrack}) = rbrack in + DelimitedList {lbrack; codes0; rbrack} + | larray:"[|" codes0:Codes0 rarray:"|]" -> + let X.(LARRAY {token_=larray}) = larray in + let X.(RARRAY {token_=rarray}) = rarray in + DelimitedArray {larray; codes0; rarray} + | lcurly:"{" codes0:Codes0 rcurly:"}" -> + let X.(LCURLY {token_=lcurly}) = lcurly in + let X.(RCURLY {token_=rcurly}) = rcurly in + DelimitedModule {lcurly; codes0; rcurly} + + nonterm CodeToken of X.nonterm_code_token ::= + | token_:OTHER_TOKEN -> + let X.(OTHER_TOKEN {token_}) = token_ in + CodeToken {token_} + | token_:UIDENT -> + let X.(UIDENT {token_}) = token_ in + CodeToken {token_} + | token_:CIDENT -> + let X.(CIDENT {token_}) = token_ in + CodeToken {token_} + | token_:"_"-> + let X.(USCORE {token_}) = token_ in + CodeToken {token_} + | token_:ISTRING -> + let X.(ISTRING {token_}) = token_ in + CodeToken {token_} + | token_:"of" -> + let X.(OF {token_}) = token_ in + CodeToken {token_} + | token_:":" -> + let X.(COLON {token_}) = token_ in + CodeToken {token_} + | token_:"." -> + let X.(DOT {token_}) = token_ in + CodeToken {token_} + | token_:"->" -> + let X.(ARROW {token_}) = token_ in + CodeToken {token_} + | token_:"<" -> + let X.(LT {token_}) = token_ in + CodeToken {token_} + | token_:"," -> + let X.(COMMA {token_}) = token_ in + CodeToken {token_} + + nonterm CodeTl of X.nonterm_code_tl ::= + | delimited:Delimited code_tl:CodeTl -> CodeTlDelimited {delimited; code_tl} + | code_token:CodeToken code_tl:CodeTl -> + let X.(CodeToken {token_}) = code_token in + CodeTlToken {token_; code_tl} + | epsilon -> CodeTlEpsilon + + nonterm Code of X.nonterm_code ::= + | delimited:Delimited code_tl:CodeTl -> CodeDelimited {delimited; code_tl} + | code_token:CodeToken code_tl:CodeTl -> + let X.(CodeToken {token_}) = code_token in + CodeCodeToken {token_; code_tl} + + nonterm ProdParamSymbol of X.nonterm_prod_param_symbol ::= + | cident:Cident -> ProdParamSymbolCident {cident} + | alias:ISTRING -> + let X.(ISTRING {token_=alias}) = alias in + ProdParamSymbolAlias {alias} + + nonterm ProdParam of X.nonterm_prod_param ::= + | ident:Ident colon:":" prod_param_symbol:ProdParamSymbol -> + let X.(COLON {token_=colon}) = colon in + ProdParamBinding {ident; colon; prod_param_symbol} + | prod_param_symbol:ProdParamSymbol -> ProdParam {prod_param_symbol} + + nonterm ProdParamsTl of X.nonterm_prod_params_tl ::= + | prod_param:ProdParam prod_params_tl:ProdParamsTl -> + ProdParamsTlProdParam {prod_param; prod_params_tl} + | epsilon -> ProdParamsTlEpsilon + + nonterm ProdParams of X.nonterm_prod_params ::= + | prod_param:ProdParam prod_params_tl:ProdParamsTl -> + ProdParamsProdParam {prod_param; prod_params_tl} + + nonterm ProdPattern of X.nonterm_prod_pattern ::= + | prod_params:ProdParams -> ProdPatternParams {prod_params} + | epsilon_:"epsilon" -> + let X.(EPSILON {token_=epsilon_}) = epsilon_ in + ProdPatternEpsilon {epsilon_} + + nonterm Prod of X.nonterm_prod ::= + | prod_pattern:ProdPattern prec_ref:PrecRef -> Prod {prod_pattern; prec_ref} + + nonterm ProdsTl of X.nonterm_prods_tl ::= + | bar:"|" prod:Prod prods_tl:ProdsTl -> + let X.(BAR {token_=bar}) = bar in + ProdsTlBarProd {bar; prod; prods_tl} + | epsilon -> ProdsTlEpsilon + + nonterm Prods of X.nonterm_prods ::= + | bar:"|" prod:Prod prods_tl:ProdsTl -> + let X.(BAR {token_=bar}) = bar in + ProdsBarProd {bar; prod; prods_tl} + | prod:Prod prods_tl:ProdsTl -> ProdsProd {prod; prods_tl} + + nonterm Reduction of X.nonterm_reduction ::= + | prods:Prods arrow:"->" code:Code -> + let X.(ARROW {token_=arrow}) = arrow in + Reduction {prods; arrow; code} + + nonterm ReductionsTl of X.nonterm_reductions_tl ::= + | bar:"|" reduction:Reduction reductions_tl:ReductionsTl -> + let X.(BAR {token_=bar}) = bar in + ReductionsTlBarReduction {bar; reduction; reductions_tl} + | epsilon -> ReductionsTlEpsilon + + nonterm Reductions of X.nonterm_reductions ::= + | reduction:Reduction reductions_tl:ReductionsTl -> + ReductionsReduction {reduction; reductions_tl} + + nonterm NontermType of X.nonterm_nonterm_type ::= + | nonterm_:"nonterm" -> + let X.(NONTERM {token_=nonterm_}) = nonterm_ in + NontermTypeNonterm {nonterm_} + | start_:"start" -> + let X.(START {token_=start_}) = start_ in + NontermTypeStart {start_} + + nonterm Nonterm of X.nonterm_nonterm ::= + | nonterm_type:NontermType cident:Cident prec_ref:PrecRef cce:"::=" prods:Prods -> + let X.(COLON_COLON_EQ {token_=cce}) = cce in + NontermProds {nonterm_type; cident; prec_ref; cce; prods} + | nonterm_type:NontermType cident:Cident of_type:OfType prec_ref:PrecRef cce:"::=" + reductions:Reductions -> + let X.(COLON_COLON_EQ {token_=cce}) = cce in + NontermReductions {nonterm_type; cident; of_type; prec_ref; cce; reductions} + + nonterm Stmt of X.nonterm_stmt ::= + | prec_:Prec -> StmtPrec {prec_} + | token_:Token -> StmtToken {token_} + | nonterm_:Nonterm -> StmtNonterm {nonterm_} + | code:Code -> StmtCode {code} + + nonterm StmtsTl of X.nonterm_stmts_tl ::= + | line_delim:LINE_DELIM stmt:Stmt stmts_tl:StmtsTl -> + let X.(LINE_DELIM {token_=line_delim}) = line_delim in + StmtsTl {line_delim; stmt; stmts_tl} + | epsilon -> StmtsTlEpsilon + + nonterm Stmts of X.nonterm_stmts ::= + | stmt:Stmt stmts_tl:StmtsTl -> Stmts {stmt; stmts_tl} + + nonterm Hocc of X.nonterm_hocc ::= + | hocc_:"hocc" indent:INDENT stmts:Stmts dedent:DEDENT -> + let X.(HOCC {token_=hocc_}) = hocc_ in + let X.(INDENT {token_=indent}) = indent in + let X.(DEDENT {token_=dedent}) = dedent in + Hocc {hocc_; indent; stmts; dedent} + + nonterm MatterToken of X.nonterm_matter_token ::= + | code_token:CodeToken -> + let X.(CodeToken {token_}) = code_token in + MatterToken {token_} + | sep:Sep -> + let token_ = match sep with + | SepLineDelim {line_delim=token_} + | SepSemi {semi=token_} + | SepBar {bar=token_} + -> token_ + in + MatterToken {token_} + | token_:INDENT -> + let X.(INDENT {token_}) = token_ in + MatterToken {token_} + | token_:DEDENT -> + let X.(DEDENT {token_}) = token_ in + MatterToken {token_} + | token_:"(" -> + let X.(LPAREN {token_}) = token_ in + MatterToken {token_} + | token_:")" -> + let X.(RPAREN {token_}) = token_ in + MatterToken {token_} + | token_:"(|" -> + let X.(LCAPTURE {token_}) = token_ in + MatterToken {token_} + | token_:"|)" -> + let X.(RCAPTURE {token_}) = token_ in + MatterToken {token_} + | token_:"[" -> + let X.(LBRACK {token_}) = token_ in + MatterToken {token_} + | token_:"]" -> + let X.(RBRACK {token_}) = token_ in + MatterToken {token_} + | token_:"[|" -> + let X.(LARRAY {token_}) = token_ in + MatterToken {token_} + | token_:"|]" -> + let X.(RARRAY {token_}) = token_ in + MatterToken {token_} + | token_:"{" -> + let X.(LCURLY {token_}) = token_ in + MatterToken {token_} + | token_:"}" -> + let X.(RCURLY {token_}) = token_ in + MatterToken {token_} + + nonterm Matter of X.nonterm_matter ::= + | matter_token:MatterToken matter:Matter -> + let X.(MatterToken {token_}) = matter_token in + Matter {token_; matter} + | epsilon -> MatterEpsilon + + start Hmh of X.nonterm_hmh ::= + | prelude:Matter hocc_:Hocc postlude:Matter eoi:EOI -> + let X.(EOI {token_=eoi}) = eoi in + Hmh {prelude; hocc_; postlude; eoi} + + start Hmhi of X.nonterm_hmhi ::= + | prelude:Matter hocc_:"hocc" postlude:Matter eoi:EOI -> + let X.(HOCC {token_=hocc_}) = hocc_ in + let X.(EOI {token_=eoi}) = eoi in + Hmhi {prelude; hocc_; postlude; eoi} + +include X (* XXX Work around qualified type syntax limitations. *) +let rec scan scanner = + let scanner, scan_token = Scan.next scanner in + match Scan.Token.malformations scan_token with + | [] -> begin + let token_opt = match scan_token with + | Scan.Token.HmcToken {atok; _} -> begin + match atok with + | Tok_whitespace + | Tok_hash_comment + | Tok_paren_comment _ -> None (* Swallow. *) + | Tok_uident _ -> Some (Token.UIDENT (UIDENT {token_=scan_token})) + | Tok_cident _ -> Some (Token.CIDENT (CIDENT {token_=scan_token})) + | Tok_uscore -> Some (Token.USCORE (USCORE {token_=scan_token})) + | Tok_istring _ -> Some (Token.ISTRING (ISTRING {token_=scan_token})) + | Tok_of -> Some (Token.OF (OF {token_=scan_token})) + | Tok_colon -> Some (Token.COLON (COLON {token_=scan_token})) + | Tok_dot -> Some (Token.DOT (DOT {token_=scan_token})) + | Tok_arrow -> Some (Token.ARROW (ARROW {token_=scan_token})) + | Tok_bar -> Some (Token.BAR (BAR {token_=scan_token})) + | Tok_lt -> Some (Token.LT (LT {token_=scan_token})) + | Tok_comma -> Some (Token.COMMA (COMMA {token_=scan_token})) + | Tok_semi -> Some (Token.SEMI (SEMI {token_=scan_token})) + | Tok_line_delim -> Some (Token.LINE_DELIM (LINE_DELIM {token_=scan_token})) + | Tok_indent _ -> Some (Token.INDENT (INDENT {token_=scan_token})) + | Tok_dedent _ -> Some (Token.DEDENT (DEDENT {token_=scan_token})) + | Tok_lparen -> Some (Token.LPAREN (LPAREN {token_=scan_token})) + | Tok_rparen -> Some (Token.RPAREN (RPAREN {token_=scan_token})) + | Tok_lcapture -> Some (Token.LCAPTURE (LCAPTURE {token_=scan_token})) + | Tok_rcapture -> Some (Token.RCAPTURE (RCAPTURE {token_=scan_token})) + | Tok_lbrack -> Some (Token.LBRACK (LBRACK {token_=scan_token})) + | Tok_rbrack -> Some (Token.RBRACK (RBRACK {token_=scan_token})) + | Tok_larray -> Some (Token.LARRAY (LARRAY {token_=scan_token})) + | Tok_rarray -> Some (Token.RARRAY (RARRAY {token_=scan_token})) + | Tok_lcurly -> Some (Token.LCURLY (LCURLY {token_=scan_token})) + | Tok_rcurly -> Some (Token.RCURLY (RCURLY {token_=scan_token})) + | Tok_end_of_input -> Some (Token.EOI (EOI {token_=scan_token})) + | _ -> Some (Token.OTHER_TOKEN (OTHER_TOKEN {token_=scan_token})) + end + | HoccToken {atok; _} -> begin + match atok with + | Tok_hocc -> Some (Token.HOCC (HOCC {token_=scan_token})) + | Tok_token -> Some (Token.TOKEN (TOKEN {token_=scan_token})) + | Tok_nonterm -> Some (Token.NONTERM (NONTERM {token_=scan_token})) + | Tok_start -> Some (Token.START (START {token_=scan_token})) + | Tok_epsilon -> Some (Token.EPSILON_ (EPSILON {token_=scan_token})) + | Tok_neutral -> Some (Token.NEUTRAL (NEUTRAL {token_=scan_token})) + | Tok_left -> Some (Token.LEFT (LEFT {token_=scan_token})) + | Tok_right -> Some (Token.RIGHT (RIGHT {token_=scan_token})) + | Tok_prec -> Some (Token.PREC (PREC {token_=scan_token})) + | Tok_colon_colon_eq -> + Some (Token.COLON_COLON_EQ (COLON_COLON_EQ {token_=scan_token})) + end in + match token_opt with + | Some token_ -> scanner, scan_token, token_, [] + | None -> scan scanner + end + | mal :: [] -> begin + (* Try to pass e.g. 42L through as a u64 token to support OCaml syntax. *) + let u64_opt = match Hmc.Scan.AbstractToken.Rendition.Malformation.description mal with + | "Invalid numerical constant" -> begin + let source = Scan.Token.source scan_token in + Hmc.Source.Slice.to_string source + |> String.chop_suffix ~suffix:"L" + |> (fun s_opt -> + match s_opt with + | None -> None + | Some s -> Stdlib.Int64.of_string_opt s + ) + end + | _ -> None + in + match u64_opt with + | Some x -> begin + let rendition = Hmc.Scan.AbstractToken.Rendition.Constant x in + let ctok = Hmc.Scan.ConcreteToken.{ + atok=Hmc.Scan.AbstractToken.Tok_u64 rendition; + source=Scan.Token.source scan_token + } in + let scan_token = Scan.Token.HmcToken ctok in + scanner, scan_token, Token.OTHER_TOKEN (OTHER_TOKEN {token_=scan_token}), [] + end + | None -> scanner, scan_token, Token.OTHER_TOKEN (OTHER_TOKEN {token_=scan_token}), [mal] + end + | mals -> scanner, scan_token, Token.OTHER_TOKEN (OTHER_TOKEN {token_=scan_token}), mals + +let hmhi scanner = + let rec inner scanner errs parser = begin + let scanner, scan_token, token_, mals = scan scanner in + let errs = match mals with + | [] -> errs + | _ -> List.fold ~init:errs ~f:(fun errs mal -> Error.init_mal mal :: errs) mals + in + let {status; _} as parser = next token_ parser in + match status, errs with + | Prefix, _ -> inner scanner errs parser + | Accept (Hmhi hmhi), [] -> scanner, Ok hmhi + | Accept (Hmhi _), _ -> scanner, Error errs + | Reject _, _ -> + let errs = Error.init_token scan_token "Unexpected token" :: errs in + scanner, Error errs + | _ -> not_reached () + end in + let parser = Start.Hmhi.boi in + inner scanner [] parser + +let hmh scanner = + let rec inner scanner errs parser = begin + let scanner, scan_token, token_, mals = scan scanner in +(* + File.Fmt.stderr + |> Fmt.fmt "XXX scan_token=" + |> Scan.Token.pp scan_token + |> Fmt.fmt "\n" + |> ignore; +*) + let errs = match mals with + | [] -> errs + | _ -> List.fold ~init:errs ~f:(fun errs mal -> Error.init_mal mal :: errs) mals + in + let {stack=_XXX; status} as parser = next token_ parser in +(* + File.Fmt.stderr + |> Fmt.fmt "XXX status=" + |> Status.pp status + |> Fmt.fmt "\n" + |> ignore; +*) + match status, errs with + | Prefix, _ -> inner scanner errs parser + | Accept (Hmh hmh), [] -> scanner, Ok hmh + | Accept (Hmh _), _ -> scanner, Error errs + | Reject _, _ -> begin +(* + File.Fmt.stderr + |> Fmt.fmt "XXX stack=" + |> Stack.fmt ~alt:true stack + |> Fmt.fmt "\n" + |> ignore; +*) + let errs = Error.init_token scan_token "Unexpected token" :: errs in + scanner, Error errs + end + | _ -> not_reached () + end in + let parser = Start.Hmh.boi in + inner scanner [] parser + +(**************************************************************************************************) +(* source_of_* functions. *) + +(* Not to be confused with joining forces. *) +let join_sources source0_opt source1_opt = + match source0_opt, source1_opt with + | None, None -> None + | Some _, None -> source0_opt + | None, Some _ -> source1_opt + | Some source0, Some source1 -> begin + let open Hmc.Source in + let base0, past0 = Slice.cursors source0 in + let base1, past1 = Slice.cursors source1 in + let open Cmp in + let base = match Cursor.cmp base0 base1 with + | Lt + | Eq -> base0 + | Gt -> base1 + in + let past = match Cursor.cmp past0 past1 with + | Lt + | Eq -> past1 + | Gt -> past0 + in + Some (Slice.of_cursors ~base ~past) + end + +(* Not to be confused with a token force. *) +let token_source token_ = + Some (Scan.Token.source token_) + +let rec source_of_uident = function + | Uident {uident} -> token_source uident + + and source_of_cident = function + | Cident {cident} -> token_source cident + + and source_of_ident = function + | IdentUident {uident} -> source_of_uident uident + | IdentCident {cident} -> source_of_cident cident + | IdentUscore {uscore} -> token_source uscore + + and source_of_precs_tl = function + | PrecsTlCommaUident {comma; uident; precs_tl} -> + token_source comma + |> join_sources (source_of_uident uident) + |> join_sources (source_of_precs_tl precs_tl) + | PrecsTlEpsilon -> None + + and source_of_precs = function + | Precs {uident; precs_tl} -> + source_of_uident uident + |> join_sources (source_of_precs_tl precs_tl) + + and source_of_prec_rels = function + | PrecRelsLtPrecs {lt; precs} -> + token_source lt + |> join_sources (source_of_precs precs) + | PrecRelsEpsilon -> None + + and source_of_prec_type = function + | PrecTypeNeutral {neutral_} -> token_source neutral_ + | PrecTypeLeft {left_} -> token_source left_ + | PrecTypeRight {right_} -> token_source right_ + + and source_of_prec = function + | Prec {prec_type; uident; prec_rels} -> + source_of_prec_type prec_type + |> join_sources (source_of_uident uident) + |> join_sources (source_of_prec_rels prec_rels) + + and source_of_of_type = function + | OfType {of_; type_module=_; dot; type_type} -> + token_source of_ + |> join_sources (token_source dot) + |> join_sources (source_of_uident type_type) + + and source_of_of_type0 = function + | OfType0OfType {of_type} -> source_of_of_type of_type + | OfType0Epsilon -> None + + and source_of_prec_ref = function + | PrecRefPrecUident {prec_; uident} -> + token_source prec_ + |> join_sources (source_of_uident uident) + | PrecRefEpsilon -> None + + and source_of_token_alias = function + | TokenAlias {alias} -> token_source alias + | TokenAliasEpsilon -> None + + and source_of_token = function + | Token {token_; cident; token_alias; of_type0; prec_ref} -> + token_source token_ + |> join_sources (source_of_cident cident) + |> join_sources (source_of_token_alias token_alias) + |> join_sources (source_of_of_type0 of_type0) + |> join_sources (source_of_prec_ref prec_ref) + + and source_of_sep = function + | SepLineDelim {line_delim} -> token_source line_delim + | SepSemi {semi} -> token_source semi + | SepBar {bar} -> token_source bar + + and source_of_codes_tl = function + | CodesTlSepCode {sep; code; codes_tl} -> + source_of_sep sep + |> join_sources (source_of_code code) + |> join_sources (source_of_codes_tl codes_tl) + | CodesTlEpsilon -> None + + and source_of_codes = function + | Codes {code; codes_tl} -> + source_of_code code + |> join_sources (source_of_codes_tl codes_tl) + + and source_of_codes0 = function + | Codes0Codes {codes} -> source_of_codes codes + | Codes0Epsilon -> None + + and source_of_delimited = function + | DelimitedBlock {indent=ldelim; codes=_; dedent=rdelim} + | DelimitedParen {lparen=ldelim; codes0=_; rparen=rdelim} + | DelimitedCapture {lcapture=ldelim; codes0=_; rcapture=rdelim} + | DelimitedList {lbrack=ldelim; codes0=_; rbrack=rdelim} + | DelimitedArray {larray=ldelim; codes0=_; rarray=rdelim} + | DelimitedModule {lcurly=ldelim; codes0=_; rcurly=rdelim} -> + token_source ldelim + |> join_sources (token_source rdelim) + + and source_of_code_tl = function + | CodeTlDelimited {delimited; code_tl} -> + source_of_delimited delimited + |> join_sources (source_of_code_tl code_tl) + | CodeTlToken {token_; code_tl} -> + token_source token_ + |> join_sources (source_of_code_tl code_tl) + | CodeTlEpsilon -> None + + and source_of_code = function + | CodeDelimited {delimited; code_tl} -> + source_of_delimited delimited + |> join_sources (source_of_code_tl code_tl) + | CodeCodeToken {token_; code_tl} -> + token_source token_ + |> join_sources (source_of_code_tl code_tl) + + and source_of_prod_param_symbol = function + | ProdParamSymbolCident {cident} -> source_of_cident cident + | ProdParamSymbolAlias {alias} -> token_source alias + + and source_of_prod_param = function + | ProdParamBinding {ident; colon=_; prod_param_symbol} -> + source_of_ident ident + |> join_sources (source_of_prod_param_symbol prod_param_symbol) + | ProdParam {prod_param_symbol} -> + source_of_prod_param_symbol prod_param_symbol + + and source_of_prod_params_tl = function + | ProdParamsTlProdParam {prod_param; prod_params_tl} -> + source_of_prod_param prod_param + |> join_sources (source_of_prod_params_tl prod_params_tl) + | ProdParamsTlEpsilon -> None + + and source_of_prod_params = function + | ProdParamsProdParam {prod_param; prod_params_tl} -> + source_of_prod_param prod_param + |> join_sources (source_of_prod_params_tl prod_params_tl) + + and source_of_prod_pattern = function + | ProdPatternParams {prod_params} -> source_of_prod_params prod_params + | ProdPatternEpsilon {epsilon_} -> token_source epsilon_ + + and source_of_prod = function + | Prod {prod_pattern; prec_ref} -> + source_of_prod_pattern prod_pattern + |> join_sources (source_of_prec_ref prec_ref) + + and source_of_prods_tl = function + | ProdsTlBarProd {bar; prod; prods_tl} -> + token_source bar + |> join_sources (source_of_prod prod) + |> join_sources (source_of_prods_tl prods_tl) + | ProdsTlEpsilon -> None + + and source_of_prods = function + | ProdsBarProd {bar; prod; prods_tl} -> + token_source bar + |> join_sources (source_of_prod prod) + |> join_sources (source_of_prods_tl prods_tl) + | ProdsProd {prod; prods_tl} -> + source_of_prod prod + |> join_sources (source_of_prods_tl prods_tl) + + and source_of_reduction = function + | Reduction {prods; arrow=_; code} -> + source_of_prods prods + |> join_sources (source_of_code code) + + and source_of_reductions_tl = function + | ReductionsTlBarReduction {bar; reduction; reductions_tl} -> + token_source bar + |> join_sources (source_of_reduction reduction) + |> join_sources (source_of_reductions_tl reductions_tl) + | ReductionsTlEpsilon -> None + + and source_of_reductions = function + | ReductionsReduction {reduction; reductions_tl} -> + source_of_reduction reduction + |> join_sources (source_of_reductions_tl reductions_tl) + + and source_of_nonterm_type = function + | NontermTypeNonterm {nonterm_} -> token_source nonterm_ + | NontermTypeStart {start_} -> token_source start_ + + and source_of_nonterm = function + | NontermProds {nonterm_type; cident=_; prec_ref=_; cce=_; prods} -> + source_of_nonterm_type nonterm_type + |> join_sources (source_of_prods prods) + | NontermReductions {nonterm_type; cident=_; of_type=_; prec_ref=_; cce=_; reductions} -> + source_of_nonterm_type nonterm_type + |> join_sources (source_of_reductions reductions) + + and source_of_stmt = function + | StmtPrec {prec_} -> source_of_prec prec_ + | StmtToken {token_} -> source_of_token token_ + | StmtNonterm {nonterm_} -> source_of_nonterm nonterm_ + | StmtCode {code} -> source_of_code code + + and source_of_stmts_tl = function + | StmtsTl {line_delim; stmt; stmts_tl} -> + token_source line_delim + |> join_sources (source_of_stmt stmt) + |> join_sources (source_of_stmts_tl stmts_tl) + | StmtsTlEpsilon -> None + + and source_of_stmts = function + | Stmts {stmt; stmts_tl} -> + source_of_stmt stmt + |> join_sources (source_of_stmts_tl stmts_tl) + + and source_of_hocc = function + | Hocc {hocc_; indent=_; stmts=_; dedent} -> + token_source hocc_ + |> join_sources (token_source dedent) + + and source_of_matter = function + | Matter {token_; matter} -> + token_source token_ + |> join_sources (source_of_matter matter) + | MatterEpsilon -> None + + and source_of_hmh = function + | Hmh {prelude; hocc_; postlude=_; eoi} -> + source_of_matter prelude + |> join_sources (source_of_hocc hocc_) + |> join_sources (token_source eoi) + + and source_of_hmhi = function + | Hmhi {prelude; hocc_; postlude=_; eoi} -> + source_of_matter prelude + |> join_sources (token_source hocc_) + |> join_sources (token_source eoi) + +(**************************************************************************************************) +(* fmt_* functions. *) + +let rec fmt_lcurly ~alt ~width formatter = + match alt with + | false -> formatter |> Fmt.fmt "{" + | true -> + formatter + |> Fmt.fmt "{\n" + |> Fmt.fmt ~pad:" " ~just:Fmt.Left ~width:(width + 4L) "" + + and fmt_semi ~alt ~width formatter = + match alt with + | false -> formatter |> Fmt.fmt "; " + | true -> + formatter + |> Fmt.fmt "\n" + |> Fmt.fmt ~pad:" " ~just:Fmt.Left ~width:(width + 4L) "" + + and fmt_rcurly ~alt ~width formatter = + match alt with + | false -> formatter |> Fmt.fmt "}" + | true -> + formatter + |> Fmt.fmt "\n" + |> Fmt.fmt ~pad:" " ~just:Fmt.Left ~width:(width + 2L) "" + |> Fmt.fmt "}" + + and fmt_uident ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) uident formatter = + match uident with + | Uident {uident} -> + formatter + |> Fmt.fmt "Uident " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "uident=" |> Scan.Token.pp uident + |> fmt_rcurly ~alt ~width + and pp_uident uident formatter = + fmt_uident uident formatter + + and fmt_cident ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) cident formatter = + match cident with + | Cident {cident} -> + formatter + |> Fmt.fmt "Cident " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "cident=" |> Scan.Token.pp cident + |> fmt_rcurly ~alt ~width + and pp_cident cident formatter = + fmt_cident cident formatter + + and fmt_ident ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) ident formatter = + match ident with + | IdentUident {uident} -> + formatter |> Fmt.fmt "IdentUident " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "uident=" |> pp_uident uident + |> fmt_rcurly ~alt ~width + | IdentCident {cident} -> + formatter |> Fmt.fmt "IdentCident " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "cident=" |> pp_cident cident + |> fmt_rcurly ~alt ~width + | IdentUscore {uscore} -> + formatter |> Fmt.fmt "IdentUscore " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "uscore=" |> Scan.Token.pp uscore + |> fmt_rcurly ~alt ~width + and pp_ident ident formatter = + fmt_ident ident formatter + + and fmt_precs_tl ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) precs_tl formatter = + let width' = width + 4L in + match precs_tl with + | PrecsTlCommaUident {comma; uident; precs_tl} -> + formatter |> Fmt.fmt "PrecsTlCommaUident " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "comma=" |> Scan.Token.pp comma + |> fmt_semi ~alt ~width + |> Fmt.fmt "uident=" |> fmt_uident ~alt ~width:width' uident + |> fmt_semi ~alt ~width + |> Fmt.fmt "precs_tl=" |> fmt_precs_tl ~alt ~width:width' precs_tl + |> fmt_rcurly ~alt ~width + | PrecsTlEpsilon -> + formatter |> Fmt.fmt "PrecsTlEpsilon" + and pp_precs_tl precs_tl formatter = + fmt_precs_tl precs_tl formatter + + and fmt_precs ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) precs formatter = + let width' = width + 4L in + match precs with + | Precs {uident; precs_tl} -> + formatter |> Fmt.fmt "Precs " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "uident=" |> fmt_uident ~alt ~width:width' uident + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "precs_tl=" |> fmt_precs_tl ~alt ~width:width' precs_tl + |> fmt_rcurly ~alt ~width + and pp_precs precs formatter = + fmt_precs precs formatter + + and fmt_prec_rels ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prec_rels formatter = + let width' = width + 4L in + match prec_rels with + | PrecRelsLtPrecs {lt; precs} -> + formatter |> Fmt.fmt "PrecRelsLtPrecs " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "lt=" |> Scan.Token.pp lt + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "precs=" |> fmt_precs ~alt ~width:width' precs + |> fmt_rcurly ~alt ~width + | PrecRelsEpsilon -> + formatter |> Fmt.fmt "PrecRelsEpsilon" + and pp_prec_rels prec_rels formatter = + fmt_prec_rels prec_rels formatter + + and fmt_prec_type ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prec_type formatter = + match prec_type with + | PrecTypeNeutral {neutral_} -> + formatter |> Fmt.fmt "PrecTypeNeutral " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "neutral_=" |> Scan.Token.pp neutral_ + |> fmt_rcurly ~alt ~width + | PrecTypeLeft {left_} -> + formatter |> Fmt.fmt "PrecTypeLeft " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "left_=" |> Scan.Token.pp left_ + |> fmt_rcurly ~alt ~width + | PrecTypeRight {right_} -> + formatter |> Fmt.fmt "PrecTypeRight " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "right_=" |> Scan.Token.pp right_ + |> fmt_rcurly ~alt ~width + and pp_prec_type prec_type formatter = + fmt_prec_type prec_type formatter + + and fmt_prec ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prec_ formatter = + let width' = width + 4L in + match prec_ with + | Prec {prec_type; uident; prec_rels} -> + formatter |> Fmt.fmt "Prec " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prec_type=" |> fmt_prec_type ~alt ~width:width' prec_type + |> fmt_semi ~alt ~width + |> Fmt.fmt "uident=" |> fmt_uident ~alt ~width:width' uident + |> fmt_semi ~alt ~width + |> Fmt.fmt "prec_rels=" |> fmt_prec_rels ~alt ~width:width' prec_rels + |> fmt_rcurly ~alt ~width + and pp_prec prec_ formatter = + fmt_prec prec_ formatter + + and fmt_of_type ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) of_type formatter = + let width' = width + 4L in + match of_type with + | OfType {of_; type_module; dot; type_type} -> + formatter |> Fmt.fmt "OfType " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "of_=" |> Scan.Token.pp of_ + |> fmt_semi ~alt ~width + |> Fmt.fmt "type_module=" |> fmt_cident ~alt ~width:width' type_module + |> fmt_semi ~alt ~width + |> Fmt.fmt "dot=" |> Scan.Token.pp dot + |> fmt_semi ~alt ~width + |> Fmt.fmt "type_type=" |> fmt_uident ~alt ~width:width' type_type + |> fmt_rcurly ~alt ~width + and pp_of_type of_type formatter = + fmt_of_type of_type formatter + + and fmt_of_type0 ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) of_type0 formatter = + let width' = width + 4L in + match of_type0 with + | OfType0OfType {of_type} -> + formatter |> Fmt.fmt "OfType0OfType " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "of_type=" |> fmt_of_type ~alt ~width:width' of_type + |> fmt_rcurly ~alt ~width + | OfType0Epsilon -> + formatter |> Fmt.fmt "OfType0Epsilon" + and pp_of_type0 of_type0 formatter = + fmt_of_type0 of_type0 formatter + + and fmt_prec_ref ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prec_ref formatter = + let width' = width + 4L in + match prec_ref with + | PrecRefPrecUident {prec_; uident} -> + formatter |> Fmt.fmt "PrecRefPrecUident " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prec_=" |> Scan.Token.pp prec_ + |> fmt_semi ~alt ~width + |> Fmt.fmt "uident=" |> fmt_uident ~alt ~width:width' uident + |> fmt_rcurly ~alt ~width + | PrecRefEpsilon -> + formatter |> Fmt.fmt "PrecRefEpsilon" + and pp_prec_ref prec_ref formatter = + fmt_prec_ref prec_ref formatter + + and fmt_token_alias ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) token_alias formatter = + match token_alias with + | TokenAlias {alias} -> + formatter |> Fmt.fmt "Token " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "alias=" |> Scan.Token.pp alias + |> fmt_rcurly ~alt ~width + | TokenAliasEpsilon -> + formatter |> Fmt.fmt "TokenAliasEpsilon" + and pp_token_alias token_alias formatter = + fmt_token_alias token_alias formatter + + and fmt_token ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) token_ formatter = + let width' = width + 4L in + match token_ with + | Token {token_; cident; token_alias; of_type0; prec_ref} -> + formatter |> Fmt.fmt "Token " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "token_=" |> Scan.Token.pp token_ + |> fmt_semi ~alt ~width + |> Fmt.fmt "cident=" |> fmt_cident ~alt ~width:width' cident + |> fmt_semi ~alt ~width + |> Fmt.fmt "token_alias=" |> fmt_token_alias ~alt ~width:width' token_alias + |> fmt_semi ~alt ~width + |> Fmt.fmt "of_type0=" |> fmt_of_type0 ~alt ~width:width' of_type0 + |> fmt_semi ~alt ~width + |> Fmt.fmt "prec_ref=" |> fmt_prec_ref ~alt ~width:width' prec_ref + |> fmt_rcurly ~alt ~width + and pp_token token_ formatter = + fmt_token token_ formatter + + and fmt_sep ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) sep formatter = + match sep with + | SepLineDelim {line_delim} -> + formatter |> Fmt.fmt "SepLineDelim " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "line_delim=" |> Scan.Token.pp line_delim + |> fmt_rcurly ~alt ~width + | SepSemi {semi} -> + formatter |> Fmt.fmt "SepSemi " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "semi=" |> Scan.Token.pp semi + |> fmt_rcurly ~alt ~width + | SepBar {bar} -> + formatter |> Fmt.fmt "SepBar " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "bar=" |> Scan.Token.pp bar + |> fmt_rcurly ~alt ~width + and pp_sep sep formatter = + fmt_sep sep formatter + + and fmt_codes_tl ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) codes_tl formatter = + let width' = width + 4L in + match codes_tl with + | CodesTlSepCode {sep; code; codes_tl} -> + formatter |> Fmt.fmt "CodesTlSepCode " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "sep=" |> fmt_sep ~alt ~width:width' sep + |> fmt_semi ~alt ~width + |> Fmt.fmt "code=" |> fmt_code ~alt ~width:width' code + |> fmt_rcurly ~alt ~width + |> Fmt.fmt "codes_tl=" |> fmt_codes_tl ~alt ~width:width' codes_tl + |> fmt_rcurly ~alt ~width + | CodesTlEpsilon -> formatter |> Fmt.fmt "CodesTlEpsilon" + and pp_codes_tl codes_tl formatter = + fmt_codes codes_tl formatter + + and fmt_codes ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) codes formatter = + let width' = width + 4L in + match codes with + | Codes {code; codes_tl} -> + formatter |> Fmt.fmt "Codes " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "code=" |> fmt_code ~alt ~width:width' code + |> fmt_semi ~alt ~width + |> Fmt.fmt "codes_tl=" |> fmt_codes_tl ~alt ~width:width' codes_tl + |> fmt_rcurly ~alt ~width + and pp_codes codes formatter = + fmt_codes codes formatter + + and fmt_codes0 ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) codes0 formatter = + let width' = width + 4L in + match codes0 with + | Codes0Codes {codes} -> + formatter |> Fmt.fmt "Codes0Codes " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "codes=" |> fmt_codes ~alt ~width:width' codes + |> fmt_rcurly ~alt ~width + | Codes0Epsilon -> + formatter |> Fmt.fmt "Codes0Epsilon" + and pp_codes0 codes formatter = + fmt_codes codes formatter + + and fmt_delimited ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) delimited formatter = + let width' = width + 4L in + match delimited with + | DelimitedBlock {indent; codes; dedent} -> + formatter |> Fmt.fmt "DelimitedBlock " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "indent=" |> Scan.Token.pp indent + |> fmt_semi ~alt ~width + |> Fmt.fmt "codes=" |> fmt_codes ~alt ~width:width' codes + |> fmt_semi ~alt ~width + |> Fmt.fmt "dedent=" |> Scan.Token.pp dedent + |> fmt_rcurly ~alt ~width + | DelimitedParen {lparen; codes0; rparen} -> + formatter |> Fmt.fmt "DelimitedParen " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "lparen=" |> Scan.Token.pp lparen + |> fmt_semi ~alt ~width + |> Fmt.fmt "codes0=" |> fmt_codes0 ~alt ~width:width' codes0 + |> fmt_semi ~alt ~width + |> Fmt.fmt "rparen=" |> Scan.Token.pp rparen + |> fmt_rcurly ~alt ~width + | DelimitedCapture {lcapture; codes0; rcapture} -> + formatter |> Fmt.fmt "DelimitedCapture " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "lcapture=" |> Scan.Token.pp lcapture + |> fmt_semi ~alt ~width + |> Fmt.fmt "codes0=" |> fmt_codes0 ~alt ~width:width' codes0 + |> fmt_semi ~alt ~width + |> Fmt.fmt "rcapture=" |> Scan.Token.pp rcapture + |> fmt_rcurly ~alt ~width + | DelimitedList {lbrack; codes0; rbrack} -> + formatter |> Fmt.fmt "DelimitedList " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "lbrack=" |> Scan.Token.pp lbrack + |> fmt_semi ~alt ~width + |> Fmt.fmt "codes0=" |> fmt_codes0 ~alt ~width:width' codes0 + |> fmt_semi ~alt ~width + |> Fmt.fmt "rbrack=" |> Scan.Token.pp rbrack + |> fmt_rcurly ~alt ~width + | DelimitedArray {larray; codes0; rarray} -> + formatter |> Fmt.fmt "DelimitedArray " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "larray=" |> Scan.Token.pp larray + |> fmt_semi ~alt ~width + |> Fmt.fmt "codes0=" |> fmt_codes0 ~alt ~width:width' codes0 + |> fmt_semi ~alt ~width + |> Fmt.fmt "rarray=" |> Scan.Token.pp rarray + |> fmt_rcurly ~alt ~width + | DelimitedModule {lcurly; codes0; rcurly} -> + formatter |> Fmt.fmt "DelimitedModule " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "lcurly=" |> Scan.Token.pp lcurly + |> fmt_semi ~alt ~width + |> Fmt.fmt "codes0=" |> fmt_codes0 ~alt ~width:width' codes0 + |> fmt_semi ~alt ~width + |> Fmt.fmt "rcurly=" |> Scan.Token.pp rcurly + |> fmt_rcurly ~alt ~width + and pp_delimited delimited formatter = + fmt_delimited delimited formatter + + and fmt_code_tl ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) code_tl formatter = + let width' = width + 4L in + match code_tl with + | CodeTlDelimited {delimited; code_tl} -> + formatter |> Fmt.fmt "CodeTlDelimited " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "delimited=" |> fmt_delimited ~alt ~width:width' delimited + |> fmt_semi ~alt ~width + |> Fmt.fmt "code_tl=" |> fmt_code_tl ~alt ~width:width' code_tl + |> fmt_rcurly ~alt ~width + | CodeTlToken {token_; code_tl} -> + formatter |> Fmt.fmt "CodeTlToken " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "token_=" |> Scan.Token.pp token_ + |> fmt_semi ~alt ~width + |> Fmt.fmt "code_tl=" |> fmt_code_tl ~alt ~width:width' code_tl + |> fmt_rcurly ~alt ~width + | CodeTlEpsilon -> + formatter |> Fmt.fmt "CodeTlEpsilon" + and pp_code_tl code_tl formatter = + fmt_code code_tl formatter + + and fmt_code ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) code formatter = + let width' = width + 4L in + match code with + | CodeDelimited {delimited; code_tl} -> + formatter |> Fmt.fmt "CodeDelimited " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "delimited=" |> fmt_delimited ~alt ~width:width' delimited + |> fmt_semi ~alt ~width + |> Fmt.fmt "code_tl=" |> fmt_code_tl ~alt ~width:width' code_tl + |> fmt_rcurly ~alt ~width + | CodeCodeToken {token_; code_tl} -> + formatter |> Fmt.fmt "CodeCodeToken " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "token_=" |> Scan.Token.pp token_ + |> fmt_semi ~alt ~width + |> Fmt.fmt "code_tl=" |> fmt_code_tl ~alt ~width:width' code_tl + |> fmt_rcurly ~alt ~width + and pp_code code formatter = + fmt_code code formatter + + and fmt_prod_param_symbol ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prod_param_symbol + formatter = + let width' = width + 4L in + match prod_param_symbol with + | ProdParamSymbolCident {cident} -> + formatter |> Fmt.fmt "ProdParamSymbolCident " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "cident=" |> fmt_cident ~alt ~width:width' cident + |> fmt_rcurly ~alt ~width + | ProdParamSymbolAlias {alias} -> + formatter |> Fmt.fmt "ProdParamSymbolAlias " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "alias=" |> Scan.Token.pp alias + |> fmt_rcurly ~alt ~width + and pp_prod_param_symbol prod_param_symbol formatter = + fmt_prod_param_symbol prod_param_symbol formatter + + and fmt_prod_param ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prod_param formatter = + let width' = width + 4L in + match prod_param with + | ProdParamBinding {ident; colon; prod_param_symbol} -> + formatter |> Fmt.fmt "ProdParam " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "ident=" |> fmt_ident ~alt ~width:width' ident + |> fmt_semi ~alt ~width + |> Fmt.fmt "colon=" |> Scan.Token.pp colon + |> fmt_semi ~alt ~width + |> Fmt.fmt "prod_param_symbol=" + |> fmt_prod_param_symbol ~alt ~width:width' prod_param_symbol + |> fmt_rcurly ~alt ~width + | ProdParam {prod_param_symbol} -> + formatter |> Fmt.fmt "ProdParam " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prod_param_symbol=" + |> fmt_prod_param_symbol ~alt ~width:width' prod_param_symbol + |> fmt_rcurly ~alt ~width + and pp_prod_param prod_param formatter = + fmt_prod_param prod_param formatter + + and fmt_prod_params_tl ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prod_params_tl + formatter = + let width' = width + 4L in + match prod_params_tl with + | ProdParamsTlProdParam {prod_param; prod_params_tl} -> + formatter |> Fmt.fmt "ProdParamsTlProdParam " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prod_param=" |> fmt_prod_param ~alt ~width:width' prod_param + |> fmt_semi ~alt ~width + |> Fmt.fmt "prod_params_tl=" |> fmt_prod_params_tl ~alt ~width:width' prod_params_tl + |> fmt_rcurly ~alt ~width + | ProdParamsTlEpsilon -> + formatter |> Fmt.fmt "ProdParamsTlEpsilon" + and pp_prod_params_tl prod_params_tl formatter = + fmt_prod_params_tl prod_params_tl formatter + + and fmt_prod_params ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prod_params formatter = + let width' = width + 4L in + match prod_params with + | ProdParamsProdParam {prod_param; prod_params_tl} -> + formatter |> Fmt.fmt "ProdParamsProdParam " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prod_param=" |> fmt_prod_param ~alt ~width:width' prod_param + |> fmt_semi ~alt ~width + |> Fmt.fmt "prod_params_tl=" |> fmt_prod_params_tl ~alt ~width:width' prod_params_tl + |> fmt_rcurly ~alt ~width + and pp_prod_params prod_params formatter = + fmt_prod_params prod_params formatter + + and fmt_prod_pattern ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prod_pattern formatter = + let width' = width + 4L in + match prod_pattern with + | ProdPatternParams {prod_params} -> + formatter |> Fmt.fmt "ProdPatternParams " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prod_params=" |> fmt_prod_params ~alt ~width:width' prod_params + |> fmt_rcurly ~alt ~width + | ProdPatternEpsilon {epsilon_} -> + formatter |> Fmt.fmt "ProdPatternEpsilon " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "epsilon_=" |> Scan.Token.pp epsilon_ + |> fmt_rcurly ~alt ~width + and pp_prod_pattern prod_pattern formatter = + fmt_prod_pattern prod_pattern formatter + + and fmt_prod ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prod formatter = + let width' = width + 4L in + match prod with + | Prod {prod_pattern; prec_ref} -> + formatter |> Fmt.fmt "Prod " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prod_pattern=" |> fmt_prod_pattern ~alt ~width:width' prod_pattern + |> fmt_semi ~alt ~width + |> Fmt.fmt "prec_ref=" |> fmt_prec_ref ~alt ~width:width' prec_ref + |> fmt_rcurly ~alt ~width + and pp_prod prod formatter = + fmt_prod prod formatter + + and fmt_prods_tl ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prods_tl formatter = + let width' = width + 4L in + match prods_tl with + | ProdsTlBarProd {bar; prod; prods_tl} -> + formatter |> Fmt.fmt "ProdsTlBarProd " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "bar=" |> Scan.Token.pp bar + |> fmt_semi ~alt ~width + |> Fmt.fmt "prod=" |> fmt_prod ~alt ~width:width' prod + |> fmt_semi ~alt ~width + |> Fmt.fmt "prods_tl=" |> fmt_prods_tl ~alt ~width:width' prods_tl + |> fmt_rcurly ~alt ~width + | ProdsTlEpsilon -> + formatter |> Fmt.fmt "ProdsTlEpsilon" + and pp_prods_tl prods_tl formatter = + fmt_prods_tl prods_tl formatter + + and fmt_prods ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prods formatter = + let width' = width + 4L in + match prods with + | ProdsBarProd {bar; prod; prods_tl} -> + formatter |> Fmt.fmt "ProdsBarProd " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "bar=" |> Scan.Token.pp bar + |> fmt_semi ~alt ~width + |> Fmt.fmt "prod=" |> fmt_prod ~alt ~width:width' prod + |> fmt_semi ~alt ~width + |> Fmt.fmt "prods_tl=" |> fmt_prods_tl ~alt ~width:width' prods_tl + |> fmt_rcurly ~alt ~width + | ProdsProd {prod; prods_tl} -> + formatter |> Fmt.fmt "ProdsProd " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prod=" |> fmt_prod ~alt ~width:width' prod + |> fmt_semi ~alt ~width + |> Fmt.fmt "prods_tl=" |> fmt_prods_tl ~alt ~width:width' prods_tl + |> fmt_rcurly ~alt ~width + and pp_prods prods formatter = + fmt_prods prods formatter + + and fmt_reduction ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) reduction formatter = + let width' = width + 4L in + match reduction with + | Reduction {prods; arrow; code} -> + formatter |> Fmt.fmt "Reduction " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prods=" |> fmt_prods ~alt ~width:width' prods + |> fmt_semi ~alt ~width + |> Fmt.fmt "arrow=" |> Scan.Token.pp arrow + |> fmt_semi ~alt ~width + |> Fmt.fmt "code=" |> pp_code code + |> fmt_rcurly ~alt ~width + and pp_reduction reduction formatter = + fmt_reduction reduction formatter + + and fmt_reductions_tl ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) reductions_tl formatter = + let width' = width + 4L in + match reductions_tl with + | ReductionsTlBarReduction {bar; reduction; reductions_tl} -> + formatter |> Fmt.fmt "ReductionsTlBarReduction " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "bar=" |> Scan.Token.pp bar + |> fmt_semi ~alt ~width + |> Fmt.fmt "reduction=" |> fmt_reduction ~alt ~width:width' reduction + |> fmt_semi ~alt ~width + |> Fmt.fmt "reductions_tl=" |> fmt_reductions_tl ~alt ~width:width' reductions_tl + |> fmt_rcurly ~alt ~width + | ReductionsTlEpsilon -> + formatter |> Fmt.fmt "ReductionsTlEpsilon" + and pp_reductions_tl reductions_tl formatter = + fmt_reductions_tl reductions_tl formatter + + and fmt_reductions ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) reductions formatter = + let width' = width + 4L in + match reductions with + | ReductionsReduction {reduction; reductions_tl} -> + formatter |> Fmt.fmt "ReductionsReduction " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "reduction=" |> fmt_reduction ~alt ~width:width' reduction + |> fmt_semi ~alt ~width + |> Fmt.fmt "reductions_tl=" |> fmt_reductions_tl ~alt ~width:width' reductions_tl + |> fmt_rcurly ~alt ~width + and pp_reductions reductions formatter = + fmt_reductions reductions formatter + + and fmt_nonterm_type ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) nonterm_type formatter = + match nonterm_type with + | NontermTypeNonterm {nonterm_} -> + formatter |> Fmt.fmt "NontermTypeNonterm " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "nonterm_=" |> Scan.Token.pp nonterm_ + |> fmt_rcurly ~alt ~width + | NontermTypeStart {start_} -> + formatter |> Fmt.fmt "NontermTypeStart " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "start_=" |> Scan.Token.pp start_ + |> fmt_rcurly ~alt ~width + and pp_nonterm_type nonterm_type formatter = + fmt_nonterm_type nonterm_type formatter + + and fmt_nonterm ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) nonterm_ formatter = + let width' = width + 4L in + match nonterm_ with + | NontermProds {nonterm_type; cident; prec_ref; cce; prods} -> + formatter |> Fmt.fmt "NontermProds " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "nonterm_type=" |> fmt_nonterm_type ~alt ~width:width' nonterm_type + |> fmt_semi ~alt ~width + |> Fmt.fmt "cident=" |> fmt_cident ~alt ~width:width' cident + |> fmt_semi ~alt ~width + |> Fmt.fmt "prec_ref=" |> fmt_prec_ref ~alt ~width:width' prec_ref + |> fmt_semi ~alt ~width + |> Fmt.fmt "cce=" |> Scan.Token.pp cce + |> fmt_semi ~alt ~width + |> Fmt.fmt "prods=" |> fmt_prods ~alt ~width:width' prods + |> fmt_rcurly ~alt ~width + | NontermReductions {nonterm_type; cident; of_type; prec_ref; cce; reductions} -> + formatter |> Fmt.fmt "NontermReductions " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "nonterm_type=" |> fmt_nonterm_type ~alt ~width:width' nonterm_type + |> fmt_semi ~alt ~width + |> Fmt.fmt "cident=" |> fmt_cident ~alt ~width:width' cident + |> fmt_semi ~alt ~width + |> Fmt.fmt "of_type=" |> fmt_of_type ~alt ~width:width' of_type + |> fmt_semi ~alt ~width + |> Fmt.fmt "prec_ref=" |> fmt_prec_ref ~alt ~width:width' prec_ref + |> fmt_semi ~alt ~width + |> Fmt.fmt "cce=" |> Scan.Token.pp cce + |> fmt_semi ~alt ~width + |> Fmt.fmt "reductions=" |> fmt_reductions ~alt ~width:width' reductions + |> fmt_rcurly ~alt ~width + and pp_nonterm nonterm_ formatter = + fmt_nonterm nonterm_ formatter + + and fmt_stmt ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) stmt formatter = + let width' = width + 4L in + match stmt with + | StmtPrec {prec_} -> + formatter |> Fmt.fmt "StmtPrec " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prec_=" |> fmt_prec ~alt ~width:width' prec_ + |> fmt_rcurly ~alt ~width + | StmtToken {token_} -> + formatter |> Fmt.fmt "StmtToken " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "token_=" |> fmt_token ~alt ~width:width' token_ + |> fmt_rcurly ~alt ~width + | StmtNonterm {nonterm_} -> + formatter |> Fmt.fmt "StmtNonterm " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "nonterm_=" |> fmt_nonterm ~alt ~width:width' nonterm_ + |> fmt_rcurly ~alt ~width + | StmtCode {code} -> + formatter |> Fmt.fmt "StmtCode " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "code=" |> fmt_code ~alt ~width:width' code + |> fmt_rcurly ~alt ~width + and pp_stmt stmt formatter = + fmt_stmt stmt formatter + + and fmt_stmts_tl ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) stmts_tl formatter = + let width' = width + 4L in + match stmts_tl with + | StmtsTl {line_delim; stmt; stmts_tl} -> + formatter |> Fmt.fmt "StmtsTl " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "line_delim=" |> Scan.Token.pp line_delim + |> fmt_semi ~alt ~width + |> Fmt.fmt "stmt=" |> fmt_stmt ~alt ~width:width' stmt + |> fmt_semi ~alt ~width + |> Fmt.fmt "stmts_tl=" |> fmt_stmts_tl ~alt ~width:width' stmts_tl + |> fmt_rcurly ~alt ~width + | StmtsTlEpsilon -> + formatter |> Fmt.fmt "StmtsTlEpsilon" + and pp_stmts_tl stmts_tl formatter = + fmt_stmts_tl stmts_tl formatter + + and fmt_stmts ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) stmts formatter = + let width' = width + 4L in + match stmts with + | Stmts {stmt; stmts_tl} -> + formatter |> Fmt.fmt "Stmts " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "stmt=" |> fmt_stmt ~alt ~width:width' stmt + |> fmt_semi ~alt ~width + |> Fmt.fmt "stmts_tl=" |> fmt_stmts_tl ~alt ~width:width' stmts_tl + |> fmt_rcurly ~alt ~width + and pp_stmts stmts formatter = + fmt_stmts stmts formatter + + and fmt_hocc ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) hocc_ formatter = + let width' = width + 4L in + match hocc_ with + | Hocc {hocc_; indent; stmts; dedent} -> + formatter |> Fmt.fmt "Hocc " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "hocc_=" |> Scan.Token.pp hocc_ + |> fmt_semi ~alt ~width + |> Fmt.fmt "indent=" |> Scan.Token.pp indent + |> fmt_semi ~alt ~width + |> Fmt.fmt "stmts=" |> fmt_stmts ~alt ~width:width' stmts + |> fmt_semi ~alt ~width + |> Fmt.fmt "dedent=" |> Scan.Token.pp dedent + |> fmt_rcurly ~alt ~width + and pp_hocc hocc_ formatter = + fmt_hocc hocc_ formatter + + and fmt_matter ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) matter formatter = + let width' = width + 4L in + match matter with + | Matter {token_; matter} -> + formatter |> Fmt.fmt "Matter " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "token_=" |> Scan.Token.pp token_ + |> fmt_semi ~alt ~width + |> Fmt.fmt "matter=" |> fmt_matter ~alt ~width:width' matter + |> fmt_rcurly ~alt ~width + | MatterEpsilon -> + formatter |> Fmt.fmt "MatterEpsilon" + and pp_matter matter formatter = + fmt_matter matter formatter + + and fmt_hmh ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) hmh formatter = + let width' = width + 4L in + match hmh with + | Hmh {prelude; hocc_; postlude; eoi} -> + formatter |> Fmt.fmt "Hmh " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prelude=" |> pp_matter prelude + |> fmt_semi ~alt ~width + |> Fmt.fmt "hocc_=" |> fmt_hocc ~alt ~width:width' hocc_ + |> fmt_semi ~alt ~width + |> Fmt.fmt "postlude=" |> pp_matter postlude + |> fmt_semi ~alt ~width + |> Fmt.fmt "eoi=" |> Scan.Token.pp eoi + |> fmt_rcurly ~alt ~width + and pp_hmh hmh formatter = + fmt_hmh hmh formatter + + and fmt_hmhi ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) hmhi formatter = + match hmhi with + | Hmhi {prelude; hocc_; postlude; eoi} -> + formatter |> Fmt.fmt "Hmhi " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prelude=" |> pp_matter prelude + |> fmt_semi ~alt ~width + |> Fmt.fmt "hocc_=" |> Scan.Token.pp hocc_ + |> fmt_semi ~alt ~width + |> Fmt.fmt "postlude=" |> pp_matter postlude + |> fmt_semi ~alt ~width + |> Fmt.fmt "eoi=" |> Scan.Token.pp eoi + |> fmt_rcurly ~alt ~width + and pp_hmhi hmhi formatter = + fmt_hmhi hmhi formatter + +(**************************************************************************************************) +(* Miscellaneous helper functions. *) + +let min_comment_indentation_of_hocc_block = function + | Hocc {indent; _} -> + Scan.Token.source indent + |> Hmc.Source.Slice.base + |> Hmc.Source.Cursor.pos + |> Text.Pos.col + +let base_of_code code = + let of_token token_ = + let open Scan.Token in + let source = match token_ with + | HmcToken ctok -> ctok |> Hmc.Scan.ConcreteToken.source + | HoccToken ctok -> ctok |> Scan.ConcreteToken.source + in + Hmc.Source.Slice.base source + in + let rec of_delimited = function + | DelimitedBlock {indent=token_; _} + | DelimitedParen {lparen=token_; _} + | DelimitedCapture {lcapture=token_; _} + | DelimitedList {lbrack=token_; _} + | DelimitedArray {larray=token_; _} + | DelimitedModule {lcurly=token_; _} -> of_token token_ + and of_code = function + | CodeDelimited {delimited; _} -> of_delimited delimited + | CodeCodeToken {token_; _} -> of_token token_ + in + of_code code + +let last_token_of_code code = + let rec of_codes_tl = function + | CodesTlSepCode {code; codes_tl; _} -> begin + of_codes_tl codes_tl + |> Option.some_or_thunk ~f:(fun () -> Some (of_code code)) + end + | CodesTlEpsilon -> None + and of_codes = function + | Codes {code; codes_tl} -> begin + of_codes_tl codes_tl + |> Option.value_or_thunk ~f:(fun () -> of_code code) + end + and of_delimited = function + | DelimitedBlock {codes; dedent; _} -> begin + of_codes codes + |> Option.some_or_thunk ~f:(fun () -> Some dedent) + |> Option.value_hlt + end + | DelimitedParen {rparen=token_; _} + | DelimitedCapture {rcapture=token_; _} + | DelimitedList {rbrack=token_; _} + | DelimitedArray {rarray=token_; _} + | DelimitedModule {rcurly=token_; _} -> token_ + and of_code_tl = function + | CodeTlDelimited {delimited; code_tl} -> + of_code_tl code_tl |> Option.some_or_thunk ~f:(fun () -> Some (of_delimited delimited)) + | CodeTlToken {token_; code_tl} -> + of_code_tl code_tl |> Option.some_or_thunk ~f:(fun () -> Some token_) + | CodeTlEpsilon -> None + and of_code = function + | CodeDelimited {delimited; code_tl} -> + of_code_tl code_tl |> Option.some_or_thunk ~f:(fun () -> Some (of_delimited delimited)) + | CodeCodeToken {token_; code_tl} -> + of_code_tl code_tl |> Option.some_or_thunk ~f:(fun () -> Some token_) + in + of_code code + |> Option.value_hlt + +let past_of_code code = + let of_token token_ = + let open Scan.Token in + let source = match token_ with + | HmcToken ctok -> ctok |> Hmc.Scan.ConcreteToken.source + | HoccToken ctok -> ctok |> Scan.ConcreteToken.source + in + Hmc.Source.Slice.past source + in + last_token_of_code code |> of_token + +let source_of_code code = + let base = base_of_code code in + let past = past_of_code code in + Hmc.Source.Slice.of_cursors ~base ~past + +let indentation_of_code hocc_block code = + let min_comment_indentation = min_comment_indentation_of_hocc_block hocc_block in + match code with + | CodeDelimited _ -> min_comment_indentation + 4L + | CodeCodeToken _ -> min_comment_indentation + +(* Find the base cursor for the postlude that preserves comments/whitespace that fall outside the + * `hocc` block. *) +let postlude_base_of_hocc (Hocc {stmts=Stmts {stmt; stmts_tl}; _}) = + let rec of_uident = function + | Uident {uident} -> uident + and of_cident = function + | Cident {cident} -> cident + and of_precs_tl = function + | PrecsTlCommaUident {uident; precs_tl; _} -> + Some ( + of_precs_tl precs_tl + |> Option.value_or_thunk ~f:(fun () -> of_uident uident) + ) + | PrecsTlEpsilon -> None + and of_precs = function + | Precs {uident; precs_tl} -> begin + of_precs_tl precs_tl + |> Option.value_or_thunk ~f:(fun () -> of_uident uident) + end + and of_prec_rels = function + | PrecRelsLtPrecs {precs; _} -> Some (of_precs precs) + | PrecRelsEpsilon -> None + and of_of_type = function + | OfType {type_type; _} -> of_uident type_type + and of_of_type0 = function + | OfType0OfType {of_type} -> Some (of_of_type of_type) + | OfType0Epsilon -> None + and of_prec_ref = function + | PrecRefPrecUident {uident; _} -> Some (of_uident uident) + | PrecRefEpsilon -> None + and of_token_alias = function + | TokenAlias {alias} -> Some alias + | TokenAliasEpsilon -> None + and of_prod_param_symbol = function + | ProdParamSymbolCident {cident} -> of_cident cident + | ProdParamSymbolAlias {alias} -> alias + and of_prod_param = function + | ProdParamBinding {prod_param_symbol; _} + | ProdParam {prod_param_symbol} -> of_prod_param_symbol prod_param_symbol + and of_prod_params_tl = function + | ProdParamsTlProdParam {prod_param; prod_params_tl} -> begin + of_prod_params_tl prod_params_tl + |> Option.some_or_thunk ~f:(fun () -> Some (of_prod_param prod_param)) + end + | ProdParamsTlEpsilon -> None + and of_prod_params = function + | ProdParamsProdParam {prod_param; prod_params_tl} -> begin + of_prod_params_tl prod_params_tl + |> Option.value_or_thunk ~f:(fun () -> of_prod_param prod_param) + end + and of_prod_pattern = function + | ProdPatternParams {prod_params} -> of_prod_params prod_params + | ProdPatternEpsilon {epsilon_} -> epsilon_ + and of_prod = function + | Prod {prod_pattern; prec_ref} -> begin + of_prec_ref prec_ref + |> Option.value_or_thunk ~f:(fun () -> of_prod_pattern prod_pattern) + end + and of_prods_tl = function + | ProdsTlBarProd {prod; prods_tl; _} -> begin + of_prods_tl prods_tl + |> Option.some_or_thunk ~f:(fun () -> Some (of_prod prod)) + end + | ProdsTlEpsilon -> None + and of_prods = function + | ProdsBarProd {prod; prods_tl; _} + | ProdsProd {prod; prods_tl} -> begin + of_prods_tl prods_tl + |> Option.value_or_thunk ~f:(fun () -> of_prod prod) + end + and of_reduction = function + | Reduction {code; _} -> last_token_of_code code + and of_reductions_tl = function + | ReductionsTlBarReduction {reduction; reductions_tl; _} -> begin + of_reductions_tl reductions_tl + |> Option.some_or_thunk ~f:(fun () -> Some (of_reduction reduction)) + end + | ReductionsTlEpsilon -> None + and of_reductions = function + | ReductionsReduction {reduction; reductions_tl} -> begin + of_reductions_tl reductions_tl + |> Option.value_or_thunk ~f:(fun () -> of_reduction reduction) + end + and of_nonterm = function + | NontermProds {prods; _} -> of_prods prods + | NontermReductions {reductions; _} -> of_reductions reductions + and of_stmt = function + | StmtPrec {prec_=Prec {uident; prec_rels; _}} -> begin + of_prec_rels prec_rels + |> Option.value_or_thunk ~f:(fun () -> of_uident uident) + end + | StmtToken {token_=Token {cident; token_alias; of_type0; prec_ref; _}} -> begin + of_prec_ref prec_ref + |> Option.some_or_thunk ~f:(fun () -> of_of_type0 of_type0) + |> Option.some_or_thunk ~f:(fun () -> of_token_alias token_alias) + |> Option.value_or_thunk ~f:(fun () -> of_cident cident) + end + | StmtNonterm {nonterm_} -> of_nonterm nonterm_ + | StmtCode {code} -> last_token_of_code code + and of_stmts_tl = function + | StmtsTl {stmt; stmts_tl; _} -> begin + (of_stmts_tl stmts_tl) + |> Option.some_or_thunk ~f:(fun () -> Some (of_stmt stmt)) + end + | StmtsTlEpsilon -> None + in + of_stmts_tl stmts_tl + |> Option.value_or_thunk ~f:(fun () -> of_stmt stmt) + |> Scan.Token.source + |> Hmc.Source.Slice.past diff --git a/bootstrap/bin/hocc/code.ml b/bootstrap/bin/hocc/code.ml index 1c3cc7ea..6745ffdf 100644 --- a/bootstrap/bin/hocc/code.ml +++ b/bootstrap/bin/hocc/code.ml @@ -1690,7 +1690,7 @@ let expand_hm_callbacks hocc_block symbols callbacks ~indentation formatter = let underline = Codepoint.of_char '_' in let overline = Codepoint.kv 0x203eL (*'‾'*) in let code = Option.value_hlt code in - let source = Parse.source_of_code hocc_block code in + let source = Parse.source_of_code code in formatter |> Fmt.fmt "function\n" |> (fun formatter -> @@ -3531,7 +3531,7 @@ let expand_ml_nonterms symbols ~indentation formatter = |> Fmt.fmt "\n" |> expand_ml_nonterm_index symbols ~indentation -let expand_ml_callbacks hocc_block symbols callbacks ~indentation formatter = +let expand_ml_callbacks symbols callbacks ~indentation formatter = let fmt_callbacks ~indentation formatter = begin let indent = mk_indent indentation in let formatter, _first = Callbacks.fold ~init:(formatter, true) @@ -3552,7 +3552,7 @@ let expand_ml_callbacks hocc_block symbols callbacks ~indentation formatter = let underline = Codepoint.of_char '_' in let overline = Codepoint.kv 0x203eL (*'‾'*) in let code = Option.value_hlt code in - let source = Parse.source_of_code hocc_block code in + let source = Parse.source_of_code code in formatter |> Fmt.fmt "(function\n" |> (fun formatter -> @@ -3682,7 +3682,7 @@ let expand_ml_starts symbols states ~indentation formatter = in formatter -let expand_ml_template template_indentation template hocc_block +let expand_ml_template template_indentation template Spec.{algorithm; precs; symbols; prods; callbacks; states} formatter = let expanders = Map.of_alist (module String) [ ("«algorithm»", expand_ml_algorithm algorithm); @@ -3692,7 +3692,7 @@ let expand_ml_template template_indentation template hocc_block ("«states»", expand_ml_states states); ("«tokens»", expand_ml_tokens symbols); ("«nonterms»", expand_ml_nonterms symbols); - ("«callbacks»", expand_ml_callbacks hocc_block symbols callbacks); + ("«callbacks»", expand_ml_callbacks symbols callbacks); ("«starts»", expand_ml_starts symbols states) ] in formatter |> expand ~template_indentation template expanders @@ -3725,7 +3725,7 @@ let generate_ml conf end | MatterEpsilon -> formatter ) - |> expand_ml_template indentation ml_template hocc_block spec + |> expand_ml_template indentation ml_template spec |> (fun formatter -> match postlude with | Parse.Matter _ -> begin diff --git a/bootstrap/bin/hocc/parse.ml b/bootstrap/bin/hocc/parse.ml index 8be2abfb..322d5e3c 100644 --- a/bootstrap/bin/hocc/parse.ml +++ b/bootstrap/bin/hocc/parse.ml @@ -1,307 +1,13780 @@ -(** Recursive descent parser for the hocc grammar that is documented (using hocc syntax) in the - manual. This could in principle be bootstrapped to be hocc-generated, but doing so would - complicate maintenance more than it's probably worth. However, it is useful to keep the - `Hocc.hmh` test grammar in sync in order to avoid introducing grammar ambiguities. - - Note that `trace` can be set to `true` in order to enable extremely verbose output, should the - need to diagnose a parser flaw arise. *) - +(* This file was generated by `hocc` based on "ParseLR.hmh" *) open Basis open! Basis.Rudiments module Error = struct - module T = struct - type t = { - source: Hmc.Source.Slice.t; - msg: string; - } - - let cmp t0 t1 = - Hmc.Source.Slice.cmp t0.source t1.source - - let pp {source; msg} formatter = - formatter - |> Fmt.fmt "{source=" |> Hmc.Source.Slice.pp source - |> Fmt.fmt "; msg=" |> String.pp msg - |> Fmt.fmt "}" - - let fmt ?(alt=false) ({source; msg} as t) formatter = - match alt with - | false -> pp t formatter - | true -> begin - formatter - |> Fmt.fmt "hocc: At " - |> Hmc.Source.Slice.pp source - |> Fmt.fmt ": " - |> Fmt.fmt msg - |> Fmt.fmt "\n" - end - end - include T - include Cmpable.Make(T) + module T = struct + type t = { + source: Hmc.Source.Slice.t; + msg: string; + } + + let cmp t0 t1 = + Hmc.Source.Slice.cmp t0.source t1.source + + let pp {source; msg} formatter = + formatter + |> Fmt.fmt "{source=" |> Hmc.Source.Slice.pp source + |> Fmt.fmt "; msg=" |> String.pp msg + |> Fmt.fmt "}" + + let fmt ?(alt=false) ({source; msg} as t) formatter = + match alt with + | false -> pp t formatter + | true -> begin + formatter + |> Fmt.fmt "hocc: At " + |> Hmc.Source.Slice.pp source + |> Fmt.fmt ": " + |> Fmt.fmt msg + |> Fmt.fmt "\n" + end + end + include T + include Cmpable.Make(T) - let init_token token msg = - {source=Scan.Token.source token; msg} + let init_token token_ msg = + {source=Scan.Token.source token_; msg} - let init_mal mal = - let open Hmc.Scan.AbstractToken.Rendition.Malformation in - {source=source mal; msg=description mal} + let init_mal mal = + let open Hmc.Scan.AbstractToken.Rendition.Malformation in + {source=source mal; msg=description mal} - let init_scanner scanner msg = - let cursor = Scan.cursor scanner in - let source = Hmc.Source.Slice.of_cursors ~base:cursor ~past:cursor in - {source; msg} -end + let init_scanner scanner msg = + let cursor = Scan.cursor scanner in + let source = Hmc.Source.Slice.of_cursors ~base:cursor ~past:cursor in + {source; msg} + end + +module X = struct (* XXX Workaround for qualified type syntax limitation. *) +type token_hocc = + | HOCC of {token_: Scan.Token.t} +type token_nonterm = + | NONTERM of {token_: Scan.Token.t} +type token_epsilon = + | EPSILON of {token_: Scan.Token.t} +type token_start = + | START of {token_: Scan.Token.t} +type token_token = + | TOKEN of {token_: Scan.Token.t} +type token_neutral = + | NEUTRAL of {token_: Scan.Token.t} +type token_left = + | LEFT of {token_: Scan.Token.t} +type token_right = + | RIGHT of {token_: Scan.Token.t} +type token_prec = + | PREC of {token_: Scan.Token.t} +type token_uident = + | UIDENT of {token_: Scan.Token.t} +type token_cident = + | CIDENT of {token_: Scan.Token.t} +type token_uscore = + | USCORE of {token_: Scan.Token.t} +type token_istring = + | ISTRING of {token_: Scan.Token.t} +type token_colon_colon_eq = + | COLON_COLON_EQ of {token_: Scan.Token.t} +type token_of = + | OF of {token_: Scan.Token.t} +type token_colon = + | COLON of {token_: Scan.Token.t} +type token_dot = + | DOT of {token_: Scan.Token.t} +type token_arrow = + | ARROW of {token_: Scan.Token.t} +type token_bar = + | BAR of {token_: Scan.Token.t} +type token_lt = + | LT of {token_: Scan.Token.t} +type token_comma = + | COMMA of {token_: Scan.Token.t} +type token_semi = + | SEMI of {token_: Scan.Token.t} +type token_line_delim = + | LINE_DELIM of {token_: Scan.Token.t} +type token_indent = + | INDENT of {token_: Scan.Token.t} +type token_dedent = + | DEDENT of {token_: Scan.Token.t} +type token_lparen = + | LPAREN of {token_: Scan.Token.t} +type token_rparen = + | RPAREN of {token_: Scan.Token.t} +type token_lcapture = + | LCAPTURE of {token_: Scan.Token.t} +type token_rcapture = + | RCAPTURE of {token_: Scan.Token.t} +type token_lbrack = + | LBRACK of {token_: Scan.Token.t} +type token_rbrack = + | RBRACK of {token_: Scan.Token.t} +type token_larray = + | LARRAY of {token_: Scan.Token.t} +type token_rarray = + | RARRAY of {token_: Scan.Token.t} +type token_lcurly = + | LCURLY of {token_: Scan.Token.t} +type token_rcurly = + | RCURLY of {token_: Scan.Token.t} +type token_other_token = + | OTHER_TOKEN of {token_: Scan.Token.t} +type token_eoi = + | EOI of {token_: Scan.Token.t} type nonterm_uident = | Uident of {uident: Scan.Token.t} -and nonterm_cident = + and nonterm_cident = | Cident of {cident: Scan.Token.t} -and nonterm_ident = + and nonterm_ident = | IdentUident of {uident: nonterm_uident} | IdentCident of {cident: nonterm_cident} | IdentUscore of {uscore: Scan.Token.t} -and nonterm_precs_tl = + and nonterm_precs_tl = | PrecsTlCommaUident of {comma: Scan.Token.t; uident: nonterm_uident; precs_tl: nonterm_precs_tl} | PrecsTlEpsilon -and nonterm_precs = + and nonterm_precs = | Precs of {uident: nonterm_uident; precs_tl: nonterm_precs_tl} -and nonterm_prec_rels = + and nonterm_prec_rels = | PrecRelsLtPrecs of {lt: Scan.Token.t; precs: nonterm_precs} | PrecRelsEpsilon -and nonterm_prec_type = + and nonterm_prec_type = | PrecTypeNeutral of {neutral_: Scan.Token.t} | PrecTypeLeft of {left_: Scan.Token.t} | PrecTypeRight of {right_: Scan.Token.t} -and nonterm_prec = + and nonterm_prec = | Prec of {prec_type: nonterm_prec_type; uident: nonterm_uident; prec_rels: nonterm_prec_rels} -and nonterm_of_type = + and nonterm_of_type = | OfType of {of_: Scan.Token.t; type_module: nonterm_cident; dot: Scan.Token.t; - type_type: nonterm_uident} -and nonterm_of_type0 = + type_type: nonterm_uident} + and nonterm_of_type0 = | OfType0OfType of {of_type: nonterm_of_type} | OfType0Epsilon -and nonterm_prec_ref = + and nonterm_prec_ref = | PrecRefPrecUident of {prec_: Scan.Token.t; uident: nonterm_uident} | PrecRefEpsilon -and nonterm_token_alias = + and nonterm_token_alias = | TokenAlias of {alias: Scan.Token.t} | TokenAliasEpsilon -and nonterm_token = + and nonterm_token = | Token of {token_: Scan.Token.t; cident: nonterm_cident; token_alias: nonterm_token_alias; - of_type0: nonterm_of_type0; prec_ref: nonterm_prec_ref} -and nonterm_sep = + of_type0: nonterm_of_type0; prec_ref: nonterm_prec_ref} + and nonterm_sep = | SepLineDelim of {line_delim: Scan.Token.t} | SepSemi of {semi: Scan.Token.t} | SepBar of {bar: Scan.Token.t} -and nonterm_codes_tl = + and nonterm_codes_tl = | CodesTlSepCode of {sep: nonterm_sep; code: nonterm_code; codes_tl: nonterm_codes_tl} | CodesTlEpsilon -and nonterm_codes = + and nonterm_codes = | Codes of {code: nonterm_code; codes_tl: nonterm_codes_tl} -and nonterm_codes0 = + and nonterm_codes0 = | Codes0Codes of {codes: nonterm_codes} | Codes0Epsilon -and nonterm_delimited = + and nonterm_delimited = | DelimitedBlock of {indent: Scan.Token.t; codes: nonterm_codes; dedent: Scan.Token.t} | DelimitedParen of {lparen: Scan.Token.t; codes0: nonterm_codes0; rparen: Scan.Token.t} | DelimitedCapture of {lcapture: Scan.Token.t; codes0: nonterm_codes0; rcapture: Scan.Token.t} | DelimitedList of {lbrack: Scan.Token.t; codes0: nonterm_codes0; rbrack: Scan.Token.t} | DelimitedArray of {larray: Scan.Token.t; codes0: nonterm_codes0; rarray: Scan.Token.t} | DelimitedModule of {lcurly: Scan.Token.t; codes0: nonterm_codes0; rcurly: Scan.Token.t} -and nonterm_code_tl = + and nonterm_code_token = + | CodeToken of {token_: Scan.Token.t} + and nonterm_code_tl = | CodeTlDelimited of {delimited: nonterm_delimited; code_tl: nonterm_code_tl} | CodeTlToken of {token_: Scan.Token.t; code_tl: nonterm_code_tl} | CodeTlEpsilon -and nonterm_code = + and nonterm_code = | CodeDelimited of {delimited: nonterm_delimited; code_tl: nonterm_code_tl} - | CodeToken of {token_: Scan.Token.t; code_tl: nonterm_code_tl} -and nonterm_prod_param_symbol = + | CodeCodeToken of {token_: Scan.Token.t; code_tl: nonterm_code_tl} + and nonterm_prod_param_symbol = | ProdParamSymbolCident of {cident: nonterm_cident} | ProdParamSymbolAlias of {alias: Scan.Token.t} -and nonterm_prod_param = + and nonterm_prod_param = | ProdParamBinding of {ident: nonterm_ident; colon: Scan.Token.t; - prod_param_symbol: nonterm_prod_param_symbol} + prod_param_symbol: nonterm_prod_param_symbol} | ProdParam of {prod_param_symbol: nonterm_prod_param_symbol} -and nonterm_prod_params_tl = + and nonterm_prod_params_tl = | ProdParamsTlProdParam of {prod_param: nonterm_prod_param; - prod_params_tl: nonterm_prod_params_tl} + prod_params_tl: nonterm_prod_params_tl} | ProdParamsTlEpsilon -and nonterm_prod_params = + and nonterm_prod_params = | ProdParamsProdParam of {prod_param: nonterm_prod_param; prod_params_tl: nonterm_prod_params_tl} -and nonterm_prod_pattern = + and nonterm_prod_pattern = | ProdPatternParams of {prod_params: nonterm_prod_params} | ProdPatternEpsilon of {epsilon_: Scan.Token.t} -and nonterm_prod = + and nonterm_prod = | Prod of {prod_pattern: nonterm_prod_pattern; prec_ref: nonterm_prec_ref} -and nonterm_prods_tl = + and nonterm_prods_tl = | ProdsTlBarProd of {bar: Scan.Token.t; prod: nonterm_prod; prods_tl: nonterm_prods_tl} | ProdsTlEpsilon -and nonterm_prods = + and nonterm_prods = | ProdsBarProd of {bar: Scan.Token.t; prod: nonterm_prod; prods_tl: nonterm_prods_tl} | ProdsProd of {prod: nonterm_prod; prods_tl: nonterm_prods_tl} -and nonterm_reduction = + and nonterm_reduction = | Reduction of {prods: nonterm_prods; arrow: Scan.Token.t; code: nonterm_code} -and nonterm_reductions_tl = + and nonterm_reductions_tl = | ReductionsTlBarReduction of {bar: Scan.Token.t; reduction: nonterm_reduction; - reductions_tl: nonterm_reductions_tl} + reductions_tl: nonterm_reductions_tl} | ReductionsTlEpsilon -and nonterm_reductions = + and nonterm_reductions = | ReductionsReduction of {reduction: nonterm_reduction; reductions_tl: nonterm_reductions_tl} -and nonterm_nonterm_type = + and nonterm_nonterm_type = | NontermTypeNonterm of {nonterm_: Scan.Token.t} | NontermTypeStart of {start_: Scan.Token.t} -and nonterm_nonterm = + and nonterm_nonterm = | NontermProds of {nonterm_type: nonterm_nonterm_type; cident: nonterm_cident; - prec_ref: nonterm_prec_ref; cce: Scan.Token.t; prods: nonterm_prods} + prec_ref: nonterm_prec_ref; cce: Scan.Token.t; prods: nonterm_prods} | NontermReductions of {nonterm_type: nonterm_nonterm_type; cident: nonterm_cident; - of_type: nonterm_of_type; prec_ref: nonterm_prec_ref; cce: Scan.Token.t; - reductions: nonterm_reductions} -and nonterm_stmt = + of_type: nonterm_of_type; prec_ref: nonterm_prec_ref; cce: Scan.Token.t; + reductions: nonterm_reductions} + and nonterm_stmt = | StmtPrec of {prec_: nonterm_prec} | StmtToken of {token_: nonterm_token} | StmtNonterm of {nonterm_: nonterm_nonterm} | StmtCode of {code: nonterm_code} -and nonterm_stmts_tl = + and nonterm_stmts_tl = | StmtsTl of {line_delim: Scan.Token.t; stmt: nonterm_stmt; stmts_tl: nonterm_stmts_tl} | StmtsTlEpsilon -and nonterm_stmts = + and nonterm_stmts = | Stmts of {stmt: nonterm_stmt; stmts_tl: nonterm_stmts_tl} -and nonterm_hocc = + and nonterm_hocc = | Hocc of {hocc_: Scan.Token.t; indent: Scan.Token.t; stmts: nonterm_stmts; dedent: Scan.Token.t} -and nonterm_eoi = - | Eoi of {eoi: Scan.Token.t} -and nonterm_matter = + and nonterm_matter_token = + | MatterToken of {token_: Scan.Token.t} + and nonterm_matter = | Matter of {token_: Scan.Token.t; matter: nonterm_matter} | MatterEpsilon -and nonterm_hmh = + and nonterm_hmh = | Hmh of {prelude: nonterm_matter; hocc_: nonterm_hocc; postlude: nonterm_matter; - eoi: Scan.Token.t} -and nonterm_hmhi = + eoi: Scan.Token.t} + and nonterm_hmhi = | Hmhi of {prelude: nonterm_matter; hocc_: Scan.Token.t; postlude: nonterm_matter; - eoi: Scan.Token.t} + eoi: Scan.Token.t} + end + +include struct + module Spec = struct + module Algorithm = struct + module T = struct + type t = + | Lr1 + | Ielr1 + | Pgm1 + | Lalr1 + + let index = function + | Lr1 -> 0L + | Ielr1 -> 1L + | Pgm1 -> 2L + | Lalr1 -> 3L + + let hash_fold t state = + state |> Uns.hash_fold (index t) + + let cmp t0 t1 = + Uns.cmp (index t0) (index t1) + + let to_string = function + | Lr1 -> "Lr1" + | Ielr1 -> "Ielr1" + | Pgm1 -> "Pgm1" + | Lalr1 -> "Lalr1" + + let pp t formatter = + formatter |> Fmt.fmt (to_string t) + end + include T + include Identifiable.Make(T) + end + + let algorithm = Algorithm.Pgm1 + + module Assoc = struct + module T = struct + type t = + | Left + | Right + + let index = function + | Left -> 0L + | Right -> 1L + + let hash_fold t state = + state |> Uns.hash_fold (index t) + + let cmp t0 t1 = + Uns.cmp (index t0) (index t1) + + let to_string = function + | Left -> "Left" + | Right -> "Right" + + let pp t formatter = + formatter |> Fmt.fmt (to_string t) + end + include T + include Identifiable.Make(T) + end + + module Prec = struct + module T = struct + type t = { + index: uns; + name: string; + assoc: Assoc.t option; + doms: (uns, Uns.cmper_witness) Ordset.t; + } + + let index {index; _} = + index + + let hash_fold t state = + state |> Uns.hash_fold (index t) + + let cmp t0 t1 = + Uns.cmp (index t0) (index t1) + + let pp {index; name; assoc; doms} formatter = + formatter + |> Fmt.fmt "{index=" |> Uns.pp index + |> Fmt.fmt "; name=" |> String.pp name + |> Fmt.fmt "; assoc=" |> Option.pp Assoc.pp assoc + |> Fmt.fmt "; doms=" |> Ordset.pp doms + |> Fmt.fmt "}" + end + include T + include Identifiable.Make(T) + + let init ~index ~name ~assoc ~doms = + {index; name; assoc; doms} + end + + let precs = [| + + |] + + module Prod = struct + module T = struct + type t = { + index: uns; + lhs_index: uns; + rhs_indexes: uns array; + prec: Prec.t option; + callback: uns; + } + + let hash_fold {index; _} state = + Uns.hash_fold index state + + let cmp {index=i0; _} {index=i1; _} = + Uns.cmp i0 i1 + + let pp {index; lhs_index; rhs_indexes; prec; callback} formatter = + formatter + |> Fmt.fmt "{index=" |> Uns.pp index + |> Fmt.fmt "; lhs_index=" |> Uns.pp lhs_index + |> Fmt.fmt "; rhs_indexes=" |> Array.pp Uns.pp rhs_indexes + |> Fmt.fmt "; prec=" |> Option.pp Prec.pp prec + |> Fmt.fmt "; callback=" |> Uns.pp callback + |> Fmt.fmt "}" + end + include T + include Identifiable.Make(T) + + let init ~index ~lhs_index ~rhs_indexes ~prec ~callback = + {index; lhs_index; rhs_indexes; prec; callback} + end + + let prods = [| + Prod.init ~index:0L ~lhs_index:39L ~rhs_indexes:[|11L|] + ~prec:None ~callback:0L; + Prod.init ~index:1L ~lhs_index:40L ~rhs_indexes:[|12L|] + ~prec:None ~callback:1L; + Prod.init ~index:2L ~lhs_index:41L ~rhs_indexes:[|39L|] + ~prec:None ~callback:2L; + Prod.init ~index:3L ~lhs_index:41L ~rhs_indexes:[|40L|] + ~prec:None ~callback:3L; + Prod.init ~index:4L ~lhs_index:41L ~rhs_indexes:[|13L|] + ~prec:None ~callback:4L; + Prod.init ~index:5L ~lhs_index:42L ~rhs_indexes:[|22L; 39L; 42L|] + ~prec:None ~callback:5L; + Prod.init ~index:6L ~lhs_index:42L ~rhs_indexes:[||] + ~prec:None ~callback:6L; + Prod.init ~index:7L ~lhs_index:43L ~rhs_indexes:[|39L; 42L|] + ~prec:None ~callback:7L; + Prod.init ~index:8L ~lhs_index:44L ~rhs_indexes:[|21L; 43L|] + ~prec:None ~callback:8L; + Prod.init ~index:9L ~lhs_index:44L ~rhs_indexes:[||] + ~prec:None ~callback:9L; + Prod.init ~index:10L ~lhs_index:45L ~rhs_indexes:[|7L|] + ~prec:None ~callback:10L; + Prod.init ~index:11L ~lhs_index:45L ~rhs_indexes:[|8L|] + ~prec:None ~callback:11L; + Prod.init ~index:12L ~lhs_index:45L ~rhs_indexes:[|9L|] + ~prec:None ~callback:12L; + Prod.init ~index:13L ~lhs_index:46L ~rhs_indexes:[|45L; 39L; 44L|] + ~prec:None ~callback:13L; + Prod.init ~index:14L ~lhs_index:47L ~rhs_indexes:[|16L; 40L; 18L; 39L|] + ~prec:None ~callback:14L; + Prod.init ~index:15L ~lhs_index:48L ~rhs_indexes:[|47L|] + ~prec:None ~callback:15L; + Prod.init ~index:16L ~lhs_index:48L ~rhs_indexes:[||] + ~prec:None ~callback:16L; + Prod.init ~index:17L ~lhs_index:49L ~rhs_indexes:[|10L; 39L|] + ~prec:None ~callback:17L; + Prod.init ~index:18L ~lhs_index:49L ~rhs_indexes:[||] + ~prec:None ~callback:18L; + Prod.init ~index:19L ~lhs_index:50L ~rhs_indexes:[|14L|] + ~prec:None ~callback:19L; + Prod.init ~index:20L ~lhs_index:50L ~rhs_indexes:[||] + ~prec:None ~callback:20L; + Prod.init ~index:21L ~lhs_index:51L ~rhs_indexes:[|6L; 40L; 50L; 48L; 49L|] + ~prec:None ~callback:21L; + Prod.init ~index:22L ~lhs_index:52L ~rhs_indexes:[|24L|] + ~prec:None ~callback:22L; + Prod.init ~index:23L ~lhs_index:52L ~rhs_indexes:[|23L|] + ~prec:None ~callback:23L; + Prod.init ~index:24L ~lhs_index:52L ~rhs_indexes:[|20L|] + ~prec:None ~callback:24L; + Prod.init ~index:25L ~lhs_index:53L ~rhs_indexes:[|52L; 59L; 53L|] + ~prec:None ~callback:25L; + Prod.init ~index:26L ~lhs_index:53L ~rhs_indexes:[||] + ~prec:None ~callback:26L; + Prod.init ~index:27L ~lhs_index:54L ~rhs_indexes:[|59L; 53L|] + ~prec:None ~callback:27L; + Prod.init ~index:28L ~lhs_index:55L ~rhs_indexes:[|54L|] + ~prec:None ~callback:28L; + Prod.init ~index:29L ~lhs_index:55L ~rhs_indexes:[||] + ~prec:None ~callback:29L; + Prod.init ~index:30L ~lhs_index:56L ~rhs_indexes:[|25L; 54L; 26L|] + ~prec:None ~callback:30L; + Prod.init ~index:31L ~lhs_index:56L ~rhs_indexes:[|27L; 55L; 28L|] + ~prec:None ~callback:31L; + Prod.init ~index:32L ~lhs_index:56L ~rhs_indexes:[|29L; 55L; 30L|] + ~prec:None ~callback:32L; + Prod.init ~index:33L ~lhs_index:56L ~rhs_indexes:[|31L; 55L; 32L|] + ~prec:None ~callback:33L; + Prod.init ~index:34L ~lhs_index:56L ~rhs_indexes:[|33L; 55L; 34L|] + ~prec:None ~callback:34L; + Prod.init ~index:35L ~lhs_index:56L ~rhs_indexes:[|35L; 55L; 36L|] + ~prec:None ~callback:35L; + Prod.init ~index:36L ~lhs_index:57L ~rhs_indexes:[|37L|] + ~prec:None ~callback:36L; + Prod.init ~index:37L ~lhs_index:57L ~rhs_indexes:[|11L|] + ~prec:None ~callback:37L; + Prod.init ~index:38L ~lhs_index:57L ~rhs_indexes:[|12L|] + ~prec:None ~callback:38L; + Prod.init ~index:39L ~lhs_index:57L ~rhs_indexes:[|13L|] + ~prec:None ~callback:39L; + Prod.init ~index:40L ~lhs_index:57L ~rhs_indexes:[|14L|] + ~prec:None ~callback:40L; + Prod.init ~index:41L ~lhs_index:57L ~rhs_indexes:[|16L|] + ~prec:None ~callback:41L; + Prod.init ~index:42L ~lhs_index:57L ~rhs_indexes:[|17L|] + ~prec:None ~callback:42L; + Prod.init ~index:43L ~lhs_index:57L ~rhs_indexes:[|18L|] + ~prec:None ~callback:43L; + Prod.init ~index:44L ~lhs_index:57L ~rhs_indexes:[|19L|] + ~prec:None ~callback:44L; + Prod.init ~index:45L ~lhs_index:57L ~rhs_indexes:[|21L|] + ~prec:None ~callback:45L; + Prod.init ~index:46L ~lhs_index:57L ~rhs_indexes:[|22L|] + ~prec:None ~callback:46L; + Prod.init ~index:47L ~lhs_index:58L ~rhs_indexes:[|56L; 58L|] + ~prec:None ~callback:47L; + Prod.init ~index:48L ~lhs_index:58L ~rhs_indexes:[|57L; 58L|] + ~prec:None ~callback:48L; + Prod.init ~index:49L ~lhs_index:58L ~rhs_indexes:[||] + ~prec:None ~callback:49L; + Prod.init ~index:50L ~lhs_index:59L ~rhs_indexes:[|56L; 58L|] + ~prec:None ~callback:50L; + Prod.init ~index:51L ~lhs_index:59L ~rhs_indexes:[|57L; 58L|] + ~prec:None ~callback:51L; + Prod.init ~index:52L ~lhs_index:60L ~rhs_indexes:[|40L|] + ~prec:None ~callback:52L; + Prod.init ~index:53L ~lhs_index:60L ~rhs_indexes:[|14L|] + ~prec:None ~callback:53L; + Prod.init ~index:54L ~lhs_index:61L ~rhs_indexes:[|41L; 17L; 60L|] + ~prec:None ~callback:54L; + Prod.init ~index:55L ~lhs_index:61L ~rhs_indexes:[|60L|] + ~prec:None ~callback:55L; + Prod.init ~index:56L ~lhs_index:62L ~rhs_indexes:[|61L; 62L|] + ~prec:None ~callback:56L; + Prod.init ~index:57L ~lhs_index:62L ~rhs_indexes:[||] + ~prec:None ~callback:57L; + Prod.init ~index:58L ~lhs_index:63L ~rhs_indexes:[|61L; 62L|] + ~prec:None ~callback:58L; + Prod.init ~index:59L ~lhs_index:64L ~rhs_indexes:[|63L|] + ~prec:None ~callback:59L; + Prod.init ~index:60L ~lhs_index:64L ~rhs_indexes:[|4L|] + ~prec:None ~callback:60L; + Prod.init ~index:61L ~lhs_index:65L ~rhs_indexes:[|64L; 49L|] + ~prec:None ~callback:61L; + Prod.init ~index:62L ~lhs_index:66L ~rhs_indexes:[|20L; 65L; 66L|] + ~prec:None ~callback:62L; + Prod.init ~index:63L ~lhs_index:66L ~rhs_indexes:[||] + ~prec:None ~callback:63L; + Prod.init ~index:64L ~lhs_index:67L ~rhs_indexes:[|20L; 65L; 66L|] + ~prec:None ~callback:64L; + Prod.init ~index:65L ~lhs_index:67L ~rhs_indexes:[|65L; 66L|] + ~prec:None ~callback:65L; + Prod.init ~index:66L ~lhs_index:68L ~rhs_indexes:[|67L; 19L; 59L|] + ~prec:None ~callback:66L; + Prod.init ~index:67L ~lhs_index:69L ~rhs_indexes:[|20L; 68L; 69L|] + ~prec:None ~callback:67L; + Prod.init ~index:68L ~lhs_index:69L ~rhs_indexes:[||] + ~prec:None ~callback:68L; + Prod.init ~index:69L ~lhs_index:70L ~rhs_indexes:[|68L; 69L|] + ~prec:None ~callback:69L; + Prod.init ~index:70L ~lhs_index:71L ~rhs_indexes:[|3L|] + ~prec:None ~callback:70L; + Prod.init ~index:71L ~lhs_index:71L ~rhs_indexes:[|5L|] + ~prec:None ~callback:71L; + Prod.init ~index:72L ~lhs_index:72L ~rhs_indexes:[|71L; 40L; 49L; 15L; 67L|] + ~prec:None ~callback:72L; + Prod.init ~index:73L ~lhs_index:72L ~rhs_indexes:[|71L; 40L; 47L; 49L; 15L; 70L|] + ~prec:None ~callback:73L; + Prod.init ~index:74L ~lhs_index:73L ~rhs_indexes:[|46L|] + ~prec:None ~callback:74L; + Prod.init ~index:75L ~lhs_index:73L ~rhs_indexes:[|51L|] + ~prec:None ~callback:75L; + Prod.init ~index:76L ~lhs_index:73L ~rhs_indexes:[|72L|] + ~prec:None ~callback:76L; + Prod.init ~index:77L ~lhs_index:73L ~rhs_indexes:[|59L|] + ~prec:None ~callback:77L; + Prod.init ~index:78L ~lhs_index:74L ~rhs_indexes:[|24L; 73L; 74L|] + ~prec:None ~callback:78L; + Prod.init ~index:79L ~lhs_index:74L ~rhs_indexes:[||] + ~prec:None ~callback:79L; + Prod.init ~index:80L ~lhs_index:75L ~rhs_indexes:[|73L; 74L|] + ~prec:None ~callback:80L; + Prod.init ~index:81L ~lhs_index:76L ~rhs_indexes:[|2L; 25L; 75L; 26L|] + ~prec:None ~callback:81L; + Prod.init ~index:82L ~lhs_index:77L ~rhs_indexes:[|57L|] + ~prec:None ~callback:82L; + Prod.init ~index:83L ~lhs_index:77L ~rhs_indexes:[|52L|] + ~prec:None ~callback:83L; + Prod.init ~index:84L ~lhs_index:77L ~rhs_indexes:[|25L|] + ~prec:None ~callback:84L; + Prod.init ~index:85L ~lhs_index:77L ~rhs_indexes:[|26L|] + ~prec:None ~callback:85L; + Prod.init ~index:86L ~lhs_index:77L ~rhs_indexes:[|27L|] + ~prec:None ~callback:86L; + Prod.init ~index:87L ~lhs_index:77L ~rhs_indexes:[|28L|] + ~prec:None ~callback:87L; + Prod.init ~index:88L ~lhs_index:77L ~rhs_indexes:[|29L|] + ~prec:None ~callback:88L; + Prod.init ~index:89L ~lhs_index:77L ~rhs_indexes:[|30L|] + ~prec:None ~callback:89L; + Prod.init ~index:90L ~lhs_index:77L ~rhs_indexes:[|31L|] + ~prec:None ~callback:90L; + Prod.init ~index:91L ~lhs_index:77L ~rhs_indexes:[|32L|] + ~prec:None ~callback:91L; + Prod.init ~index:92L ~lhs_index:77L ~rhs_indexes:[|33L|] + ~prec:None ~callback:92L; + Prod.init ~index:93L ~lhs_index:77L ~rhs_indexes:[|34L|] + ~prec:None ~callback:93L; + Prod.init ~index:94L ~lhs_index:77L ~rhs_indexes:[|35L|] + ~prec:None ~callback:94L; + Prod.init ~index:95L ~lhs_index:77L ~rhs_indexes:[|36L|] + ~prec:None ~callback:95L; + Prod.init ~index:96L ~lhs_index:78L ~rhs_indexes:[|77L; 78L|] + ~prec:None ~callback:96L; + Prod.init ~index:97L ~lhs_index:78L ~rhs_indexes:[||] + ~prec:None ~callback:97L; + Prod.init ~index:98L ~lhs_index:79L ~rhs_indexes:[|78L; 76L; 78L; 38L|] + ~prec:None ~callback:98L; + Prod.init ~index:99L ~lhs_index:80L ~rhs_indexes:[|79L; 1L|] + ~prec:None ~callback:99L; + Prod.init ~index:100L ~lhs_index:81L ~rhs_indexes:[|78L; 2L; 78L; 38L|] + ~prec:None ~callback:100L; + Prod.init ~index:101L ~lhs_index:82L ~rhs_indexes:[|81L; 1L|] + ~prec:None ~callback:101L + |] + + module Symbol = struct + module T = struct + type t = { + index: uns; + name: string; + prec: Prec.t option; + alias: string option; + start: bool; + prods: (Prod.t, Prod.cmper_witness) Ordset.t; + first: (uns, Uns.cmper_witness) Ordset.t; + follow: (uns, Uns.cmper_witness) Ordset.t; + } + + let hash_fold {index; _} state = + Uns.hash_fold index state + + let cmp {index=i0; _} {index=i1; _} = + Uns.cmp i0 i1 + + let pp {index; name; prec; alias; start; prods; first; follow} formatter = + formatter + |> Fmt.fmt "{index=" |> Uns.pp index + |> Fmt.fmt "; name=" |> String.pp name + |> Fmt.fmt "; prec=" |> Option.pp Prec.pp prec + |> Fmt.fmt "; alias=" |> Option.pp String.pp alias + |> Fmt.fmt "; start=" |> Bool.pp start + |> Fmt.fmt "; prods=" |> Ordset.pp prods + |> Fmt.fmt "; first=" |> Ordset.pp first + |> Fmt.fmt "; follow=" |> Ordset.pp follow + |> Fmt.fmt "}" + end + include T + include Identifiable.Make(T) + + let init ~index ~name ~prec ~alias ~start ~prods ~first ~follow = + {index; name; prec; alias; start; prods; first; follow} + end + + let symbols = [| + Symbol.init ~index:0L ~name:"EPSILON" + ~prec:None ~alias:(Some "ε") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 0L) + ~follow:(Ordset.empty (module Uns)); + Symbol.init ~index:1L ~name:"PSEUDO_END" + ~prec:None ~alias:(Some "⊥") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 1L) + ~follow:(Ordset.singleton (module Uns) 0L); + Symbol.init ~index:2L ~name:"HOCC" + ~prec:None ~alias:(Some "hocc") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 2L) + ~follow:(Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:3L ~name:"NONTERM" + ~prec:None ~alias:(Some "nonterm") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 3L) + ~follow:(Ordset.singleton (module Uns) 12L); + Symbol.init ~index:4L ~name:"EPSILON_" + ~prec:None ~alias:(Some "epsilon") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 4L) + ~follow:(Ordset.of_list (module Uns) [10L; 19L; 20L; 24L; 26L]); + Symbol.init ~index:5L ~name:"START" + ~prec:None ~alias:(Some "start") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 5L) + ~follow:(Ordset.singleton (module Uns) 12L); + Symbol.init ~index:6L ~name:"TOKEN" + ~prec:None ~alias:(Some "token") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 6L) + ~follow:(Ordset.singleton (module Uns) 12L); + Symbol.init ~index:7L ~name:"NEUTRAL" + ~prec:None ~alias:(Some "neutral") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 7L) + ~follow:(Ordset.singleton (module Uns) 11L); + Symbol.init ~index:8L ~name:"LEFT" + ~prec:None ~alias:(Some "left") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 8L) + ~follow:(Ordset.singleton (module Uns) 11L); + Symbol.init ~index:9L ~name:"RIGHT" + ~prec:None ~alias:(Some "right") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 9L) + ~follow:(Ordset.singleton (module Uns) 11L); + Symbol.init ~index:10L ~name:"PREC" + ~prec:None ~alias:(Some "prec") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 10L) + ~follow:(Ordset.singleton (module Uns) 11L); + Symbol.init ~index:11L ~name:"UIDENT" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 11L) + ~follow:(Ordset.of_list (module Uns) [2L; 10L; 11L; 12L; 13L; 14L; 15L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:12L ~name:"CIDENT" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 12L) + ~follow:(Ordset.of_list (module Uns) [2L; 10L; 11L; 12L; 13L; 14L; 15L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:13L ~name:"USCORE" + ~prec:None ~alias:(Some "_") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 13L) + ~follow:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:14L ~name:"ISTRING" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 14L) + ~follow:(Ordset.of_list (module Uns) [2L; 10L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:15L ~name:"COLON_COLON_EQ" + ~prec:None ~alias:(Some "::=") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 15L) + ~follow:(Ordset.of_list (module Uns) [4L; 11L; 12L; 13L; 14L; 20L]); + Symbol.init ~index:16L ~name:"OF" + ~prec:None ~alias:(Some "of") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 16L) + ~follow:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:17L ~name:"COLON" + ~prec:None ~alias:(Some ":") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 17L) + ~follow:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:18L ~name:"DOT" + ~prec:None ~alias:(Some ".") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 18L) + ~follow:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:19L ~name:"ARROW" + ~prec:None ~alias:(Some "->") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 19L) + ~follow:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:20L ~name:"BAR" + ~prec:None ~alias:(Some "|") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 20L) + ~follow:(Ordset.of_list (module Uns) [2L; 4L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:21L ~name:"LT" + ~prec:None ~alias:(Some "<") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 21L) + ~follow:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:22L ~name:"COMMA" + ~prec:None ~alias:(Some ",") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 22L) + ~follow:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:23L ~name:"SEMI" + ~prec:None ~alias:(Some ";") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 23L) + ~follow:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:24L ~name:"LINE_DELIM" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 24L) + ~follow:(Ordset.of_list (module Uns) [2L; 3L; 5L; 6L; 7L; 8L; 9L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:25L ~name:"INDENT" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 25L) + ~follow:(Ordset.of_list (module Uns) [2L; 3L; 5L; 6L; 7L; 8L; 9L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:26L ~name:"DEDENT" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 26L) + ~follow:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:27L ~name:"LPAREN" + ~prec:None ~alias:(Some "(") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 27L) + ~follow:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:28L ~name:"RPAREN" + ~prec:None ~alias:(Some ")") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 28L) + ~follow:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:29L ~name:"LCAPTURE" + ~prec:None ~alias:(Some "(|") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 29L) + ~follow:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:30L ~name:"RCAPTURE" + ~prec:None ~alias:(Some "|)") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 30L) + ~follow:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:31L ~name:"LBRACK" + ~prec:None ~alias:(Some "[") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 31L) + ~follow:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:32L ~name:"RBRACK" + ~prec:None ~alias:(Some "]") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 32L) + ~follow:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:33L ~name:"LARRAY" + ~prec:None ~alias:(Some "[|") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 33L) + ~follow:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:34L ~name:"RARRAY" + ~prec:None ~alias:(Some "|]") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 34L) + ~follow:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:35L ~name:"LCURLY" + ~prec:None ~alias:(Some "{") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 35L) + ~follow:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:36L ~name:"RCURLY" + ~prec:None ~alias:(Some "}") ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 36L) + ~follow:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:37L ~name:"OTHER_TOKEN" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 37L) + ~follow:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:38L ~name:"EOI" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.empty (module Prod)) ~first:(Ordset.singleton (module Uns) 38L) + ~follow:(Ordset.singleton (module Uns) 1L); + Symbol.init ~index:39L ~name:"Uident" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.singleton (module Prod) (Array.get 0L prods)) ~first:(Ordset.singleton (module Uns) 11L) + ~follow:(Ordset.of_list (module Uns) [10L; 15L; 17L; 19L; 20L; 21L; 22L; 24L; 26L]); + Symbol.init ~index:40L ~name:"Cident" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.singleton (module Prod) (Array.get 1L prods)) ~first:(Ordset.singleton (module Uns) 12L) + ~follow:(Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 15L; 16L; 17L; 18L; 19L; 20L; 24L; 26L]); + Symbol.init ~index:41L ~name:"Ident" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 2L prods; + Array.get 3L prods; + Array.get 4L prods; + ]) ~first:(Ordset.of_list (module Uns) [11L; 12L; 13L]) + ~follow:(Ordset.singleton (module Uns) 17L); + Symbol.init ~index:42L ~name:"PrecsTl" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 5L prods; + Array.get 6L prods; + ]) ~first:(Ordset.of_list (module Uns) [0L; 22L]) + ~follow:(Ordset.of_list (module Uns) [24L; 26L]); + Symbol.init ~index:43L ~name:"Precs" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.singleton (module Prod) (Array.get 7L prods)) ~first:(Ordset.singleton (module Uns) 11L) + ~follow:(Ordset.of_list (module Uns) [24L; 26L]); + Symbol.init ~index:44L ~name:"PrecRels" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 8L prods; + Array.get 9L prods; + ]) ~first:(Ordset.of_list (module Uns) [0L; 21L]) + ~follow:(Ordset.of_list (module Uns) [24L; 26L]); + Symbol.init ~index:45L ~name:"PrecType" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 10L prods; + Array.get 11L prods; + Array.get 12L prods; + ]) ~first:(Ordset.of_list (module Uns) [7L; 8L; 9L]) + ~follow:(Ordset.singleton (module Uns) 11L); + Symbol.init ~index:46L ~name:"Prec" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.singleton (module Prod) (Array.get 13L prods)) ~first:(Ordset.of_list (module Uns) [7L; 8L; 9L]) + ~follow:(Ordset.of_list (module Uns) [24L; 26L]); + Symbol.init ~index:47L ~name:"OfType" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.singleton (module Prod) (Array.get 14L prods)) ~first:(Ordset.singleton (module Uns) 16L) + ~follow:(Ordset.of_list (module Uns) [10L; 15L; 24L; 26L]); + Symbol.init ~index:48L ~name:"OfType0" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 15L prods; + Array.get 16L prods; + ]) ~first:(Ordset.of_list (module Uns) [0L; 16L]) + ~follow:(Ordset.of_list (module Uns) [10L; 24L; 26L]); + Symbol.init ~index:49L ~name:"PrecRef" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 17L prods; + Array.get 18L prods; + ]) ~first:(Ordset.of_list (module Uns) [0L; 10L]) + ~follow:(Ordset.of_list (module Uns) [15L; 19L; 20L; 24L; 26L]); + Symbol.init ~index:50L ~name:"TokenAlias" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 19L prods; + Array.get 20L prods; + ]) ~first:(Ordset.of_list (module Uns) [0L; 14L]) + ~follow:(Ordset.of_list (module Uns) [10L; 16L; 24L; 26L]); + Symbol.init ~index:51L ~name:"Token" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.singleton (module Prod) (Array.get 21L prods)) ~first:(Ordset.singleton (module Uns) 6L) + ~follow:(Ordset.of_list (module Uns) [24L; 26L]); + Symbol.init ~index:52L ~name:"Sep" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 22L prods; + Array.get 23L prods; + Array.get 24L prods; + ]) ~first:(Ordset.of_list (module Uns) [20L; 23L; 24L]) + ~follow:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:53L ~name:"CodesTl" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 25L prods; + Array.get 26L prods; + ]) ~first:(Ordset.of_list (module Uns) [0L; 20L; 23L; 24L]) + ~follow:(Ordset.of_list (module Uns) [26L; 28L; 30L; 32L; 34L; 36L]); + Symbol.init ~index:54L ~name:"Codes" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.singleton (module Prod) (Array.get 27L prods)) ~first:(Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 25L; 27L; 29L; 31L; 33L; 35L; 37L]) + ~follow:(Ordset.of_list (module Uns) [26L; 28L; 30L; 32L; 34L; 36L]); + Symbol.init ~index:55L ~name:"Codes0" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 28L prods; + Array.get 29L prods; + ]) ~first:(Ordset.of_list (module Uns) [0L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 25L; 27L; 29L; 31L; 33L; 35L; 37L]) + ~follow:(Ordset.of_list (module Uns) [28L; 30L; 32L; 34L; 36L]); + Symbol.init ~index:56L ~name:"Delimited" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 30L prods; + Array.get 31L prods; + Array.get 32L prods; + Array.get 33L prods; + Array.get 34L prods; + Array.get 35L prods; + ]) ~first:(Ordset.of_list (module Uns) [25L; 27L; 29L; 31L; 33L; 35L]) + ~follow:(Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L]); + Symbol.init ~index:57L ~name:"CodeToken" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 36L prods; + Array.get 37L prods; + Array.get 38L prods; + Array.get 39L prods; + Array.get 40L prods; + Array.get 41L prods; + Array.get 42L prods; + Array.get 43L prods; + Array.get 44L prods; + Array.get 45L prods; + Array.get 46L prods; + ]) ~first:(Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 37L]) + ~follow:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:58L ~name:"CodeTl" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 47L prods; + Array.get 48L prods; + Array.get 49L prods; + ]) ~first:(Ordset.of_list (module Uns) [0L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 25L; 27L; 29L; 31L; 33L; 35L; 37L]) + ~follow:(Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L]); + Symbol.init ~index:59L ~name:"Code" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 50L prods; + Array.get 51L prods; + ]) ~first:(Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 25L; 27L; 29L; 31L; 33L; 35L; 37L]) + ~follow:(Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L]); + Symbol.init ~index:60L ~name:"ProdParamSymbol" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 52L prods; + Array.get 53L prods; + ]) ~first:(Ordset.of_list (module Uns) [12L; 14L]) + ~follow:(Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L]); + Symbol.init ~index:61L ~name:"ProdParam" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 54L prods; + Array.get 55L prods; + ]) ~first:(Ordset.of_list (module Uns) [11L; 12L; 13L; 14L]) + ~follow:(Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L]); + Symbol.init ~index:62L ~name:"ProdParamsTl" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 56L prods; + Array.get 57L prods; + ]) ~first:(Ordset.of_list (module Uns) [0L; 11L; 12L; 13L; 14L]) + ~follow:(Ordset.of_list (module Uns) [10L; 19L; 20L; 24L; 26L]); + Symbol.init ~index:63L ~name:"ProdParams" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.singleton (module Prod) (Array.get 58L prods)) ~first:(Ordset.of_list (module Uns) [11L; 12L; 13L; 14L]) + ~follow:(Ordset.of_list (module Uns) [10L; 19L; 20L; 24L; 26L]); + Symbol.init ~index:64L ~name:"ProdPattern" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 59L prods; + Array.get 60L prods; + ]) ~first:(Ordset.of_list (module Uns) [4L; 11L; 12L; 13L; 14L]) + ~follow:(Ordset.of_list (module Uns) [10L; 19L; 20L; 24L; 26L]); + Symbol.init ~index:65L ~name:"Prod" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.singleton (module Prod) (Array.get 61L prods)) ~first:(Ordset.of_list (module Uns) [4L; 11L; 12L; 13L; 14L]) + ~follow:(Ordset.of_list (module Uns) [19L; 20L; 24L; 26L]); + Symbol.init ~index:66L ~name:"ProdsTl" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 62L prods; + Array.get 63L prods; + ]) ~first:(Ordset.of_list (module Uns) [0L; 20L]) + ~follow:(Ordset.of_list (module Uns) [19L; 24L; 26L]); + Symbol.init ~index:67L ~name:"Prods" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 64L prods; + Array.get 65L prods; + ]) ~first:(Ordset.of_list (module Uns) [4L; 11L; 12L; 13L; 14L; 20L]) + ~follow:(Ordset.of_list (module Uns) [19L; 24L; 26L]); + Symbol.init ~index:68L ~name:"Reduction" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.singleton (module Prod) (Array.get 66L prods)) ~first:(Ordset.of_list (module Uns) [4L; 11L; 12L; 13L; 14L; 20L]) + ~follow:(Ordset.of_list (module Uns) [20L; 24L; 26L]); + Symbol.init ~index:69L ~name:"ReductionsTl" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 67L prods; + Array.get 68L prods; + ]) ~first:(Ordset.of_list (module Uns) [0L; 20L]) + ~follow:(Ordset.of_list (module Uns) [24L; 26L]); + Symbol.init ~index:70L ~name:"Reductions" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.singleton (module Prod) (Array.get 69L prods)) ~first:(Ordset.of_list (module Uns) [4L; 11L; 12L; 13L; 14L; 20L]) + ~follow:(Ordset.of_list (module Uns) [24L; 26L]); + Symbol.init ~index:71L ~name:"NontermType" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 70L prods; + Array.get 71L prods; + ]) ~first:(Ordset.of_list (module Uns) [3L; 5L]) + ~follow:(Ordset.singleton (module Uns) 12L); + Symbol.init ~index:72L ~name:"Nonterm" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 72L prods; + Array.get 73L prods; + ]) ~first:(Ordset.of_list (module Uns) [3L; 5L]) + ~follow:(Ordset.of_list (module Uns) [24L; 26L]); + Symbol.init ~index:73L ~name:"Stmt" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 74L prods; + Array.get 75L prods; + Array.get 76L prods; + Array.get 77L prods; + ]) ~first:(Ordset.of_list (module Uns) [3L; 5L; 6L; 7L; 8L; 9L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 25L; 27L; 29L; 31L; 33L; 35L; 37L]) + ~follow:(Ordset.of_list (module Uns) [24L; 26L]); + Symbol.init ~index:74L ~name:"StmtsTl" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 78L prods; + Array.get 79L prods; + ]) ~first:(Ordset.of_list (module Uns) [0L; 24L]) + ~follow:(Ordset.singleton (module Uns) 26L); + Symbol.init ~index:75L ~name:"Stmts" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.singleton (module Prod) (Array.get 80L prods)) ~first:(Ordset.of_list (module Uns) [3L; 5L; 6L; 7L; 8L; 9L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 25L; 27L; 29L; 31L; 33L; 35L; 37L]) + ~follow:(Ordset.singleton (module Uns) 26L); + Symbol.init ~index:76L ~name:"Hocc" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.singleton (module Prod) (Array.get 81L prods)) ~first:(Ordset.singleton (module Uns) 2L) + ~follow:(Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:77L ~name:"MatterToken" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 82L prods; + Array.get 83L prods; + Array.get 84L prods; + Array.get 85L prods; + Array.get 86L prods; + Array.get 87L prods; + Array.get 88L prods; + Array.get 89L prods; + Array.get 90L prods; + Array.get 91L prods; + Array.get 92L prods; + Array.get 93L prods; + Array.get 94L prods; + Array.get 95L prods; + ]) ~first:(Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L]) + ~follow:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L]); + Symbol.init ~index:78L ~name:"Matter" + ~prec:None ~alias:None ~start:false + ~prods:(Ordset.of_list (module Prod) [ + Array.get 96L prods; + Array.get 97L prods; + ]) ~first:(Ordset.of_list (module Uns) [0L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L]) + ~follow:(Ordset.of_list (module Uns) [2L; 38L]); + Symbol.init ~index:79L ~name:"Hmh" + ~prec:None ~alias:None ~start:true + ~prods:(Ordset.singleton (module Prod) (Array.get 98L prods)) ~first:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L]) + ~follow:(Ordset.singleton (module Uns) 1L); + Symbol.init ~index:80L ~name:"Hmh'" + ~prec:None ~alias:None ~start:true + ~prods:(Ordset.singleton (module Prod) (Array.get 99L prods)) ~first:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L]) + ~follow:(Ordset.singleton (module Uns) 0L); + Symbol.init ~index:81L ~name:"Hmhi" + ~prec:None ~alias:None ~start:true + ~prods:(Ordset.singleton (module Prod) (Array.get 100L prods)) ~first:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L]) + ~follow:(Ordset.singleton (module Uns) 1L); + Symbol.init ~index:82L ~name:"Hmhi'" + ~prec:None ~alias:None ~start:true + ~prods:(Ordset.singleton (module Prod) (Array.get 101L prods)) ~first:(Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L]) + ~follow:(Ordset.singleton (module Uns) 0L) + |] + + module Lr0Item = struct + module T = struct + type t = { + prod: Prod.t; + dot: uns; + } + + let hash_fold {prod; dot} state = + state + |> Prod.hash_fold prod + |> Uns.hash_fold dot + + let cmp {prod=p0; dot=d0} {prod=p1; dot=d1} = + let open Cmp in + match Prod.cmp p0 p1 with + | Lt -> Lt + | Eq -> Uns.cmp d0 d1 + | Gt -> Gt + + let pp {prod; dot} formatter = + formatter + |> Fmt.fmt "{prod=" |> Prod.pp prod + |> Fmt.fmt "; dot=" |> Uns.pp dot + |> Fmt.fmt "}" + end + include T + include Identifiable.Make(T) + + let init ~prod ~dot = + {prod; dot} + end + + module Lr1Item = struct + module T = struct + type t = { + lr0item: Lr0Item.t; + follow: (uns, Uns.cmper_witness) Ordset.t; + } + + let hash_fold {lr0item; follow} state = + state + |> Lr0Item.hash_fold lr0item + |> Ordset.hash_fold follow + + let cmp {lr0item=l0; follow=f0} {lr0item=l1; follow=f1} = + let open Cmp in + match Lr0Item.cmp l0 l1 with + | Lt -> Lt + | Eq -> Ordset.cmp f0 f1 + | Gt -> Gt + + let pp {lr0item; follow} formatter = + formatter + |> Fmt.fmt "{lr0item=" |> Lr0Item.pp lr0item + |> Fmt.fmt "; follow=" |> Ordset.pp follow + |> Fmt.fmt "}" + end + include T + include Identifiable.Make(T) + + let init ~lr0item ~follow = + {lr0item; follow} + end + + module Lr1Itemset = struct + module T = struct + type t = (Lr0Item.t, Lr1Item.t, Lr0Item.cmper_witness) Ordmap.t + + let hash_fold t = + Ordmap.hash_fold Lr1Item.hash_fold t + + let cmp t0 t1 = + Ordmap.cmp Lr1Item.cmp t0 t1 + + let pp = Ordmap.pp Lr1Item.pp + end + include T + include Identifiable.Make(T) + + let empty = Ordmap.empty (module Lr0Item) + + let init = Ordmap.of_alist (module Lr0Item) + end + + module Lr1ItemsetClosure = struct + module T = struct + type t = { + index: uns; + kernel: Lr1Itemset.t; + added: Lr1Itemset.t; + } + + let hash_fold {index; _} state = + state |> Uns.hash_fold index + + let cmp {index=i0; _} {index=i1; _} = + Uns.cmp i0 i1 + + let pp {index; kernel; added} formatter = + formatter + |> Fmt.fmt "{index=" |> Uns.pp index + |> Fmt.fmt "; kernel=" |> Lr1Itemset.pp kernel + |> Fmt.fmt "; added=" |> Lr1Itemset.pp added + |> Fmt.fmt "}" + end + include T + include Identifiable.Make(T) + + let init ~index ~kernel ~added = + {index; kernel; added} + end + + module Action = struct + module T = struct + type t = + | ShiftPrefix of uns + | ShiftAccept of uns + | Reduce of uns + + let constructor_index = function + | ShiftPrefix _ -> 0L + | ShiftAccept _ -> 1L + | Reduce _ -> 2L + + let arg_index = function + | ShiftPrefix arg_index + | ShiftAccept arg_index + | Reduce arg_index -> arg_index + + let hash_fold t state = + state + |> Uns.hash_fold (constructor_index t) + |> Uns.hash_fold (arg_index t) + + let cmp t0 t1 = + let open Cmp in + match Uns.cmp (constructor_index t0) (constructor_index t1) with + | Lt -> Lt + | Eq -> Uns.cmp (arg_index t0) (arg_index t1) + | Gt -> Gt + + let to_string = function + | ShiftPrefix state_index -> begin + String.Fmt.empty + |> Fmt.fmt "ShiftPrefix " |> Uns.pp state_index + |> Fmt.to_string + end + | ShiftAccept state_index -> begin + String.Fmt.empty + |> Fmt.fmt "ShiftAccept " |> Uns.pp state_index + |> Fmt.to_string + end + | Reduce prod_index -> begin + String.Fmt.empty + |> Fmt.fmt "Reduce " |> Uns.pp prod_index + |> Fmt.to_string + end + + let pp t formatter = + formatter |> Fmt.fmt (to_string t) + end + include T + include Identifiable.Make(T) + end + + module State = struct + module T = struct + type t = { + lr1ItemsetClosure: Lr1ItemsetClosure.t; + actions: (uns, Action.t, Uns.cmper_witness) Map.t; + gotos: (uns, uns, Uns.cmper_witness) Map.t; + } + + let hash_fold {lr1ItemsetClosure; _} state = + state |> Lr1ItemsetClosure.hash_fold lr1ItemsetClosure + + let cmp {lr1ItemsetClosure=c0; _} {lr1ItemsetClosure=c1; _} = + Lr1ItemsetClosure.cmp c0 c1 + + let pp {lr1ItemsetClosure; actions; gotos} formatter = + formatter + |> Fmt.fmt "{lr1ItemsetClosure=" |> Lr1ItemsetClosure.pp lr1ItemsetClosure + |> Fmt.fmt "; actions=" |> Map.pp Action.pp actions + |> Fmt.fmt "; gotos=" |> Map.pp Uns.pp gotos + |> Fmt.fmt "}" + end + include T + include Identifiable.Make(T) + + let init ~lr1ItemsetClosure ~actions ~gotos = + {lr1ItemsetClosure; actions; gotos} + end + + let states = [| + (* 0 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:0L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 99L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [0L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 22L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 23L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 24L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 36L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 37L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 38L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 39L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 40L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 41L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 42L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 43L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 44L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 45L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 46L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 82L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 83L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 84L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 85L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 86L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 87L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 88L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 89L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 90L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 91L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 92L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 93L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 94L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 95L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 96L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 97L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 98L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [1L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 97L); + (11L, Action.ShiftPrefix 2L); + (12L, Action.ShiftPrefix 3L); + (13L, Action.ShiftPrefix 4L); + (14L, Action.ShiftPrefix 5L); + (16L, Action.ShiftPrefix 6L); + (17L, Action.ShiftPrefix 7L); + (18L, Action.ShiftPrefix 8L); + (19L, Action.ShiftPrefix 9L); + (20L, Action.ShiftPrefix 10L); + (21L, Action.ShiftPrefix 11L); + (22L, Action.ShiftPrefix 12L); + (23L, Action.ShiftPrefix 13L); + (24L, Action.ShiftPrefix 14L); + (25L, Action.ShiftPrefix 15L); + (26L, Action.ShiftPrefix 16L); + (27L, Action.ShiftPrefix 17L); + (28L, Action.ShiftPrefix 18L); + (29L, Action.ShiftPrefix 19L); + (30L, Action.ShiftPrefix 20L); + (31L, Action.ShiftPrefix 21L); + (32L, Action.ShiftPrefix 22L); + (33L, Action.ShiftPrefix 23L); + (34L, Action.ShiftPrefix 24L); + (35L, Action.ShiftPrefix 25L); + (36L, Action.ShiftPrefix 26L); + (37L, Action.ShiftPrefix 27L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (52L, 28L); + (57L, 29L); + (77L, 30L); + (78L, 31L); + (79L, 32L); + ] + ); + (* 1 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:1L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 101L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [0L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 22L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 23L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 24L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 36L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 37L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 38L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 39L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 40L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 41L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 42L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 43L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 44L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 45L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 46L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 82L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 83L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 84L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 85L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 86L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 87L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 88L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 89L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 90L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 91L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 92L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 93L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 94L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 95L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 96L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 97L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 100L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [1L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 97L); + (11L, Action.ShiftPrefix 2L); + (12L, Action.ShiftPrefix 3L); + (13L, Action.ShiftPrefix 4L); + (14L, Action.ShiftPrefix 5L); + (16L, Action.ShiftPrefix 6L); + (17L, Action.ShiftPrefix 7L); + (18L, Action.ShiftPrefix 8L); + (19L, Action.ShiftPrefix 9L); + (20L, Action.ShiftPrefix 10L); + (21L, Action.ShiftPrefix 11L); + (22L, Action.ShiftPrefix 12L); + (23L, Action.ShiftPrefix 13L); + (24L, Action.ShiftPrefix 14L); + (25L, Action.ShiftPrefix 15L); + (26L, Action.ShiftPrefix 16L); + (27L, Action.ShiftPrefix 17L); + (28L, Action.ShiftPrefix 18L); + (29L, Action.ShiftPrefix 19L); + (30L, Action.ShiftPrefix 20L); + (31L, Action.ShiftPrefix 21L); + (32L, Action.ShiftPrefix 22L); + (33L, Action.ShiftPrefix 23L); + (34L, Action.ShiftPrefix 24L); + (35L, Action.ShiftPrefix 25L); + (36L, Action.ShiftPrefix 26L); + (37L, Action.ShiftPrefix 27L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (52L, 28L); + (57L, 29L); + (77L, 30L); + (78L, 33L); + (81L, 34L); + ] + ); + (* 2 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:2L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 37L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 37L); + (11L, Action.Reduce 37L); + (12L, Action.Reduce 37L); + (13L, Action.Reduce 37L); + (14L, Action.Reduce 37L); + (16L, Action.Reduce 37L); + (17L, Action.Reduce 37L); + (18L, Action.Reduce 37L); + (19L, Action.Reduce 37L); + (20L, Action.Reduce 37L); + (21L, Action.Reduce 37L); + (22L, Action.Reduce 37L); + (23L, Action.Reduce 37L); + (24L, Action.Reduce 37L); + (25L, Action.Reduce 37L); + (26L, Action.Reduce 37L); + (27L, Action.Reduce 37L); + (28L, Action.Reduce 37L); + (29L, Action.Reduce 37L); + (30L, Action.Reduce 37L); + (31L, Action.Reduce 37L); + (32L, Action.Reduce 37L); + (33L, Action.Reduce 37L); + (34L, Action.Reduce 37L); + (35L, Action.Reduce 37L); + (36L, Action.Reduce 37L); + (37L, Action.Reduce 37L); + (38L, Action.Reduce 37L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 3 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:3L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 38L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 38L); + (11L, Action.Reduce 38L); + (12L, Action.Reduce 38L); + (13L, Action.Reduce 38L); + (14L, Action.Reduce 38L); + (16L, Action.Reduce 38L); + (17L, Action.Reduce 38L); + (18L, Action.Reduce 38L); + (19L, Action.Reduce 38L); + (20L, Action.Reduce 38L); + (21L, Action.Reduce 38L); + (22L, Action.Reduce 38L); + (23L, Action.Reduce 38L); + (24L, Action.Reduce 38L); + (25L, Action.Reduce 38L); + (26L, Action.Reduce 38L); + (27L, Action.Reduce 38L); + (28L, Action.Reduce 38L); + (29L, Action.Reduce 38L); + (30L, Action.Reduce 38L); + (31L, Action.Reduce 38L); + (32L, Action.Reduce 38L); + (33L, Action.Reduce 38L); + (34L, Action.Reduce 38L); + (35L, Action.Reduce 38L); + (36L, Action.Reduce 38L); + (37L, Action.Reduce 38L); + (38L, Action.Reduce 38L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 4 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:4L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 39L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 39L); + (11L, Action.Reduce 39L); + (12L, Action.Reduce 39L); + (13L, Action.Reduce 39L); + (14L, Action.Reduce 39L); + (16L, Action.Reduce 39L); + (17L, Action.Reduce 39L); + (18L, Action.Reduce 39L); + (19L, Action.Reduce 39L); + (20L, Action.Reduce 39L); + (21L, Action.Reduce 39L); + (22L, Action.Reduce 39L); + (23L, Action.Reduce 39L); + (24L, Action.Reduce 39L); + (25L, Action.Reduce 39L); + (26L, Action.Reduce 39L); + (27L, Action.Reduce 39L); + (28L, Action.Reduce 39L); + (29L, Action.Reduce 39L); + (30L, Action.Reduce 39L); + (31L, Action.Reduce 39L); + (32L, Action.Reduce 39L); + (33L, Action.Reduce 39L); + (34L, Action.Reduce 39L); + (35L, Action.Reduce 39L); + (36L, Action.Reduce 39L); + (37L, Action.Reduce 39L); + (38L, Action.Reduce 39L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 5 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:5L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 40L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 40L); + (11L, Action.Reduce 40L); + (12L, Action.Reduce 40L); + (13L, Action.Reduce 40L); + (14L, Action.Reduce 40L); + (16L, Action.Reduce 40L); + (17L, Action.Reduce 40L); + (18L, Action.Reduce 40L); + (19L, Action.Reduce 40L); + (20L, Action.Reduce 40L); + (21L, Action.Reduce 40L); + (22L, Action.Reduce 40L); + (23L, Action.Reduce 40L); + (24L, Action.Reduce 40L); + (25L, Action.Reduce 40L); + (26L, Action.Reduce 40L); + (27L, Action.Reduce 40L); + (28L, Action.Reduce 40L); + (29L, Action.Reduce 40L); + (30L, Action.Reduce 40L); + (31L, Action.Reduce 40L); + (32L, Action.Reduce 40L); + (33L, Action.Reduce 40L); + (34L, Action.Reduce 40L); + (35L, Action.Reduce 40L); + (36L, Action.Reduce 40L); + (37L, Action.Reduce 40L); + (38L, Action.Reduce 40L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 6 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:6L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 41L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 41L); + (11L, Action.Reduce 41L); + (12L, Action.Reduce 41L); + (13L, Action.Reduce 41L); + (14L, Action.Reduce 41L); + (16L, Action.Reduce 41L); + (17L, Action.Reduce 41L); + (18L, Action.Reduce 41L); + (19L, Action.Reduce 41L); + (20L, Action.Reduce 41L); + (21L, Action.Reduce 41L); + (22L, Action.Reduce 41L); + (23L, Action.Reduce 41L); + (24L, Action.Reduce 41L); + (25L, Action.Reduce 41L); + (26L, Action.Reduce 41L); + (27L, Action.Reduce 41L); + (28L, Action.Reduce 41L); + (29L, Action.Reduce 41L); + (30L, Action.Reduce 41L); + (31L, Action.Reduce 41L); + (32L, Action.Reduce 41L); + (33L, Action.Reduce 41L); + (34L, Action.Reduce 41L); + (35L, Action.Reduce 41L); + (36L, Action.Reduce 41L); + (37L, Action.Reduce 41L); + (38L, Action.Reduce 41L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 7 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:7L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 42L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 42L); + (11L, Action.Reduce 42L); + (12L, Action.Reduce 42L); + (13L, Action.Reduce 42L); + (14L, Action.Reduce 42L); + (16L, Action.Reduce 42L); + (17L, Action.Reduce 42L); + (18L, Action.Reduce 42L); + (19L, Action.Reduce 42L); + (20L, Action.Reduce 42L); + (21L, Action.Reduce 42L); + (22L, Action.Reduce 42L); + (23L, Action.Reduce 42L); + (24L, Action.Reduce 42L); + (25L, Action.Reduce 42L); + (26L, Action.Reduce 42L); + (27L, Action.Reduce 42L); + (28L, Action.Reduce 42L); + (29L, Action.Reduce 42L); + (30L, Action.Reduce 42L); + (31L, Action.Reduce 42L); + (32L, Action.Reduce 42L); + (33L, Action.Reduce 42L); + (34L, Action.Reduce 42L); + (35L, Action.Reduce 42L); + (36L, Action.Reduce 42L); + (37L, Action.Reduce 42L); + (38L, Action.Reduce 42L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 8 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:8L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 43L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 43L); + (11L, Action.Reduce 43L); + (12L, Action.Reduce 43L); + (13L, Action.Reduce 43L); + (14L, Action.Reduce 43L); + (16L, Action.Reduce 43L); + (17L, Action.Reduce 43L); + (18L, Action.Reduce 43L); + (19L, Action.Reduce 43L); + (20L, Action.Reduce 43L); + (21L, Action.Reduce 43L); + (22L, Action.Reduce 43L); + (23L, Action.Reduce 43L); + (24L, Action.Reduce 43L); + (25L, Action.Reduce 43L); + (26L, Action.Reduce 43L); + (27L, Action.Reduce 43L); + (28L, Action.Reduce 43L); + (29L, Action.Reduce 43L); + (30L, Action.Reduce 43L); + (31L, Action.Reduce 43L); + (32L, Action.Reduce 43L); + (33L, Action.Reduce 43L); + (34L, Action.Reduce 43L); + (35L, Action.Reduce 43L); + (36L, Action.Reduce 43L); + (37L, Action.Reduce 43L); + (38L, Action.Reduce 43L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 9 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:9L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 44L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 44L); + (11L, Action.Reduce 44L); + (12L, Action.Reduce 44L); + (13L, Action.Reduce 44L); + (14L, Action.Reduce 44L); + (16L, Action.Reduce 44L); + (17L, Action.Reduce 44L); + (18L, Action.Reduce 44L); + (19L, Action.Reduce 44L); + (20L, Action.Reduce 44L); + (21L, Action.Reduce 44L); + (22L, Action.Reduce 44L); + (23L, Action.Reduce 44L); + (24L, Action.Reduce 44L); + (25L, Action.Reduce 44L); + (26L, Action.Reduce 44L); + (27L, Action.Reduce 44L); + (28L, Action.Reduce 44L); + (29L, Action.Reduce 44L); + (30L, Action.Reduce 44L); + (31L, Action.Reduce 44L); + (32L, Action.Reduce 44L); + (33L, Action.Reduce 44L); + (34L, Action.Reduce 44L); + (35L, Action.Reduce 44L); + (36L, Action.Reduce 44L); + (37L, Action.Reduce 44L); + (38L, Action.Reduce 44L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 10 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:10L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 24L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 24L); + (11L, Action.Reduce 24L); + (12L, Action.Reduce 24L); + (13L, Action.Reduce 24L); + (14L, Action.Reduce 24L); + (16L, Action.Reduce 24L); + (17L, Action.Reduce 24L); + (18L, Action.Reduce 24L); + (19L, Action.Reduce 24L); + (20L, Action.Reduce 24L); + (21L, Action.Reduce 24L); + (22L, Action.Reduce 24L); + (23L, Action.Reduce 24L); + (24L, Action.Reduce 24L); + (25L, Action.Reduce 24L); + (26L, Action.Reduce 24L); + (27L, Action.Reduce 24L); + (28L, Action.Reduce 24L); + (29L, Action.Reduce 24L); + (30L, Action.Reduce 24L); + (31L, Action.Reduce 24L); + (32L, Action.Reduce 24L); + (33L, Action.Reduce 24L); + (34L, Action.Reduce 24L); + (35L, Action.Reduce 24L); + (36L, Action.Reduce 24L); + (37L, Action.Reduce 24L); + (38L, Action.Reduce 24L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 11 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:11L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 45L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 45L); + (11L, Action.Reduce 45L); + (12L, Action.Reduce 45L); + (13L, Action.Reduce 45L); + (14L, Action.Reduce 45L); + (16L, Action.Reduce 45L); + (17L, Action.Reduce 45L); + (18L, Action.Reduce 45L); + (19L, Action.Reduce 45L); + (20L, Action.Reduce 45L); + (21L, Action.Reduce 45L); + (22L, Action.Reduce 45L); + (23L, Action.Reduce 45L); + (24L, Action.Reduce 45L); + (25L, Action.Reduce 45L); + (26L, Action.Reduce 45L); + (27L, Action.Reduce 45L); + (28L, Action.Reduce 45L); + (29L, Action.Reduce 45L); + (30L, Action.Reduce 45L); + (31L, Action.Reduce 45L); + (32L, Action.Reduce 45L); + (33L, Action.Reduce 45L); + (34L, Action.Reduce 45L); + (35L, Action.Reduce 45L); + (36L, Action.Reduce 45L); + (37L, Action.Reduce 45L); + (38L, Action.Reduce 45L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 12 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:12L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 46L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 46L); + (11L, Action.Reduce 46L); + (12L, Action.Reduce 46L); + (13L, Action.Reduce 46L); + (14L, Action.Reduce 46L); + (16L, Action.Reduce 46L); + (17L, Action.Reduce 46L); + (18L, Action.Reduce 46L); + (19L, Action.Reduce 46L); + (20L, Action.Reduce 46L); + (21L, Action.Reduce 46L); + (22L, Action.Reduce 46L); + (23L, Action.Reduce 46L); + (24L, Action.Reduce 46L); + (25L, Action.Reduce 46L); + (26L, Action.Reduce 46L); + (27L, Action.Reduce 46L); + (28L, Action.Reduce 46L); + (29L, Action.Reduce 46L); + (30L, Action.Reduce 46L); + (31L, Action.Reduce 46L); + (32L, Action.Reduce 46L); + (33L, Action.Reduce 46L); + (34L, Action.Reduce 46L); + (35L, Action.Reduce 46L); + (36L, Action.Reduce 46L); + (37L, Action.Reduce 46L); + (38L, Action.Reduce 46L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 13 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:13L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 23L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 23L); + (11L, Action.Reduce 23L); + (12L, Action.Reduce 23L); + (13L, Action.Reduce 23L); + (14L, Action.Reduce 23L); + (16L, Action.Reduce 23L); + (17L, Action.Reduce 23L); + (18L, Action.Reduce 23L); + (19L, Action.Reduce 23L); + (20L, Action.Reduce 23L); + (21L, Action.Reduce 23L); + (22L, Action.Reduce 23L); + (23L, Action.Reduce 23L); + (24L, Action.Reduce 23L); + (25L, Action.Reduce 23L); + (26L, Action.Reduce 23L); + (27L, Action.Reduce 23L); + (28L, Action.Reduce 23L); + (29L, Action.Reduce 23L); + (30L, Action.Reduce 23L); + (31L, Action.Reduce 23L); + (32L, Action.Reduce 23L); + (33L, Action.Reduce 23L); + (34L, Action.Reduce 23L); + (35L, Action.Reduce 23L); + (36L, Action.Reduce 23L); + (37L, Action.Reduce 23L); + (38L, Action.Reduce 23L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 14 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:14L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 22L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 22L); + (11L, Action.Reduce 22L); + (12L, Action.Reduce 22L); + (13L, Action.Reduce 22L); + (14L, Action.Reduce 22L); + (16L, Action.Reduce 22L); + (17L, Action.Reduce 22L); + (18L, Action.Reduce 22L); + (19L, Action.Reduce 22L); + (20L, Action.Reduce 22L); + (21L, Action.Reduce 22L); + (22L, Action.Reduce 22L); + (23L, Action.Reduce 22L); + (24L, Action.Reduce 22L); + (25L, Action.Reduce 22L); + (26L, Action.Reduce 22L); + (27L, Action.Reduce 22L); + (28L, Action.Reduce 22L); + (29L, Action.Reduce 22L); + (30L, Action.Reduce 22L); + (31L, Action.Reduce 22L); + (32L, Action.Reduce 22L); + (33L, Action.Reduce 22L); + (34L, Action.Reduce 22L); + (35L, Action.Reduce 22L); + (36L, Action.Reduce 22L); + (37L, Action.Reduce 22L); + (38L, Action.Reduce 22L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 15 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:15L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 84L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 84L); + (11L, Action.Reduce 84L); + (12L, Action.Reduce 84L); + (13L, Action.Reduce 84L); + (14L, Action.Reduce 84L); + (16L, Action.Reduce 84L); + (17L, Action.Reduce 84L); + (18L, Action.Reduce 84L); + (19L, Action.Reduce 84L); + (20L, Action.Reduce 84L); + (21L, Action.Reduce 84L); + (22L, Action.Reduce 84L); + (23L, Action.Reduce 84L); + (24L, Action.Reduce 84L); + (25L, Action.Reduce 84L); + (26L, Action.Reduce 84L); + (27L, Action.Reduce 84L); + (28L, Action.Reduce 84L); + (29L, Action.Reduce 84L); + (30L, Action.Reduce 84L); + (31L, Action.Reduce 84L); + (32L, Action.Reduce 84L); + (33L, Action.Reduce 84L); + (34L, Action.Reduce 84L); + (35L, Action.Reduce 84L); + (36L, Action.Reduce 84L); + (37L, Action.Reduce 84L); + (38L, Action.Reduce 84L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 16 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:16L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 85L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 85L); + (11L, Action.Reduce 85L); + (12L, Action.Reduce 85L); + (13L, Action.Reduce 85L); + (14L, Action.Reduce 85L); + (16L, Action.Reduce 85L); + (17L, Action.Reduce 85L); + (18L, Action.Reduce 85L); + (19L, Action.Reduce 85L); + (20L, Action.Reduce 85L); + (21L, Action.Reduce 85L); + (22L, Action.Reduce 85L); + (23L, Action.Reduce 85L); + (24L, Action.Reduce 85L); + (25L, Action.Reduce 85L); + (26L, Action.Reduce 85L); + (27L, Action.Reduce 85L); + (28L, Action.Reduce 85L); + (29L, Action.Reduce 85L); + (30L, Action.Reduce 85L); + (31L, Action.Reduce 85L); + (32L, Action.Reduce 85L); + (33L, Action.Reduce 85L); + (34L, Action.Reduce 85L); + (35L, Action.Reduce 85L); + (36L, Action.Reduce 85L); + (37L, Action.Reduce 85L); + (38L, Action.Reduce 85L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 17 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:17L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 86L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 86L); + (11L, Action.Reduce 86L); + (12L, Action.Reduce 86L); + (13L, Action.Reduce 86L); + (14L, Action.Reduce 86L); + (16L, Action.Reduce 86L); + (17L, Action.Reduce 86L); + (18L, Action.Reduce 86L); + (19L, Action.Reduce 86L); + (20L, Action.Reduce 86L); + (21L, Action.Reduce 86L); + (22L, Action.Reduce 86L); + (23L, Action.Reduce 86L); + (24L, Action.Reduce 86L); + (25L, Action.Reduce 86L); + (26L, Action.Reduce 86L); + (27L, Action.Reduce 86L); + (28L, Action.Reduce 86L); + (29L, Action.Reduce 86L); + (30L, Action.Reduce 86L); + (31L, Action.Reduce 86L); + (32L, Action.Reduce 86L); + (33L, Action.Reduce 86L); + (34L, Action.Reduce 86L); + (35L, Action.Reduce 86L); + (36L, Action.Reduce 86L); + (37L, Action.Reduce 86L); + (38L, Action.Reduce 86L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 18 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:18L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 87L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 87L); + (11L, Action.Reduce 87L); + (12L, Action.Reduce 87L); + (13L, Action.Reduce 87L); + (14L, Action.Reduce 87L); + (16L, Action.Reduce 87L); + (17L, Action.Reduce 87L); + (18L, Action.Reduce 87L); + (19L, Action.Reduce 87L); + (20L, Action.Reduce 87L); + (21L, Action.Reduce 87L); + (22L, Action.Reduce 87L); + (23L, Action.Reduce 87L); + (24L, Action.Reduce 87L); + (25L, Action.Reduce 87L); + (26L, Action.Reduce 87L); + (27L, Action.Reduce 87L); + (28L, Action.Reduce 87L); + (29L, Action.Reduce 87L); + (30L, Action.Reduce 87L); + (31L, Action.Reduce 87L); + (32L, Action.Reduce 87L); + (33L, Action.Reduce 87L); + (34L, Action.Reduce 87L); + (35L, Action.Reduce 87L); + (36L, Action.Reduce 87L); + (37L, Action.Reduce 87L); + (38L, Action.Reduce 87L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 19 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:19L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 88L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 88L); + (11L, Action.Reduce 88L); + (12L, Action.Reduce 88L); + (13L, Action.Reduce 88L); + (14L, Action.Reduce 88L); + (16L, Action.Reduce 88L); + (17L, Action.Reduce 88L); + (18L, Action.Reduce 88L); + (19L, Action.Reduce 88L); + (20L, Action.Reduce 88L); + (21L, Action.Reduce 88L); + (22L, Action.Reduce 88L); + (23L, Action.Reduce 88L); + (24L, Action.Reduce 88L); + (25L, Action.Reduce 88L); + (26L, Action.Reduce 88L); + (27L, Action.Reduce 88L); + (28L, Action.Reduce 88L); + (29L, Action.Reduce 88L); + (30L, Action.Reduce 88L); + (31L, Action.Reduce 88L); + (32L, Action.Reduce 88L); + (33L, Action.Reduce 88L); + (34L, Action.Reduce 88L); + (35L, Action.Reduce 88L); + (36L, Action.Reduce 88L); + (37L, Action.Reduce 88L); + (38L, Action.Reduce 88L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 20 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:20L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 89L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 89L); + (11L, Action.Reduce 89L); + (12L, Action.Reduce 89L); + (13L, Action.Reduce 89L); + (14L, Action.Reduce 89L); + (16L, Action.Reduce 89L); + (17L, Action.Reduce 89L); + (18L, Action.Reduce 89L); + (19L, Action.Reduce 89L); + (20L, Action.Reduce 89L); + (21L, Action.Reduce 89L); + (22L, Action.Reduce 89L); + (23L, Action.Reduce 89L); + (24L, Action.Reduce 89L); + (25L, Action.Reduce 89L); + (26L, Action.Reduce 89L); + (27L, Action.Reduce 89L); + (28L, Action.Reduce 89L); + (29L, Action.Reduce 89L); + (30L, Action.Reduce 89L); + (31L, Action.Reduce 89L); + (32L, Action.Reduce 89L); + (33L, Action.Reduce 89L); + (34L, Action.Reduce 89L); + (35L, Action.Reduce 89L); + (36L, Action.Reduce 89L); + (37L, Action.Reduce 89L); + (38L, Action.Reduce 89L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 21 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:21L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 90L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 90L); + (11L, Action.Reduce 90L); + (12L, Action.Reduce 90L); + (13L, Action.Reduce 90L); + (14L, Action.Reduce 90L); + (16L, Action.Reduce 90L); + (17L, Action.Reduce 90L); + (18L, Action.Reduce 90L); + (19L, Action.Reduce 90L); + (20L, Action.Reduce 90L); + (21L, Action.Reduce 90L); + (22L, Action.Reduce 90L); + (23L, Action.Reduce 90L); + (24L, Action.Reduce 90L); + (25L, Action.Reduce 90L); + (26L, Action.Reduce 90L); + (27L, Action.Reduce 90L); + (28L, Action.Reduce 90L); + (29L, Action.Reduce 90L); + (30L, Action.Reduce 90L); + (31L, Action.Reduce 90L); + (32L, Action.Reduce 90L); + (33L, Action.Reduce 90L); + (34L, Action.Reduce 90L); + (35L, Action.Reduce 90L); + (36L, Action.Reduce 90L); + (37L, Action.Reduce 90L); + (38L, Action.Reduce 90L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 22 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:22L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 91L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 91L); + (11L, Action.Reduce 91L); + (12L, Action.Reduce 91L); + (13L, Action.Reduce 91L); + (14L, Action.Reduce 91L); + (16L, Action.Reduce 91L); + (17L, Action.Reduce 91L); + (18L, Action.Reduce 91L); + (19L, Action.Reduce 91L); + (20L, Action.Reduce 91L); + (21L, Action.Reduce 91L); + (22L, Action.Reduce 91L); + (23L, Action.Reduce 91L); + (24L, Action.Reduce 91L); + (25L, Action.Reduce 91L); + (26L, Action.Reduce 91L); + (27L, Action.Reduce 91L); + (28L, Action.Reduce 91L); + (29L, Action.Reduce 91L); + (30L, Action.Reduce 91L); + (31L, Action.Reduce 91L); + (32L, Action.Reduce 91L); + (33L, Action.Reduce 91L); + (34L, Action.Reduce 91L); + (35L, Action.Reduce 91L); + (36L, Action.Reduce 91L); + (37L, Action.Reduce 91L); + (38L, Action.Reduce 91L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 23 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:23L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 92L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 92L); + (11L, Action.Reduce 92L); + (12L, Action.Reduce 92L); + (13L, Action.Reduce 92L); + (14L, Action.Reduce 92L); + (16L, Action.Reduce 92L); + (17L, Action.Reduce 92L); + (18L, Action.Reduce 92L); + (19L, Action.Reduce 92L); + (20L, Action.Reduce 92L); + (21L, Action.Reduce 92L); + (22L, Action.Reduce 92L); + (23L, Action.Reduce 92L); + (24L, Action.Reduce 92L); + (25L, Action.Reduce 92L); + (26L, Action.Reduce 92L); + (27L, Action.Reduce 92L); + (28L, Action.Reduce 92L); + (29L, Action.Reduce 92L); + (30L, Action.Reduce 92L); + (31L, Action.Reduce 92L); + (32L, Action.Reduce 92L); + (33L, Action.Reduce 92L); + (34L, Action.Reduce 92L); + (35L, Action.Reduce 92L); + (36L, Action.Reduce 92L); + (37L, Action.Reduce 92L); + (38L, Action.Reduce 92L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 24 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:24L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 93L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 93L); + (11L, Action.Reduce 93L); + (12L, Action.Reduce 93L); + (13L, Action.Reduce 93L); + (14L, Action.Reduce 93L); + (16L, Action.Reduce 93L); + (17L, Action.Reduce 93L); + (18L, Action.Reduce 93L); + (19L, Action.Reduce 93L); + (20L, Action.Reduce 93L); + (21L, Action.Reduce 93L); + (22L, Action.Reduce 93L); + (23L, Action.Reduce 93L); + (24L, Action.Reduce 93L); + (25L, Action.Reduce 93L); + (26L, Action.Reduce 93L); + (27L, Action.Reduce 93L); + (28L, Action.Reduce 93L); + (29L, Action.Reduce 93L); + (30L, Action.Reduce 93L); + (31L, Action.Reduce 93L); + (32L, Action.Reduce 93L); + (33L, Action.Reduce 93L); + (34L, Action.Reduce 93L); + (35L, Action.Reduce 93L); + (36L, Action.Reduce 93L); + (37L, Action.Reduce 93L); + (38L, Action.Reduce 93L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 25 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:25L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 94L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 94L); + (11L, Action.Reduce 94L); + (12L, Action.Reduce 94L); + (13L, Action.Reduce 94L); + (14L, Action.Reduce 94L); + (16L, Action.Reduce 94L); + (17L, Action.Reduce 94L); + (18L, Action.Reduce 94L); + (19L, Action.Reduce 94L); + (20L, Action.Reduce 94L); + (21L, Action.Reduce 94L); + (22L, Action.Reduce 94L); + (23L, Action.Reduce 94L); + (24L, Action.Reduce 94L); + (25L, Action.Reduce 94L); + (26L, Action.Reduce 94L); + (27L, Action.Reduce 94L); + (28L, Action.Reduce 94L); + (29L, Action.Reduce 94L); + (30L, Action.Reduce 94L); + (31L, Action.Reduce 94L); + (32L, Action.Reduce 94L); + (33L, Action.Reduce 94L); + (34L, Action.Reduce 94L); + (35L, Action.Reduce 94L); + (36L, Action.Reduce 94L); + (37L, Action.Reduce 94L); + (38L, Action.Reduce 94L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 26 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:26L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 95L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 95L); + (11L, Action.Reduce 95L); + (12L, Action.Reduce 95L); + (13L, Action.Reduce 95L); + (14L, Action.Reduce 95L); + (16L, Action.Reduce 95L); + (17L, Action.Reduce 95L); + (18L, Action.Reduce 95L); + (19L, Action.Reduce 95L); + (20L, Action.Reduce 95L); + (21L, Action.Reduce 95L); + (22L, Action.Reduce 95L); + (23L, Action.Reduce 95L); + (24L, Action.Reduce 95L); + (25L, Action.Reduce 95L); + (26L, Action.Reduce 95L); + (27L, Action.Reduce 95L); + (28L, Action.Reduce 95L); + (29L, Action.Reduce 95L); + (30L, Action.Reduce 95L); + (31L, Action.Reduce 95L); + (32L, Action.Reduce 95L); + (33L, Action.Reduce 95L); + (34L, Action.Reduce 95L); + (35L, Action.Reduce 95L); + (36L, Action.Reduce 95L); + (37L, Action.Reduce 95L); + (38L, Action.Reduce 95L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 27 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:27L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 36L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 36L); + (11L, Action.Reduce 36L); + (12L, Action.Reduce 36L); + (13L, Action.Reduce 36L); + (14L, Action.Reduce 36L); + (16L, Action.Reduce 36L); + (17L, Action.Reduce 36L); + (18L, Action.Reduce 36L); + (19L, Action.Reduce 36L); + (20L, Action.Reduce 36L); + (21L, Action.Reduce 36L); + (22L, Action.Reduce 36L); + (23L, Action.Reduce 36L); + (24L, Action.Reduce 36L); + (25L, Action.Reduce 36L); + (26L, Action.Reduce 36L); + (27L, Action.Reduce 36L); + (28L, Action.Reduce 36L); + (29L, Action.Reduce 36L); + (30L, Action.Reduce 36L); + (31L, Action.Reduce 36L); + (32L, Action.Reduce 36L); + (33L, Action.Reduce 36L); + (34L, Action.Reduce 36L); + (35L, Action.Reduce 36L); + (36L, Action.Reduce 36L); + (37L, Action.Reduce 36L); + (38L, Action.Reduce 36L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 28 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:28L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 83L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 83L); + (11L, Action.Reduce 83L); + (12L, Action.Reduce 83L); + (13L, Action.Reduce 83L); + (14L, Action.Reduce 83L); + (16L, Action.Reduce 83L); + (17L, Action.Reduce 83L); + (18L, Action.Reduce 83L); + (19L, Action.Reduce 83L); + (20L, Action.Reduce 83L); + (21L, Action.Reduce 83L); + (22L, Action.Reduce 83L); + (23L, Action.Reduce 83L); + (24L, Action.Reduce 83L); + (25L, Action.Reduce 83L); + (26L, Action.Reduce 83L); + (27L, Action.Reduce 83L); + (28L, Action.Reduce 83L); + (29L, Action.Reduce 83L); + (30L, Action.Reduce 83L); + (31L, Action.Reduce 83L); + (32L, Action.Reduce 83L); + (33L, Action.Reduce 83L); + (34L, Action.Reduce 83L); + (35L, Action.Reduce 83L); + (36L, Action.Reduce 83L); + (37L, Action.Reduce 83L); + (38L, Action.Reduce 83L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 29 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:29L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 82L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 82L); + (11L, Action.Reduce 82L); + (12L, Action.Reduce 82L); + (13L, Action.Reduce 82L); + (14L, Action.Reduce 82L); + (16L, Action.Reduce 82L); + (17L, Action.Reduce 82L); + (18L, Action.Reduce 82L); + (19L, Action.Reduce 82L); + (20L, Action.Reduce 82L); + (21L, Action.Reduce 82L); + (22L, Action.Reduce 82L); + (23L, Action.Reduce 82L); + (24L, Action.Reduce 82L); + (25L, Action.Reduce 82L); + (26L, Action.Reduce 82L); + (27L, Action.Reduce 82L); + (28L, Action.Reduce 82L); + (29L, Action.Reduce 82L); + (30L, Action.Reduce 82L); + (31L, Action.Reduce 82L); + (32L, Action.Reduce 82L); + (33L, Action.Reduce 82L); + (34L, Action.Reduce 82L); + (35L, Action.Reduce 82L); + (36L, Action.Reduce 82L); + (37L, Action.Reduce 82L); + (38L, Action.Reduce 82L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 30 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:30L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 96L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 22L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 23L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 24L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 36L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 37L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 38L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 39L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 40L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 41L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 42L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 43L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 44L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 45L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 46L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 82L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 83L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 84L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 85L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 86L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 87L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 88L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 89L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 90L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 91L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 92L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 93L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 94L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 95L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 96L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 97L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 97L); + (11L, Action.ShiftPrefix 2L); + (12L, Action.ShiftPrefix 3L); + (13L, Action.ShiftPrefix 4L); + (14L, Action.ShiftPrefix 5L); + (16L, Action.ShiftPrefix 6L); + (17L, Action.ShiftPrefix 7L); + (18L, Action.ShiftPrefix 8L); + (19L, Action.ShiftPrefix 9L); + (20L, Action.ShiftPrefix 10L); + (21L, Action.ShiftPrefix 11L); + (22L, Action.ShiftPrefix 12L); + (23L, Action.ShiftPrefix 13L); + (24L, Action.ShiftPrefix 14L); + (25L, Action.ShiftPrefix 15L); + (26L, Action.ShiftPrefix 16L); + (27L, Action.ShiftPrefix 17L); + (28L, Action.ShiftPrefix 18L); + (29L, Action.ShiftPrefix 19L); + (30L, Action.ShiftPrefix 20L); + (31L, Action.ShiftPrefix 21L); + (32L, Action.ShiftPrefix 22L); + (33L, Action.ShiftPrefix 23L); + (34L, Action.ShiftPrefix 24L); + (35L, Action.ShiftPrefix 25L); + (36L, Action.ShiftPrefix 26L); + (37L, Action.ShiftPrefix 27L); + (38L, Action.Reduce 97L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (52L, 28L); + (57L, 29L); + (77L, 30L); + (78L, 35L); + ] + ); + (* 31 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:31L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 98L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [1L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 81L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.ShiftPrefix 36L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (76L, 37L); + ] + ); + (* 32 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:32L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 99L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [0L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (1L, Action.ShiftPrefix 38L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 33 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:33L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 100L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [1L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.ShiftPrefix 39L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 34 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:34L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 101L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [0L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (1L, Action.ShiftPrefix 40L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 35 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:35L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 96L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [2L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (2L, Action.Reduce 96L); + (38L, Action.Reduce 96L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 36 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:36L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 81L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (25L, Action.ShiftPrefix 41L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 37 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:37L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 98L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [1L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 22L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 23L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 24L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 36L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 37L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 38L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 39L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 40L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 41L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 42L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 43L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 44L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 45L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 46L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 82L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 83L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 84L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 85L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 86L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 87L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 88L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 89L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 90L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 91L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 92L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 93L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 94L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 95L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 96L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 97L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [38L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.ShiftPrefix 2L); + (12L, Action.ShiftPrefix 3L); + (13L, Action.ShiftPrefix 4L); + (14L, Action.ShiftPrefix 5L); + (16L, Action.ShiftPrefix 6L); + (17L, Action.ShiftPrefix 7L); + (18L, Action.ShiftPrefix 8L); + (19L, Action.ShiftPrefix 9L); + (20L, Action.ShiftPrefix 10L); + (21L, Action.ShiftPrefix 11L); + (22L, Action.ShiftPrefix 12L); + (23L, Action.ShiftPrefix 13L); + (24L, Action.ShiftPrefix 14L); + (25L, Action.ShiftPrefix 15L); + (26L, Action.ShiftPrefix 16L); + (27L, Action.ShiftPrefix 17L); + (28L, Action.ShiftPrefix 18L); + (29L, Action.ShiftPrefix 19L); + (30L, Action.ShiftPrefix 20L); + (31L, Action.ShiftPrefix 21L); + (32L, Action.ShiftPrefix 22L); + (33L, Action.ShiftPrefix 23L); + (34L, Action.ShiftPrefix 24L); + (35L, Action.ShiftPrefix 25L); + (36L, Action.ShiftPrefix 26L); + (37L, Action.ShiftPrefix 27L); + (38L, Action.Reduce 97L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (52L, 28L); + (57L, 29L); + (77L, 30L); + (78L, 42L); + ] + ); + (* 38 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:38L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 99L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [0L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (0L, Action.Reduce 99L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 39 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:39L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 100L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [1L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 22L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 23L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 24L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 36L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 37L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 38L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 39L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 40L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 41L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 42L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 43L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 44L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 45L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 46L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 82L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 83L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 84L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 85L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 86L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 87L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 88L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 89L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 90L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 91L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 92L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 93L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 94L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 95L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 96L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [38L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 97L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [38L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.ShiftPrefix 2L); + (12L, Action.ShiftPrefix 3L); + (13L, Action.ShiftPrefix 4L); + (14L, Action.ShiftPrefix 5L); + (16L, Action.ShiftPrefix 6L); + (17L, Action.ShiftPrefix 7L); + (18L, Action.ShiftPrefix 8L); + (19L, Action.ShiftPrefix 9L); + (20L, Action.ShiftPrefix 10L); + (21L, Action.ShiftPrefix 11L); + (22L, Action.ShiftPrefix 12L); + (23L, Action.ShiftPrefix 13L); + (24L, Action.ShiftPrefix 14L); + (25L, Action.ShiftPrefix 15L); + (26L, Action.ShiftPrefix 16L); + (27L, Action.ShiftPrefix 17L); + (28L, Action.ShiftPrefix 18L); + (29L, Action.ShiftPrefix 19L); + (30L, Action.ShiftPrefix 20L); + (31L, Action.ShiftPrefix 21L); + (32L, Action.ShiftPrefix 22L); + (33L, Action.ShiftPrefix 23L); + (34L, Action.ShiftPrefix 24L); + (35L, Action.ShiftPrefix 25L); + (36L, Action.ShiftPrefix 26L); + (37L, Action.ShiftPrefix 27L); + (38L, Action.Reduce 97L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (52L, 28L); + (57L, 29L); + (77L, 30L); + (78L, 43L); + ] + ); + (* 40 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:40L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 101L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [0L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (0L, Action.Reduce 101L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 41 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:41L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 81L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 10L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 11L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 12L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 13L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 21L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 30L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 31L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 32L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 33L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 34L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 35L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 36L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 37L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 38L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 39L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 40L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 41L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 42L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 43L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 44L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 45L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 46L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 50L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 51L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 70L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [12L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 71L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [12L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 72L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 73L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 74L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 75L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 76L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 77L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 80L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (3L, Action.ShiftPrefix 44L); + (5L, Action.ShiftPrefix 45L); + (6L, Action.ShiftPrefix 46L); + (7L, Action.ShiftPrefix 47L); + (8L, Action.ShiftPrefix 48L); + (9L, Action.ShiftPrefix 49L); + (11L, Action.ShiftPrefix 2L); + (12L, Action.ShiftPrefix 3L); + (13L, Action.ShiftPrefix 4L); + (14L, Action.ShiftPrefix 5L); + (16L, Action.ShiftPrefix 6L); + (17L, Action.ShiftPrefix 7L); + (18L, Action.ShiftPrefix 8L); + (19L, Action.ShiftPrefix 9L); + (21L, Action.ShiftPrefix 11L); + (22L, Action.ShiftPrefix 12L); + (25L, Action.ShiftPrefix 50L); + (27L, Action.ShiftPrefix 51L); + (29L, Action.ShiftPrefix 52L); + (31L, Action.ShiftPrefix 53L); + (33L, Action.ShiftPrefix 54L); + (35L, Action.ShiftPrefix 55L); + (37L, Action.ShiftPrefix 27L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (45L, 56L); + (46L, 57L); + (51L, 58L); + (56L, 59L); + (57L, 60L); + (59L, 61L); + (71L, 62L); + (72L, 63L); + (73L, 64L); + (75L, 65L); + ] + ); + (* 42 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:42L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 98L prods) ~dot:3L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [1L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (38L, Action.ShiftAccept 66L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 43 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:43L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 100L prods) ~dot:3L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [1L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (38L, Action.ShiftAccept 67L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 44 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:44L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 70L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [12L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (12L, Action.Reduce 70L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 45 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:45L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 71L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [12L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (12L, Action.Reduce 71L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 46 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:46L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 21L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 1L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 14L; 16L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (12L, Action.ShiftPrefix 68L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (40L, 69L); + ] + ); + (* 47 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:47L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 10L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.Reduce 10L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 48 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:48L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 11L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.Reduce 11L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 49 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:49L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 12L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.Reduce 12L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 50 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:50L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 30L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 27L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 30L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 31L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 32L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 33L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 34L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 35L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 36L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 37L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 38L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 39L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 40L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 41L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 42L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 43L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 44L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 45L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 46L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 50L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 51L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.ShiftPrefix 2L); + (12L, Action.ShiftPrefix 3L); + (13L, Action.ShiftPrefix 4L); + (14L, Action.ShiftPrefix 5L); + (16L, Action.ShiftPrefix 6L); + (17L, Action.ShiftPrefix 7L); + (18L, Action.ShiftPrefix 8L); + (19L, Action.ShiftPrefix 9L); + (21L, Action.ShiftPrefix 11L); + (22L, Action.ShiftPrefix 12L); + (25L, Action.ShiftPrefix 50L); + (27L, Action.ShiftPrefix 51L); + (29L, Action.ShiftPrefix 52L); + (31L, Action.ShiftPrefix 53L); + (33L, Action.ShiftPrefix 54L); + (35L, Action.ShiftPrefix 55L); + (37L, Action.ShiftPrefix 27L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (54L, 70L); + (56L, 59L); + (57L, 60L); + (59L, 71L); + ] + ); + (* 51 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:51L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 31L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 27L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [28L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 28L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [28L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 29L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [28L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 30L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 28L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 31L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 28L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 32L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 28L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 33L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 28L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 34L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 28L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 35L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 28L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 36L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 28L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 37L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 28L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 38L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 28L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 39L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 28L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 40L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 28L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 41L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 28L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 42L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 28L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 43L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 28L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 44L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 28L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 45L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 28L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 46L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 28L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 50L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 28L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 51L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 28L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.ShiftPrefix 2L); + (12L, Action.ShiftPrefix 3L); + (13L, Action.ShiftPrefix 4L); + (14L, Action.ShiftPrefix 5L); + (16L, Action.ShiftPrefix 6L); + (17L, Action.ShiftPrefix 7L); + (18L, Action.ShiftPrefix 8L); + (19L, Action.ShiftPrefix 9L); + (21L, Action.ShiftPrefix 11L); + (22L, Action.ShiftPrefix 12L); + (25L, Action.ShiftPrefix 50L); + (27L, Action.ShiftPrefix 51L); + (28L, Action.Reduce 29L); + (29L, Action.ShiftPrefix 52L); + (31L, Action.ShiftPrefix 53L); + (33L, Action.ShiftPrefix 54L); + (35L, Action.ShiftPrefix 55L); + (37L, Action.ShiftPrefix 27L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (54L, 72L); + (55L, 73L); + (56L, 59L); + (57L, 60L); + (59L, 71L); + ] + ); + (* 52 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:52L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 32L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 27L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [30L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 28L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [30L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 29L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [30L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 30L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 30L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 31L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 30L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 32L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 30L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 33L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 30L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 34L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 30L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 35L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 30L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 36L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 30L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 37L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 30L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 38L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 30L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 39L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 30L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 40L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 30L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 41L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 30L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 42L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 30L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 43L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 30L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 44L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 30L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 45L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 30L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 46L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 30L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 50L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 30L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 51L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 30L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.ShiftPrefix 2L); + (12L, Action.ShiftPrefix 3L); + (13L, Action.ShiftPrefix 4L); + (14L, Action.ShiftPrefix 5L); + (16L, Action.ShiftPrefix 6L); + (17L, Action.ShiftPrefix 7L); + (18L, Action.ShiftPrefix 8L); + (19L, Action.ShiftPrefix 9L); + (21L, Action.ShiftPrefix 11L); + (22L, Action.ShiftPrefix 12L); + (25L, Action.ShiftPrefix 50L); + (27L, Action.ShiftPrefix 51L); + (29L, Action.ShiftPrefix 52L); + (30L, Action.Reduce 29L); + (31L, Action.ShiftPrefix 53L); + (33L, Action.ShiftPrefix 54L); + (35L, Action.ShiftPrefix 55L); + (37L, Action.ShiftPrefix 27L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (54L, 72L); + (55L, 74L); + (56L, 59L); + (57L, 60L); + (59L, 71L); + ] + ); + (* 53 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:53L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 33L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 27L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [32L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 28L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [32L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 29L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [32L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 30L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 32L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 31L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 32L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 32L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 32L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 33L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 32L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 34L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 32L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 35L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 32L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 36L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 32L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 37L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 32L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 38L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 32L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 39L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 32L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 40L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 32L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 41L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 32L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 42L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 32L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 43L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 32L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 44L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 32L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 45L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 32L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 46L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 32L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 50L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 32L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 51L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 32L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.ShiftPrefix 2L); + (12L, Action.ShiftPrefix 3L); + (13L, Action.ShiftPrefix 4L); + (14L, Action.ShiftPrefix 5L); + (16L, Action.ShiftPrefix 6L); + (17L, Action.ShiftPrefix 7L); + (18L, Action.ShiftPrefix 8L); + (19L, Action.ShiftPrefix 9L); + (21L, Action.ShiftPrefix 11L); + (22L, Action.ShiftPrefix 12L); + (25L, Action.ShiftPrefix 50L); + (27L, Action.ShiftPrefix 51L); + (29L, Action.ShiftPrefix 52L); + (31L, Action.ShiftPrefix 53L); + (32L, Action.Reduce 29L); + (33L, Action.ShiftPrefix 54L); + (35L, Action.ShiftPrefix 55L); + (37L, Action.ShiftPrefix 27L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (54L, 72L); + (55L, 75L); + (56L, 59L); + (57L, 60L); + (59L, 71L); + ] + ); + (* 54 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:54L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 34L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 27L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [34L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 28L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [34L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 29L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [34L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 30L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 34L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 31L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 34L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 32L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 34L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 33L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 34L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 34L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 34L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 35L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 34L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 36L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 34L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 37L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 34L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 38L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 34L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 39L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 34L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 40L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 34L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 41L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 34L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 42L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 34L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 43L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 34L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 44L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 34L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 45L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 34L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 46L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 34L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 50L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 34L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 51L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 34L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.ShiftPrefix 2L); + (12L, Action.ShiftPrefix 3L); + (13L, Action.ShiftPrefix 4L); + (14L, Action.ShiftPrefix 5L); + (16L, Action.ShiftPrefix 6L); + (17L, Action.ShiftPrefix 7L); + (18L, Action.ShiftPrefix 8L); + (19L, Action.ShiftPrefix 9L); + (21L, Action.ShiftPrefix 11L); + (22L, Action.ShiftPrefix 12L); + (25L, Action.ShiftPrefix 50L); + (27L, Action.ShiftPrefix 51L); + (29L, Action.ShiftPrefix 52L); + (31L, Action.ShiftPrefix 53L); + (33L, Action.ShiftPrefix 54L); + (34L, Action.Reduce 29L); + (35L, Action.ShiftPrefix 55L); + (37L, Action.ShiftPrefix 27L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (54L, 72L); + (55L, 76L); + (56L, 59L); + (57L, 60L); + (59L, 71L); + ] + ); + (* 55 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:55L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 35L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 27L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [36L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 28L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [36L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 29L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [36L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 30L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 31L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 32L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 33L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 34L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 35L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 36L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 37L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 38L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 39L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 40L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 41L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 42L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 43L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 44L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 45L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 46L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 27L; 29L; 31L; 33L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 50L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 36L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 51L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 36L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.ShiftPrefix 2L); + (12L, Action.ShiftPrefix 3L); + (13L, Action.ShiftPrefix 4L); + (14L, Action.ShiftPrefix 5L); + (16L, Action.ShiftPrefix 6L); + (17L, Action.ShiftPrefix 7L); + (18L, Action.ShiftPrefix 8L); + (19L, Action.ShiftPrefix 9L); + (21L, Action.ShiftPrefix 11L); + (22L, Action.ShiftPrefix 12L); + (25L, Action.ShiftPrefix 50L); + (27L, Action.ShiftPrefix 51L); + (29L, Action.ShiftPrefix 52L); + (31L, Action.ShiftPrefix 53L); + (33L, Action.ShiftPrefix 54L); + (35L, Action.ShiftPrefix 55L); + (36L, Action.Reduce 29L); + (37L, Action.ShiftPrefix 27L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (54L, 72L); + (55L, 77L); + (56L, 59L); + (57L, 60L); + (59L, 71L); + ] + ); + (* 56 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:56L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 13L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 0L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [21L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.ShiftPrefix 78L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (39L, 79L); + ] + ); + (* 57 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:57L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 74L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (24L, Action.Reduce 74L); + (26L, Action.Reduce 74L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 58 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:58L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 75L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (24L, Action.Reduce 75L); + (26L, Action.Reduce 75L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 59 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:59L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 50L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 30L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 31L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 32L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 33L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 34L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 35L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 36L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 37L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 38L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 39L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 40L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 41L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 42L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 43L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 44L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 45L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 46L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 47L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 48L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 49L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.ShiftPrefix 2L); + (12L, Action.ShiftPrefix 3L); + (13L, Action.ShiftPrefix 4L); + (14L, Action.ShiftPrefix 5L); + (16L, Action.ShiftPrefix 6L); + (17L, Action.ShiftPrefix 7L); + (18L, Action.ShiftPrefix 8L); + (19L, Action.ShiftPrefix 9L); + (20L, Action.Reduce 49L); + (21L, Action.ShiftPrefix 11L); + (22L, Action.ShiftPrefix 12L); + (23L, Action.Reduce 49L); + (24L, Action.Reduce 49L); + (25L, Action.ShiftPrefix 50L); + (26L, Action.Reduce 49L); + (27L, Action.ShiftPrefix 51L); + (28L, Action.Reduce 49L); + (29L, Action.ShiftPrefix 52L); + (30L, Action.Reduce 49L); + (31L, Action.ShiftPrefix 53L); + (32L, Action.Reduce 49L); + (33L, Action.ShiftPrefix 54L); + (34L, Action.Reduce 49L); + (35L, Action.ShiftPrefix 55L); + (36L, Action.Reduce 49L); + (37L, Action.ShiftPrefix 27L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (56L, 80L); + (57L, 81L); + (58L, 82L); + ] + ); + (* 60 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:60L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 51L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 30L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 31L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 32L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 33L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 34L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 35L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 36L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 37L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 38L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 39L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 40L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 41L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 42L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 43L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 44L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 45L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 46L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 47L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 48L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 49L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.ShiftPrefix 2L); + (12L, Action.ShiftPrefix 3L); + (13L, Action.ShiftPrefix 4L); + (14L, Action.ShiftPrefix 5L); + (16L, Action.ShiftPrefix 6L); + (17L, Action.ShiftPrefix 7L); + (18L, Action.ShiftPrefix 8L); + (19L, Action.ShiftPrefix 9L); + (20L, Action.Reduce 49L); + (21L, Action.ShiftPrefix 11L); + (22L, Action.ShiftPrefix 12L); + (23L, Action.Reduce 49L); + (24L, Action.Reduce 49L); + (25L, Action.ShiftPrefix 50L); + (26L, Action.Reduce 49L); + (27L, Action.ShiftPrefix 51L); + (28L, Action.Reduce 49L); + (29L, Action.ShiftPrefix 52L); + (30L, Action.Reduce 49L); + (31L, Action.ShiftPrefix 53L); + (32L, Action.Reduce 49L); + (33L, Action.ShiftPrefix 54L); + (34L, Action.Reduce 49L); + (35L, Action.ShiftPrefix 55L); + (36L, Action.Reduce 49L); + (37L, Action.ShiftPrefix 27L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (56L, 80L); + (57L, 81L); + (58L, 83L); + ] + ); + (* 61 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:61L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 77L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (24L, Action.Reduce 77L); + (26L, Action.Reduce 77L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 62 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:62L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 72L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 73L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 1L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 15L; 16L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (12L, Action.ShiftPrefix 68L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (40L, 84L); + ] + ); + (* 63 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:63L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 76L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (24L, Action.Reduce 76L); + (26L, Action.Reduce 76L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 64 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:64L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 80L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 78L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 79L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (24L, Action.ShiftPrefix 85L); + (26L, Action.Reduce 79L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (74L, 86L); + ] + ); + (* 65 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:65L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 81L prods) ~dot:3L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (26L, Action.ShiftPrefix 87L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 66 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:66L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 98L prods) ~dot:4L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [1L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (1L, Action.Reduce 98L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 67 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:67L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 100L prods) ~dot:4L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [1L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (1L, Action.Reduce 100L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 68 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:68L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 1L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 15L; 16L; 17L; 18L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (10L, Action.Reduce 1L); + (11L, Action.Reduce 1L); + (12L, Action.Reduce 1L); + (13L, Action.Reduce 1L); + (14L, Action.Reduce 1L); + (15L, Action.Reduce 1L); + (16L, Action.Reduce 1L); + (17L, Action.Reduce 1L); + (18L, Action.Reduce 1L); + (19L, Action.Reduce 1L); + (20L, Action.Reduce 1L); + (24L, Action.Reduce 1L); + (26L, Action.Reduce 1L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 69 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:69L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 21L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 19L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 16L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 20L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 16L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (10L, Action.Reduce 20L); + (14L, Action.ShiftPrefix 88L); + (16L, Action.Reduce 20L); + (24L, Action.Reduce 20L); + (26L, Action.Reduce 20L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (50L, 89L); + ] + ); + (* 70 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:70L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 30L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (26L, Action.ShiftPrefix 90L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 71 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:71L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 27L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 22L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 25L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 23L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 25L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 24L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 25L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 25L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 26L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (20L, Action.ShiftPrefix 10L); + (23L, Action.ShiftPrefix 13L); + (24L, Action.ShiftPrefix 14L); + (26L, Action.Reduce 26L); + (28L, Action.Reduce 26L); + (30L, Action.Reduce 26L); + (32L, Action.Reduce 26L); + (34L, Action.Reduce 26L); + (36L, Action.Reduce 26L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (52L, 91L); + (53L, 92L); + ] + ); + (* 72 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:72L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 28L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (28L, Action.Reduce 28L); + (30L, Action.Reduce 28L); + (32L, Action.Reduce 28L); + (34L, Action.Reduce 28L); + (36L, Action.Reduce 28L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 73 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:73L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 31L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (28L, Action.ShiftPrefix 93L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 74 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:74L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 32L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (30L, Action.ShiftPrefix 94L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 75 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:75L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 33L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (32L, Action.ShiftPrefix 95L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 76 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:76L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 34L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (34L, Action.ShiftPrefix 96L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 77 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:77L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 35L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (36L, Action.ShiftPrefix 97L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 78 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:78L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 0L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 15L; 17L; 19L; 20L; 21L; 22L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (10L, Action.Reduce 0L); + (15L, Action.Reduce 0L); + (17L, Action.Reduce 0L); + (19L, Action.Reduce 0L); + (20L, Action.Reduce 0L); + (21L, Action.Reduce 0L); + (22L, Action.Reduce 0L); + (24L, Action.Reduce 0L); + (26L, Action.Reduce 0L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 79 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:79L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 13L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 8L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 9L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (21L, Action.ShiftPrefix 98L); + (24L, Action.Reduce 9L); + (26L, Action.Reduce 9L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (44L, 99L); + ] + ); + (* 80 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:80L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 47L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 30L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 31L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 32L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 33L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 34L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 35L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 36L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 37L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 38L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 39L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 40L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 41L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 42L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 43L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 44L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 45L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 46L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 47L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 48L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 49L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.ShiftPrefix 2L); + (12L, Action.ShiftPrefix 3L); + (13L, Action.ShiftPrefix 4L); + (14L, Action.ShiftPrefix 5L); + (16L, Action.ShiftPrefix 6L); + (17L, Action.ShiftPrefix 7L); + (18L, Action.ShiftPrefix 8L); + (19L, Action.ShiftPrefix 9L); + (20L, Action.Reduce 49L); + (21L, Action.ShiftPrefix 11L); + (22L, Action.ShiftPrefix 12L); + (23L, Action.Reduce 49L); + (24L, Action.Reduce 49L); + (25L, Action.ShiftPrefix 50L); + (26L, Action.Reduce 49L); + (27L, Action.ShiftPrefix 51L); + (28L, Action.Reduce 49L); + (29L, Action.ShiftPrefix 52L); + (30L, Action.Reduce 49L); + (31L, Action.ShiftPrefix 53L); + (32L, Action.Reduce 49L); + (33L, Action.ShiftPrefix 54L); + (34L, Action.Reduce 49L); + (35L, Action.ShiftPrefix 55L); + (36L, Action.Reduce 49L); + (37L, Action.ShiftPrefix 27L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (56L, 80L); + (57L, 81L); + (58L, 100L); + ] + ); + (* 81 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:81L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 48L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 30L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 31L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 32L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 33L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 34L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 35L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 36L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 37L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 38L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 39L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 40L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 41L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 42L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 43L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 44L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 45L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 46L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 47L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 48L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 49L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.ShiftPrefix 2L); + (12L, Action.ShiftPrefix 3L); + (13L, Action.ShiftPrefix 4L); + (14L, Action.ShiftPrefix 5L); + (16L, Action.ShiftPrefix 6L); + (17L, Action.ShiftPrefix 7L); + (18L, Action.ShiftPrefix 8L); + (19L, Action.ShiftPrefix 9L); + (20L, Action.Reduce 49L); + (21L, Action.ShiftPrefix 11L); + (22L, Action.ShiftPrefix 12L); + (23L, Action.Reduce 49L); + (24L, Action.Reduce 49L); + (25L, Action.ShiftPrefix 50L); + (26L, Action.Reduce 49L); + (27L, Action.ShiftPrefix 51L); + (28L, Action.Reduce 49L); + (29L, Action.ShiftPrefix 52L); + (30L, Action.Reduce 49L); + (31L, Action.ShiftPrefix 53L); + (32L, Action.Reduce 49L); + (33L, Action.ShiftPrefix 54L); + (34L, Action.Reduce 49L); + (35L, Action.ShiftPrefix 55L); + (36L, Action.Reduce 49L); + (37L, Action.ShiftPrefix 27L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (56L, 80L); + (57L, 81L); + (58L, 101L); + ] + ); + (* 82 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:82L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 50L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (20L, Action.Reduce 50L); + (23L, Action.Reduce 50L); + (24L, Action.Reduce 50L); + (26L, Action.Reduce 50L); + (28L, Action.Reduce 50L); + (30L, Action.Reduce 50L); + (32L, Action.Reduce 50L); + (34L, Action.Reduce 50L); + (36L, Action.Reduce 50L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 83 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:83L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 51L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (20L, Action.Reduce 51L); + (23L, Action.Reduce 51L); + (24L, Action.Reduce 51L); + (26L, Action.Reduce 51L); + (28L, Action.Reduce 51L); + (30L, Action.Reduce 51L); + (32L, Action.Reduce 51L); + (34L, Action.Reduce 51L); + (36L, Action.Reduce 51L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 84 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:84L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 72L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 73L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 14L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 15L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 17L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [15L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 18L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [15L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (10L, Action.ShiftPrefix 102L); + (15L, Action.Reduce 18L); + (16L, Action.ShiftPrefix 103L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (47L, 104L); + (49L, 105L); + ] + ); + (* 85 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:85L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 78L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 10L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 11L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 12L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 13L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 21L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 30L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 31L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 32L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 33L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 34L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 35L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 36L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 37L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 38L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 39L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 40L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 41L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 42L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 43L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 44L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 45L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 46L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 50L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 51L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 70L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [12L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 71L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [12L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 72L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 73L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 74L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 75L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 76L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 77L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (3L, Action.ShiftPrefix 44L); + (5L, Action.ShiftPrefix 45L); + (6L, Action.ShiftPrefix 46L); + (7L, Action.ShiftPrefix 47L); + (8L, Action.ShiftPrefix 48L); + (9L, Action.ShiftPrefix 49L); + (11L, Action.ShiftPrefix 2L); + (12L, Action.ShiftPrefix 3L); + (13L, Action.ShiftPrefix 4L); + (14L, Action.ShiftPrefix 5L); + (16L, Action.ShiftPrefix 6L); + (17L, Action.ShiftPrefix 7L); + (18L, Action.ShiftPrefix 8L); + (19L, Action.ShiftPrefix 9L); + (21L, Action.ShiftPrefix 11L); + (22L, Action.ShiftPrefix 12L); + (25L, Action.ShiftPrefix 50L); + (27L, Action.ShiftPrefix 51L); + (29L, Action.ShiftPrefix 52L); + (31L, Action.ShiftPrefix 53L); + (33L, Action.ShiftPrefix 54L); + (35L, Action.ShiftPrefix 55L); + (37L, Action.ShiftPrefix 27L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (45L, 56L); + (46L, 57L); + (51L, 58L); + (56L, 59L); + (57L, 60L); + (59L, 61L); + (71L, 62L); + (72L, 63L); + (73L, 106L); + ] + ); + (* 86 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:86L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 80L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (26L, Action.Reduce 80L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 87 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:87L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 81L prods) ~dot:4L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L; 38L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.Reduce 81L); + (12L, Action.Reduce 81L); + (13L, Action.Reduce 81L); + (14L, Action.Reduce 81L); + (16L, Action.Reduce 81L); + (17L, Action.Reduce 81L); + (18L, Action.Reduce 81L); + (19L, Action.Reduce 81L); + (20L, Action.Reduce 81L); + (21L, Action.Reduce 81L); + (22L, Action.Reduce 81L); + (23L, Action.Reduce 81L); + (24L, Action.Reduce 81L); + (25L, Action.Reduce 81L); + (26L, Action.Reduce 81L); + (27L, Action.Reduce 81L); + (28L, Action.Reduce 81L); + (29L, Action.Reduce 81L); + (30L, Action.Reduce 81L); + (31L, Action.Reduce 81L); + (32L, Action.Reduce 81L); + (33L, Action.Reduce 81L); + (34L, Action.Reduce 81L); + (35L, Action.Reduce 81L); + (36L, Action.Reduce 81L); + (37L, Action.Reduce 81L); + (38L, Action.Reduce 81L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 88 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:88L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 19L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 16L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (10L, Action.Reduce 19L); + (16L, Action.Reduce 19L); + (24L, Action.Reduce 19L); + (26L, Action.Reduce 19L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 89 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:89L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 21L prods) ~dot:3L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 14L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 15L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 16L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (10L, Action.Reduce 16L); + (16L, Action.ShiftPrefix 103L); + (24L, Action.Reduce 16L); + (26L, Action.Reduce 16L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (47L, 107L); + (48L, 108L); + ] + ); + (* 90 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:90L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 30L prods) ~dot:3L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.Reduce 30L); + (12L, Action.Reduce 30L); + (13L, Action.Reduce 30L); + (14L, Action.Reduce 30L); + (16L, Action.Reduce 30L); + (17L, Action.Reduce 30L); + (18L, Action.Reduce 30L); + (19L, Action.Reduce 30L); + (20L, Action.Reduce 30L); + (21L, Action.Reduce 30L); + (22L, Action.Reduce 30L); + (23L, Action.Reduce 30L); + (24L, Action.Reduce 30L); + (25L, Action.Reduce 30L); + (26L, Action.Reduce 30L); + (27L, Action.Reduce 30L); + (28L, Action.Reduce 30L); + (29L, Action.Reduce 30L); + (30L, Action.Reduce 30L); + (31L, Action.Reduce 30L); + (32L, Action.Reduce 30L); + (33L, Action.Reduce 30L); + (34L, Action.Reduce 30L); + (35L, Action.Reduce 30L); + (36L, Action.Reduce 30L); + (37L, Action.Reduce 30L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 91 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:91L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 25L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 30L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 31L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 32L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 33L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 34L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 35L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 36L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 37L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 38L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 39L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 40L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 41L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 42L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 43L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 44L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 45L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 46L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 50L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 51L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.ShiftPrefix 2L); + (12L, Action.ShiftPrefix 3L); + (13L, Action.ShiftPrefix 4L); + (14L, Action.ShiftPrefix 5L); + (16L, Action.ShiftPrefix 6L); + (17L, Action.ShiftPrefix 7L); + (18L, Action.ShiftPrefix 8L); + (19L, Action.ShiftPrefix 9L); + (21L, Action.ShiftPrefix 11L); + (22L, Action.ShiftPrefix 12L); + (25L, Action.ShiftPrefix 50L); + (27L, Action.ShiftPrefix 51L); + (29L, Action.ShiftPrefix 52L); + (31L, Action.ShiftPrefix 53L); + (33L, Action.ShiftPrefix 54L); + (35L, Action.ShiftPrefix 55L); + (37L, Action.ShiftPrefix 27L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (56L, 59L); + (57L, 60L); + (59L, 109L); + ] + ); + (* 92 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:92L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 27L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (26L, Action.Reduce 27L); + (28L, Action.Reduce 27L); + (30L, Action.Reduce 27L); + (32L, Action.Reduce 27L); + (34L, Action.Reduce 27L); + (36L, Action.Reduce 27L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 93 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:93L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 31L prods) ~dot:3L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.Reduce 31L); + (12L, Action.Reduce 31L); + (13L, Action.Reduce 31L); + (14L, Action.Reduce 31L); + (16L, Action.Reduce 31L); + (17L, Action.Reduce 31L); + (18L, Action.Reduce 31L); + (19L, Action.Reduce 31L); + (20L, Action.Reduce 31L); + (21L, Action.Reduce 31L); + (22L, Action.Reduce 31L); + (23L, Action.Reduce 31L); + (24L, Action.Reduce 31L); + (25L, Action.Reduce 31L); + (26L, Action.Reduce 31L); + (27L, Action.Reduce 31L); + (28L, Action.Reduce 31L); + (29L, Action.Reduce 31L); + (30L, Action.Reduce 31L); + (31L, Action.Reduce 31L); + (32L, Action.Reduce 31L); + (33L, Action.Reduce 31L); + (34L, Action.Reduce 31L); + (35L, Action.Reduce 31L); + (36L, Action.Reduce 31L); + (37L, Action.Reduce 31L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 94 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:94L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 32L prods) ~dot:3L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.Reduce 32L); + (12L, Action.Reduce 32L); + (13L, Action.Reduce 32L); + (14L, Action.Reduce 32L); + (16L, Action.Reduce 32L); + (17L, Action.Reduce 32L); + (18L, Action.Reduce 32L); + (19L, Action.Reduce 32L); + (20L, Action.Reduce 32L); + (21L, Action.Reduce 32L); + (22L, Action.Reduce 32L); + (23L, Action.Reduce 32L); + (24L, Action.Reduce 32L); + (25L, Action.Reduce 32L); + (26L, Action.Reduce 32L); + (27L, Action.Reduce 32L); + (28L, Action.Reduce 32L); + (29L, Action.Reduce 32L); + (30L, Action.Reduce 32L); + (31L, Action.Reduce 32L); + (32L, Action.Reduce 32L); + (33L, Action.Reduce 32L); + (34L, Action.Reduce 32L); + (35L, Action.Reduce 32L); + (36L, Action.Reduce 32L); + (37L, Action.Reduce 32L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 95 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:95L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 33L prods) ~dot:3L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.Reduce 33L); + (12L, Action.Reduce 33L); + (13L, Action.Reduce 33L); + (14L, Action.Reduce 33L); + (16L, Action.Reduce 33L); + (17L, Action.Reduce 33L); + (18L, Action.Reduce 33L); + (19L, Action.Reduce 33L); + (20L, Action.Reduce 33L); + (21L, Action.Reduce 33L); + (22L, Action.Reduce 33L); + (23L, Action.Reduce 33L); + (24L, Action.Reduce 33L); + (25L, Action.Reduce 33L); + (26L, Action.Reduce 33L); + (27L, Action.Reduce 33L); + (28L, Action.Reduce 33L); + (29L, Action.Reduce 33L); + (30L, Action.Reduce 33L); + (31L, Action.Reduce 33L); + (32L, Action.Reduce 33L); + (33L, Action.Reduce 33L); + (34L, Action.Reduce 33L); + (35L, Action.Reduce 33L); + (36L, Action.Reduce 33L); + (37L, Action.Reduce 33L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 96 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:96L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 34L prods) ~dot:3L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.Reduce 34L); + (12L, Action.Reduce 34L); + (13L, Action.Reduce 34L); + (14L, Action.Reduce 34L); + (16L, Action.Reduce 34L); + (17L, Action.Reduce 34L); + (18L, Action.Reduce 34L); + (19L, Action.Reduce 34L); + (20L, Action.Reduce 34L); + (21L, Action.Reduce 34L); + (22L, Action.Reduce 34L); + (23L, Action.Reduce 34L); + (24L, Action.Reduce 34L); + (25L, Action.Reduce 34L); + (26L, Action.Reduce 34L); + (27L, Action.Reduce 34L); + (28L, Action.Reduce 34L); + (29L, Action.Reduce 34L); + (30L, Action.Reduce 34L); + (31L, Action.Reduce 34L); + (32L, Action.Reduce 34L); + (33L, Action.Reduce 34L); + (34L, Action.Reduce 34L); + (35L, Action.Reduce 34L); + (36L, Action.Reduce 34L); + (37L, Action.Reduce 34L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 97 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:97L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 35L prods) ~dot:3L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 23L; 24L; 25L; 26L; 27L; 28L; 29L; 30L; 31L; 32L; 33L; 34L; 35L; 36L; 37L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.Reduce 35L); + (12L, Action.Reduce 35L); + (13L, Action.Reduce 35L); + (14L, Action.Reduce 35L); + (16L, Action.Reduce 35L); + (17L, Action.Reduce 35L); + (18L, Action.Reduce 35L); + (19L, Action.Reduce 35L); + (20L, Action.Reduce 35L); + (21L, Action.Reduce 35L); + (22L, Action.Reduce 35L); + (23L, Action.Reduce 35L); + (24L, Action.Reduce 35L); + (25L, Action.Reduce 35L); + (26L, Action.Reduce 35L); + (27L, Action.Reduce 35L); + (28L, Action.Reduce 35L); + (29L, Action.Reduce 35L); + (30L, Action.Reduce 35L); + (31L, Action.Reduce 35L); + (32L, Action.Reduce 35L); + (33L, Action.Reduce 35L); + (34L, Action.Reduce 35L); + (35L, Action.Reduce 35L); + (36L, Action.Reduce 35L); + (37L, Action.Reduce 35L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 98 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:98L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 8L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 0L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [22L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 7L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.ShiftPrefix 78L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (39L, 110L); + (43L, 111L); + ] + ); + (* 99 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:99L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 13L prods) ~dot:3L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (24L, Action.Reduce 13L); + (26L, Action.Reduce 13L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 100 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:100L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 47L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (20L, Action.Reduce 47L); + (23L, Action.Reduce 47L); + (24L, Action.Reduce 47L); + (26L, Action.Reduce 47L); + (28L, Action.Reduce 47L); + (30L, Action.Reduce 47L); + (32L, Action.Reduce 47L); + (34L, Action.Reduce 47L); + (36L, Action.Reduce 47L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 101 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:101L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 48L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 23L; 24L; 26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (20L, Action.Reduce 48L); + (23L, Action.Reduce 48L); + (24L, Action.Reduce 48L); + (26L, Action.Reduce 48L); + (28L, Action.Reduce 48L); + (30L, Action.Reduce 48L); + (32L, Action.Reduce 48L); + (34L, Action.Reduce 48L); + (36L, Action.Reduce 48L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 102 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:102L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 17L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [15L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 0L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [15L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.ShiftPrefix 78L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (39L, 112L); + ] + ); + (* 103 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:103L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 14L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 15L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 1L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [18L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (12L, Action.ShiftPrefix 68L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (40L, 113L); + ] + ); + (* 104 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:104L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 73L prods) ~dot:3L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 17L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [15L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 18L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [15L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (10L, Action.ShiftPrefix 102L); + (15L, Action.Reduce 18L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (49L, 114L); + ] + ); + (* 105 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:105L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 72L prods) ~dot:3L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (15L, Action.ShiftPrefix 115L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 106 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:106L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 78L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 78L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 79L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (24L, Action.ShiftPrefix 85L); + (26L, Action.Reduce 79L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (74L, 116L); + ] + ); + (* 107 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:107L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 15L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (10L, Action.Reduce 15L); + (24L, Action.Reduce 15L); + (26L, Action.Reduce 15L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 108 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:108L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 21L prods) ~dot:4L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 17L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 18L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (10L, Action.ShiftPrefix 102L); + (24L, Action.Reduce 18L); + (26L, Action.Reduce 18L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (49L, 117L); + ] + ); + (* 109 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:109L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 25L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 22L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 25L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 23L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 25L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 24L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 21L; 22L; 25L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 25L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 26L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (20L, Action.ShiftPrefix 10L); + (23L, Action.ShiftPrefix 13L); + (24L, Action.ShiftPrefix 14L); + (26L, Action.Reduce 26L); + (28L, Action.Reduce 26L); + (30L, Action.Reduce 26L); + (32L, Action.Reduce 26L); + (34L, Action.Reduce 26L); + (36L, Action.Reduce 26L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (52L, 91L); + (53L, 118L); + ] + ); + (* 110 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:110L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 7L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 5L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 6L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (22L, Action.ShiftPrefix 119L); + (24L, Action.Reduce 6L); + (26L, Action.Reduce 6L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (42L, 120L); + ] + ); + (* 111 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:111L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 8L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (24L, Action.Reduce 8L); + (26L, Action.Reduce 8L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 112 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:112L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 17L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [15L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (15L, Action.Reduce 17L); + (19L, Action.Reduce 17L); + (20L, Action.Reduce 17L); + (24L, Action.Reduce 17L); + (26L, Action.Reduce 17L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 113 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:113L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 14L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 15L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (18L, Action.ShiftPrefix 121L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 114 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:114L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 73L prods) ~dot:4L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (15L, Action.ShiftPrefix 122L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 115 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:115L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 72L prods) ~dot:4L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 0L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 1L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 17L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 2L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 3L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 4L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 52L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 53L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 54L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 55L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 58L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 59L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 60L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 61L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 64L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 65L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (4L, Action.ShiftPrefix 123L); + (11L, Action.ShiftPrefix 78L); + (12L, Action.ShiftPrefix 68L); + (13L, Action.ShiftPrefix 124L); + (14L, Action.ShiftPrefix 125L); + (20L, Action.ShiftPrefix 126L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (39L, 127L); + (40L, 128L); + (41L, 129L); + (60L, 130L); + (61L, 131L); + (63L, 132L); + (64L, 133L); + (65L, 134L); + (67L, 135L); + ] + ); + (* 116 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:116L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 78L prods) ~dot:3L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (26L, Action.Reduce 78L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 117 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:117L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 21L prods) ~dot:5L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (24L, Action.Reduce 21L); + (26L, Action.Reduce 21L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 118 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:118L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 25L prods) ~dot:3L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [26L; 28L; 30L; 32L; 34L; 36L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (26L, Action.Reduce 25L); + (28L, Action.Reduce 25L); + (30L, Action.Reduce 25L); + (32L, Action.Reduce 25L); + (34L, Action.Reduce 25L); + (36L, Action.Reduce 25L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 119 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:119L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 5L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 0L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [22L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.ShiftPrefix 78L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (39L, 136L); + ] + ); + (* 120 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:120L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 7L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (24L, Action.Reduce 7L); + (26L, Action.Reduce 7L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 121 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:121L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 14L prods) ~dot:3L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 15L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 0L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 15L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.ShiftPrefix 78L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (39L, 137L); + ] + ); + (* 122 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:122L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 73L prods) ~dot:5L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 0L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 1L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 17L; 19L; 20L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 2L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 3L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 4L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 52L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 53L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 54L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 55L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 58L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 19L; 20L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 59L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 19L; 20L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 60L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 19L; 20L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 61L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L; 20L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 64L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 65L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 66L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 69L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (4L, Action.ShiftPrefix 123L); + (11L, Action.ShiftPrefix 78L); + (12L, Action.ShiftPrefix 68L); + (13L, Action.ShiftPrefix 124L); + (14L, Action.ShiftPrefix 125L); + (20L, Action.ShiftPrefix 126L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (39L, 127L); + (40L, 128L); + (41L, 129L); + (60L, 130L); + (61L, 131L); + (63L, 132L); + (64L, 133L); + (65L, 134L); + (67L, 138L); + (68L, 139L); + (70L, 140L); + ] + ); + (* 123 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:123L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 60L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (10L, Action.Reduce 60L); + (19L, Action.Reduce 60L); + (20L, Action.Reduce 60L); + (24L, Action.Reduce 60L); + (26L, Action.Reduce 60L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 124 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:124L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 4L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (17L, Action.Reduce 4L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 125 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:125L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 53L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (10L, Action.Reduce 53L); + (11L, Action.Reduce 53L); + (12L, Action.Reduce 53L); + (13L, Action.Reduce 53L); + (14L, Action.Reduce 53L); + (19L, Action.Reduce 53L); + (20L, Action.Reduce 53L); + (24L, Action.Reduce 53L); + (26L, Action.Reduce 53L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 126 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:126L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 64L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 0L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 1L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 17L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 2L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 3L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 4L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 52L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 53L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 54L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 55L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 58L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 59L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 60L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 61L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (4L, Action.ShiftPrefix 123L); + (11L, Action.ShiftPrefix 78L); + (12L, Action.ShiftPrefix 68L); + (13L, Action.ShiftPrefix 124L); + (14L, Action.ShiftPrefix 125L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (39L, 127L); + (40L, 128L); + (41L, 129L); + (60L, 130L); + (61L, 131L); + (63L, 132L); + (64L, 133L); + (65L, 141L); + ] + ); + (* 127 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:127L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 2L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (17L, Action.Reduce 2L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 128 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:128L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 3L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 52L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (10L, Action.Reduce 52L); + (11L, Action.Reduce 52L); + (12L, Action.Reduce 52L); + (13L, Action.Reduce 52L); + (14L, Action.Reduce 52L); + (17L, Action.Reduce 3L); + (19L, Action.Reduce 52L); + (20L, Action.Reduce 52L); + (24L, Action.Reduce 52L); + (26L, Action.Reduce 52L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 129 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:129L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 54L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (17L, Action.ShiftPrefix 142L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 130 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:130L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 55L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (10L, Action.Reduce 55L); + (11L, Action.Reduce 55L); + (12L, Action.Reduce 55L); + (13L, Action.Reduce 55L); + (14L, Action.Reduce 55L); + (19L, Action.Reduce 55L); + (20L, Action.Reduce 55L); + (24L, Action.Reduce 55L); + (26L, Action.Reduce 55L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 131 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:131L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 58L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 0L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 1L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 17L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 2L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 3L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 4L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 52L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 53L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 54L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 55L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 56L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 57L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (10L, Action.Reduce 57L); + (11L, Action.ShiftPrefix 78L); + (12L, Action.ShiftPrefix 68L); + (13L, Action.ShiftPrefix 124L); + (14L, Action.ShiftPrefix 125L); + (19L, Action.Reduce 57L); + (20L, Action.Reduce 57L); + (24L, Action.Reduce 57L); + (26L, Action.Reduce 57L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (39L, 127L); + (40L, 128L); + (41L, 129L); + (60L, 130L); + (61L, 143L); + (62L, 144L); + ] + ); + (* 132 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:132L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 59L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (10L, Action.Reduce 59L); + (19L, Action.Reduce 59L); + (20L, Action.Reduce 59L); + (24L, Action.Reduce 59L); + (26L, Action.Reduce 59L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 133 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:133L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 61L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 17L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 18L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (10L, Action.ShiftPrefix 102L); + (19L, Action.Reduce 18L); + (20L, Action.Reduce 18L); + (24L, Action.Reduce 18L); + (26L, Action.Reduce 18L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (49L, 145L); + ] + ); + (* 134 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:134L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 65L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 62L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 63L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (19L, Action.Reduce 63L); + (20L, Action.ShiftPrefix 146L); + (24L, Action.Reduce 63L); + (26L, Action.Reduce 63L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (66L, 147L); + ] + ); + (* 135 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:135L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 72L prods) ~dot:5L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (24L, Action.Reduce 72L); + (26L, Action.Reduce 72L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 136 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:136L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 5L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 5L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 6L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (22L, Action.ShiftPrefix 119L); + (24L, Action.Reduce 6L); + (26L, Action.Reduce 6L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (42L, 148L); + ] + ); + (* 137 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:137L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 14L prods) ~dot:4L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 15L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (10L, Action.Reduce 14L); + (15L, Action.Reduce 14L); + (24L, Action.Reduce 14L); + (26L, Action.Reduce 14L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 138 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:138L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 66L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (19L, Action.ShiftPrefix 149L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 139 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:139L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 69L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 67L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 68L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (20L, Action.ShiftPrefix 150L); + (24L, Action.Reduce 68L); + (26L, Action.Reduce 68L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (69L, 151L); + ] + ); + (* 140 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:140L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 73L prods) ~dot:6L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (24L, Action.Reduce 73L); + (26L, Action.Reduce 73L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 141 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:141L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 64L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 62L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 63L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (19L, Action.Reduce 63L); + (20L, Action.ShiftPrefix 146L); + (24L, Action.Reduce 63L); + (26L, Action.Reduce 63L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (66L, 152L); + ] + ); + (* 142 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:142L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 54L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 1L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 52L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 53L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (12L, Action.ShiftPrefix 68L); + (14L, Action.ShiftPrefix 125L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (40L, 153L); + (60L, 154L); + ] + ); + (* 143 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:143L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 56L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 0L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 1L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 17L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 2L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 3L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 4L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 52L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 53L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 54L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 55L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 56L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 57L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (10L, Action.Reduce 57L); + (11L, Action.ShiftPrefix 78L); + (12L, Action.ShiftPrefix 68L); + (13L, Action.ShiftPrefix 124L); + (14L, Action.ShiftPrefix 125L); + (19L, Action.Reduce 57L); + (20L, Action.Reduce 57L); + (24L, Action.Reduce 57L); + (26L, Action.Reduce 57L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (39L, 127L); + (40L, 128L); + (41L, 129L); + (60L, 130L); + (61L, 143L); + (62L, 155L); + ] + ); + (* 144 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:144L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 58L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (10L, Action.Reduce 58L); + (19L, Action.Reduce 58L); + (20L, Action.Reduce 58L); + (24L, Action.Reduce 58L); + (26L, Action.Reduce 58L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 145 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:145L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 61L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (19L, Action.Reduce 61L); + (20L, Action.Reduce 61L); + (24L, Action.Reduce 61L); + (26L, Action.Reduce 61L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 146 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:146L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 62L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 0L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 1L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 17L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 2L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 3L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 4L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 52L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 53L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 54L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 55L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 58L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 59L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 60L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 61L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (4L, Action.ShiftPrefix 123L); + (11L, Action.ShiftPrefix 78L); + (12L, Action.ShiftPrefix 68L); + (13L, Action.ShiftPrefix 124L); + (14L, Action.ShiftPrefix 125L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (39L, 127L); + (40L, 128L); + (41L, 129L); + (60L, 130L); + (61L, 131L); + (63L, 132L); + (64L, 133L); + (65L, 156L); + ] + ); + (* 147 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:147L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 65L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (19L, Action.Reduce 65L); + (24L, Action.Reduce 65L); + (26L, Action.Reduce 65L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 148 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:148L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 5L prods) ~dot:3L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (24L, Action.Reduce 5L); + (26L, Action.Reduce 5L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 149 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:149L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 66L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 30L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 31L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 32L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 33L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 34L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 35L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 36L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 37L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 38L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 39L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 40L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 41L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 42L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 43L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 44L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 45L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 46L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [11L; 12L; 13L; 14L; 16L; 17L; 18L; 19L; 20L; 21L; 22L; 24L; 25L; 26L; 27L; 29L; 31L; 33L; 35L; 37L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 50L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 51L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (11L, Action.ShiftPrefix 2L); + (12L, Action.ShiftPrefix 3L); + (13L, Action.ShiftPrefix 4L); + (14L, Action.ShiftPrefix 5L); + (16L, Action.ShiftPrefix 6L); + (17L, Action.ShiftPrefix 7L); + (18L, Action.ShiftPrefix 8L); + (19L, Action.ShiftPrefix 9L); + (21L, Action.ShiftPrefix 11L); + (22L, Action.ShiftPrefix 12L); + (25L, Action.ShiftPrefix 50L); + (27L, Action.ShiftPrefix 51L); + (29L, Action.ShiftPrefix 52L); + (31L, Action.ShiftPrefix 53L); + (33L, Action.ShiftPrefix 54L); + (35L, Action.ShiftPrefix 55L); + (37L, Action.ShiftPrefix 27L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (56L, 59L); + (57L, 60L); + (59L, 157L); + ] + ); + (* 150 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:150L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 67L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 0L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 1L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 17L; 19L; 20L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 2L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 3L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 4L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [17L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 52L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 53L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 54L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 55L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 58L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 19L; 20L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 59L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 19L; 20L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 60L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 19L; 20L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 61L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L; 20L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 64L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 65L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 66L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (4L, Action.ShiftPrefix 123L); + (11L, Action.ShiftPrefix 78L); + (12L, Action.ShiftPrefix 68L); + (13L, Action.ShiftPrefix 124L); + (14L, Action.ShiftPrefix 125L); + (20L, Action.ShiftPrefix 126L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (39L, 127L); + (40L, 128L); + (41L, 129L); + (60L, 130L); + (61L, 131L); + (63L, 132L); + (64L, 133L); + (65L, 134L); + (67L, 138L); + (68L, 158L); + ] + ); + (* 151 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:151L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 69L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (24L, Action.Reduce 69L); + (26L, Action.Reduce 69L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 152 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:152L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 64L prods) ~dot:3L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (19L, Action.Reduce 64L); + (24L, Action.Reduce 64L); + (26L, Action.Reduce 64L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 153 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:153L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 52L prods) ~dot:1L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (10L, Action.Reduce 52L); + (11L, Action.Reduce 52L); + (12L, Action.Reduce 52L); + (13L, Action.Reduce 52L); + (14L, Action.Reduce 52L); + (19L, Action.Reduce 52L); + (20L, Action.Reduce 52L); + (24L, Action.Reduce 52L); + (26L, Action.Reduce 52L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 154 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:154L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 54L prods) ~dot:3L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 11L; 12L; 13L; 14L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (10L, Action.Reduce 54L); + (11L, Action.Reduce 54L); + (12L, Action.Reduce 54L); + (13L, Action.Reduce 54L); + (14L, Action.Reduce 54L); + (19L, Action.Reduce 54L); + (20L, Action.Reduce 54L); + (24L, Action.Reduce 54L); + (26L, Action.Reduce 54L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 155 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:155L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 56L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [10L; 19L; 20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (10L, Action.Reduce 56L); + (19L, Action.Reduce 56L); + (20L, Action.Reduce 56L); + (24L, Action.Reduce 56L); + (26L, Action.Reduce 56L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 156 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:156L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 62L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 62L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L; 24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 63L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (19L, Action.Reduce 63L); + (20L, Action.ShiftPrefix 146L); + (24L, Action.Reduce 63L); + (26L, Action.Reduce 63L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (66L, 159L); + ] + ); + (* 157 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:157L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 66L prods) ~dot:3L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [20L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (20L, Action.Reduce 66L); + (24L, Action.Reduce 66L); + (26L, Action.Reduce 66L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 158 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:158L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 67L prods) ~dot:2L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 67L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ( + let lr0item = Lr0Item.init ~prod:(Array.get 68L prods) ~dot:0L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (20L, Action.ShiftPrefix 150L); + (24L, Action.Reduce 68L); + (26L, Action.Reduce 68L); + ] + ) + ~gotos:( + Map.of_alist (module Uns) [ + (69L, 160L); + ] + ); + (* 159 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:159L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 62L prods) ~dot:3L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [19L; 24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (19L, Action.Reduce 62L); + (24L, Action.Reduce 62L); + (26L, Action.Reduce 62L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + (* 160 *) State.init + ~lr1ItemsetClosure:( + Lr1ItemsetClosure.init + ~index:160L + ~kernel:( + Lr1Itemset.init [ + ( + let lr0item = Lr0Item.init ~prod:(Array.get 67L prods) ~dot:3L in + let lr1item = Lr1Item.init ~lr0item ~follow:( + Ordset.of_list (module Uns) [24L; 26L] + ) in + lr0item, lr1item + ); + ] + ) + ~added:( + Lr1Itemset.empty + ) + ) + ~actions:( + Map.of_alist (module Uns) [ + (24L, Action.Reduce 67L); + (26L, Action.Reduce 67L); + ] + ) + ~gotos:( + Map.empty (module Uns) + ); + |] + end + + module Token = struct + module T = struct + type t = + | EPSILON (* "ε" *) + | PSEUDO_END (* "⊥" *) + | HOCC of X.token_hocc (* "hocc" *) + | NONTERM of X.token_nonterm (* "nonterm" *) + | EPSILON_ of X.token_epsilon (* "epsilon" *) + | START of X.token_start (* "start" *) + | TOKEN of X.token_token (* "token" *) + | NEUTRAL of X.token_neutral (* "neutral" *) + | LEFT of X.token_left (* "left" *) + | RIGHT of X.token_right (* "right" *) + | PREC of X.token_prec (* "prec" *) + | UIDENT of X.token_uident + | CIDENT of X.token_cident + | USCORE of X.token_uscore (* "_" *) + | ISTRING of X.token_istring + | COLON_COLON_EQ of X.token_colon_colon_eq (* "::=" *) + | OF of X.token_of (* "of" *) + | COLON of X.token_colon (* ":" *) + | DOT of X.token_dot (* "." *) + | ARROW of X.token_arrow (* "->" *) + | BAR of X.token_bar (* "|" *) + | LT of X.token_lt (* "<" *) + | COMMA of X.token_comma (* "," *) + | SEMI of X.token_semi (* ";" *) + | LINE_DELIM of X.token_line_delim + | INDENT of X.token_indent + | DEDENT of X.token_dedent + | LPAREN of X.token_lparen (* "(" *) + | RPAREN of X.token_rparen (* ")" *) + | LCAPTURE of X.token_lcapture (* "(|" *) + | RCAPTURE of X.token_rcapture (* "|)" *) + | LBRACK of X.token_lbrack (* "[" *) + | RBRACK of X.token_rbrack (* "]" *) + | LARRAY of X.token_larray (* "[|" *) + | RARRAY of X.token_rarray (* "|]" *) + | LCURLY of X.token_lcurly (* "{" *) + | RCURLY of X.token_rcurly (* "}" *) + | OTHER_TOKEN of X.token_other_token + | EOI of X.token_eoi + + let index = function + | EPSILON -> 0L + | PSEUDO_END -> 1L + | HOCC _ -> 2L + | NONTERM _ -> 3L + | EPSILON_ _ -> 4L + | START _ -> 5L + | TOKEN _ -> 6L + | NEUTRAL _ -> 7L + | LEFT _ -> 8L + | RIGHT _ -> 9L + | PREC _ -> 10L + | UIDENT _ -> 11L + | CIDENT _ -> 12L + | USCORE _ -> 13L + | ISTRING _ -> 14L + | COLON_COLON_EQ _ -> 15L + | OF _ -> 16L + | COLON _ -> 17L + | DOT _ -> 18L + | ARROW _ -> 19L + | BAR _ -> 20L + | LT _ -> 21L + | COMMA _ -> 22L + | SEMI _ -> 23L + | LINE_DELIM _ -> 24L + | INDENT _ -> 25L + | DEDENT _ -> 26L + | LPAREN _ -> 27L + | RPAREN _ -> 28L + | LCAPTURE _ -> 29L + | RCAPTURE _ -> 30L + | LBRACK _ -> 31L + | RBRACK _ -> 32L + | LARRAY _ -> 33L + | RARRAY _ -> 34L + | LCURLY _ -> 35L + | RCURLY _ -> 36L + | OTHER_TOKEN _ -> 37L + | EOI _ -> 38L + + let hash_fold t state = + state |> Uns.hash_fold (index t) + + let cmp t0 t1 = + Uns.cmp (index t0) (index t1) + + let spec t = + Array.get (index t) Spec.symbols + + let pp t formatter = + formatter + |> Spec.Symbol.pp (spec t) + end + include T + include Identifiable.Make(T) + end + + module Nonterm = struct + module T = struct + type t = + | Uident of X.nonterm_uident + | Cident of X.nonterm_cident + | Ident of X.nonterm_ident + | PrecsTl of X.nonterm_precs_tl + | Precs of X.nonterm_precs + | PrecRels of X.nonterm_prec_rels + | PrecType of X.nonterm_prec_type + | Prec of X.nonterm_prec + | OfType of X.nonterm_of_type + | OfType0 of X.nonterm_of_type0 + | PrecRef of X.nonterm_prec_ref + | TokenAlias of X.nonterm_token_alias + | Token of X.nonterm_token + | Sep of X.nonterm_sep + | CodesTl of X.nonterm_codes_tl + | Codes of X.nonterm_codes + | Codes0 of X.nonterm_codes0 + | Delimited of X.nonterm_delimited + | CodeToken of X.nonterm_code_token + | CodeTl of X.nonterm_code_tl + | Code of X.nonterm_code + | ProdParamSymbol of X.nonterm_prod_param_symbol + | ProdParam of X.nonterm_prod_param + | ProdParamsTl of X.nonterm_prod_params_tl + | ProdParams of X.nonterm_prod_params + | ProdPattern of X.nonterm_prod_pattern + | Prod of X.nonterm_prod + | ProdsTl of X.nonterm_prods_tl + | Prods of X.nonterm_prods + | Reduction of X.nonterm_reduction + | ReductionsTl of X.nonterm_reductions_tl + | Reductions of X.nonterm_reductions + | NontermType of X.nonterm_nonterm_type + | Nonterm of X.nonterm_nonterm + | Stmt of X.nonterm_stmt + | StmtsTl of X.nonterm_stmts_tl + | Stmts of X.nonterm_stmts + | Hocc of X.nonterm_hocc + | MatterToken of X.nonterm_matter_token + | Matter of X.nonterm_matter + | Hmh of X.nonterm_hmh + | Hmh' of X.nonterm_hmh + | Hmhi of X.nonterm_hmhi + | Hmhi' of X.nonterm_hmhi + + let index = function + | Uident _ -> 39L + | Cident _ -> 40L + | Ident _ -> 41L + | PrecsTl _ -> 42L + | Precs _ -> 43L + | PrecRels _ -> 44L + | PrecType _ -> 45L + | Prec _ -> 46L + | OfType _ -> 47L + | OfType0 _ -> 48L + | PrecRef _ -> 49L + | TokenAlias _ -> 50L + | Token _ -> 51L + | Sep _ -> 52L + | CodesTl _ -> 53L + | Codes _ -> 54L + | Codes0 _ -> 55L + | Delimited _ -> 56L + | CodeToken _ -> 57L + | CodeTl _ -> 58L + | Code _ -> 59L + | ProdParamSymbol _ -> 60L + | ProdParam _ -> 61L + | ProdParamsTl _ -> 62L + | ProdParams _ -> 63L + | ProdPattern _ -> 64L + | Prod _ -> 65L + | ProdsTl _ -> 66L + | Prods _ -> 67L + | Reduction _ -> 68L + | ReductionsTl _ -> 69L + | Reductions _ -> 70L + | NontermType _ -> 71L + | Nonterm _ -> 72L + | Stmt _ -> 73L + | StmtsTl _ -> 74L + | Stmts _ -> 75L + | Hocc _ -> 76L + | MatterToken _ -> 77L + | Matter _ -> 78L + | Hmh _ -> 79L + | Hmh' _ -> 80L + | Hmhi _ -> 81L + | Hmhi' _ -> 82L + + let hash_fold t state = + state |> Uns.hash_fold (index t) + + let cmp t0 t1 = + Uns.cmp (index t0) (index t1) + + let spec t = + Array.get (index t) Spec.symbols + + let pp t formatter = + formatter + |> Spec.Symbol.pp (spec t) + end + include T + include Identifiable.Make(T) + end + + module Symbol = struct + module T = struct + type t = + | Token of Token.t + | Nonterm of Nonterm.t + + let index = function + | Token token -> Token.index token + | Nonterm nonterm -> Nonterm.index nonterm + + let hash_fold t state = + state |> Uns.hash_fold (index t) + + let cmp t0 t1 = + Uns.cmp (index t0) (index t1) + + let spec = function + | Token token -> Token.spec token + | Nonterm nonterm -> Nonterm.spec nonterm + + let pp t formatter = + formatter + |> Spec.Symbol.pp (spec t) + end + include T + include Identifiable.Make(T) + end + + module State = struct + module T = struct + type t = uns + + let hash_fold t state = + state |> Uns.hash_fold t + + let cmp t0 t1 = + Uns.cmp t0 t1 + + let spec t = + Array.get t Spec.states + + let pp t formatter = + formatter |> Uns.pp t + end + include T + include Identifiable.Make(T) + + let init state_index = + state_index + end + + module Stack = struct + module Elm = struct + module T = struct + type t = { + symbol: Symbol.t; + state: State.t; + } + + let hash_fold {symbol; state} hash_state = + hash_state + |> Symbol.hash_fold symbol + |> State.hash_fold state + + let cmp {symbol=symbol0; state=state0} {symbol=symbol1; state=state1} = + let open Cmp in + match State.cmp state0 state1 with + | Lt -> Lt + | Eq -> Symbol.cmp symbol0 symbol1 + | Gt -> Gt + + let pp {symbol; state} formatter = + formatter + |> Fmt.fmt "{symbol=" |> Symbol.pp symbol + |> Fmt.fmt "; state=" |> State.pp state + |> Fmt.fmt "}" + end + include T + include Identifiable.Make(T) + + let init ~symbol ~state = + {symbol; state} + end + + type t = Elm.t list + + let fmt ?(alt=false) ?(width=0L) t formatter = + formatter |> List.fmt ~alt ~width Elm.pp t + + let pp t formatter = + formatter |> fmt t + + module Reduction = struct + module T = struct + type stack = t + type t = uns + type callback = stack -> Symbol.t * stack + + let hash_fold t state = + state |> Uns.hash_fold t + + let cmp t0 t1 = + Uns.cmp t0 t1 + + let pp t formatter = + formatter |> Uns.pp t + end + include T + include Identifiable.Make(T) + + let callbacks = [| + (* 0 *) (function + | Elm.{symbol=Symbol.Token (UIDENT uident); _} + :: tl -> Symbol.Nonterm (Uident ( + (*______________________________________________________________________________*) +#309 "./ParseLR.hmh" +let X.(UIDENT {token_=uident}) = uident in + Uident {uident} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 1 *) (function + | Elm.{symbol=Symbol.Token (CIDENT cident); _} + :: tl -> Symbol.Nonterm (Cident ( + (*______________________________________________________________________________*) +#314 "./ParseLR.hmh" +let X.(CIDENT {token_=cident}) = cident in + Cident {cident} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 2 *) (function + | Elm.{symbol=Symbol.Nonterm (Uident uident); _} + :: tl -> Symbol.Nonterm (Ident ( + (*______________________________________________________________________________*) +#318 "./ParseLR.hmh" +IdentUident {uident} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 3 *) (function + | Elm.{symbol=Symbol.Nonterm (Cident cident); _} + :: tl -> Symbol.Nonterm (Ident ( + (*______________________________________________________________________________*) +#319 "./ParseLR.hmh" +IdentCident {cident} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 4 *) (function + | Elm.{symbol=Symbol.Token (USCORE uscore); _} + :: tl -> Symbol.Nonterm (Ident ( + (*______________________________________________________________________________*) +#321 "./ParseLR.hmh" +let X.(USCORE {token_=uscore}) = uscore in + IdentUscore {uscore} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 5 *) (function + | Elm.{symbol=Symbol.Nonterm (PrecsTl precs_tl); _} + :: Elm.{symbol=Symbol.Nonterm (Uident uident); _} + :: Elm.{symbol=Symbol.Token (COMMA comma); _} + :: tl -> Symbol.Nonterm (PrecsTl ( + (*______________________________________________________________________________*) +#326 "./ParseLR.hmh" +let X.(COMMA {token_=comma}) = comma in + PrecsTlCommaUident {comma; uident; precs_tl} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 6 *) (function + tl -> Symbol.Nonterm (PrecsTl ( + (*______________________________________________________________________________*) +#328 "./ParseLR.hmh" +PrecsTlEpsilon + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + ); + (* 7 *) (function + | Elm.{symbol=Symbol.Nonterm (PrecsTl precs_tl); _} + :: Elm.{symbol=Symbol.Nonterm (Uident uident); _} + :: tl -> Symbol.Nonterm (Precs ( + (*______________________________________________________________________________*) +#331 "./ParseLR.hmh" +Precs {uident; precs_tl} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 8 *) (function + | Elm.{symbol=Symbol.Nonterm (Precs precs); _} + :: Elm.{symbol=Symbol.Token (LT lt); _} + :: tl -> Symbol.Nonterm (PrecRels ( + (*______________________________________________________________________________*) +#335 "./ParseLR.hmh" +let X.(LT {token_=lt}) = lt in + PrecRelsLtPrecs {lt; precs} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 9 *) (function + tl -> Symbol.Nonterm (PrecRels ( + (*______________________________________________________________________________*) +#337 "./ParseLR.hmh" +PrecRelsEpsilon + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + ); + (* 10 *) (function + | Elm.{symbol=Symbol.Token (NEUTRAL neutral_); _} + :: tl -> Symbol.Nonterm (PrecType ( + (*______________________________________________________________________________*) +#341 "./ParseLR.hmh" +let X.(NEUTRAL {token_=neutral_}) = neutral_ in + PrecTypeNeutral {neutral_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 11 *) (function + | Elm.{symbol=Symbol.Token (LEFT left_); _} + :: tl -> Symbol.Nonterm (PrecType ( + (*______________________________________________________________________________*) +#344 "./ParseLR.hmh" +let X.(LEFT {token_=left_}) = left_ in + PrecTypeLeft {left_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 12 *) (function + | Elm.{symbol=Symbol.Token (RIGHT right_); _} + :: tl -> Symbol.Nonterm (PrecType ( + (*______________________________________________________________________________*) +#347 "./ParseLR.hmh" +let X.(RIGHT {token_=right_}) = right_ in + PrecTypeRight {right_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 13 *) (function + | Elm.{symbol=Symbol.Nonterm (PrecRels prec_rels); _} + :: Elm.{symbol=Symbol.Nonterm (Uident uident); _} + :: Elm.{symbol=Symbol.Nonterm (PrecType prec_type); _} + :: tl -> Symbol.Nonterm (Prec ( + (*______________________________________________________________________________*) +#351 "./ParseLR.hmh" +Prec {prec_type; uident; prec_rels} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 14 *) (function + | Elm.{symbol=Symbol.Nonterm (Uident type_type); _} + :: Elm.{symbol=Symbol.Token (DOT dot); _} + :: Elm.{symbol=Symbol.Nonterm (Cident type_module); _} + :: Elm.{symbol=Symbol.Token (OF of_); _} + :: tl -> Symbol.Nonterm (OfType ( + (*______________________________________________________________________________*) +#355 "./ParseLR.hmh" +let X.(OF {token_=of_}) = of_ in + let X.(DOT {token_=dot}) = dot in + OfType {of_; type_module; dot; type_type} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 15 *) (function + | Elm.{symbol=Symbol.Nonterm (OfType of_type); _} + :: tl -> Symbol.Nonterm (OfType0 ( + (*______________________________________________________________________________*) +#360 "./ParseLR.hmh" +OfType0OfType {of_type} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 16 *) (function + tl -> Symbol.Nonterm (OfType0 ( + (*______________________________________________________________________________*) +#361 "./ParseLR.hmh" +OfType0Epsilon + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + ); + (* 17 *) (function + | Elm.{symbol=Symbol.Nonterm (Uident uident); _} + :: Elm.{symbol=Symbol.Token (PREC prec_); _} + :: tl -> Symbol.Nonterm (PrecRef ( + (*______________________________________________________________________________*) +#365 "./ParseLR.hmh" +let X.(PREC {token_=prec_}) = prec_ in + PrecRefPrecUident {prec_; uident} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 18 *) (function + tl -> Symbol.Nonterm (PrecRef ( + (*______________________________________________________________________________*) +#367 "./ParseLR.hmh" +PrecRefEpsilon + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + ); + (* 19 *) (function + | Elm.{symbol=Symbol.Token (ISTRING alias); _} + :: tl -> Symbol.Nonterm (TokenAlias ( + (*______________________________________________________________________________*) +#371 "./ParseLR.hmh" +let X.(ISTRING {token_=alias}) = alias in + TokenAlias {alias} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 20 *) (function + tl -> Symbol.Nonterm (TokenAlias ( + (*______________________________________________________________________________*) +#373 "./ParseLR.hmh" +TokenAliasEpsilon + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + ); + (* 21 *) (function + | Elm.{symbol=Symbol.Nonterm (PrecRef prec_ref); _} + :: Elm.{symbol=Symbol.Nonterm (OfType0 of_type0); _} + :: Elm.{symbol=Symbol.Nonterm (TokenAlias token_alias); _} + :: Elm.{symbol=Symbol.Nonterm (Cident cident); _} + :: Elm.{symbol=Symbol.Token (TOKEN token_); _} + :: tl -> Symbol.Nonterm (Token ( + (*______________________________________________________________________________*) +#377 "./ParseLR.hmh" +let X.(TOKEN {token_}) = token_ in + Token {token_; cident; token_alias; of_type0; prec_ref} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 22 *) (function + | Elm.{symbol=Symbol.Token (LINE_DELIM line_delim); _} + :: tl -> Symbol.Nonterm (Sep ( + (*______________________________________________________________________________*) +#382 "./ParseLR.hmh" +let X.(LINE_DELIM {token_=line_delim}) = line_delim in + SepLineDelim {line_delim} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 23 *) (function + | Elm.{symbol=Symbol.Token (SEMI semi); _} + :: tl -> Symbol.Nonterm (Sep ( + (*______________________________________________________________________________*) +#385 "./ParseLR.hmh" +let X.(SEMI {token_=semi}) = semi in + SepSemi {semi} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 24 *) (function + | Elm.{symbol=Symbol.Token (BAR bar); _} + :: tl -> Symbol.Nonterm (Sep ( + (*______________________________________________________________________________*) +#388 "./ParseLR.hmh" +let X.(BAR {token_=bar}) = bar in + SepBar {bar} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 25 *) (function + | Elm.{symbol=Symbol.Nonterm (CodesTl codes_tl); _} + :: Elm.{symbol=Symbol.Nonterm (Code code); _} + :: Elm.{symbol=Symbol.Nonterm (Sep sep); _} + :: tl -> Symbol.Nonterm (CodesTl ( + (*______________________________________________________________________________*) +#392 "./ParseLR.hmh" +CodesTlSepCode {sep; code; codes_tl} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 26 *) (function + tl -> Symbol.Nonterm (CodesTl ( + (*______________________________________________________________________________*) +#393 "./ParseLR.hmh" +CodesTlEpsilon + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + ); + (* 27 *) (function + | Elm.{symbol=Symbol.Nonterm (CodesTl codes_tl); _} + :: Elm.{symbol=Symbol.Nonterm (Code code); _} + :: tl -> Symbol.Nonterm (Codes ( + (*______________________________________________________________________________*) +#396 "./ParseLR.hmh" +Codes {code; codes_tl} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 28 *) (function + | Elm.{symbol=Symbol.Nonterm (Codes codes); _} + :: tl -> Symbol.Nonterm (Codes0 ( + (*______________________________________________________________________________*) +#399 "./ParseLR.hmh" +Codes0Codes {codes} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 29 *) (function + tl -> Symbol.Nonterm (Codes0 ( + (*______________________________________________________________________________*) +#400 "./ParseLR.hmh" +Codes0Epsilon + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + ); + (* 30 *) (function + | Elm.{symbol=Symbol.Token (DEDENT dedent); _} + :: Elm.{symbol=Symbol.Nonterm (Codes codes); _} + :: Elm.{symbol=Symbol.Token (INDENT indent); _} + :: tl -> Symbol.Nonterm (Delimited ( + (*______________________________________________________________________________*) +#404 "./ParseLR.hmh" +let X.(INDENT {token_=indent}) = indent in + let X.(DEDENT {token_=dedent}) = dedent in + DelimitedBlock {indent; codes; dedent} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 31 *) (function + | Elm.{symbol=Symbol.Token (RPAREN rparen); _} + :: Elm.{symbol=Symbol.Nonterm (Codes0 codes0); _} + :: Elm.{symbol=Symbol.Token (LPAREN lparen); _} + :: tl -> Symbol.Nonterm (Delimited ( + (*______________________________________________________________________________*) +#408 "./ParseLR.hmh" +let X.(LPAREN {token_=lparen}) = lparen in + let X.(RPAREN {token_=rparen}) = rparen in + DelimitedParen {lparen; codes0; rparen} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 32 *) (function + | Elm.{symbol=Symbol.Token (RCAPTURE rcapture); _} + :: Elm.{symbol=Symbol.Nonterm (Codes0 codes0); _} + :: Elm.{symbol=Symbol.Token (LCAPTURE lcapture); _} + :: tl -> Symbol.Nonterm (Delimited ( + (*______________________________________________________________________________*) +#412 "./ParseLR.hmh" +let X.(LCAPTURE {token_=lcapture}) = lcapture in + let X.(RCAPTURE {token_=rcapture}) = rcapture in + DelimitedCapture {lcapture; codes0; rcapture} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 33 *) (function + | Elm.{symbol=Symbol.Token (RBRACK rbrack); _} + :: Elm.{symbol=Symbol.Nonterm (Codes0 codes0); _} + :: Elm.{symbol=Symbol.Token (LBRACK lbrack); _} + :: tl -> Symbol.Nonterm (Delimited ( + (*______________________________________________________________________________*) +#416 "./ParseLR.hmh" +let X.(LBRACK {token_=lbrack}) = lbrack in + let X.(RBRACK {token_=rbrack}) = rbrack in + DelimitedList {lbrack; codes0; rbrack} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 34 *) (function + | Elm.{symbol=Symbol.Token (RARRAY rarray); _} + :: Elm.{symbol=Symbol.Nonterm (Codes0 codes0); _} + :: Elm.{symbol=Symbol.Token (LARRAY larray); _} + :: tl -> Symbol.Nonterm (Delimited ( + (*______________________________________________________________________________*) +#420 "./ParseLR.hmh" +let X.(LARRAY {token_=larray}) = larray in + let X.(RARRAY {token_=rarray}) = rarray in + DelimitedArray {larray; codes0; rarray} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 35 *) (function + | Elm.{symbol=Symbol.Token (RCURLY rcurly); _} + :: Elm.{symbol=Symbol.Nonterm (Codes0 codes0); _} + :: Elm.{symbol=Symbol.Token (LCURLY lcurly); _} + :: tl -> Symbol.Nonterm (Delimited ( + (*______________________________________________________________________________*) +#424 "./ParseLR.hmh" +let X.(LCURLY {token_=lcurly}) = lcurly in + let X.(RCURLY {token_=rcurly}) = rcurly in + DelimitedModule {lcurly; codes0; rcurly} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 36 *) (function + | Elm.{symbol=Symbol.Token (OTHER_TOKEN token_); _} + :: tl -> Symbol.Nonterm (CodeToken ( + (*______________________________________________________________________________*) +#430 "./ParseLR.hmh" +let X.(OTHER_TOKEN {token_}) = token_ in + CodeToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 37 *) (function + | Elm.{symbol=Symbol.Token (UIDENT token_); _} + :: tl -> Symbol.Nonterm (CodeToken ( + (*______________________________________________________________________________*) +#433 "./ParseLR.hmh" +let X.(UIDENT {token_}) = token_ in + CodeToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 38 *) (function + | Elm.{symbol=Symbol.Token (CIDENT token_); _} + :: tl -> Symbol.Nonterm (CodeToken ( + (*______________________________________________________________________________*) +#436 "./ParseLR.hmh" +let X.(CIDENT {token_}) = token_ in + CodeToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 39 *) (function + | Elm.{symbol=Symbol.Token (USCORE token_); _} + :: tl -> Symbol.Nonterm (CodeToken ( + (*______________________________________________________________________________*) +#439 "./ParseLR.hmh" +let X.(USCORE {token_}) = token_ in + CodeToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 40 *) (function + | Elm.{symbol=Symbol.Token (ISTRING token_); _} + :: tl -> Symbol.Nonterm (CodeToken ( + (*______________________________________________________________________________*) +#442 "./ParseLR.hmh" +let X.(ISTRING {token_}) = token_ in + CodeToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 41 *) (function + | Elm.{symbol=Symbol.Token (OF token_); _} + :: tl -> Symbol.Nonterm (CodeToken ( + (*______________________________________________________________________________*) +#445 "./ParseLR.hmh" +let X.(OF {token_}) = token_ in + CodeToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 42 *) (function + | Elm.{symbol=Symbol.Token (COLON token_); _} + :: tl -> Symbol.Nonterm (CodeToken ( + (*______________________________________________________________________________*) +#448 "./ParseLR.hmh" +let X.(COLON {token_}) = token_ in + CodeToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 43 *) (function + | Elm.{symbol=Symbol.Token (DOT token_); _} + :: tl -> Symbol.Nonterm (CodeToken ( + (*______________________________________________________________________________*) +#451 "./ParseLR.hmh" +let X.(DOT {token_}) = token_ in + CodeToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 44 *) (function + | Elm.{symbol=Symbol.Token (ARROW token_); _} + :: tl -> Symbol.Nonterm (CodeToken ( + (*______________________________________________________________________________*) +#454 "./ParseLR.hmh" +let X.(ARROW {token_}) = token_ in + CodeToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 45 *) (function + | Elm.{symbol=Symbol.Token (LT token_); _} + :: tl -> Symbol.Nonterm (CodeToken ( + (*______________________________________________________________________________*) +#457 "./ParseLR.hmh" +let X.(LT {token_}) = token_ in + CodeToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 46 *) (function + | Elm.{symbol=Symbol.Token (COMMA token_); _} + :: tl -> Symbol.Nonterm (CodeToken ( + (*______________________________________________________________________________*) +#460 "./ParseLR.hmh" +let X.(COMMA {token_}) = token_ in + CodeToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 47 *) (function + | Elm.{symbol=Symbol.Nonterm (CodeTl code_tl); _} + :: Elm.{symbol=Symbol.Nonterm (Delimited delimited); _} + :: tl -> Symbol.Nonterm (CodeTl ( + (*______________________________________________________________________________*) +#464 "./ParseLR.hmh" +CodeTlDelimited {delimited; code_tl} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 48 *) (function + | Elm.{symbol=Symbol.Nonterm (CodeTl code_tl); _} + :: Elm.{symbol=Symbol.Nonterm (CodeToken code_token); _} + :: tl -> Symbol.Nonterm (CodeTl ( + (*______________________________________________________________________________*) +#466 "./ParseLR.hmh" +let X.(CodeToken {token_}) = code_token in + CodeTlToken {token_; code_tl} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 49 *) (function + tl -> Symbol.Nonterm (CodeTl ( + (*______________________________________________________________________________*) +#468 "./ParseLR.hmh" +CodeTlEpsilon + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + ); + (* 50 *) (function + | Elm.{symbol=Symbol.Nonterm (CodeTl code_tl); _} + :: Elm.{symbol=Symbol.Nonterm (Delimited delimited); _} + :: tl -> Symbol.Nonterm (Code ( + (*______________________________________________________________________________*) +#471 "./ParseLR.hmh" +CodeDelimited {delimited; code_tl} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 51 *) (function + | Elm.{symbol=Symbol.Nonterm (CodeTl code_tl); _} + :: Elm.{symbol=Symbol.Nonterm (CodeToken code_token); _} + :: tl -> Symbol.Nonterm (Code ( + (*______________________________________________________________________________*) +#473 "./ParseLR.hmh" +let X.(CodeToken {token_}) = code_token in + CodeCodeToken {token_; code_tl} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 52 *) (function + | Elm.{symbol=Symbol.Nonterm (Cident cident); _} + :: tl -> Symbol.Nonterm (ProdParamSymbol ( + (*______________________________________________________________________________*) +#477 "./ParseLR.hmh" +ProdParamSymbolCident {cident} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 53 *) (function + | Elm.{symbol=Symbol.Token (ISTRING alias); _} + :: tl -> Symbol.Nonterm (ProdParamSymbol ( + (*______________________________________________________________________________*) +#479 "./ParseLR.hmh" +let X.(ISTRING {token_=alias}) = alias in + ProdParamSymbolAlias {alias} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 54 *) (function + | Elm.{symbol=Symbol.Nonterm (ProdParamSymbol prod_param_symbol); _} + :: Elm.{symbol=Symbol.Token (COLON colon); _} + :: Elm.{symbol=Symbol.Nonterm (Ident ident); _} + :: tl -> Symbol.Nonterm (ProdParam ( + (*______________________________________________________________________________*) +#484 "./ParseLR.hmh" +let X.(COLON {token_=colon}) = colon in + ProdParamBinding {ident; colon; prod_param_symbol} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 55 *) (function + | Elm.{symbol=Symbol.Nonterm (ProdParamSymbol prod_param_symbol); _} + :: tl -> Symbol.Nonterm (ProdParam ( + (*______________________________________________________________________________*) +#486 "./ParseLR.hmh" +ProdParam {prod_param_symbol} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 56 *) (function + | Elm.{symbol=Symbol.Nonterm (ProdParamsTl prod_params_tl); _} + :: Elm.{symbol=Symbol.Nonterm (ProdParam prod_param); _} + :: tl -> Symbol.Nonterm (ProdParamsTl ( + (*______________________________________________________________________________*) +#490 "./ParseLR.hmh" +ProdParamsTlProdParam {prod_param; prod_params_tl} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 57 *) (function + tl -> Symbol.Nonterm (ProdParamsTl ( + (*______________________________________________________________________________*) +#491 "./ParseLR.hmh" +ProdParamsTlEpsilon + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + ); + (* 58 *) (function + | Elm.{symbol=Symbol.Nonterm (ProdParamsTl prod_params_tl); _} + :: Elm.{symbol=Symbol.Nonterm (ProdParam prod_param); _} + :: tl -> Symbol.Nonterm (ProdParams ( + (*______________________________________________________________________________*) +#495 "./ParseLR.hmh" +ProdParamsProdParam {prod_param; prod_params_tl} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 59 *) (function + | Elm.{symbol=Symbol.Nonterm (ProdParams prod_params); _} + :: tl -> Symbol.Nonterm (ProdPattern ( + (*______________________________________________________________________________*) +#498 "./ParseLR.hmh" +ProdPatternParams {prod_params} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 60 *) (function + | Elm.{symbol=Symbol.Token (EPSILON_ epsilon_); _} + :: tl -> Symbol.Nonterm (ProdPattern ( + (*______________________________________________________________________________*) +#500 "./ParseLR.hmh" +let X.(EPSILON {token_=epsilon_}) = epsilon_ in + ProdPatternEpsilon {epsilon_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 61 *) (function + | Elm.{symbol=Symbol.Nonterm (PrecRef prec_ref); _} + :: Elm.{symbol=Symbol.Nonterm (ProdPattern prod_pattern); _} + :: tl -> Symbol.Nonterm (Prod ( + (*______________________________________________________________________________*) +#504 "./ParseLR.hmh" +Prod {prod_pattern; prec_ref} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 62 *) (function + | Elm.{symbol=Symbol.Nonterm (ProdsTl prods_tl); _} + :: Elm.{symbol=Symbol.Nonterm (Prod prod); _} + :: Elm.{symbol=Symbol.Token (BAR bar); _} + :: tl -> Symbol.Nonterm (ProdsTl ( + (*______________________________________________________________________________*) +#508 "./ParseLR.hmh" +let X.(BAR {token_=bar}) = bar in + ProdsTlBarProd {bar; prod; prods_tl} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 63 *) (function + tl -> Symbol.Nonterm (ProdsTl ( + (*______________________________________________________________________________*) +#510 "./ParseLR.hmh" +ProdsTlEpsilon + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + ); + (* 64 *) (function + | Elm.{symbol=Symbol.Nonterm (ProdsTl prods_tl); _} + :: Elm.{symbol=Symbol.Nonterm (Prod prod); _} + :: Elm.{symbol=Symbol.Token (BAR bar); _} + :: tl -> Symbol.Nonterm (Prods ( + (*______________________________________________________________________________*) +#514 "./ParseLR.hmh" +let X.(BAR {token_=bar}) = bar in + ProdsBarProd {bar; prod; prods_tl} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 65 *) (function + | Elm.{symbol=Symbol.Nonterm (ProdsTl prods_tl); _} + :: Elm.{symbol=Symbol.Nonterm (Prod prod); _} + :: tl -> Symbol.Nonterm (Prods ( + (*______________________________________________________________________________*) +#516 "./ParseLR.hmh" +ProdsProd {prod; prods_tl} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 66 *) (function + | Elm.{symbol=Symbol.Nonterm (Code code); _} + :: Elm.{symbol=Symbol.Token (ARROW arrow); _} + :: Elm.{symbol=Symbol.Nonterm (Prods prods); _} + :: tl -> Symbol.Nonterm (Reduction ( + (*______________________________________________________________________________*) +#520 "./ParseLR.hmh" +let X.(ARROW {token_=arrow}) = arrow in + Reduction {prods; arrow; code} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 67 *) (function + | Elm.{symbol=Symbol.Nonterm (ReductionsTl reductions_tl); _} + :: Elm.{symbol=Symbol.Nonterm (Reduction reduction); _} + :: Elm.{symbol=Symbol.Token (BAR bar); _} + :: tl -> Symbol.Nonterm (ReductionsTl ( + (*______________________________________________________________________________*) +#525 "./ParseLR.hmh" +let X.(BAR {token_=bar}) = bar in + ReductionsTlBarReduction {bar; reduction; reductions_tl} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 68 *) (function + tl -> Symbol.Nonterm (ReductionsTl ( + (*______________________________________________________________________________*) +#527 "./ParseLR.hmh" +ReductionsTlEpsilon + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + ); + (* 69 *) (function + | Elm.{symbol=Symbol.Nonterm (ReductionsTl reductions_tl); _} + :: Elm.{symbol=Symbol.Nonterm (Reduction reduction); _} + :: tl -> Symbol.Nonterm (Reductions ( + (*______________________________________________________________________________*) +#531 "./ParseLR.hmh" +ReductionsReduction {reduction; reductions_tl} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 70 *) (function + | Elm.{symbol=Symbol.Token (NONTERM nonterm_); _} + :: tl -> Symbol.Nonterm (NontermType ( + (*______________________________________________________________________________*) +#535 "./ParseLR.hmh" +let X.(NONTERM {token_=nonterm_}) = nonterm_ in + NontermTypeNonterm {nonterm_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 71 *) (function + | Elm.{symbol=Symbol.Token (START start_); _} + :: tl -> Symbol.Nonterm (NontermType ( + (*______________________________________________________________________________*) +#538 "./ParseLR.hmh" +let X.(START {token_=start_}) = start_ in + NontermTypeStart {start_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 72 *) (function + | Elm.{symbol=Symbol.Nonterm (Prods prods); _} + :: Elm.{symbol=Symbol.Token (COLON_COLON_EQ cce); _} + :: Elm.{symbol=Symbol.Nonterm (PrecRef prec_ref); _} + :: Elm.{symbol=Symbol.Nonterm (Cident cident); _} + :: Elm.{symbol=Symbol.Nonterm (NontermType nonterm_type); _} + :: tl -> Symbol.Nonterm (Nonterm ( + (*______________________________________________________________________________*) +#543 "./ParseLR.hmh" +let X.(COLON_COLON_EQ {token_=cce}) = cce in + NontermProds {nonterm_type; cident; prec_ref; cce; prods} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 73 *) (function + | Elm.{symbol=Symbol.Nonterm (Reductions reductions); _} + :: Elm.{symbol=Symbol.Token (COLON_COLON_EQ cce); _} + :: Elm.{symbol=Symbol.Nonterm (PrecRef prec_ref); _} + :: Elm.{symbol=Symbol.Nonterm (OfType of_type); _} + :: Elm.{symbol=Symbol.Nonterm (Cident cident); _} + :: Elm.{symbol=Symbol.Nonterm (NontermType nonterm_type); _} + :: tl -> Symbol.Nonterm (Nonterm ( + (*______________________________________________________________________________*) +#547 "./ParseLR.hmh" +let X.(COLON_COLON_EQ {token_=cce}) = cce in + NontermReductions {nonterm_type; cident; of_type; prec_ref; cce; reductions} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 74 *) (function + | Elm.{symbol=Symbol.Nonterm (Prec prec_); _} + :: tl -> Symbol.Nonterm (Stmt ( + (*______________________________________________________________________________*) +#551 "./ParseLR.hmh" +StmtPrec {prec_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 75 *) (function + | Elm.{symbol=Symbol.Nonterm (Token token_); _} + :: tl -> Symbol.Nonterm (Stmt ( + (*______________________________________________________________________________*) +#552 "./ParseLR.hmh" +StmtToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 76 *) (function + | Elm.{symbol=Symbol.Nonterm (Nonterm nonterm_); _} + :: tl -> Symbol.Nonterm (Stmt ( + (*______________________________________________________________________________*) +#553 "./ParseLR.hmh" +StmtNonterm {nonterm_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 77 *) (function + | Elm.{symbol=Symbol.Nonterm (Code code); _} + :: tl -> Symbol.Nonterm (Stmt ( + (*______________________________________________________________________________*) +#554 "./ParseLR.hmh" +StmtCode {code} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 78 *) (function + | Elm.{symbol=Symbol.Nonterm (StmtsTl stmts_tl); _} + :: Elm.{symbol=Symbol.Nonterm (Stmt stmt); _} + :: Elm.{symbol=Symbol.Token (LINE_DELIM line_delim); _} + :: tl -> Symbol.Nonterm (StmtsTl ( + (*______________________________________________________________________________*) +#558 "./ParseLR.hmh" +let X.(LINE_DELIM {token_=line_delim}) = line_delim in + StmtsTl {line_delim; stmt; stmts_tl} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 79 *) (function + tl -> Symbol.Nonterm (StmtsTl ( + (*______________________________________________________________________________*) +#560 "./ParseLR.hmh" +StmtsTlEpsilon + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + ); + (* 80 *) (function + | Elm.{symbol=Symbol.Nonterm (StmtsTl stmts_tl); _} + :: Elm.{symbol=Symbol.Nonterm (Stmt stmt); _} + :: tl -> Symbol.Nonterm (Stmts ( + (*______________________________________________________________________________*) +#563 "./ParseLR.hmh" +Stmts {stmt; stmts_tl} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 81 *) (function + | Elm.{symbol=Symbol.Token (DEDENT dedent); _} + :: Elm.{symbol=Symbol.Nonterm (Stmts stmts); _} + :: Elm.{symbol=Symbol.Token (INDENT indent); _} + :: Elm.{symbol=Symbol.Token (HOCC hocc_); _} + :: tl -> Symbol.Nonterm (Hocc ( + (*______________________________________________________________________________*) +#567 "./ParseLR.hmh" +let X.(HOCC {token_=hocc_}) = hocc_ in + let X.(INDENT {token_=indent}) = indent in + let X.(DEDENT {token_=dedent}) = dedent in + Hocc {hocc_; indent; stmts; dedent} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 82 *) (function + | Elm.{symbol=Symbol.Nonterm (CodeToken code_token); _} + :: tl -> Symbol.Nonterm (MatterToken ( + (*______________________________________________________________________________*) +#574 "./ParseLR.hmh" +let X.(CodeToken {token_}) = code_token in + MatterToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 83 *) (function + | Elm.{symbol=Symbol.Nonterm (Sep sep); _} + :: tl -> Symbol.Nonterm (MatterToken ( + (*______________________________________________________________________________*) +#577 "./ParseLR.hmh" +let token_ = match sep with + | SepLineDelim {line_delim=token_} + | SepSemi {semi=token_} + | SepBar {bar=token_} + -> token_ + in + MatterToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 84 *) (function + | Elm.{symbol=Symbol.Token (INDENT token_); _} + :: tl -> Symbol.Nonterm (MatterToken ( + (*______________________________________________________________________________*) +#585 "./ParseLR.hmh" +let X.(INDENT {token_}) = token_ in + MatterToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 85 *) (function + | Elm.{symbol=Symbol.Token (DEDENT token_); _} + :: tl -> Symbol.Nonterm (MatterToken ( + (*______________________________________________________________________________*) +#588 "./ParseLR.hmh" +let X.(DEDENT {token_}) = token_ in + MatterToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 86 *) (function + | Elm.{symbol=Symbol.Token (LPAREN token_); _} + :: tl -> Symbol.Nonterm (MatterToken ( + (*______________________________________________________________________________*) +#591 "./ParseLR.hmh" +let X.(LPAREN {token_}) = token_ in + MatterToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 87 *) (function + | Elm.{symbol=Symbol.Token (RPAREN token_); _} + :: tl -> Symbol.Nonterm (MatterToken ( + (*______________________________________________________________________________*) +#594 "./ParseLR.hmh" +let X.(RPAREN {token_}) = token_ in + MatterToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 88 *) (function + | Elm.{symbol=Symbol.Token (LCAPTURE token_); _} + :: tl -> Symbol.Nonterm (MatterToken ( + (*______________________________________________________________________________*) +#597 "./ParseLR.hmh" +let X.(LCAPTURE {token_}) = token_ in + MatterToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 89 *) (function + | Elm.{symbol=Symbol.Token (RCAPTURE token_); _} + :: tl -> Symbol.Nonterm (MatterToken ( + (*______________________________________________________________________________*) +#600 "./ParseLR.hmh" +let X.(RCAPTURE {token_}) = token_ in + MatterToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 90 *) (function + | Elm.{symbol=Symbol.Token (LBRACK token_); _} + :: tl -> Symbol.Nonterm (MatterToken ( + (*______________________________________________________________________________*) +#603 "./ParseLR.hmh" +let X.(LBRACK {token_}) = token_ in + MatterToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 91 *) (function + | Elm.{symbol=Symbol.Token (RBRACK token_); _} + :: tl -> Symbol.Nonterm (MatterToken ( + (*______________________________________________________________________________*) +#606 "./ParseLR.hmh" +let X.(RBRACK {token_}) = token_ in + MatterToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 92 *) (function + | Elm.{symbol=Symbol.Token (LARRAY token_); _} + :: tl -> Symbol.Nonterm (MatterToken ( + (*______________________________________________________________________________*) +#609 "./ParseLR.hmh" +let X.(LARRAY {token_}) = token_ in + MatterToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 93 *) (function + | Elm.{symbol=Symbol.Token (RARRAY token_); _} + :: tl -> Symbol.Nonterm (MatterToken ( + (*______________________________________________________________________________*) +#612 "./ParseLR.hmh" +let X.(RARRAY {token_}) = token_ in + MatterToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 94 *) (function + | Elm.{symbol=Symbol.Token (LCURLY token_); _} + :: tl -> Symbol.Nonterm (MatterToken ( + (*______________________________________________________________________________*) +#615 "./ParseLR.hmh" +let X.(LCURLY {token_}) = token_ in + MatterToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 95 *) (function + | Elm.{symbol=Symbol.Token (RCURLY token_); _} + :: tl -> Symbol.Nonterm (MatterToken ( + (*______________________________________________________________________________*) +#618 "./ParseLR.hmh" +let X.(RCURLY {token_}) = token_ in + MatterToken {token_} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 96 *) (function + | Elm.{symbol=Symbol.Nonterm (Matter matter); _} + :: Elm.{symbol=Symbol.Nonterm (MatterToken matter_token); _} + :: tl -> Symbol.Nonterm (Matter ( + (*______________________________________________________________________________*) +#623 "./ParseLR.hmh" +let X.(MatterToken {token_}) = matter_token in + Matter {token_; matter} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 97 *) (function + tl -> Symbol.Nonterm (Matter ( + (*______________________________________________________________________________*) +#625 "./ParseLR.hmh" +MatterEpsilon + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + ); + (* 98 *) (function + | Elm.{symbol=Symbol.Token (EOI eoi); _} + :: Elm.{symbol=Symbol.Nonterm (Matter postlude); _} + :: Elm.{symbol=Symbol.Nonterm (Hocc hocc_); _} + :: Elm.{symbol=Symbol.Nonterm (Matter prelude); _} + :: tl -> Symbol.Nonterm (Hmh ( + (*______________________________________________________________________________*) +#629 "./ParseLR.hmh" +let X.(EOI {token_=eoi}) = eoi in + Hmh {prelude; hocc_; postlude; eoi} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 99 *) (fun _stack -> not_reached ()); + (* 100 *) (function + | Elm.{symbol=Symbol.Token (EOI eoi); _} + :: Elm.{symbol=Symbol.Nonterm (Matter postlude); _} + :: Elm.{symbol=Symbol.Token (HOCC hocc_); _} + :: Elm.{symbol=Symbol.Nonterm (Matter prelude); _} + :: tl -> Symbol.Nonterm (Hmhi ( + (*______________________________________________________________________________*) +#634 "./ParseLR.hmh" +let X.(HOCC {token_=hocc_}) = hocc_ in + let X.(EOI {token_=eoi}) = eoi in + Hmhi {prelude; hocc_; postlude; eoi} + (*‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾*) + )), tl + | _ -> not_reached () + ); + (* 101 *) (fun _stack -> not_reached ()) + |] + + let callback t = + Array.get t callbacks + + let init callback_index = + callback_index + end + + let shift ~symbol ~state t = + (Elm.init ~symbol ~state) :: t + + (* val goto: Symbol.t -> t -> t *) + let goto symbol t = + match t with + | [] -> not_reached () + | Elm.{state; _} :: _ -> + let symbol_index = Symbol.index symbol in + let Spec.State.{gotos; _} = Array.get state Spec.states in + let state' = Map.get_hlt symbol_index gotos |> State.init in + shift ~symbol ~state:state' t + + let reduce ~reduction t = + let callback = Reduction.callback reduction in + let symbol, t' = callback t in + goto symbol t' + end + + module Status = struct + module T = struct + type t = + | ShiftPrefix of Token.t * State.t + | ShiftAccept of Token.t * State.t + | Reduce of Token.t * Stack.Reduction.t + | Prefix + | Accept of Nonterm.t + | Reject of Token.t + + let constructor_index = function + | ShiftPrefix _ -> 0L + | ShiftAccept _ -> 1L + | Reduce _ -> 2L + | Prefix -> 3L + | Accept _ -> 4L + | Reject _ -> 5L + + let hash_fold t state = + state + |> Uns.hash_fold (constructor_index t) + |> (fun hash_state -> + match t with + | ShiftPrefix (token, state) + | ShiftAccept (token, state) -> + hash_state |> State.hash_fold state |> Token.hash_fold token + | Reduce (token, reduction) -> + hash_state |> Stack.Reduction.hash_fold reduction |> Token.hash_fold token + | Prefix -> hash_state + | Accept nonterm -> hash_state |> Nonterm.hash_fold nonterm + | Reject token -> hash_state |> Token.hash_fold token + ) + + let cmp t0 t1 = + let open Cmp in + match Uns.cmp (constructor_index t0) (constructor_index t1) with + | Lt -> Lt + | Eq -> begin + match t0, t1 with + | ShiftPrefix (token0, state0), ShiftPrefix (token1, state1) + | ShiftAccept (token0, state0), ShiftAccept (token1, state1) -> begin + match State.cmp state0 state1 with + | Lt -> Lt + | Eq -> Token.cmp token0 token1 + | Gt -> Gt + end + | Reduce (token0, reduction0), Reduce (token1, reduction1) + -> begin + match Stack.Reduction.cmp reduction0 reduction1 with + | Lt -> Lt + | Eq -> Token.cmp token0 token1 + | Gt -> Gt + end + | Prefix, Prefix -> Eq + | Accept nonterm0, Accept nonterm1 -> Nonterm.cmp nonterm0 nonterm1 + | Reject token0, Reject token1 -> Token.cmp token0 token1 + | _, _ -> not_reached () + end + | Gt -> Gt + + let pp t formatter = + formatter + |> (fun formatter -> + match t with + | ShiftPrefix (token, state) -> begin + formatter + |> Fmt.fmt "ShiftPrefix (" |> Token.pp token + |> Fmt.fmt ", " |> State.pp state + |> Fmt.fmt ")" + end + | ShiftAccept (token, state) -> begin + formatter + |> Fmt.fmt "ShiftAccept (" |> Token.pp token + |> Fmt.fmt ", " |> State.pp state + |> Fmt.fmt ")" + end + | Reduce (token, reduction) -> begin + formatter + |> Fmt.fmt "Reduce (" |> Token.pp token + |> Fmt.fmt ", " |> Stack.Reduction.pp reduction + |> Fmt.fmt ")" + end + | Prefix -> formatter |> Fmt.fmt "Prefix" + | Accept nonterm -> formatter |> Fmt.fmt "Accept " |> Nonterm.pp nonterm + | Reject token -> formatter |> Fmt.fmt "Reject " |> Token.pp token + ) + end + include T + include Identifiable.Make(T) + end + + type t = { + stack: Stack.t; + status: Status.t; + } + + module Start = struct + module Hmh = struct + let boi = { + stack=[{ + symbol=Token Token.EPSILON; + state=State.init 0L; + }]; + status=Prefix; + } + end + module Hmhi = struct + let boi = { + stack=[{ + symbol=Token Token.EPSILON; + state=State.init 1L; + }]; + status=Prefix; + } + end + end + + let feed token = function + | {stack={state; _} :: _; status=Prefix} as t -> begin + let token_index = Token.index token in + let Spec.State.{actions; _} = Array.get state Spec.states in + let status = match Map.get token_index actions with + | Some (Spec.Action.ShiftPrefix state') -> Status.ShiftPrefix (token, state') + | Some (Spec.Action.ShiftAccept state') -> Status.ShiftAccept (token, state') + | Some (Spec.Action.Reduce prod_index) -> begin + let Spec.Prod.{callback=callback_index; _} = Array.get prod_index Spec.prods in + let reduction = Stack.Reduction.init callback_index in + Status.Reduce (token, reduction) + end + | None -> Status.Reject token + in + {t with status} + end + | _ -> not_reached () + + let step {stack; status} = + let open Status in + match status with + | ShiftPrefix (token, state) -> + {stack=Stack.shift ~symbol:(Token token) ~state stack; status=Prefix} + | ShiftAccept (token, state) -> begin + (* Shift, perform the ⊥ reduction, and extract the accepted symbol from the stack. *) + let stack = Stack.shift ~symbol:(Token token) ~state stack in + let pseudo_end_index = Token.index Token.PSEUDO_END in + let Spec.State.{actions; _} = Array.get state Spec.states in + match Map.get_hlt pseudo_end_index actions with + | Spec.Action.Reduce prod_index -> begin + let Spec.Prod.{callback=callback_index; _} = Array.get prod_index Spec.prods in + let reduction = Stack.Reduction.init callback_index in + let stack = Stack.reduce ~reduction stack in + match stack with + | [] -> not_reached () + | {symbol=Token _; _} :: _ -> not_reached () + | {symbol=Nonterm nonterm; _} :: _ -> {stack=[]; status=Accept nonterm} + end + | _ -> not_reached () + end + | Reduce (token, reduction) -> begin + feed token {stack=Stack.reduce ~reduction stack; status=Prefix} + end + | _ -> not_reached () + + (* val walk: t -> t *) + let rec walk ({status; _} as t) = + let open Status in + match status with + | ShiftPrefix _ + | ShiftAccept _ + | Reduce _ -> t |> step |> walk + | Prefix + | Accept _ + | Reject _ -> t + + let next token ({status; _} as t) = + match status with + | Status.Prefix -> t |> feed token |> walk + | _ -> not_reached () + end +#637 "./ParseLR.hmh" + +include X (* XXX Work around qualified type syntax limitations. *) +let rec scan scanner = + let scanner, scan_token = Scan.next scanner in + match Scan.Token.malformations scan_token with + | [] -> begin + let token_opt = match scan_token with + | Scan.Token.HmcToken {atok; _} -> begin + match atok with + | Tok_whitespace + | Tok_hash_comment + | Tok_paren_comment _ -> None (* Swallow. *) + | Tok_uident _ -> Some (Token.UIDENT (UIDENT {token_=scan_token})) + | Tok_cident _ -> Some (Token.CIDENT (CIDENT {token_=scan_token})) + | Tok_uscore -> Some (Token.USCORE (USCORE {token_=scan_token})) + | Tok_istring _ -> Some (Token.ISTRING (ISTRING {token_=scan_token})) + | Tok_of -> Some (Token.OF (OF {token_=scan_token})) + | Tok_colon -> Some (Token.COLON (COLON {token_=scan_token})) + | Tok_dot -> Some (Token.DOT (DOT {token_=scan_token})) + | Tok_arrow -> Some (Token.ARROW (ARROW {token_=scan_token})) + | Tok_bar -> Some (Token.BAR (BAR {token_=scan_token})) + | Tok_lt -> Some (Token.LT (LT {token_=scan_token})) + | Tok_comma -> Some (Token.COMMA (COMMA {token_=scan_token})) + | Tok_semi -> Some (Token.SEMI (SEMI {token_=scan_token})) + | Tok_line_delim -> Some (Token.LINE_DELIM (LINE_DELIM {token_=scan_token})) + | Tok_indent _ -> Some (Token.INDENT (INDENT {token_=scan_token})) + | Tok_dedent _ -> Some (Token.DEDENT (DEDENT {token_=scan_token})) + | Tok_lparen -> Some (Token.LPAREN (LPAREN {token_=scan_token})) + | Tok_rparen -> Some (Token.RPAREN (RPAREN {token_=scan_token})) + | Tok_lcapture -> Some (Token.LCAPTURE (LCAPTURE {token_=scan_token})) + | Tok_rcapture -> Some (Token.RCAPTURE (RCAPTURE {token_=scan_token})) + | Tok_lbrack -> Some (Token.LBRACK (LBRACK {token_=scan_token})) + | Tok_rbrack -> Some (Token.RBRACK (RBRACK {token_=scan_token})) + | Tok_larray -> Some (Token.LARRAY (LARRAY {token_=scan_token})) + | Tok_rarray -> Some (Token.RARRAY (RARRAY {token_=scan_token})) + | Tok_lcurly -> Some (Token.LCURLY (LCURLY {token_=scan_token})) + | Tok_rcurly -> Some (Token.RCURLY (RCURLY {token_=scan_token})) + | Tok_end_of_input -> Some (Token.EOI (EOI {token_=scan_token})) + | _ -> Some (Token.OTHER_TOKEN (OTHER_TOKEN {token_=scan_token})) + end + | HoccToken {atok; _} -> begin + match atok with + | Tok_hocc -> Some (Token.HOCC (HOCC {token_=scan_token})) + | Tok_token -> Some (Token.TOKEN (TOKEN {token_=scan_token})) + | Tok_nonterm -> Some (Token.NONTERM (NONTERM {token_=scan_token})) + | Tok_start -> Some (Token.START (START {token_=scan_token})) + | Tok_epsilon -> Some (Token.EPSILON_ (EPSILON {token_=scan_token})) + | Tok_neutral -> Some (Token.NEUTRAL (NEUTRAL {token_=scan_token})) + | Tok_left -> Some (Token.LEFT (LEFT {token_=scan_token})) + | Tok_right -> Some (Token.RIGHT (RIGHT {token_=scan_token})) + | Tok_prec -> Some (Token.PREC (PREC {token_=scan_token})) + | Tok_colon_colon_eq -> + Some (Token.COLON_COLON_EQ (COLON_COLON_EQ {token_=scan_token})) + end in + match token_opt with + | Some token_ -> scanner, scan_token, token_, [] + | None -> scan scanner + end + | mal :: [] -> begin + (* Try to pass e.g. 42L through as a u64 token to support OCaml syntax. *) + let u64_opt = match Hmc.Scan.AbstractToken.Rendition.Malformation.description mal with + | "Invalid numerical constant" -> begin + let source = Scan.Token.source scan_token in + Hmc.Source.Slice.to_string source + |> String.chop_suffix ~suffix:"L" + |> (fun s_opt -> + match s_opt with + | None -> None + | Some s -> Stdlib.Int64.of_string_opt s + ) + end + | _ -> None + in + match u64_opt with + | Some x -> begin + let rendition = Hmc.Scan.AbstractToken.Rendition.Constant x in + let ctok = Hmc.Scan.ConcreteToken.{ + atok=Hmc.Scan.AbstractToken.Tok_u64 rendition; + source=Scan.Token.source scan_token + } in + let scan_token = Scan.Token.HmcToken ctok in + scanner, scan_token, Token.OTHER_TOKEN (OTHER_TOKEN {token_=scan_token}), [] + end + | None -> scanner, scan_token, Token.OTHER_TOKEN (OTHER_TOKEN {token_=scan_token}), [mal] + end + | mals -> scanner, scan_token, Token.OTHER_TOKEN (OTHER_TOKEN {token_=scan_token}), mals + +let hmhi scanner = + let rec inner scanner errs parser = begin + let scanner, scan_token, token_, mals = scan scanner in + let errs = match mals with + | [] -> errs + | _ -> List.fold ~init:errs ~f:(fun errs mal -> Error.init_mal mal :: errs) mals + in + let {status; _} as parser = next token_ parser in + match status, errs with + | Prefix, _ -> inner scanner errs parser + | Accept (Hmhi hmhi), [] -> scanner, Ok hmhi + | Accept (Hmhi _), _ -> scanner, Error errs + | Reject _, _ -> + let errs = Error.init_token scan_token "Unexpected token" :: errs in + scanner, Error errs + | _ -> not_reached () + end in + let parser = Start.Hmhi.boi in + inner scanner [] parser + +let hmh scanner = + let rec inner scanner errs parser = begin + let scanner, scan_token, token_, mals = scan scanner in +(* + File.Fmt.stderr + |> Fmt.fmt "XXX scan_token=" + |> Scan.Token.pp scan_token + |> Fmt.fmt "\n" + |> ignore; +*) + let errs = match mals with + | [] -> errs + | _ -> List.fold ~init:errs ~f:(fun errs mal -> Error.init_mal mal :: errs) mals + in + let {stack=_XXX; status} as parser = next token_ parser in +(* + File.Fmt.stderr + |> Fmt.fmt "XXX status=" + |> Status.pp status + |> Fmt.fmt "\n" + |> ignore; +*) + match status, errs with + | Prefix, _ -> inner scanner errs parser + | Accept (Hmh hmh), [] -> scanner, Ok hmh + | Accept (Hmh _), _ -> scanner, Error errs + | Reject _, _ -> begin +(* + File.Fmt.stderr + |> Fmt.fmt "XXX stack=" + |> Stack.fmt ~alt:true stack + |> Fmt.fmt "\n" + |> ignore; +*) + let errs = Error.init_token scan_token "Unexpected token" :: errs in + scanner, Error errs + end + | _ -> not_reached () + end in + let parser = Start.Hmh.boi in + inner scanner [] parser (**************************************************************************************************) (* source_of_* functions. *) (* Not to be confused with joining forces. *) let join_sources source0_opt source1_opt = - match source0_opt, source1_opt with - | None, None -> None - | Some _, None -> source0_opt - | None, Some _ -> source1_opt - | Some source0, Some source1 -> begin - let open Hmc.Source in - let base0, past0 = Slice.cursors source0 in - let base1, past1 = Slice.cursors source1 in - let open Cmp in - let base = match Cursor.cmp base0 base1 with - | Lt - | Eq -> base0 - | Gt -> base1 - in - let past = match Cursor.cmp past0 past1 with - | Lt - | Eq -> past1 - | Gt -> past0 - in - Some (Slice.of_cursors ~base ~past) - end + match source0_opt, source1_opt with + | None, None -> None + | Some _, None -> source0_opt + | None, Some _ -> source1_opt + | Some source0, Some source1 -> begin + let open Hmc.Source in + let base0, past0 = Slice.cursors source0 in + let base1, past1 = Slice.cursors source1 in + let open Cmp in + let base = match Cursor.cmp base0 base1 with + | Lt + | Eq -> base0 + | Gt -> base1 + in + let past = match Cursor.cmp past0 past1 with + | Lt + | Eq -> past1 + | Gt -> past0 + in + Some (Slice.of_cursors ~base ~past) + end (* Not to be confused with a token force. *) -let token_source token = - Some (Scan.Token.source token) +let token_source token_ = + Some (Scan.Token.source token_) let rec source_of_uident = function | Uident {uident} -> token_source uident -and source_of_cident = function + and source_of_cident = function | Cident {cident} -> token_source cident -and source_of_ident = function + and source_of_ident = function | IdentUident {uident} -> source_of_uident uident | IdentCident {cident} -> source_of_cident cident | IdentUscore {uscore} -> token_source uscore -and source_of_precs_tl = function + and source_of_precs_tl = function | PrecsTlCommaUident {comma; uident; precs_tl} -> token_source comma - |> join_sources (source_of_uident uident) - |> join_sources (source_of_precs_tl precs_tl) + |> join_sources (source_of_uident uident) + |> join_sources (source_of_precs_tl precs_tl) | PrecsTlEpsilon -> None -and source_of_precs = function + and source_of_precs = function | Precs {uident; precs_tl} -> source_of_uident uident - |> join_sources (source_of_precs_tl precs_tl) + |> join_sources (source_of_precs_tl precs_tl) -and source_of_prec_rels = function + and source_of_prec_rels = function | PrecRelsLtPrecs {lt; precs} -> token_source lt - |> join_sources (source_of_precs precs) + |> join_sources (source_of_precs precs) | PrecRelsEpsilon -> None -and source_of_prec_type = function + and source_of_prec_type = function | PrecTypeNeutral {neutral_} -> token_source neutral_ | PrecTypeLeft {left_} -> token_source left_ | PrecTypeRight {right_} -> token_source right_ -and source_of_prec = function + and source_of_prec = function | Prec {prec_type; uident; prec_rels} -> source_of_prec_type prec_type - |> join_sources (source_of_uident uident) - |> join_sources (source_of_prec_rels prec_rels) + |> join_sources (source_of_uident uident) + |> join_sources (source_of_prec_rels prec_rels) -and source_of_of_type = function + and source_of_of_type = function | OfType {of_; type_module=_; dot; type_type} -> token_source of_ - |> join_sources (token_source dot) - |> join_sources (source_of_uident type_type) + |> join_sources (token_source dot) + |> join_sources (source_of_uident type_type) -and source_of_of_type0 = function + and source_of_of_type0 = function | OfType0OfType {of_type} -> source_of_of_type of_type | OfType0Epsilon -> None -and source_of_prec_ref = function + and source_of_prec_ref = function | PrecRefPrecUident {prec_; uident} -> token_source prec_ - |> join_sources (source_of_uident uident) + |> join_sources (source_of_uident uident) | PrecRefEpsilon -> None -and source_of_token_alias = function + and source_of_token_alias = function | TokenAlias {alias} -> token_source alias | TokenAliasEpsilon -> None -and source_of_token = function + and source_of_token = function | Token {token_; cident; token_alias; of_type0; prec_ref} -> token_source token_ - |> join_sources (source_of_cident cident) - |> join_sources (source_of_token_alias token_alias) - |> join_sources (source_of_of_type0 of_type0) - |> join_sources (source_of_prec_ref prec_ref) + |> join_sources (source_of_cident cident) + |> join_sources (source_of_token_alias token_alias) + |> join_sources (source_of_of_type0 of_type0) + |> join_sources (source_of_prec_ref prec_ref) -and source_of_sep = function + and source_of_sep = function | SepLineDelim {line_delim} -> token_source line_delim | SepSemi {semi} -> token_source semi | SepBar {bar} -> token_source bar -and source_of_codes_tl = function + and source_of_codes_tl = function | CodesTlSepCode {sep; code; codes_tl} -> source_of_sep sep - |> join_sources (source_of_code code) - |> join_sources (source_of_codes_tl codes_tl) + |> join_sources (source_of_code code) + |> join_sources (source_of_codes_tl codes_tl) | CodesTlEpsilon -> None -and source_of_codes = function + and source_of_codes = function | Codes {code; codes_tl} -> source_of_code code - |> join_sources (source_of_codes_tl codes_tl) + |> join_sources (source_of_codes_tl codes_tl) -and source_of_codes0 = function + and source_of_codes0 = function | Codes0Codes {codes} -> source_of_codes codes | Codes0Epsilon -> None -and source_of_delimited = function + and source_of_delimited = function | DelimitedBlock {indent=ldelim; codes=_; dedent=rdelim} | DelimitedParen {lparen=ldelim; codes0=_; rparen=rdelim} | DelimitedCapture {lcapture=ldelim; codes0=_; rcapture=rdelim} @@ -309,1620 +13782,882 @@ and source_of_delimited = function | DelimitedArray {larray=ldelim; codes0=_; rarray=rdelim} | DelimitedModule {lcurly=ldelim; codes0=_; rcurly=rdelim} -> token_source ldelim - |> join_sources (token_source rdelim) + |> join_sources (token_source rdelim) -and source_of_code_tl = function + and source_of_code_tl = function | CodeTlDelimited {delimited; code_tl} -> source_of_delimited delimited - |> join_sources (source_of_code_tl code_tl) + |> join_sources (source_of_code_tl code_tl) | CodeTlToken {token_; code_tl} -> token_source token_ - |> join_sources (source_of_code_tl code_tl) + |> join_sources (source_of_code_tl code_tl) | CodeTlEpsilon -> None -and source_of_code = function + and source_of_code = function | CodeDelimited {delimited; code_tl} -> source_of_delimited delimited - |> join_sources (source_of_code_tl code_tl) - | CodeToken {token_; code_tl} -> + |> join_sources (source_of_code_tl code_tl) + | CodeCodeToken {token_; code_tl} -> token_source token_ - |> join_sources (source_of_code_tl code_tl) + |> join_sources (source_of_code_tl code_tl) -and source_of_prod_param_symbol = function + and source_of_prod_param_symbol = function | ProdParamSymbolCident {cident} -> source_of_cident cident | ProdParamSymbolAlias {alias} -> token_source alias -and source_of_prod_param = function + and source_of_prod_param = function | ProdParamBinding {ident; colon=_; prod_param_symbol} -> source_of_ident ident - |> join_sources (source_of_prod_param_symbol prod_param_symbol) + |> join_sources (source_of_prod_param_symbol prod_param_symbol) | ProdParam {prod_param_symbol} -> source_of_prod_param_symbol prod_param_symbol -and source_of_prod_params_tl = function + and source_of_prod_params_tl = function | ProdParamsTlProdParam {prod_param; prod_params_tl} -> source_of_prod_param prod_param - |> join_sources (source_of_prod_params_tl prod_params_tl) + |> join_sources (source_of_prod_params_tl prod_params_tl) | ProdParamsTlEpsilon -> None -and source_of_prod_params = function + and source_of_prod_params = function | ProdParamsProdParam {prod_param; prod_params_tl} -> source_of_prod_param prod_param - |> join_sources (source_of_prod_params_tl prod_params_tl) + |> join_sources (source_of_prod_params_tl prod_params_tl) -and source_of_prod_pattern = function + and source_of_prod_pattern = function | ProdPatternParams {prod_params} -> source_of_prod_params prod_params | ProdPatternEpsilon {epsilon_} -> token_source epsilon_ -and source_of_prod = function + and source_of_prod = function | Prod {prod_pattern; prec_ref} -> source_of_prod_pattern prod_pattern - |> join_sources (source_of_prec_ref prec_ref) + |> join_sources (source_of_prec_ref prec_ref) -and source_of_prods_tl = function + and source_of_prods_tl = function | ProdsTlBarProd {bar; prod; prods_tl} -> token_source bar - |> join_sources (source_of_prod prod) - |> join_sources (source_of_prods_tl prods_tl) + |> join_sources (source_of_prod prod) + |> join_sources (source_of_prods_tl prods_tl) | ProdsTlEpsilon -> None -and source_of_prods = function + and source_of_prods = function | ProdsBarProd {bar; prod; prods_tl} -> token_source bar - |> join_sources (source_of_prod prod) - |> join_sources (source_of_prods_tl prods_tl) + |> join_sources (source_of_prod prod) + |> join_sources (source_of_prods_tl prods_tl) | ProdsProd {prod; prods_tl} -> source_of_prod prod - |> join_sources (source_of_prods_tl prods_tl) + |> join_sources (source_of_prods_tl prods_tl) -and source_of_reduction = function + and source_of_reduction = function | Reduction {prods; arrow=_; code} -> source_of_prods prods - |> join_sources (source_of_code code) + |> join_sources (source_of_code code) -and source_of_reductions_tl = function + and source_of_reductions_tl = function | ReductionsTlBarReduction {bar; reduction; reductions_tl} -> token_source bar - |> join_sources (source_of_reduction reduction) - |> join_sources (source_of_reductions_tl reductions_tl) + |> join_sources (source_of_reduction reduction) + |> join_sources (source_of_reductions_tl reductions_tl) | ReductionsTlEpsilon -> None -and source_of_reductions = function + and source_of_reductions = function | ReductionsReduction {reduction; reductions_tl} -> source_of_reduction reduction - |> join_sources (source_of_reductions_tl reductions_tl) + |> join_sources (source_of_reductions_tl reductions_tl) -and source_of_nonterm_type = function + and source_of_nonterm_type = function | NontermTypeNonterm {nonterm_} -> token_source nonterm_ | NontermTypeStart {start_} -> token_source start_ -and source_of_nonterm = function + and source_of_nonterm = function | NontermProds {nonterm_type; cident=_; prec_ref=_; cce=_; prods} -> source_of_nonterm_type nonterm_type - |> join_sources (source_of_prods prods) + |> join_sources (source_of_prods prods) | NontermReductions {nonterm_type; cident=_; of_type=_; prec_ref=_; cce=_; reductions} -> source_of_nonterm_type nonterm_type - |> join_sources (source_of_reductions reductions) + |> join_sources (source_of_reductions reductions) -and source_of_stmt = function + and source_of_stmt = function | StmtPrec {prec_} -> source_of_prec prec_ | StmtToken {token_} -> source_of_token token_ | StmtNonterm {nonterm_} -> source_of_nonterm nonterm_ | StmtCode {code} -> source_of_code code -and source_of_stmts_tl = function + and source_of_stmts_tl = function | StmtsTl {line_delim; stmt; stmts_tl} -> token_source line_delim - |> join_sources (source_of_stmt stmt) - |> join_sources (source_of_stmts_tl stmts_tl) + |> join_sources (source_of_stmt stmt) + |> join_sources (source_of_stmts_tl stmts_tl) | StmtsTlEpsilon -> None -and source_of_stmts = function + and source_of_stmts = function | Stmts {stmt; stmts_tl} -> source_of_stmt stmt - |> join_sources (source_of_stmts_tl stmts_tl) + |> join_sources (source_of_stmts_tl stmts_tl) -and source_of_hocc = function + and source_of_hocc = function | Hocc {hocc_; indent=_; stmts=_; dedent} -> token_source hocc_ - |> join_sources (token_source dedent) - -and source_of_eoi = function - | Eoi {eoi} -> token_source eoi + |> join_sources (token_source dedent) -and source_of_matter = function + and source_of_matter = function | Matter {token_; matter} -> token_source token_ - |> join_sources (source_of_matter matter) + |> join_sources (source_of_matter matter) | MatterEpsilon -> None -and source_of_hmh = function + and source_of_hmh = function | Hmh {prelude; hocc_; postlude=_; eoi} -> source_of_matter prelude - |> join_sources (source_of_hocc hocc_) - |> join_sources (token_source eoi) + |> join_sources (source_of_hocc hocc_) + |> join_sources (token_source eoi) -and source_of_hmhi = function + and source_of_hmhi = function | Hmhi {prelude; hocc_; postlude=_; eoi} -> source_of_matter prelude - |> join_sources (token_source hocc_) - |> join_sources (token_source eoi) + |> join_sources (token_source hocc_) + |> join_sources (token_source eoi) (**************************************************************************************************) (* fmt_* functions. *) let rec fmt_lcurly ~alt ~width formatter = - match alt with - | false -> formatter |> Fmt.fmt "{" - | true -> - formatter - |> Fmt.fmt "{\n" - |> Fmt.fmt ~pad:" " ~just:Fmt.Left ~width:(width + 4L) "" - -and fmt_semi ~alt ~width formatter = - match alt with - | false -> formatter |> Fmt.fmt "; " - | true -> - formatter - |> Fmt.fmt "\n" - |> Fmt.fmt ~pad:" " ~just:Fmt.Left ~width:(width + 4L) "" - -and fmt_rcurly ~alt ~width formatter = - match alt with - | false -> formatter |> Fmt.fmt "}" - | true -> - formatter - |> Fmt.fmt "\n" - |> Fmt.fmt ~pad:" " ~just:Fmt.Left ~width:(width + 2L) "" - |> Fmt.fmt "}" - -and fmt_uident ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) uident formatter = - match uident with - | Uident {uident} -> - formatter - |> Fmt.fmt "Uident " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "uident=" |> Scan.Token.pp uident - |> fmt_rcurly ~alt ~width -and pp_uident uident formatter = - fmt_uident uident formatter - -and fmt_cident ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) cident formatter = - match cident with - | Cident {cident} -> - formatter - |> Fmt.fmt "Cident " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "cident=" |> Scan.Token.pp cident - |> fmt_rcurly ~alt ~width -and pp_cident cident formatter = - fmt_cident cident formatter - -and fmt_ident ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) ident formatter = - match ident with - | IdentUident {uident} -> - formatter |> Fmt.fmt "IdentUident " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "uident=" |> pp_uident uident - |> fmt_rcurly ~alt ~width - | IdentCident {cident} -> - formatter |> Fmt.fmt "IdentCident " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "cident=" |> pp_cident cident - |> fmt_rcurly ~alt ~width - | IdentUscore {uscore} -> - formatter |> Fmt.fmt "IdentUscore " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "uscore=" |> Scan.Token.pp uscore - |> fmt_rcurly ~alt ~width -and pp_ident ident formatter = - fmt_ident ident formatter - -and fmt_precs_tl ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) precs_tl formatter = - let width' = width + 4L in - match precs_tl with - | PrecsTlCommaUident {comma; uident; precs_tl} -> - formatter |> Fmt.fmt "PrecsTlCommaUident " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "comma=" |> Scan.Token.pp comma - |> fmt_semi ~alt ~width - |> Fmt.fmt "uident=" |> fmt_uident ~alt ~width:width' uident - |> fmt_semi ~alt ~width - |> Fmt.fmt "precs_tl=" |> fmt_precs_tl ~alt ~width:width' precs_tl - |> fmt_rcurly ~alt ~width - | PrecsTlEpsilon -> - formatter |> Fmt.fmt "PrecsTlEpsilon" -and pp_precs_tl precs_tl formatter = - fmt_precs_tl precs_tl formatter - -and fmt_precs ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) precs formatter = - let width' = width + 4L in - match precs with - | Precs {uident; precs_tl} -> - formatter |> Fmt.fmt "Precs " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "uident=" |> fmt_uident ~alt ~width:width' uident - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "precs_tl=" |> fmt_precs_tl ~alt ~width:width' precs_tl - |> fmt_rcurly ~alt ~width -and pp_precs precs formatter = - fmt_precs precs formatter - -and fmt_prec_rels ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prec_rels formatter = - let width' = width + 4L in - match prec_rels with - | PrecRelsLtPrecs {lt; precs} -> - formatter |> Fmt.fmt "PrecRelsLtPrecs " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "lt=" |> Scan.Token.pp lt - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "precs=" |> fmt_precs ~alt ~width:width' precs - |> fmt_rcurly ~alt ~width - | PrecRelsEpsilon -> - formatter |> Fmt.fmt "PrecRelsEpsilon" -and pp_prec_rels prec_rels formatter = - fmt_prec_rels prec_rels formatter - -and fmt_prec_type ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prec_type formatter = - match prec_type with - | PrecTypeNeutral {neutral_} -> - formatter |> Fmt.fmt "PrecTypeNeutral " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "neutral_=" |> Scan.Token.pp neutral_ - |> fmt_rcurly ~alt ~width - | PrecTypeLeft {left_} -> - formatter |> Fmt.fmt "PrecTypeLeft " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "left_=" |> Scan.Token.pp left_ - |> fmt_rcurly ~alt ~width - | PrecTypeRight {right_} -> - formatter |> Fmt.fmt "PrecTypeRight " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "right_=" |> Scan.Token.pp right_ - |> fmt_rcurly ~alt ~width -and pp_prec_type prec_type formatter = - fmt_prec_type prec_type formatter - -and fmt_prec ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prec formatter = - let width' = width + 4L in - match prec with - | Prec {prec_type; uident; prec_rels} -> - formatter |> Fmt.fmt "Prec " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "prec_type=" |> fmt_prec_type ~alt ~width:width' prec_type - |> fmt_semi ~alt ~width - |> Fmt.fmt "uident=" |> fmt_uident ~alt ~width:width' uident - |> fmt_semi ~alt ~width - |> Fmt.fmt "prec_rels=" |> fmt_prec_rels ~alt ~width:width' prec_rels - |> fmt_rcurly ~alt ~width -and pp_prec prec formatter = - fmt_prec prec formatter - -and fmt_of_type ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) of_type formatter = - let width' = width + 4L in - match of_type with - | OfType {of_; type_module; dot; type_type} -> - formatter |> Fmt.fmt "OfType " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "of_=" |> Scan.Token.pp of_ - |> fmt_semi ~alt ~width - |> Fmt.fmt "type_module=" |> fmt_cident ~alt ~width:width' type_module - |> fmt_semi ~alt ~width - |> Fmt.fmt "dot=" |> Scan.Token.pp dot - |> fmt_semi ~alt ~width - |> Fmt.fmt "type_type=" |> fmt_uident ~alt ~width:width' type_type - |> fmt_rcurly ~alt ~width -and pp_of_type of_type formatter = - fmt_of_type of_type formatter - -and fmt_of_type0 ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) of_type0 formatter = - let width' = width + 4L in - match of_type0 with - | OfType0OfType {of_type} -> - formatter |> Fmt.fmt "OfType0OfType " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "of_type=" |> fmt_of_type ~alt ~width:width' of_type - |> fmt_rcurly ~alt ~width - | OfType0Epsilon -> - formatter |> Fmt.fmt "OfType0Epsilon" -and pp_of_type0 of_type0 formatter = - fmt_of_type0 of_type0 formatter - -and fmt_prec_ref ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prec_ref formatter = - let width' = width + 4L in - match prec_ref with - | PrecRefPrecUident {prec_; uident} -> - formatter |> Fmt.fmt "PrecRefPrecUident " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "prec_=" |> Scan.Token.pp prec_ - |> fmt_semi ~alt ~width - |> Fmt.fmt "uident=" |> fmt_uident ~alt ~width:width' uident - |> fmt_rcurly ~alt ~width - | PrecRefEpsilon -> - formatter |> Fmt.fmt "PrecRefEpsilon" -and pp_prec_ref prec_ref formatter = - fmt_prec_ref prec_ref formatter - -and fmt_token_alias ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) token_alias formatter = - match token_alias with - | TokenAlias {alias} -> - formatter |> Fmt.fmt "Token " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "alias=" |> Scan.Token.pp alias - |> fmt_rcurly ~alt ~width - | TokenAliasEpsilon -> - formatter |> Fmt.fmt "TokenAliasEpsilon" -and pp_token_alias token_alias formatter = - fmt_token_alias token_alias formatter - -and fmt_token ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) token formatter = - let width' = width + 4L in - match token with - | Token {token_; cident; token_alias; of_type0; prec_ref} -> - formatter |> Fmt.fmt "Token " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "token_=" |> Scan.Token.pp token_ - |> fmt_semi ~alt ~width - |> Fmt.fmt "cident=" |> fmt_cident ~alt ~width:width' cident - |> fmt_semi ~alt ~width - |> Fmt.fmt "token_alias=" |> fmt_token_alias ~alt ~width:width' token_alias - |> fmt_semi ~alt ~width - |> Fmt.fmt "of_type0=" |> fmt_of_type0 ~alt ~width:width' of_type0 - |> fmt_semi ~alt ~width - |> Fmt.fmt "prec_ref=" |> fmt_prec_ref ~alt ~width:width' prec_ref - |> fmt_rcurly ~alt ~width -and pp_token token formatter = - fmt_token token formatter - -and fmt_sep ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) sep formatter = - match sep with - | SepLineDelim {line_delim} -> - formatter |> Fmt.fmt "SepLineDelim " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "line_delim=" |> Scan.Token.pp line_delim - |> fmt_rcurly ~alt ~width - | SepSemi {semi} -> - formatter |> Fmt.fmt "SepSemi " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "semi=" |> Scan.Token.pp semi - |> fmt_rcurly ~alt ~width - | SepBar {bar} -> - formatter |> Fmt.fmt "SepBar " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "bar=" |> Scan.Token.pp bar - |> fmt_rcurly ~alt ~width -and pp_sep sep formatter = - fmt_sep sep formatter - -and fmt_codes_tl ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) codes_tl formatter = - let width' = width + 4L in - match codes_tl with - | CodesTlSepCode {sep; code; codes_tl} -> - formatter |> Fmt.fmt "CodesTlSepCode " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "sep=" |> fmt_sep ~alt ~width:width' sep - |> fmt_semi ~alt ~width - |> Fmt.fmt "code=" |> fmt_code ~alt ~width:width' code - |> fmt_rcurly ~alt ~width - |> Fmt.fmt "codes_tl=" |> fmt_codes_tl ~alt ~width:width' codes_tl - |> fmt_rcurly ~alt ~width - | CodesTlEpsilon -> formatter |> Fmt.fmt "CodesTlEpsilon" -and pp_codes_tl codes_tl formatter = - fmt_codes codes_tl formatter - -and fmt_codes ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) codes formatter = - let width' = width + 4L in - match codes with - | Codes {code; codes_tl} -> - formatter |> Fmt.fmt "Codes " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "code=" |> fmt_code ~alt ~width:width' code - |> fmt_semi ~alt ~width - |> Fmt.fmt "codes_tl=" |> fmt_codes_tl ~alt ~width:width' codes_tl - |> fmt_rcurly ~alt ~width -and pp_codes codes formatter = - fmt_codes codes formatter - -and fmt_codes0 ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) codes0 formatter = - let width' = width + 4L in - match codes0 with - | Codes0Codes {codes} -> - formatter |> Fmt.fmt "Codes0Codes " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "codes=" |> fmt_codes ~alt ~width:width' codes - |> fmt_rcurly ~alt ~width - | Codes0Epsilon -> - formatter |> Fmt.fmt "Codes0Epsilon" -and pp_codes0 codes formatter = - fmt_codes codes formatter - -and fmt_delimited ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) delimited formatter = - let width' = width + 4L in - match delimited with - | DelimitedBlock {indent; codes; dedent} -> - formatter |> Fmt.fmt "DelimitedBlock " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "indent=" |> Scan.Token.pp indent - |> fmt_semi ~alt ~width - |> Fmt.fmt "codes=" |> fmt_codes ~alt ~width:width' codes - |> fmt_semi ~alt ~width - |> Fmt.fmt "dedent=" |> Scan.Token.pp dedent - |> fmt_rcurly ~alt ~width - | DelimitedParen {lparen; codes0; rparen} -> - formatter |> Fmt.fmt "DelimitedParen " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "lparen=" |> Scan.Token.pp lparen - |> fmt_semi ~alt ~width - |> Fmt.fmt "codes0=" |> fmt_codes0 ~alt ~width:width' codes0 - |> fmt_semi ~alt ~width - |> Fmt.fmt "rparen=" |> Scan.Token.pp rparen - |> fmt_rcurly ~alt ~width - | DelimitedCapture {lcapture; codes0; rcapture} -> - formatter |> Fmt.fmt "DelimitedCapture " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "lcapture=" |> Scan.Token.pp lcapture - |> fmt_semi ~alt ~width - |> Fmt.fmt "codes0=" |> fmt_codes0 ~alt ~width:width' codes0 - |> fmt_semi ~alt ~width - |> Fmt.fmt "rcapture=" |> Scan.Token.pp rcapture - |> fmt_rcurly ~alt ~width - | DelimitedList {lbrack; codes0; rbrack} -> - formatter |> Fmt.fmt "DelimitedList " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "lbrack=" |> Scan.Token.pp lbrack - |> fmt_semi ~alt ~width - |> Fmt.fmt "codes0=" |> fmt_codes0 ~alt ~width:width' codes0 - |> fmt_semi ~alt ~width - |> Fmt.fmt "rbrack=" |> Scan.Token.pp rbrack - |> fmt_rcurly ~alt ~width - | DelimitedArray {larray; codes0; rarray} -> - formatter |> Fmt.fmt "DelimitedArray " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "larray=" |> Scan.Token.pp larray - |> fmt_semi ~alt ~width - |> Fmt.fmt "codes0=" |> fmt_codes0 ~alt ~width:width' codes0 - |> fmt_semi ~alt ~width - |> Fmt.fmt "rarray=" |> Scan.Token.pp rarray - |> fmt_rcurly ~alt ~width - | DelimitedModule {lcurly; codes0; rcurly} -> - formatter |> Fmt.fmt "DelimitedModule " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "lcurly=" |> Scan.Token.pp lcurly - |> fmt_semi ~alt ~width - |> Fmt.fmt "codes0=" |> fmt_codes0 ~alt ~width:width' codes0 - |> fmt_semi ~alt ~width - |> Fmt.fmt "rcurly=" |> Scan.Token.pp rcurly - |> fmt_rcurly ~alt ~width -and pp_delimited delimited formatter = - fmt_delimited delimited formatter - -and fmt_code_tl ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) code_tl formatter = - let width' = width + 4L in - match code_tl with - | CodeTlDelimited {delimited; code_tl} -> - formatter |> Fmt.fmt "CodeTlDelimited " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "delimited=" |> fmt_delimited ~alt ~width:width' delimited - |> fmt_semi ~alt ~width - |> Fmt.fmt "code_tl=" |> fmt_code_tl ~alt ~width:width' code_tl - |> fmt_rcurly ~alt ~width - | CodeTlToken {token_; code_tl} -> - formatter |> Fmt.fmt "CodeTlToken " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "token_=" |> Scan.Token.pp token_ - |> fmt_semi ~alt ~width - |> Fmt.fmt "code_tl=" |> fmt_code_tl ~alt ~width:width' code_tl - |> fmt_rcurly ~alt ~width - | CodeTlEpsilon -> - formatter |> Fmt.fmt "CodeTlEpsilon" -and pp_code_tl code_tl formatter = - fmt_code code_tl formatter - -and fmt_code ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) code formatter = - let width' = width + 4L in - match code with - | CodeDelimited {delimited; code_tl} -> - formatter |> Fmt.fmt "CodeDelimited " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "delimited=" |> fmt_delimited ~alt ~width:width' delimited - |> fmt_semi ~alt ~width - |> Fmt.fmt "code_tl=" |> fmt_code_tl ~alt ~width:width' code_tl - |> fmt_rcurly ~alt ~width - | CodeToken {token_; code_tl} -> - formatter |> Fmt.fmt "CodeToken " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "token_=" |> Scan.Token.pp token_ - |> fmt_semi ~alt ~width - |> Fmt.fmt "code_tl=" |> fmt_code_tl ~alt ~width:width' code_tl - |> fmt_rcurly ~alt ~width -and pp_code code formatter = - fmt_code code formatter - -and fmt_prod_param_symbol ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prod_param_symbol - formatter = - let width' = width + 4L in - match prod_param_symbol with - | ProdParamSymbolCident {cident} -> - formatter |> Fmt.fmt "ProdParamSymbolCident " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "cident=" |> fmt_cident ~alt ~width:width' cident - |> fmt_rcurly ~alt ~width - | ProdParamSymbolAlias {alias} -> - formatter |> Fmt.fmt "ProdParamSymbolAlias " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "alias=" |> Scan.Token.pp alias - |> fmt_rcurly ~alt ~width -and pp_prod_param_symbol prod_param_symbol formatter = - fmt_prod_param_symbol prod_param_symbol formatter - -and fmt_prod_param ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prod_param formatter = - let width' = width + 4L in - match prod_param with - | ProdParamBinding {ident; colon; prod_param_symbol} -> - formatter |> Fmt.fmt "ProdParam " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "ident=" |> fmt_ident ~alt ~width:width' ident - |> fmt_semi ~alt ~width - |> Fmt.fmt "colon=" |> Scan.Token.pp colon - |> fmt_semi ~alt ~width - |> Fmt.fmt "prod_param_symbol=" |> fmt_prod_param_symbol ~alt ~width:width' prod_param_symbol - |> fmt_rcurly ~alt ~width - | ProdParam {prod_param_symbol} -> - formatter |> Fmt.fmt "ProdParam " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "prod_param_symbol=" |> fmt_prod_param_symbol ~alt ~width:width' prod_param_symbol - |> fmt_rcurly ~alt ~width -and pp_prod_param prod_param formatter = - fmt_prod_param prod_param formatter - -and fmt_prod_params_tl ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prod_params_tl formatter = - let width' = width + 4L in - match prod_params_tl with - | ProdParamsTlProdParam {prod_param; prod_params_tl} -> - formatter |> Fmt.fmt "ProdParamsTlProdParam " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "prod_param=" |> fmt_prod_param ~alt ~width:width' prod_param - |> fmt_semi ~alt ~width - |> Fmt.fmt "prod_params_tl=" |> fmt_prod_params_tl ~alt ~width:width' prod_params_tl - |> fmt_rcurly ~alt ~width - | ProdParamsTlEpsilon -> - formatter |> Fmt.fmt "ProdParamsTlEpsilon" -and pp_prod_params_tl prod_params_tl formatter = - fmt_prod_params_tl prod_params_tl formatter - -and fmt_prod_params ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prod_params formatter = - let width' = width + 4L in - match prod_params with - | ProdParamsProdParam {prod_param; prod_params_tl} -> - formatter |> Fmt.fmt "ProdParamsProdParam " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "prod_param=" |> fmt_prod_param ~alt ~width:width' prod_param - |> fmt_semi ~alt ~width - |> Fmt.fmt "prod_params_tl=" |> fmt_prod_params_tl ~alt ~width:width' prod_params_tl - |> fmt_rcurly ~alt ~width -and pp_prod_params prod_params formatter = - fmt_prod_params prod_params formatter - -and fmt_prod_pattern ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prod_pattern formatter = - let width' = width + 4L in - match prod_pattern with - | ProdPatternParams {prod_params} -> - formatter |> Fmt.fmt "ProdPatternParams " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "prod_params=" |> fmt_prod_params ~alt ~width:width' prod_params - |> fmt_rcurly ~alt ~width - | ProdPatternEpsilon {epsilon_} -> - formatter |> Fmt.fmt "ProdPatternEpsilon " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "epsilon_=" |> Scan.Token.pp epsilon_ - |> fmt_rcurly ~alt ~width -and pp_prod_pattern prod_pattern formatter = - fmt_prod_pattern prod_pattern formatter - -and fmt_prod ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prod formatter = - let width' = width + 4L in - match prod with - | Prod {prod_pattern; prec_ref} -> - formatter |> Fmt.fmt "Prod " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "prod_pattern=" |> fmt_prod_pattern ~alt ~width:width' prod_pattern - |> fmt_semi ~alt ~width - |> Fmt.fmt "prec_ref=" |> fmt_prec_ref ~alt ~width:width' prec_ref - |> fmt_rcurly ~alt ~width -and pp_prod prod formatter = - fmt_prod prod formatter - -and fmt_prods_tl ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prods_tl formatter = - let width' = width + 4L in - match prods_tl with - | ProdsTlBarProd {bar; prod; prods_tl} -> - formatter |> Fmt.fmt "ProdsTlBarProd " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "bar=" |> Scan.Token.pp bar - |> fmt_semi ~alt ~width - |> Fmt.fmt "prod=" |> fmt_prod ~alt ~width:width' prod - |> fmt_semi ~alt ~width - |> Fmt.fmt "prods_tl=" |> fmt_prods_tl ~alt ~width:width' prods_tl - |> fmt_rcurly ~alt ~width - | ProdsTlEpsilon -> - formatter |> Fmt.fmt "ProdsTlEpsilon" -and pp_prods_tl prods_tl formatter = - fmt_prods_tl prods_tl formatter - -and fmt_prods ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prods formatter = - let width' = width + 4L in - match prods with - | ProdsBarProd {bar; prod; prods_tl} -> - formatter |> Fmt.fmt "ProdsBarProd " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "bar=" |> Scan.Token.pp bar - |> fmt_semi ~alt ~width - |> Fmt.fmt "prod=" |> fmt_prod ~alt ~width:width' prod - |> fmt_semi ~alt ~width - |> Fmt.fmt "prods_tl=" |> fmt_prods_tl ~alt ~width:width' prods_tl - |> fmt_rcurly ~alt ~width - | ProdsProd {prod; prods_tl} -> - formatter |> Fmt.fmt "ProdsProd " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "prod=" |> fmt_prod ~alt ~width:width' prod - |> fmt_semi ~alt ~width - |> Fmt.fmt "prods_tl=" |> fmt_prods_tl ~alt ~width:width' prods_tl - |> fmt_rcurly ~alt ~width -and pp_prods prods formatter = - fmt_prods prods formatter - -and fmt_reduction ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) reduction formatter = - let width' = width + 4L in - match reduction with - | Reduction {prods; arrow; code} -> - formatter |> Fmt.fmt "Reduction " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "prods=" |> fmt_prods ~alt ~width:width' prods - |> fmt_semi ~alt ~width - |> Fmt.fmt "arrow=" |> Scan.Token.pp arrow - |> fmt_semi ~alt ~width - |> Fmt.fmt "code=" |> pp_code code - |> fmt_rcurly ~alt ~width -and pp_reduction reduction formatter = - fmt_reduction reduction formatter - -and fmt_reductions_tl ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) reductions_tl formatter = - let width' = width + 4L in - match reductions_tl with - | ReductionsTlBarReduction {bar; reduction; reductions_tl} -> - formatter |> Fmt.fmt "ReductionsTlBarReduction " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "bar=" |> Scan.Token.pp bar - |> fmt_semi ~alt ~width - |> Fmt.fmt "reduction=" |> fmt_reduction ~alt ~width:width' reduction - |> fmt_semi ~alt ~width - |> Fmt.fmt "reductions_tl=" |> fmt_reductions_tl ~alt ~width:width' reductions_tl - |> fmt_rcurly ~alt ~width - | ReductionsTlEpsilon -> - formatter |> Fmt.fmt "ReductionsTlEpsilon" -and pp_reductions_tl reductions_tl formatter = - fmt_reductions_tl reductions_tl formatter - -and fmt_reductions ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) reductions formatter = - let width' = width + 4L in - match reductions with - | ReductionsReduction {reduction; reductions_tl} -> - formatter |> Fmt.fmt "ReductionsReduction " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "reduction=" |> fmt_reduction ~alt ~width:width' reduction - |> fmt_semi ~alt ~width - |> Fmt.fmt "reductions_tl=" |> fmt_reductions_tl ~alt ~width:width' reductions_tl - |> fmt_rcurly ~alt ~width -and pp_reductions reductions formatter = - fmt_reductions reductions formatter - -and fmt_nonterm_type ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) nonterm_type formatter = - match nonterm_type with - | NontermTypeNonterm {nonterm_} -> - formatter |> Fmt.fmt "NontermTypeNonterm " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "nonterm_=" |> Scan.Token.pp nonterm_ - |> fmt_rcurly ~alt ~width - | NontermTypeStart {start_} -> - formatter |> Fmt.fmt "NontermTypeStart " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "start_=" |> Scan.Token.pp start_ - |> fmt_rcurly ~alt ~width -and pp_nonterm_type nonterm_type formatter = - fmt_nonterm_type nonterm_type formatter - -and fmt_nonterm ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) nonterm formatter = - let width' = width + 4L in - match nonterm with - | NontermProds {nonterm_type; cident; prec_ref; cce; prods} -> - formatter |> Fmt.fmt "NontermProds " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "nonterm_type=" |> fmt_nonterm_type ~alt ~width:width' nonterm_type - |> fmt_semi ~alt ~width - |> Fmt.fmt "cident=" |> fmt_cident ~alt ~width:width' cident - |> fmt_semi ~alt ~width - |> Fmt.fmt "prec_ref=" |> fmt_prec_ref ~alt ~width:width' prec_ref - |> fmt_semi ~alt ~width - |> Fmt.fmt "cce=" |> Scan.Token.pp cce - |> fmt_semi ~alt ~width - |> Fmt.fmt "prods=" |> fmt_prods ~alt ~width:width' prods - |> fmt_rcurly ~alt ~width - | NontermReductions {nonterm_type; cident; of_type; prec_ref; cce; reductions} -> - formatter |> Fmt.fmt "NontermReductions " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "nonterm_type=" |> fmt_nonterm_type ~alt ~width:width' nonterm_type - |> fmt_semi ~alt ~width - |> Fmt.fmt "cident=" |> fmt_cident ~alt ~width:width' cident - |> fmt_semi ~alt ~width - |> Fmt.fmt "of_type=" |> fmt_of_type ~alt ~width:width' of_type - |> fmt_semi ~alt ~width - |> Fmt.fmt "prec_ref=" |> fmt_prec_ref ~alt ~width:width' prec_ref - |> fmt_semi ~alt ~width - |> Fmt.fmt "cce=" |> Scan.Token.pp cce - |> fmt_semi ~alt ~width - |> Fmt.fmt "reductions=" |> fmt_reductions ~alt ~width:width' reductions - |> fmt_rcurly ~alt ~width -and pp_nonterm nonterm formatter = - fmt_nonterm nonterm formatter - -and fmt_stmt ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) stmt formatter = - let width' = width + 4L in - match stmt with - | StmtPrec {prec_} -> - formatter |> Fmt.fmt "StmtPrec " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "prec_=" |> fmt_prec ~alt ~width:width' prec_ - |> fmt_rcurly ~alt ~width - | StmtToken {token_} -> - formatter |> Fmt.fmt "StmtToken " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "token_=" |> fmt_token ~alt ~width:width' token_ - |> fmt_rcurly ~alt ~width - | StmtNonterm {nonterm_} -> - formatter |> Fmt.fmt "StmtNonterm " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "nonterm_=" |> fmt_nonterm ~alt ~width:width' nonterm_ - |> fmt_rcurly ~alt ~width - | StmtCode {code} -> - formatter |> Fmt.fmt "StmtCode " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "code=" |> fmt_code ~alt ~width:width' code - |> fmt_rcurly ~alt ~width -and pp_stmt stmt formatter = - fmt_stmt stmt formatter - -and fmt_stmts_tl ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) stmts_tl formatter = - let width' = width + 4L in - match stmts_tl with - | StmtsTl {line_delim; stmt; stmts_tl} -> - formatter |> Fmt.fmt "StmtsTl " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "line_delim=" |> Scan.Token.pp line_delim - |> fmt_semi ~alt ~width - |> Fmt.fmt "stmt=" |> fmt_stmt ~alt ~width:width' stmt - |> fmt_semi ~alt ~width - |> Fmt.fmt "stmts_tl=" |> fmt_stmts_tl ~alt ~width:width' stmts_tl - |> fmt_rcurly ~alt ~width - | StmtsTlEpsilon -> - formatter |> Fmt.fmt "StmtsTlEpsilon" -and pp_stmts_tl stmts_tl formatter = - fmt_stmts_tl stmts_tl formatter - -and fmt_stmts ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) stmts formatter = - let width' = width + 4L in - match stmts with - | Stmts {stmt; stmts_tl} -> - formatter |> Fmt.fmt "Stmts " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "stmt=" |> fmt_stmt ~alt ~width:width' stmt - |> fmt_semi ~alt ~width - |> Fmt.fmt "stmts_tl=" |> fmt_stmts_tl ~alt ~width:width' stmts_tl - |> fmt_rcurly ~alt ~width -and pp_stmts stmts formatter = - fmt_stmts stmts formatter - -and fmt_hocc ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) hocc formatter = - let width' = width + 4L in - match hocc with - | Hocc {hocc_; indent; stmts; dedent} -> - formatter |> Fmt.fmt "Hocc " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "hocc_=" |> Scan.Token.pp hocc_ - |> fmt_semi ~alt ~width - |> Fmt.fmt "indent=" |> Scan.Token.pp indent - |> fmt_semi ~alt ~width - |> Fmt.fmt "stmts=" |> fmt_stmts ~alt ~width:width' stmts - |> fmt_semi ~alt ~width - |> Fmt.fmt "dedent=" |> Scan.Token.pp dedent - |> fmt_rcurly ~alt ~width -and pp_hocc hocc formatter = - fmt_hocc hocc formatter - -and fmt_eoi ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) eoi formatter = - match eoi with - | Eoi {eoi} -> - formatter |> Fmt.fmt "Eoi " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "eoi=" |> Scan.Token.pp eoi - |> fmt_rcurly ~alt ~width -and pp_eoi eoi formatter = - fmt_eoi eoi formatter - -and fmt_matter ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) matter formatter = - let width' = width + 4L in - match matter with - | Matter {token_; matter} -> - formatter |> Fmt.fmt "Matter " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "token_=" |> Scan.Token.pp token_ - |> fmt_semi ~alt ~width - |> Fmt.fmt "matter=" |> fmt_matter ~alt ~width:width' matter - |> fmt_rcurly ~alt ~width - | MatterEpsilon -> - formatter |> Fmt.fmt "MatterEpsilon" -and pp_matter matter formatter = - fmt_matter matter formatter - -and fmt_hmh ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) hmh formatter = - let width' = width + 4L in - match hmh with - | Hmh {prelude; hocc_; postlude; eoi} -> - formatter |> Fmt.fmt "Hmh " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "prelude=" |> pp_matter prelude - |> fmt_semi ~alt ~width - |> Fmt.fmt "hocc_=" |> fmt_hocc ~alt ~width:width' hocc_ - |> fmt_semi ~alt ~width - |> Fmt.fmt "postlude=" |> pp_matter postlude - |> fmt_semi ~alt ~width - |> Fmt.fmt "eoi=" |> Scan.Token.pp eoi - |> fmt_rcurly ~alt ~width -and pp_hmh hmh formatter = - fmt_hmh hmh formatter - -and fmt_hmhi ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) hmhi formatter = - match hmhi with - | Hmhi {prelude; hocc_; postlude; eoi} -> - formatter |> Fmt.fmt "Hmhi " - |> fmt_lcurly ~alt ~width - |> Fmt.fmt "prelude=" |> pp_matter prelude - |> fmt_semi ~alt ~width - |> Fmt.fmt "hocc_=" |> Scan.Token.pp hocc_ - |> fmt_semi ~alt ~width - |> Fmt.fmt "postlude=" |> pp_matter postlude - |> fmt_semi ~alt ~width - |> Fmt.fmt "eoi=" |> Scan.Token.pp eoi - |> fmt_rcurly ~alt ~width -and pp_hmhi hmhi formatter = - fmt_hmhi hmhi formatter + match alt with + | false -> formatter |> Fmt.fmt "{" + | true -> + formatter + |> Fmt.fmt "{\n" + |> Fmt.fmt ~pad:" " ~just:Fmt.Left ~width:(width + 4L) "" + + and fmt_semi ~alt ~width formatter = + match alt with + | false -> formatter |> Fmt.fmt "; " + | true -> + formatter + |> Fmt.fmt "\n" + |> Fmt.fmt ~pad:" " ~just:Fmt.Left ~width:(width + 4L) "" -(**************************************************************************************************) -(* Recursive descent parser. *) - -let trace = false - -type ctx = { - scanner: Scan.t; - errs: Error.t list; -} - -let pp_ctx {scanner; errs} formatter = - formatter - |> Fmt.fmt "{scanner=" |> Scan.pp scanner - |> Fmt.fmt "; errs=" |> (List.pp Error.pp) errs - |> Fmt.fmt "}" - -let rec next ?(all=false) spine ({scanner; errs} as ctx) = - let scanner', tok = Scan.next scanner in - let _ = if trace then - File.Fmt.stderr - |> Fmt.fmt "hocc (trace): next ~all:" |> Bool.pp all - |> Fmt.fmt " " |> (List.pp String.pp) (List.rev spine) - |> Fmt.fmt " " |> pp_ctx ctx |> ignore - in - let malformations = Scan.Token.malformations tok in - let tok, errs' = match malformations with - | [] -> tok, errs - | mal :: [] -> begin - (* Try to pass e.g. 42L through as a u64 token to support OCaml syntax. *) - let u64_opt = match Hmc.Scan.AbstractToken.Rendition.Malformation.description mal with - | "Invalid numerical constant" -> begin - let source = Scan.Token.source tok in - Hmc.Source.Slice.to_string source - |> String.chop_suffix ~suffix:"L" - |> (fun s_opt -> - match s_opt with - | None -> None - | Some s -> Stdlib.Int64.of_string_opt s - ) - end - | _ -> None - in - match u64_opt with - | Some x -> begin - let rendition = Hmc.Scan.AbstractToken.Rendition.Constant x in - let ctok = Hmc.Scan.ConcreteToken.{ - atok=Hmc.Scan.AbstractToken.Tok_u64 rendition; - source=Scan.Token.source tok - } in - let tok = Scan.Token.HmcToken ctok in - tok, errs - end - | None -> begin - let errs' = Error.init_mal mal :: errs in - tok, errs' - end - end - | _ -> begin - let errs' = List.fold malformations ~init:errs ~f:(fun accum mal -> - Error.init_mal mal :: accum) in - tok, errs' - end in - let ctx' = {scanner=scanner'; errs=errs'} in - match all, tok with - | _, HmcToken {atok=Tok_whitespace; _} - | false, HmcToken {atok=(Tok_hash_comment|Tok_paren_comment _); _} -> begin - let _ = if trace then - File.Fmt.stderr |> Fmt.fmt " -> recurse (" |> Scan.Token.pp tok |> Fmt.fmt ")\n" |> ignore - in - next ~all spine ctx' - end - | _ -> begin - let _ = if trace then - File.Fmt.stderr |> Fmt.fmt " -> " |> Scan.Token.pp tok |> Fmt.fmt "\n" |> ignore in - ctx', tok - end - -let err msg {scanner; errs} = - {scanner; errs=(Error.init_scanner scanner msg) :: errs} - -let err_token tok msg {scanner; errs} = - {scanner; errs=(Error.init_token tok msg) :: errs} - -let reduce ?(alt=true) spine ctx - (fmt_t: ?alt:bool -> ?width:uns -> 'a -> (module Fmt.Formatter) -> (module Fmt.Formatter)) t = - let _ = if trace then - File.Fmt.stderr |> Fmt.fmt "hocc (trace): reduce " |> (List.pp String.pp) (List.rev spine) - |> Fmt.fmt " " |> pp_ctx ctx |> Fmt.fmt " " |> fmt_t ~alt t |> Fmt.fmt "\n" |> ignore - in - ctx, Some t - -(* Map optional subtree result, passing the resulting ctx in to enable tail recursion. *) -let mapr ~child ~f spine ctx = - let ctx', child_opt = child spine ctx in - match child_opt with - | None -> ctx', None - | Some c -> f spine ctx' c - -(* Map optional subtree result, without support for tail recursion. *) -let map ~child ~f - ~(fmt_child: ?alt:bool -> ?width:uns -> 'a -> (module Fmt.Formatter) -> (module Fmt.Formatter)) - spine ctx = - mapr ~child ~f:(fun spine ctx' c -> reduce spine ctx' fmt_child (f c)) spine ctx - -let rec uident spine ctx = - let spine = match trace with true -> "uident" :: spine | false -> [] in - let ctx', tok = next spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_uident _; _} as uident -> - reduce spine ctx' fmt_uident (Uident {uident}) - | _ -> err_token tok "Expected uident" ctx, None - -and cident spine ctx = - let spine = "cident" :: spine in - let ctx', tok = next spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_cident _; _} as cident -> - reduce spine ctx' fmt_cident (Cident {cident}) - | _ -> err_token tok "Expected cident" ctx, None - -and ident spine ctx = - let spine = "ident" :: spine in - let ctx', tok = next spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_uident _; _} as uident -> - reduce spine ctx' fmt_ident (IdentUident {uident=Uident {uident}}) - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_cident _; _} as cident -> - reduce spine ctx' fmt_ident (IdentCident {cident=Cident {cident}}) - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_uscore; _} as uscore -> - reduce spine ctx' fmt_ident (IdentUscore {uscore}) - | _ -> err_token tok "Expected ident" ctx, None - -and precs_tl spine ctx = - let spine = "precs_tl" :: spine in - let ctx', tok = next spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_comma; _} as comma -> - mapr ~child:uident ~f:(fun spine ctx' uident -> - map ~child:precs_tl ~f:(fun precs_tl -> - PrecsTlCommaUident {comma; uident; precs_tl} - ) ~fmt_child:fmt_precs_tl spine ctx' - ) spine ctx' - | _ -> reduce spine ctx fmt_precs_tl PrecsTlEpsilon - -and precs spine ctx = - let spine = "precs" :: spine in - mapr ~child:uident ~f:(fun spine ctx' uident -> - map ~child:precs_tl ~f:(fun precs_tl -> - Precs {uident; precs_tl} - ) ~fmt_child:fmt_precs spine ctx' - ) spine ctx - -and prec_rels spine ctx = - let spine = "prec_rels" :: spine in - let ctx', tok = next spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_lt; _} as lt -> - map ~child:precs ~f:(fun precs -> - PrecRelsLtPrecs {lt; precs} - ) ~fmt_child:fmt_prec_rels spine ctx' - | _ -> reduce spine ctx fmt_prec_rels PrecRelsEpsilon - -and prec_type spine ctx = - let spine = "prec_type" :: spine in - let ctx', tok = next spine ctx in - match tok with - | HoccToken {atok=Scan.AbstractToken.Tok_neutral; _} as neutral_ -> - reduce spine ctx' fmt_prec_type (PrecTypeNeutral {neutral_}) - | HoccToken {atok=Scan.AbstractToken.Tok_left; _} as left_ -> - reduce spine ctx' fmt_prec_type (PrecTypeLeft {left_}) - | HoccToken {atok=Scan.AbstractToken.Tok_right; _} as right_ -> - reduce spine ctx' fmt_prec_type (PrecTypeRight {right_}) - | _ -> err_token tok "Expected precedence type" ctx, None - -and prec spine ctx = - let spine = "prec" :: spine in - mapr ~child:prec_type ~f:(fun spine ctx' prec_type -> - mapr ~child:uident ~f:(fun spine ctx' uident -> - map ~child:prec_rels ~f:(fun prec_rels -> - Prec {prec_type; uident; prec_rels} - ) ~fmt_child:fmt_prec spine ctx' - ) spine ctx' - ) spine ctx - -and of_type spine ctx = - let spine = "of_type" :: spine in - let ctx', tok = next spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_of; _} as of_ -> - let dot spine ctx = begin - let spine = "dot" :: spine in - let ctx', tok = next spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_dot; _} -> ctx', Some tok - | _ -> err_token tok "Expected '.'" ctx, None - end in - mapr ~child:cident ~f:(fun spine ctx' type_module -> - mapr ~child:dot ~f:(fun spine ctx' dot -> - map ~child:uident ~f:(fun type_type -> - OfType {of_; type_module; dot; type_type} - ) ~fmt_child:fmt_of_type spine ctx' - ) spine ctx' - ) spine ctx' - | _ -> err_token tok "Expected 'of'" ctx, None - -and of_type0 spine ctx = - let spine = "of_type0" :: spine in - let _ctx', tok = next spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_of; _} -> - map ~child:of_type ~f:(fun of_type -> - OfType0OfType {of_type} - ) ~fmt_child:fmt_of_type0 spine ctx - | _ -> reduce spine ctx fmt_of_type0 OfType0Epsilon - -and prec_ref spine ctx = - let spine = "prec_ref" :: spine in - let ctx', tok = next spine ctx in - match tok with - | HoccToken {atok=Scan.AbstractToken.Tok_prec; _} as prec_ -> - map ~child:uident ~f:(fun uident -> - PrecRefPrecUident {prec_; uident} - ) ~fmt_child:fmt_prec_ref spine ctx' - | _ -> reduce spine ctx fmt_prec_ref PrecRefEpsilon - -and token_alias spine ctx = - let spine = "token_alias" :: spine in - let ctx', tok = next spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_istring _; _} as alias -> - reduce spine ctx' fmt_token_alias (TokenAlias {alias}) - | _ -> reduce spine ctx fmt_token_alias TokenAliasEpsilon - -and token spine ctx = - let ctx', tok = next spine ctx in - match tok with - | HoccToken {atok=Scan.AbstractToken.Tok_token; _} as token_ -> - mapr ~child:cident ~f:(fun spine ctx' cident -> - mapr ~child:token_alias ~f:(fun spine ctx' token_alias -> - mapr ~child:of_type0 ~f:(fun spine ctx' of_type0 -> - map ~child:prec_ref ~f:(fun prec_ref -> - Token {token_; cident; token_alias; of_type0; prec_ref} - ) ~fmt_child:fmt_token spine ctx' - ) spine ctx' - ) spine ctx' - ) spine ctx' - | _ -> err_token tok "Expected 'token' statement" ctx, None - -and sep spine ctx = - let spine = "sep" :: spine in - let ctx', tok = next ~all:true spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_line_delim; _} as line_delim -> - reduce spine ctx' fmt_sep (SepLineDelim {line_delim}) - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_semi; _} as semi -> - reduce spine ctx' fmt_sep (SepSemi {semi}) - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_bar; _} as bar -> - reduce spine ctx' fmt_sep (SepBar {bar}) - | _ -> ctx, None - -and codes_tl spine ctx = - let spine = "codes_tl" :: spine in - let _ctx', tok = next ~all:true spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_line_delim; _} - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_semi; _} - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_bar; _} -> - mapr ~child:sep ~f:(fun spine ctx' sep -> - mapr ~child:code ~f:(fun spine ctx' code -> - map ~child:codes_tl ~f:(fun codes_tl -> - CodesTlSepCode {sep; code; codes_tl} - ) ~fmt_child:fmt_codes_tl spine ctx' - ) spine ctx' - ) spine ctx - | _ -> reduce spine ctx fmt_codes_tl CodesTlEpsilon - -and codes spine ctx = - let spine = "codes" :: spine in - mapr ~child:code ~f:(fun spine ctx' code -> - map ~child:codes_tl ~f:(fun codes_tl -> - Codes {code; codes_tl} - ) ~fmt_child:fmt_codes spine ctx' - ) spine ctx - -and codes0 spine ctx = - let spine = "codes0" :: spine in - let ctx', codes_opt = codes spine ctx in - match codes_opt with - | Some codes -> reduce spine ctx' fmt_codes0 (Codes0Codes {codes}) - | None -> reduce spine ctx fmt_codes0 Codes0Epsilon - -and indent spine ctx = - let spine = "indent" :: spine in - let ctx', tok = next spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_indent _; _} -> ctx', Some tok - | _ -> err_token tok "Expected indent" ctx, None - -and dedent ?all spine ctx = - let spine = "dedent" :: spine in - let ctx', tok = next ?all spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_dedent _; _} -> ctx', Some tok - | _ -> err_token tok "Expected dedent" ctx, None - -and rparen ?all spine ctx = - let spine = "rparen" :: spine in - let ctx', tok = next ?all spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_rparen; _} -> ctx', Some tok - | _ -> err_token tok "Expected ')'" ctx, None - -and rcapture ?all spine ctx = - let spine = "rcapture" :: spine in - let ctx', tok = next ?all spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_rcapture; _} -> ctx', Some tok - | _ -> err_token tok "Expected '|)'" ctx, None - -and rbrack ?all spine ctx = - let spine = "rbrack" :: spine in - let ctx', tok = next ?all spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_rbrack; _} -> ctx', Some tok - | _ -> err_token tok "Expected ']'" ctx, None - -and rarray ?all spine ctx = - let spine = "rarray" :: spine in - let ctx', tok = next ?all spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_rarray; _} -> ctx', Some tok - | _ -> err_token tok "Expected '|]'" ctx, None - -and rcurly ?all spine ctx = - let spine = "rcurly" :: spine in - let ctx', tok = next ?all spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_rcurly; _} -> ctx', Some tok - | _ -> err_token tok "Expected '}'" ctx, None - -and delimited spine ctx = - let spine = "delimited" :: spine in - let ctx', tok = next ~all:true spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_indent _; _} as indent -> - mapr ~child:codes ~f:(fun spine ctx' codes -> - map ~child:(dedent ~all:true) ~f:(fun dedent -> - DelimitedBlock {indent; codes; dedent} - ) ~fmt_child:fmt_delimited spine ctx' - ) spine ctx' - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_lparen; _} as lparen -> - mapr ~child:codes0 ~f:(fun spine ctx' codes0 -> - map ~child:(rparen ~all:true) ~f:(fun rparen -> - DelimitedParen {lparen; codes0; rparen} - ) ~fmt_child:fmt_delimited spine ctx' - ) spine ctx' - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_lcapture; _} as lcapture -> - mapr ~child:codes0 ~f:(fun spine ctx' codes0 -> - map ~child:(rcapture ~all:true) ~f:(fun rcapture -> - DelimitedCapture {lcapture; codes0; rcapture} - ) ~fmt_child:fmt_delimited spine ctx' - ) spine ctx' - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_lbrack; _} as lbrack -> - mapr ~child:codes0 ~f:(fun spine ctx' codes0 -> - map ~child:(rbrack ~all:true) ~f:(fun rbrack -> - DelimitedList {lbrack; codes0; rbrack} - ) ~fmt_child:fmt_delimited spine ctx' - ) spine ctx' - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_larray; _} as larray -> - mapr ~child:codes0 ~f:(fun spine ctx' codes0 -> - map ~child:(rarray ~all:true) ~f:(fun rarray -> - DelimitedArray {larray; codes0; rarray} - ) ~fmt_child:fmt_delimited spine ctx' - ) spine ctx' - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_lcurly; _} as lcurly -> - mapr ~child:codes0 ~f:(fun spine ctx' codes0 -> - map ~child:(rcurly ~all:true) ~f:(fun rcurly -> - DelimitedModule {lcurly; codes0; rcurly} - ) ~fmt_child:fmt_delimited spine ctx' - ) spine ctx' - | _ -> err_token tok "Expected left delimiter" ctx, None - -and code_tl spine ctx = - let spine = "code_tl" :: spine in - let ctx', tok = next ~all:true spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.(Tok_indent _|Tok_lparen|Tok_lcapture|Tok_lbrack - |Tok_larray|Tok_lcurly); _} -> - mapr ~child:delimited ~f:(fun spine ctx' delimited -> - map ~child:code_tl ~f:(fun code_tl -> - CodeTlDelimited {delimited; code_tl} - ) ~fmt_child:fmt_code_tl spine ctx' - ) spine ctx - | HmcToken {atok=Hmc.Scan.AbstractToken.(Tok_dedent _|Tok_rparen|Tok_rcapture|Tok_rbrack - |Tok_rarray|Tok_rcurly - |Tok_line_delim|Tok_semi|Tok_bar); _} -> - reduce spine ctx fmt_code_tl CodeTlEpsilon - | HmcToken _ as token_ -> - map ~child:code_tl ~f:(fun code_tl -> - CodeTlToken {token_; code_tl} - ) ~fmt_child:fmt_code_tl spine ctx' - | _ -> reduce spine ctx fmt_code_tl CodeTlEpsilon - -and code spine ctx = - let spine = "code" :: spine in - let ctx', tok = next ~all:true spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.(Tok_indent _|Tok_lparen|Tok_lcapture|Tok_lbrack - |Tok_larray|Tok_lcurly); _} -> - mapr ~child:delimited ~f:(fun spine ctx' delimited -> - map ~child:code_tl ~f:(fun code_tl -> - CodeDelimited {delimited; code_tl} - ) ~fmt_child:fmt_code spine ctx' - ) spine ctx - | HmcToken {atok=Hmc.Scan.AbstractToken.(Tok_dedent _|Tok_rparen|Tok_rcapture|Tok_rbrack - |Tok_rarray|Tok_rcurly - |Tok_line_delim|Tok_semi|Tok_bar); _} -> - err_token tok "Expected Hemlock code" ctx, None - | HmcToken _ as token_ -> - map ~child:code_tl ~f:(fun code_tl -> - CodeToken {token_; code_tl} - ) ~fmt_child:fmt_code spine ctx' - | _ -> err_token tok "Expected Hemlock code" ctx, None - -and prod_param_symbol spine ctx = - let spine = "prod_param_symbol" :: spine in - let ctx', tok = next spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_cident _; _} as cident -> - reduce spine ctx' fmt_prod_param_symbol (ProdParamSymbolCident {cident=Cident {cident}}) - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_istring _; _} as alias -> - reduce spine ctx' fmt_prod_param_symbol (ProdParamSymbolAlias {alias}) - | _ -> err_token tok "Expected production parameter symbol" ctx, None - -and prod_param spine ctx = - let spine = "prod_param" :: spine in - let colon spine ctx = begin - let spine = "colon" :: spine in - let ctx', tok = next spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_colon; _} -> ctx', Some tok - | _ -> err_token tok "Expected ':'" ctx, None - end in - let ctx', prod_param_binding_opt = mapr ~child:ident ~f:(fun spine ctx' ident -> - mapr ~child:colon ~f:(fun spine ctx' colon -> - map ~child:prod_param_symbol ~f:(fun prod_param_symbol -> - ProdParamBinding {ident; colon; prod_param_symbol} - ) ~fmt_child:fmt_prod_param spine ctx' - ) spine ctx' - ) spine ctx - in - match prod_param_binding_opt with - | Some _ -> ctx', prod_param_binding_opt - | None -> begin - map ~child:prod_param_symbol ~f:(fun prod_param_symbol -> - ProdParam {prod_param_symbol} - ) ~fmt_child:fmt_prod_param spine ctx - end - -and prod_params_tl spine ctx = - let spine = "prod_params_tl" :: spine in - let ctx', prod_param_opt = prod_param spine ctx in - match prod_param_opt with - | Some prod_param -> - map ~child:prod_params_tl ~f:(fun prod_params_tl -> - ProdParamsTlProdParam {prod_param; prod_params_tl} - ) ~fmt_child:fmt_prod_params_tl spine ctx' - | None -> reduce spine ctx fmt_prod_params_tl ProdParamsTlEpsilon - -and prod_params spine ctx = - let spine = "prod_params" :: spine in - mapr ~child:prod_param ~f:(fun spine ctx' prod_param -> - map ~child:prod_params_tl ~f:(fun prod_params_tl -> - ProdParamsProdParam {prod_param; prod_params_tl} - ) ~fmt_child:fmt_prod_params spine ctx' - ) spine ctx - -and prod_pattern spine ctx = - let spine = "prod_pattern" :: spine in - let ctx', tok = next spine ctx in - match tok with - | HoccToken {atok=Scan.AbstractToken.Tok_epsilon; _} as epsilon_ -> - reduce spine ctx' fmt_prod_pattern (ProdPatternEpsilon {epsilon_}) - | _ -> - map ~child:prod_params ~f:(fun prod_params -> - ProdPatternParams {prod_params} - ) ~fmt_child:fmt_prod_pattern spine ctx - -and prod spine ctx = - let spine = "prod" :: spine in - mapr ~child:prod_pattern ~f:(fun spine ctx' prod_pattern -> - map ~child:prec_ref ~f:(fun prec_ref -> - Prod {prod_pattern; prec_ref} - ) ~fmt_child:fmt_prod spine ctx' - ) spine ctx - -and prods_tl spine ctx = - let spine = "prods_tl" :: spine in - let ctx', tok = next spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_bar; _} as bar -> - mapr ~child:prod ~f:(fun spine ctx' prod -> - map ~child:prods_tl ~f:(fun prods_tl -> - ProdsTlBarProd {bar; prod; prods_tl} - ) ~fmt_child:fmt_prods_tl spine ctx' - ) spine ctx' - | _ -> reduce spine ctx fmt_prods_tl ProdsTlEpsilon - -and prods spine ctx = - let spine = "prods" :: spine in - let ctx', tok = next spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_bar; _} as bar -> - mapr ~child:prod ~f:(fun spine ctx' prod -> - map ~child:prods_tl ~f:(fun prods_tl -> - ProdsBarProd {bar; prod; prods_tl} - ) ~fmt_child:fmt_prods spine ctx' - ) spine ctx' - | _ -> - mapr ~child:prod ~f:(fun spine ctx' prod -> - map ~child:prods_tl ~f:(fun prods_tl -> - ProdsProd {prod; prods_tl} - ) ~fmt_child:fmt_prods spine ctx' - ) spine ctx - -and reduction spine ctx = - let spine = "reduction" :: spine in - let arrow spine ctx = begin - let spine = "arrow" :: spine in - let ctx', tok = next spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_arrow; _} -> ctx', Some tok - | _ -> err_token tok "Expected '->'" ctx, None - end in - mapr ~child:prods ~f:(fun spine ctx' prods -> - mapr ~child:arrow ~f:(fun spine ctx' arrow -> - map ~child:code ~f:(fun code -> - Reduction {prods; arrow; code} - ) ~fmt_child:fmt_reduction spine ctx' - ) spine ctx' - ) spine ctx - -and reductions_tl spine ctx = - let spine = "reductions_tl" :: spine in - let ctx', tok = next spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_bar; _} as bar -> - mapr ~child:reduction ~f:(fun spine ctx' reduction -> - map ~child:reductions_tl ~f:(fun reductions_tl -> - ReductionsTlBarReduction {bar; reduction; reductions_tl} - ) ~fmt_child:fmt_reductions_tl spine ctx' - ) spine ctx' - | _ -> reduce spine ctx fmt_reductions_tl ReductionsTlEpsilon - -and reductions spine ctx = - let spine = "reductions" :: spine in - mapr ~child:reduction ~f:(fun spine ctx' reduction -> - map ~child:reductions_tl ~f:(fun reductions_tl -> - ReductionsReduction {reduction; reductions_tl} - ) ~fmt_child:fmt_reductions spine ctx' - ) spine ctx - -and nonterm_type spine ctx = - let spine = "nonterm_type" :: spine in - let ctx', tok = next spine ctx in - match tok with - | HoccToken {atok=Scan.AbstractToken.Tok_nonterm; _} as nonterm_ -> - reduce spine ctx' fmt_nonterm_type (NontermTypeNonterm {nonterm_}) - | HoccToken {atok=Scan.AbstractToken.Tok_start; _} as start_ -> - reduce spine ctx' fmt_nonterm_type (NontermTypeStart {start_}) - | _ -> err_token tok "Expected 'nonterm'/'start'" ctx, None - -and nonterm spine ctx = - let spine = "nonterm" :: spine in - let cce spine ctx = begin - let spine = "cce" :: spine in - let ctx', tok = next spine ctx in - match tok with - | HoccToken {atok=Scan.AbstractToken.Tok_colon_colon_eq; _} -> ctx', Some tok - | _ -> err_token tok "Expected '::='" ctx, None - end in - mapr ~child:nonterm_type ~f:(fun spine ctx' nonterm_type -> - mapr ~child:cident ~f:(fun spine ctx' cident -> - let _ctx'', tok = next spine ctx' in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_of; _} -> - mapr ~child:of_type ~f:(fun spine ctx' of_type -> - mapr ~child:prec_ref ~f:(fun spine ctx' prec_ref -> - mapr ~child:cce ~f:(fun spine ctx' cce -> - map ~child:reductions ~f:(fun reductions -> - NontermReductions {nonterm_type; cident; of_type; prec_ref; cce; reductions} - ) ~fmt_child:fmt_nonterm spine ctx' - ) spine ctx' - ) spine ctx' - ) spine ctx' - | _ -> - mapr ~child:prec_ref ~f:(fun spine ctx' prec_ref -> - mapr ~child:cce ~f:(fun spine ctx' cce -> - map ~child:prods ~f:(fun prods -> - NontermProds {nonterm_type; cident; prec_ref; cce; prods} - ) ~fmt_child:fmt_nonterm spine ctx' - ) spine ctx' - ) spine ctx' - ) spine ctx' - ) spine ctx - -and stmt spine ctx = - let spine = "stmt" :: spine in - let _ctx', tok = next spine ctx in - match tok with - | HoccToken {atok=Scan.AbstractToken.(Tok_neutral|Tok_left|Tok_right); _} -> - map ~child:prec ~f:(fun prec_ -> StmtPrec {prec_}) ~fmt_child:fmt_stmt spine ctx - | HoccToken {atok=Scan.AbstractToken.Tok_token; _} -> - map ~child:token ~f:(fun token_ -> StmtToken {token_}) ~fmt_child:fmt_stmt spine ctx - | HoccToken {atok=Scan.AbstractToken.(Tok_nonterm|Tok_start); _} -> - map ~child:nonterm ~f:(fun nonterm_ -> StmtNonterm {nonterm_}) ~fmt_child:fmt_stmt spine ctx - | _ -> map ~child:code ~f:(fun code -> StmtCode {code}) ~fmt_child:fmt_stmt spine ctx - -and stmts_tl spine ctx = - let spine = "stmts_tl" :: spine in - let line_delim spine ctx = begin - let spine = "line_delim" :: spine in - let ctx', tok = next spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_line_delim; _} -> ctx', Some tok - | _ -> err_token tok "Expected line delimiter" ctx, None - end in - let ctx', line_delim_opt = line_delim spine ctx in - match line_delim_opt with - | Some line_delim -> begin - mapr ~child:stmt ~f:(fun spine ctx' stmt -> - map ~child:stmts_tl ~f:(fun stmts_tl -> - StmtsTl {line_delim; stmt; stmts_tl} - ) ~fmt_child:fmt_stmts_tl spine ctx' - ) spine ctx' - end - | None -> reduce spine ctx fmt_stmts_tl StmtsTlEpsilon - -and stmts spine ctx = - let spine = "stmts" :: spine in - mapr ~child:stmt ~f:(fun spine ctx' stmt -> - map ~child:stmts_tl ~f:(fun stmts_tl -> - Stmts {stmt; stmts_tl} - ) ~fmt_child:fmt_stmts spine ctx' - ) spine ctx - -and hocc spine ctx = - let spine = "hocc" :: spine in - let ctx', tok = next spine ctx in - match tok with - | HoccToken {atok=Scan.AbstractToken.Tok_hocc; _} as hocc_ -> - mapr ~child:indent ~f:(fun spine ctx' indent -> - mapr ~child:stmts ~f:(fun spine ctx' stmts -> - map ~child:dedent ~f:(fun dedent -> - Hocc {hocc_; indent; stmts; dedent} - ) ~fmt_child:fmt_hocc spine ctx' - ) spine ctx' - ) spine ctx' - | _ -> err_token tok "Expected 'hocc' statement" ctx, None - -and eoi spine ctx = - let spine = "eoi" :: spine in - let ctx', tok = next spine ctx in - match tok with - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_end_of_input; _} as eoi -> - reduce spine ctx' fmt_eoi (Eoi {eoi}) - | _ -> err "Unexpected token before eoi" ctx, None - -and matter spine ctx = - let spine = "matter" :: spine in - let rec f ctx = begin - let ctx', tok = next ~all:true spine ctx in - match tok with - | HoccToken _ - | HmcToken {atok=Hmc.Scan.AbstractToken.Tok_end_of_input; _} -> ctx, MatterEpsilon - | HmcToken _ -> begin - let ctx', matter_rchild = f ctx' in - ctx', Matter {token_=tok; matter=matter_rchild} - end - end in - let ctx', matter = f ctx in - reduce ~alt:false spine ctx' fmt_matter matter - -and hmh scanner = - let spine = ["hmh"] in - let ctx = {scanner; errs=[]} in - let ctx', hmh_opt = - mapr ~child:matter ~f:(fun spine ctx' prelude -> - mapr ~child:hocc ~f:(fun spine ctx' hocc_ -> - mapr ~child:matter ~f:(fun spine ctx' postlude -> - map ~child:eoi ~f:(fun (Eoi {eoi}) -> - Hmh {prelude; hocc_; postlude; eoi} - ) ~fmt_child:fmt_hmh spine ctx' - ) spine ctx' - ) spine ctx' - ) spine ctx - in - match ctx', hmh_opt with - | {errs=(_ :: _); _}, _ - | _, None -> ctx'.scanner, Error ctx'.errs - | {errs=[]; _}, Some hmh -> ctx'.scanner, Ok hmh - -and hmhi scanner = - let spine = ["hmhi"] in - let hocc spine ctx = begin - let spine = "hocc" :: spine in - let ctx', tok = next spine ctx in - match tok with - | HoccToken {atok=Scan.AbstractToken.Tok_hocc; _} as hocc -> ctx', Some hocc - | _ -> err "Expected 'hocc' keyword" ctx, None - end in - let ctx = {scanner; errs=[]} in - let ctx', hmh_opt = - mapr ~child:matter ~f:(fun spine ctx' prelude -> - mapr ~child:hocc ~f:(fun spine ctx' hocc_ -> - mapr ~child:matter ~f:(fun spine ctx' postlude -> - map ~child:eoi ~f:(fun (Eoi {eoi}) -> - Hmhi {prelude; hocc_; postlude; eoi} - ) ~fmt_child:fmt_hmhi spine ctx' - ) spine ctx' - ) spine ctx' - ) spine ctx - in - match ctx', hmh_opt with - | {errs=(_ :: _); _}, _ - | _, None -> ctx'.scanner, Error ctx'.errs - | {errs=[]; _}, Some hmh -> ctx'.scanner, Ok hmh + and fmt_rcurly ~alt ~width formatter = + match alt with + | false -> formatter |> Fmt.fmt "}" + | true -> + formatter + |> Fmt.fmt "\n" + |> Fmt.fmt ~pad:" " ~just:Fmt.Left ~width:(width + 2L) "" + |> Fmt.fmt "}" + + and fmt_uident ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) uident formatter = + match uident with + | Uident {uident} -> + formatter + |> Fmt.fmt "Uident " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "uident=" |> Scan.Token.pp uident + |> fmt_rcurly ~alt ~width + and pp_uident uident formatter = + fmt_uident uident formatter + + and fmt_cident ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) cident formatter = + match cident with + | Cident {cident} -> + formatter + |> Fmt.fmt "Cident " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "cident=" |> Scan.Token.pp cident + |> fmt_rcurly ~alt ~width + and pp_cident cident formatter = + fmt_cident cident formatter + + and fmt_ident ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) ident formatter = + match ident with + | IdentUident {uident} -> + formatter |> Fmt.fmt "IdentUident " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "uident=" |> pp_uident uident + |> fmt_rcurly ~alt ~width + | IdentCident {cident} -> + formatter |> Fmt.fmt "IdentCident " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "cident=" |> pp_cident cident + |> fmt_rcurly ~alt ~width + | IdentUscore {uscore} -> + formatter |> Fmt.fmt "IdentUscore " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "uscore=" |> Scan.Token.pp uscore + |> fmt_rcurly ~alt ~width + and pp_ident ident formatter = + fmt_ident ident formatter + + and fmt_precs_tl ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) precs_tl formatter = + let width' = width + 4L in + match precs_tl with + | PrecsTlCommaUident {comma; uident; precs_tl} -> + formatter |> Fmt.fmt "PrecsTlCommaUident " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "comma=" |> Scan.Token.pp comma + |> fmt_semi ~alt ~width + |> Fmt.fmt "uident=" |> fmt_uident ~alt ~width:width' uident + |> fmt_semi ~alt ~width + |> Fmt.fmt "precs_tl=" |> fmt_precs_tl ~alt ~width:width' precs_tl + |> fmt_rcurly ~alt ~width + | PrecsTlEpsilon -> + formatter |> Fmt.fmt "PrecsTlEpsilon" + and pp_precs_tl precs_tl formatter = + fmt_precs_tl precs_tl formatter + + and fmt_precs ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) precs formatter = + let width' = width + 4L in + match precs with + | Precs {uident; precs_tl} -> + formatter |> Fmt.fmt "Precs " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "uident=" |> fmt_uident ~alt ~width:width' uident + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "precs_tl=" |> fmt_precs_tl ~alt ~width:width' precs_tl + |> fmt_rcurly ~alt ~width + and pp_precs precs formatter = + fmt_precs precs formatter + + and fmt_prec_rels ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prec_rels formatter = + let width' = width + 4L in + match prec_rels with + | PrecRelsLtPrecs {lt; precs} -> + formatter |> Fmt.fmt "PrecRelsLtPrecs " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "lt=" |> Scan.Token.pp lt + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "precs=" |> fmt_precs ~alt ~width:width' precs + |> fmt_rcurly ~alt ~width + | PrecRelsEpsilon -> + formatter |> Fmt.fmt "PrecRelsEpsilon" + and pp_prec_rels prec_rels formatter = + fmt_prec_rels prec_rels formatter + + and fmt_prec_type ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prec_type formatter = + match prec_type with + | PrecTypeNeutral {neutral_} -> + formatter |> Fmt.fmt "PrecTypeNeutral " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "neutral_=" |> Scan.Token.pp neutral_ + |> fmt_rcurly ~alt ~width + | PrecTypeLeft {left_} -> + formatter |> Fmt.fmt "PrecTypeLeft " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "left_=" |> Scan.Token.pp left_ + |> fmt_rcurly ~alt ~width + | PrecTypeRight {right_} -> + formatter |> Fmt.fmt "PrecTypeRight " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "right_=" |> Scan.Token.pp right_ + |> fmt_rcurly ~alt ~width + and pp_prec_type prec_type formatter = + fmt_prec_type prec_type formatter + + and fmt_prec ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prec_ formatter = + let width' = width + 4L in + match prec_ with + | Prec {prec_type; uident; prec_rels} -> + formatter |> Fmt.fmt "Prec " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prec_type=" |> fmt_prec_type ~alt ~width:width' prec_type + |> fmt_semi ~alt ~width + |> Fmt.fmt "uident=" |> fmt_uident ~alt ~width:width' uident + |> fmt_semi ~alt ~width + |> Fmt.fmt "prec_rels=" |> fmt_prec_rels ~alt ~width:width' prec_rels + |> fmt_rcurly ~alt ~width + and pp_prec prec_ formatter = + fmt_prec prec_ formatter + + and fmt_of_type ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) of_type formatter = + let width' = width + 4L in + match of_type with + | OfType {of_; type_module; dot; type_type} -> + formatter |> Fmt.fmt "OfType " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "of_=" |> Scan.Token.pp of_ + |> fmt_semi ~alt ~width + |> Fmt.fmt "type_module=" |> fmt_cident ~alt ~width:width' type_module + |> fmt_semi ~alt ~width + |> Fmt.fmt "dot=" |> Scan.Token.pp dot + |> fmt_semi ~alt ~width + |> Fmt.fmt "type_type=" |> fmt_uident ~alt ~width:width' type_type + |> fmt_rcurly ~alt ~width + and pp_of_type of_type formatter = + fmt_of_type of_type formatter + + and fmt_of_type0 ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) of_type0 formatter = + let width' = width + 4L in + match of_type0 with + | OfType0OfType {of_type} -> + formatter |> Fmt.fmt "OfType0OfType " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "of_type=" |> fmt_of_type ~alt ~width:width' of_type + |> fmt_rcurly ~alt ~width + | OfType0Epsilon -> + formatter |> Fmt.fmt "OfType0Epsilon" + and pp_of_type0 of_type0 formatter = + fmt_of_type0 of_type0 formatter + + and fmt_prec_ref ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prec_ref formatter = + let width' = width + 4L in + match prec_ref with + | PrecRefPrecUident {prec_; uident} -> + formatter |> Fmt.fmt "PrecRefPrecUident " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prec_=" |> Scan.Token.pp prec_ + |> fmt_semi ~alt ~width + |> Fmt.fmt "uident=" |> fmt_uident ~alt ~width:width' uident + |> fmt_rcurly ~alt ~width + | PrecRefEpsilon -> + formatter |> Fmt.fmt "PrecRefEpsilon" + and pp_prec_ref prec_ref formatter = + fmt_prec_ref prec_ref formatter + + and fmt_token_alias ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) token_alias formatter = + match token_alias with + | TokenAlias {alias} -> + formatter |> Fmt.fmt "Token " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "alias=" |> Scan.Token.pp alias + |> fmt_rcurly ~alt ~width + | TokenAliasEpsilon -> + formatter |> Fmt.fmt "TokenAliasEpsilon" + and pp_token_alias token_alias formatter = + fmt_token_alias token_alias formatter + + and fmt_token ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) token_ formatter = + let width' = width + 4L in + match token_ with + | Token {token_; cident; token_alias; of_type0; prec_ref} -> + formatter |> Fmt.fmt "Token " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "token_=" |> Scan.Token.pp token_ + |> fmt_semi ~alt ~width + |> Fmt.fmt "cident=" |> fmt_cident ~alt ~width:width' cident + |> fmt_semi ~alt ~width + |> Fmt.fmt "token_alias=" |> fmt_token_alias ~alt ~width:width' token_alias + |> fmt_semi ~alt ~width + |> Fmt.fmt "of_type0=" |> fmt_of_type0 ~alt ~width:width' of_type0 + |> fmt_semi ~alt ~width + |> Fmt.fmt "prec_ref=" |> fmt_prec_ref ~alt ~width:width' prec_ref + |> fmt_rcurly ~alt ~width + and pp_token token_ formatter = + fmt_token token_ formatter + + and fmt_sep ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) sep formatter = + match sep with + | SepLineDelim {line_delim} -> + formatter |> Fmt.fmt "SepLineDelim " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "line_delim=" |> Scan.Token.pp line_delim + |> fmt_rcurly ~alt ~width + | SepSemi {semi} -> + formatter |> Fmt.fmt "SepSemi " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "semi=" |> Scan.Token.pp semi + |> fmt_rcurly ~alt ~width + | SepBar {bar} -> + formatter |> Fmt.fmt "SepBar " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "bar=" |> Scan.Token.pp bar + |> fmt_rcurly ~alt ~width + and pp_sep sep formatter = + fmt_sep sep formatter + + and fmt_codes_tl ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) codes_tl formatter = + let width' = width + 4L in + match codes_tl with + | CodesTlSepCode {sep; code; codes_tl} -> + formatter |> Fmt.fmt "CodesTlSepCode " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "sep=" |> fmt_sep ~alt ~width:width' sep + |> fmt_semi ~alt ~width + |> Fmt.fmt "code=" |> fmt_code ~alt ~width:width' code + |> fmt_rcurly ~alt ~width + |> Fmt.fmt "codes_tl=" |> fmt_codes_tl ~alt ~width:width' codes_tl + |> fmt_rcurly ~alt ~width + | CodesTlEpsilon -> formatter |> Fmt.fmt "CodesTlEpsilon" + and pp_codes_tl codes_tl formatter = + fmt_codes codes_tl formatter + + and fmt_codes ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) codes formatter = + let width' = width + 4L in + match codes with + | Codes {code; codes_tl} -> + formatter |> Fmt.fmt "Codes " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "code=" |> fmt_code ~alt ~width:width' code + |> fmt_semi ~alt ~width + |> Fmt.fmt "codes_tl=" |> fmt_codes_tl ~alt ~width:width' codes_tl + |> fmt_rcurly ~alt ~width + and pp_codes codes formatter = + fmt_codes codes formatter + + and fmt_codes0 ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) codes0 formatter = + let width' = width + 4L in + match codes0 with + | Codes0Codes {codes} -> + formatter |> Fmt.fmt "Codes0Codes " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "codes=" |> fmt_codes ~alt ~width:width' codes + |> fmt_rcurly ~alt ~width + | Codes0Epsilon -> + formatter |> Fmt.fmt "Codes0Epsilon" + and pp_codes0 codes formatter = + fmt_codes codes formatter + + and fmt_delimited ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) delimited formatter = + let width' = width + 4L in + match delimited with + | DelimitedBlock {indent; codes; dedent} -> + formatter |> Fmt.fmt "DelimitedBlock " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "indent=" |> Scan.Token.pp indent + |> fmt_semi ~alt ~width + |> Fmt.fmt "codes=" |> fmt_codes ~alt ~width:width' codes + |> fmt_semi ~alt ~width + |> Fmt.fmt "dedent=" |> Scan.Token.pp dedent + |> fmt_rcurly ~alt ~width + | DelimitedParen {lparen; codes0; rparen} -> + formatter |> Fmt.fmt "DelimitedParen " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "lparen=" |> Scan.Token.pp lparen + |> fmt_semi ~alt ~width + |> Fmt.fmt "codes0=" |> fmt_codes0 ~alt ~width:width' codes0 + |> fmt_semi ~alt ~width + |> Fmt.fmt "rparen=" |> Scan.Token.pp rparen + |> fmt_rcurly ~alt ~width + | DelimitedCapture {lcapture; codes0; rcapture} -> + formatter |> Fmt.fmt "DelimitedCapture " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "lcapture=" |> Scan.Token.pp lcapture + |> fmt_semi ~alt ~width + |> Fmt.fmt "codes0=" |> fmt_codes0 ~alt ~width:width' codes0 + |> fmt_semi ~alt ~width + |> Fmt.fmt "rcapture=" |> Scan.Token.pp rcapture + |> fmt_rcurly ~alt ~width + | DelimitedList {lbrack; codes0; rbrack} -> + formatter |> Fmt.fmt "DelimitedList " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "lbrack=" |> Scan.Token.pp lbrack + |> fmt_semi ~alt ~width + |> Fmt.fmt "codes0=" |> fmt_codes0 ~alt ~width:width' codes0 + |> fmt_semi ~alt ~width + |> Fmt.fmt "rbrack=" |> Scan.Token.pp rbrack + |> fmt_rcurly ~alt ~width + | DelimitedArray {larray; codes0; rarray} -> + formatter |> Fmt.fmt "DelimitedArray " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "larray=" |> Scan.Token.pp larray + |> fmt_semi ~alt ~width + |> Fmt.fmt "codes0=" |> fmt_codes0 ~alt ~width:width' codes0 + |> fmt_semi ~alt ~width + |> Fmt.fmt "rarray=" |> Scan.Token.pp rarray + |> fmt_rcurly ~alt ~width + | DelimitedModule {lcurly; codes0; rcurly} -> + formatter |> Fmt.fmt "DelimitedModule " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "lcurly=" |> Scan.Token.pp lcurly + |> fmt_semi ~alt ~width + |> Fmt.fmt "codes0=" |> fmt_codes0 ~alt ~width:width' codes0 + |> fmt_semi ~alt ~width + |> Fmt.fmt "rcurly=" |> Scan.Token.pp rcurly + |> fmt_rcurly ~alt ~width + and pp_delimited delimited formatter = + fmt_delimited delimited formatter + + and fmt_code_tl ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) code_tl formatter = + let width' = width + 4L in + match code_tl with + | CodeTlDelimited {delimited; code_tl} -> + formatter |> Fmt.fmt "CodeTlDelimited " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "delimited=" |> fmt_delimited ~alt ~width:width' delimited + |> fmt_semi ~alt ~width + |> Fmt.fmt "code_tl=" |> fmt_code_tl ~alt ~width:width' code_tl + |> fmt_rcurly ~alt ~width + | CodeTlToken {token_; code_tl} -> + formatter |> Fmt.fmt "CodeTlToken " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "token_=" |> Scan.Token.pp token_ + |> fmt_semi ~alt ~width + |> Fmt.fmt "code_tl=" |> fmt_code_tl ~alt ~width:width' code_tl + |> fmt_rcurly ~alt ~width + | CodeTlEpsilon -> + formatter |> Fmt.fmt "CodeTlEpsilon" + and pp_code_tl code_tl formatter = + fmt_code code_tl formatter + + and fmt_code ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) code formatter = + let width' = width + 4L in + match code with + | CodeDelimited {delimited; code_tl} -> + formatter |> Fmt.fmt "CodeDelimited " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "delimited=" |> fmt_delimited ~alt ~width:width' delimited + |> fmt_semi ~alt ~width + |> Fmt.fmt "code_tl=" |> fmt_code_tl ~alt ~width:width' code_tl + |> fmt_rcurly ~alt ~width + | CodeCodeToken {token_; code_tl} -> + formatter |> Fmt.fmt "CodeCodeToken " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "token_=" |> Scan.Token.pp token_ + |> fmt_semi ~alt ~width + |> Fmt.fmt "code_tl=" |> fmt_code_tl ~alt ~width:width' code_tl + |> fmt_rcurly ~alt ~width + and pp_code code formatter = + fmt_code code formatter + + and fmt_prod_param_symbol ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prod_param_symbol + formatter = + let width' = width + 4L in + match prod_param_symbol with + | ProdParamSymbolCident {cident} -> + formatter |> Fmt.fmt "ProdParamSymbolCident " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "cident=" |> fmt_cident ~alt ~width:width' cident + |> fmt_rcurly ~alt ~width + | ProdParamSymbolAlias {alias} -> + formatter |> Fmt.fmt "ProdParamSymbolAlias " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "alias=" |> Scan.Token.pp alias + |> fmt_rcurly ~alt ~width + and pp_prod_param_symbol prod_param_symbol formatter = + fmt_prod_param_symbol prod_param_symbol formatter + + and fmt_prod_param ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prod_param formatter = + let width' = width + 4L in + match prod_param with + | ProdParamBinding {ident; colon; prod_param_symbol} -> + formatter |> Fmt.fmt "ProdParam " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "ident=" |> fmt_ident ~alt ~width:width' ident + |> fmt_semi ~alt ~width + |> Fmt.fmt "colon=" |> Scan.Token.pp colon + |> fmt_semi ~alt ~width + |> Fmt.fmt "prod_param_symbol=" + |> fmt_prod_param_symbol ~alt ~width:width' prod_param_symbol + |> fmt_rcurly ~alt ~width + | ProdParam {prod_param_symbol} -> + formatter |> Fmt.fmt "ProdParam " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prod_param_symbol=" + |> fmt_prod_param_symbol ~alt ~width:width' prod_param_symbol + |> fmt_rcurly ~alt ~width + and pp_prod_param prod_param formatter = + fmt_prod_param prod_param formatter + + and fmt_prod_params_tl ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prod_params_tl + formatter = + let width' = width + 4L in + match prod_params_tl with + | ProdParamsTlProdParam {prod_param; prod_params_tl} -> + formatter |> Fmt.fmt "ProdParamsTlProdParam " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prod_param=" |> fmt_prod_param ~alt ~width:width' prod_param + |> fmt_semi ~alt ~width + |> Fmt.fmt "prod_params_tl=" |> fmt_prod_params_tl ~alt ~width:width' prod_params_tl + |> fmt_rcurly ~alt ~width + | ProdParamsTlEpsilon -> + formatter |> Fmt.fmt "ProdParamsTlEpsilon" + and pp_prod_params_tl prod_params_tl formatter = + fmt_prod_params_tl prod_params_tl formatter + + and fmt_prod_params ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prod_params formatter = + let width' = width + 4L in + match prod_params with + | ProdParamsProdParam {prod_param; prod_params_tl} -> + formatter |> Fmt.fmt "ProdParamsProdParam " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prod_param=" |> fmt_prod_param ~alt ~width:width' prod_param + |> fmt_semi ~alt ~width + |> Fmt.fmt "prod_params_tl=" |> fmt_prod_params_tl ~alt ~width:width' prod_params_tl + |> fmt_rcurly ~alt ~width + and pp_prod_params prod_params formatter = + fmt_prod_params prod_params formatter + + and fmt_prod_pattern ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prod_pattern formatter = + let width' = width + 4L in + match prod_pattern with + | ProdPatternParams {prod_params} -> + formatter |> Fmt.fmt "ProdPatternParams " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prod_params=" |> fmt_prod_params ~alt ~width:width' prod_params + |> fmt_rcurly ~alt ~width + | ProdPatternEpsilon {epsilon_} -> + formatter |> Fmt.fmt "ProdPatternEpsilon " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "epsilon_=" |> Scan.Token.pp epsilon_ + |> fmt_rcurly ~alt ~width + and pp_prod_pattern prod_pattern formatter = + fmt_prod_pattern prod_pattern formatter + + and fmt_prod ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prod formatter = + let width' = width + 4L in + match prod with + | Prod {prod_pattern; prec_ref} -> + formatter |> Fmt.fmt "Prod " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prod_pattern=" |> fmt_prod_pattern ~alt ~width:width' prod_pattern + |> fmt_semi ~alt ~width + |> Fmt.fmt "prec_ref=" |> fmt_prec_ref ~alt ~width:width' prec_ref + |> fmt_rcurly ~alt ~width + and pp_prod prod formatter = + fmt_prod prod formatter + + and fmt_prods_tl ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prods_tl formatter = + let width' = width + 4L in + match prods_tl with + | ProdsTlBarProd {bar; prod; prods_tl} -> + formatter |> Fmt.fmt "ProdsTlBarProd " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "bar=" |> Scan.Token.pp bar + |> fmt_semi ~alt ~width + |> Fmt.fmt "prod=" |> fmt_prod ~alt ~width:width' prod + |> fmt_semi ~alt ~width + |> Fmt.fmt "prods_tl=" |> fmt_prods_tl ~alt ~width:width' prods_tl + |> fmt_rcurly ~alt ~width + | ProdsTlEpsilon -> + formatter |> Fmt.fmt "ProdsTlEpsilon" + and pp_prods_tl prods_tl formatter = + fmt_prods_tl prods_tl formatter + + and fmt_prods ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) prods formatter = + let width' = width + 4L in + match prods with + | ProdsBarProd {bar; prod; prods_tl} -> + formatter |> Fmt.fmt "ProdsBarProd " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "bar=" |> Scan.Token.pp bar + |> fmt_semi ~alt ~width + |> Fmt.fmt "prod=" |> fmt_prod ~alt ~width:width' prod + |> fmt_semi ~alt ~width + |> Fmt.fmt "prods_tl=" |> fmt_prods_tl ~alt ~width:width' prods_tl + |> fmt_rcurly ~alt ~width + | ProdsProd {prod; prods_tl} -> + formatter |> Fmt.fmt "ProdsProd " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prod=" |> fmt_prod ~alt ~width:width' prod + |> fmt_semi ~alt ~width + |> Fmt.fmt "prods_tl=" |> fmt_prods_tl ~alt ~width:width' prods_tl + |> fmt_rcurly ~alt ~width + and pp_prods prods formatter = + fmt_prods prods formatter + + and fmt_reduction ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) reduction formatter = + let width' = width + 4L in + match reduction with + | Reduction {prods; arrow; code} -> + formatter |> Fmt.fmt "Reduction " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prods=" |> fmt_prods ~alt ~width:width' prods + |> fmt_semi ~alt ~width + |> Fmt.fmt "arrow=" |> Scan.Token.pp arrow + |> fmt_semi ~alt ~width + |> Fmt.fmt "code=" |> pp_code code + |> fmt_rcurly ~alt ~width + and pp_reduction reduction formatter = + fmt_reduction reduction formatter + + and fmt_reductions_tl ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) reductions_tl formatter = + let width' = width + 4L in + match reductions_tl with + | ReductionsTlBarReduction {bar; reduction; reductions_tl} -> + formatter |> Fmt.fmt "ReductionsTlBarReduction " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "bar=" |> Scan.Token.pp bar + |> fmt_semi ~alt ~width + |> Fmt.fmt "reduction=" |> fmt_reduction ~alt ~width:width' reduction + |> fmt_semi ~alt ~width + |> Fmt.fmt "reductions_tl=" |> fmt_reductions_tl ~alt ~width:width' reductions_tl + |> fmt_rcurly ~alt ~width + | ReductionsTlEpsilon -> + formatter |> Fmt.fmt "ReductionsTlEpsilon" + and pp_reductions_tl reductions_tl formatter = + fmt_reductions_tl reductions_tl formatter + + and fmt_reductions ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) reductions formatter = + let width' = width + 4L in + match reductions with + | ReductionsReduction {reduction; reductions_tl} -> + formatter |> Fmt.fmt "ReductionsReduction " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "reduction=" |> fmt_reduction ~alt ~width:width' reduction + |> fmt_semi ~alt ~width + |> Fmt.fmt "reductions_tl=" |> fmt_reductions_tl ~alt ~width:width' reductions_tl + |> fmt_rcurly ~alt ~width + and pp_reductions reductions formatter = + fmt_reductions reductions formatter + + and fmt_nonterm_type ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) nonterm_type formatter = + match nonterm_type with + | NontermTypeNonterm {nonterm_} -> + formatter |> Fmt.fmt "NontermTypeNonterm " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "nonterm_=" |> Scan.Token.pp nonterm_ + |> fmt_rcurly ~alt ~width + | NontermTypeStart {start_} -> + formatter |> Fmt.fmt "NontermTypeStart " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "start_=" |> Scan.Token.pp start_ + |> fmt_rcurly ~alt ~width + and pp_nonterm_type nonterm_type formatter = + fmt_nonterm_type nonterm_type formatter + + and fmt_nonterm ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) nonterm_ formatter = + let width' = width + 4L in + match nonterm_ with + | NontermProds {nonterm_type; cident; prec_ref; cce; prods} -> + formatter |> Fmt.fmt "NontermProds " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "nonterm_type=" |> fmt_nonterm_type ~alt ~width:width' nonterm_type + |> fmt_semi ~alt ~width + |> Fmt.fmt "cident=" |> fmt_cident ~alt ~width:width' cident + |> fmt_semi ~alt ~width + |> Fmt.fmt "prec_ref=" |> fmt_prec_ref ~alt ~width:width' prec_ref + |> fmt_semi ~alt ~width + |> Fmt.fmt "cce=" |> Scan.Token.pp cce + |> fmt_semi ~alt ~width + |> Fmt.fmt "prods=" |> fmt_prods ~alt ~width:width' prods + |> fmt_rcurly ~alt ~width + | NontermReductions {nonterm_type; cident; of_type; prec_ref; cce; reductions} -> + formatter |> Fmt.fmt "NontermReductions " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "nonterm_type=" |> fmt_nonterm_type ~alt ~width:width' nonterm_type + |> fmt_semi ~alt ~width + |> Fmt.fmt "cident=" |> fmt_cident ~alt ~width:width' cident + |> fmt_semi ~alt ~width + |> Fmt.fmt "of_type=" |> fmt_of_type ~alt ~width:width' of_type + |> fmt_semi ~alt ~width + |> Fmt.fmt "prec_ref=" |> fmt_prec_ref ~alt ~width:width' prec_ref + |> fmt_semi ~alt ~width + |> Fmt.fmt "cce=" |> Scan.Token.pp cce + |> fmt_semi ~alt ~width + |> Fmt.fmt "reductions=" |> fmt_reductions ~alt ~width:width' reductions + |> fmt_rcurly ~alt ~width + and pp_nonterm nonterm_ formatter = + fmt_nonterm nonterm_ formatter + + and fmt_stmt ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) stmt formatter = + let width' = width + 4L in + match stmt with + | StmtPrec {prec_} -> + formatter |> Fmt.fmt "StmtPrec " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prec_=" |> fmt_prec ~alt ~width:width' prec_ + |> fmt_rcurly ~alt ~width + | StmtToken {token_} -> + formatter |> Fmt.fmt "StmtToken " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "token_=" |> fmt_token ~alt ~width:width' token_ + |> fmt_rcurly ~alt ~width + | StmtNonterm {nonterm_} -> + formatter |> Fmt.fmt "StmtNonterm " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "nonterm_=" |> fmt_nonterm ~alt ~width:width' nonterm_ + |> fmt_rcurly ~alt ~width + | StmtCode {code} -> + formatter |> Fmt.fmt "StmtCode " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "code=" |> fmt_code ~alt ~width:width' code + |> fmt_rcurly ~alt ~width + and pp_stmt stmt formatter = + fmt_stmt stmt formatter + + and fmt_stmts_tl ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) stmts_tl formatter = + let width' = width + 4L in + match stmts_tl with + | StmtsTl {line_delim; stmt; stmts_tl} -> + formatter |> Fmt.fmt "StmtsTl " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "line_delim=" |> Scan.Token.pp line_delim + |> fmt_semi ~alt ~width + |> Fmt.fmt "stmt=" |> fmt_stmt ~alt ~width:width' stmt + |> fmt_semi ~alt ~width + |> Fmt.fmt "stmts_tl=" |> fmt_stmts_tl ~alt ~width:width' stmts_tl + |> fmt_rcurly ~alt ~width + | StmtsTlEpsilon -> + formatter |> Fmt.fmt "StmtsTlEpsilon" + and pp_stmts_tl stmts_tl formatter = + fmt_stmts_tl stmts_tl formatter + + and fmt_stmts ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) stmts formatter = + let width' = width + 4L in + match stmts with + | Stmts {stmt; stmts_tl} -> + formatter |> Fmt.fmt "Stmts " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "stmt=" |> fmt_stmt ~alt ~width:width' stmt + |> fmt_semi ~alt ~width + |> Fmt.fmt "stmts_tl=" |> fmt_stmts_tl ~alt ~width:width' stmts_tl + |> fmt_rcurly ~alt ~width + and pp_stmts stmts formatter = + fmt_stmts stmts formatter + + and fmt_hocc ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) hocc_ formatter = + let width' = width + 4L in + match hocc_ with + | Hocc {hocc_; indent; stmts; dedent} -> + formatter |> Fmt.fmt "Hocc " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "hocc_=" |> Scan.Token.pp hocc_ + |> fmt_semi ~alt ~width + |> Fmt.fmt "indent=" |> Scan.Token.pp indent + |> fmt_semi ~alt ~width + |> Fmt.fmt "stmts=" |> fmt_stmts ~alt ~width:width' stmts + |> fmt_semi ~alt ~width + |> Fmt.fmt "dedent=" |> Scan.Token.pp dedent + |> fmt_rcurly ~alt ~width + and pp_hocc hocc_ formatter = + fmt_hocc hocc_ formatter + + and fmt_matter ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) matter formatter = + let width' = width + 4L in + match matter with + | Matter {token_; matter} -> + formatter |> Fmt.fmt "Matter " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "token_=" |> Scan.Token.pp token_ + |> fmt_semi ~alt ~width + |> Fmt.fmt "matter=" |> fmt_matter ~alt ~width:width' matter + |> fmt_rcurly ~alt ~width + | MatterEpsilon -> + formatter |> Fmt.fmt "MatterEpsilon" + and pp_matter matter formatter = + fmt_matter matter formatter + + and fmt_hmh ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) hmh formatter = + let width' = width + 4L in + match hmh with + | Hmh {prelude; hocc_; postlude; eoi} -> + formatter |> Fmt.fmt "Hmh " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prelude=" |> pp_matter prelude + |> fmt_semi ~alt ~width + |> Fmt.fmt "hocc_=" |> fmt_hocc ~alt ~width:width' hocc_ + |> fmt_semi ~alt ~width + |> Fmt.fmt "postlude=" |> pp_matter postlude + |> fmt_semi ~alt ~width + |> Fmt.fmt "eoi=" |> Scan.Token.pp eoi + |> fmt_rcurly ~alt ~width + and pp_hmh hmh formatter = + fmt_hmh hmh formatter + + and fmt_hmhi ?(alt=Fmt.alt_default) ?(width=Fmt.width_default) hmhi formatter = + match hmhi with + | Hmhi {prelude; hocc_; postlude; eoi} -> + formatter |> Fmt.fmt "Hmhi " + |> fmt_lcurly ~alt ~width + |> Fmt.fmt "prelude=" |> pp_matter prelude + |> fmt_semi ~alt ~width + |> Fmt.fmt "hocc_=" |> Scan.Token.pp hocc_ + |> fmt_semi ~alt ~width + |> Fmt.fmt "postlude=" |> pp_matter postlude + |> fmt_semi ~alt ~width + |> Fmt.fmt "eoi=" |> Scan.Token.pp eoi + |> fmt_rcurly ~alt ~width + and pp_hmhi hmhi formatter = + fmt_hmhi hmhi formatter (**************************************************************************************************) (* Miscellaneous helper functions. *) @@ -1930,225 +14665,199 @@ and hmhi scanner = let min_comment_indentation_of_hocc_block = function | Hocc {indent; _} -> Scan.Token.source indent - |> Hmc.Source.Slice.base - |> Hmc.Source.Cursor.pos - |> Text.Pos.col + |> Hmc.Source.Slice.base + |> Hmc.Source.Cursor.pos + |> Text.Pos.col let base_of_code code = - let of_token token = - let open Scan.Token in - let source = match token with - | HmcToken ctok -> ctok |> Hmc.Scan.ConcreteToken.source - | HoccToken ctok -> ctok |> Scan.ConcreteToken.source - in - Hmc.Source.Slice.base source - in - let rec of_delimited = function - | DelimitedBlock {indent=token; _} - | DelimitedParen {lparen=token; _} - | DelimitedCapture {lcapture=token; _} - | DelimitedList {lbrack=token; _} - | DelimitedArray {larray=token; _} - | DelimitedModule {lcurly=token; _} -> of_token token - and of_code = function - | CodeDelimited {delimited; _} -> of_delimited delimited - | CodeToken {token_; _} -> of_token token_ - in - of_code code - -let last_token_of_code hocc_block code = - let min_comment_indentation = min_comment_indentation_of_hocc_block hocc_block in - let rec of_codes_tl = function - | CodesTlSepCode {code; codes_tl; _} -> begin + let of_token token_ = + let open Scan.Token in + let source = match token_ with + | HmcToken ctok -> ctok |> Hmc.Scan.ConcreteToken.source + | HoccToken ctok -> ctok |> Scan.ConcreteToken.source + in + Hmc.Source.Slice.base source + in + let rec of_delimited = function + | DelimitedBlock {indent=token_; _} + | DelimitedParen {lparen=token_; _} + | DelimitedCapture {lcapture=token_; _} + | DelimitedList {lbrack=token_; _} + | DelimitedArray {larray=token_; _} + | DelimitedModule {lcurly=token_; _} -> of_token token_ + and of_code = function + | CodeDelimited {delimited; _} -> of_delimited delimited + | CodeCodeToken {token_; _} -> of_token token_ + in + of_code code + +let last_token_of_code code = + let rec of_codes_tl = function + | CodesTlSepCode {code; codes_tl; _} -> begin of_codes_tl codes_tl - |> Option.some_or_thunk ~f:(fun () -> Some (of_code code)) + |> Option.some_or_thunk ~f:(fun () -> Some (of_code code)) end - | CodesTlEpsilon -> None - and of_codes = function - | Codes {code; codes_tl} -> begin + | CodesTlEpsilon -> None + and of_codes = function + | Codes {code; codes_tl} -> begin of_codes_tl codes_tl - |> Option.value_or_thunk ~f:(fun () -> of_code code) + |> Option.value_or_thunk ~f:(fun () -> of_code code) end - and of_delimited = function - | DelimitedBlock {codes; dedent; _} -> begin + and of_delimited = function + | DelimitedBlock {codes; dedent; _} -> begin of_codes codes - |> Option.some_or_thunk ~f:(fun () -> Some dedent) - |> Option.value_hlt - end - | DelimitedParen {rparen=token; _} - | DelimitedCapture {rcapture=token; _} - | DelimitedList {rbrack=token; _} - | DelimitedArray {rarray=token; _} - | DelimitedModule {rcurly=token; _} -> token - and of_code_tl = function - | CodeTlDelimited {delimited; code_tl} -> - of_code_tl code_tl - |> Option.some_or_thunk ~f:(fun () -> Some (of_delimited delimited)) - | CodeTlToken {token_; code_tl} -> begin - of_code_tl code_tl - |> Option.some_or_thunk ~f:(fun () -> - (* Exclude comments less indented than `hocc` block from the tail. *) - match token_ with - | HmcToken ctok -> begin - match Hmc.Scan.ConcreteToken.atok ctok with - | Tok_hash_comment - | Tok_paren_comment _ -> begin - let ctok_indentation = - ctok - |> Hmc.Scan.ConcreteToken.source - |> Hmc.Source.Slice.base - |> Hmc.Source.Cursor.pos - |> Text.Pos.col - in - match ctok_indentation >= min_comment_indentation with - | true -> Some token_ - | false -> None - end - | _ -> Some token_ - end - | HoccToken _ -> Some token_ - ) + |> Option.some_or_thunk ~f:(fun () -> Some dedent) + |> Option.value_hlt end - | CodeTlEpsilon -> None - and of_code = function - | CodeDelimited {delimited; code_tl} -> - of_code_tl code_tl |> Option.some_or_thunk ~f:(fun () -> Some (of_delimited delimited)) - | CodeToken {token_; code_tl} -> - of_code_tl code_tl |> Option.some_or_thunk ~f:(fun () -> Some token_) - in - of_code code - |> Option.value_hlt - -let past_of_code hocc_block code = - let of_token token = - let open Scan.Token in - let source = match token with - | HmcToken ctok -> ctok |> Hmc.Scan.ConcreteToken.source - | HoccToken ctok -> ctok |> Scan.ConcreteToken.source - in - Hmc.Source.Slice.past source - in - last_token_of_code hocc_block code - |> of_token - -let source_of_code hocc_block code = - let base = base_of_code code in - let past = past_of_code hocc_block code in - Hmc.Source.Slice.of_cursors ~base ~past + | DelimitedParen {rparen=token_; _} + | DelimitedCapture {rcapture=token_; _} + | DelimitedList {rbrack=token_; _} + | DelimitedArray {rarray=token_; _} + | DelimitedModule {rcurly=token_; _} -> token_ + and of_code_tl = function + | CodeTlDelimited {delimited; code_tl} -> + of_code_tl code_tl |> Option.some_or_thunk ~f:(fun () -> Some (of_delimited delimited)) + | CodeTlToken {token_; code_tl} -> + of_code_tl code_tl |> Option.some_or_thunk ~f:(fun () -> Some token_) + | CodeTlEpsilon -> None + and of_code = function + | CodeDelimited {delimited; code_tl} -> + of_code_tl code_tl |> Option.some_or_thunk ~f:(fun () -> Some (of_delimited delimited)) + | CodeCodeToken {token_; code_tl} -> + of_code_tl code_tl |> Option.some_or_thunk ~f:(fun () -> Some token_) + in + of_code code + |> Option.value_hlt + +let past_of_code code = + let of_token token_ = + let open Scan.Token in + let source = match token_ with + | HmcToken ctok -> ctok |> Hmc.Scan.ConcreteToken.source + | HoccToken ctok -> ctok |> Scan.ConcreteToken.source + in + Hmc.Source.Slice.past source + in + last_token_of_code code |> of_token + +let source_of_code code = + let base = base_of_code code in + let past = past_of_code code in + Hmc.Source.Slice.of_cursors ~base ~past let indentation_of_code hocc_block code = - let min_comment_indentation = min_comment_indentation_of_hocc_block hocc_block in - match code with - | CodeDelimited _ -> min_comment_indentation + 4L - | CodeToken _ -> min_comment_indentation + let min_comment_indentation = min_comment_indentation_of_hocc_block hocc_block in + match code with + | CodeDelimited _ -> min_comment_indentation + 4L + | CodeCodeToken _ -> min_comment_indentation (* Find the base cursor for the postlude that preserves comments/whitespace that fall outside the * `hocc` block. *) -let postlude_base_of_hocc (Hocc {stmts=Stmts {stmt; stmts_tl}; _} as hocc_block) = - let rec of_uident = function - | Uident {uident} -> uident - and of_cident = function - | Cident {cident} -> cident - and of_precs_tl = function - | PrecsTlCommaUident {uident; precs_tl; _} -> - Some ( - of_precs_tl precs_tl - |> Option.value_or_thunk ~f:(fun () -> of_uident uident) - ) - | PrecsTlEpsilon -> None - and of_precs = function - | Precs {uident; precs_tl} -> begin +let postlude_base_of_hocc (Hocc {stmts=Stmts {stmt; stmts_tl}; _}) = + let rec of_uident = function + | Uident {uident} -> uident + and of_cident = function + | Cident {cident} -> cident + and of_precs_tl = function + | PrecsTlCommaUident {uident; precs_tl; _} -> + Some ( + of_precs_tl precs_tl + |> Option.value_or_thunk ~f:(fun () -> of_uident uident) + ) + | PrecsTlEpsilon -> None + and of_precs = function + | Precs {uident; precs_tl} -> begin of_precs_tl precs_tl - |> Option.value_or_thunk ~f:(fun () -> of_uident uident) + |> Option.value_or_thunk ~f:(fun () -> of_uident uident) end - and of_prec_rels = function - | PrecRelsLtPrecs {precs; _} -> Some (of_precs precs) - | PrecRelsEpsilon -> None - and of_of_type = function - | OfType {type_type; _} -> of_uident type_type - and of_of_type0 = function - | OfType0OfType {of_type} -> Some (of_of_type of_type) - | OfType0Epsilon -> None - and of_prec_ref = function - | PrecRefPrecUident {uident; _} -> Some (of_uident uident) - | PrecRefEpsilon -> None - and of_token_alias = function - | TokenAlias {alias} -> Some alias - | TokenAliasEpsilon -> None - and of_prod_param_symbol = function - | ProdParamSymbolCident {cident} -> of_cident cident - | ProdParamSymbolAlias {alias} -> alias - and of_prod_param = function - | ProdParamBinding {prod_param_symbol; _} - | ProdParam {prod_param_symbol} -> of_prod_param_symbol prod_param_symbol - and of_prod_params_tl = function - | ProdParamsTlProdParam {prod_param; prod_params_tl} -> begin + and of_prec_rels = function + | PrecRelsLtPrecs {precs; _} -> Some (of_precs precs) + | PrecRelsEpsilon -> None + and of_of_type = function + | OfType {type_type; _} -> of_uident type_type + and of_of_type0 = function + | OfType0OfType {of_type} -> Some (of_of_type of_type) + | OfType0Epsilon -> None + and of_prec_ref = function + | PrecRefPrecUident {uident; _} -> Some (of_uident uident) + | PrecRefEpsilon -> None + and of_token_alias = function + | TokenAlias {alias} -> Some alias + | TokenAliasEpsilon -> None + and of_prod_param_symbol = function + | ProdParamSymbolCident {cident} -> of_cident cident + | ProdParamSymbolAlias {alias} -> alias + and of_prod_param = function + | ProdParamBinding {prod_param_symbol; _} + | ProdParam {prod_param_symbol} -> of_prod_param_symbol prod_param_symbol + and of_prod_params_tl = function + | ProdParamsTlProdParam {prod_param; prod_params_tl} -> begin of_prod_params_tl prod_params_tl - |> Option.some_or_thunk ~f:(fun () -> Some (of_prod_param prod_param)) + |> Option.some_or_thunk ~f:(fun () -> Some (of_prod_param prod_param)) end - | ProdParamsTlEpsilon -> None - and of_prod_params = function - | ProdParamsProdParam {prod_param; prod_params_tl} -> begin + | ProdParamsTlEpsilon -> None + and of_prod_params = function + | ProdParamsProdParam {prod_param; prod_params_tl} -> begin of_prod_params_tl prod_params_tl - |> Option.value_or_thunk ~f:(fun () -> of_prod_param prod_param) + |> Option.value_or_thunk ~f:(fun () -> of_prod_param prod_param) end - and of_prod_pattern = function - | ProdPatternParams {prod_params} -> of_prod_params prod_params - | ProdPatternEpsilon {epsilon_} -> epsilon_ - and of_prod = function - | Prod {prod_pattern; prec_ref} -> begin + and of_prod_pattern = function + | ProdPatternParams {prod_params} -> of_prod_params prod_params + | ProdPatternEpsilon {epsilon_} -> epsilon_ + and of_prod = function + | Prod {prod_pattern; prec_ref} -> begin of_prec_ref prec_ref - |> Option.value_or_thunk ~f:(fun () -> of_prod_pattern prod_pattern) + |> Option.value_or_thunk ~f:(fun () -> of_prod_pattern prod_pattern) end - and of_prods_tl = function - | ProdsTlBarProd {prod; prods_tl; _} -> begin + and of_prods_tl = function + | ProdsTlBarProd {prod; prods_tl; _} -> begin of_prods_tl prods_tl - |> Option.some_or_thunk ~f:(fun () -> Some (of_prod prod)) + |> Option.some_or_thunk ~f:(fun () -> Some (of_prod prod)) end - | ProdsTlEpsilon -> None - and of_prods = function - | ProdsBarProd {prod; prods_tl; _} - | ProdsProd {prod; prods_tl} -> begin + | ProdsTlEpsilon -> None + and of_prods = function + | ProdsBarProd {prod; prods_tl; _} + | ProdsProd {prod; prods_tl} -> begin of_prods_tl prods_tl - |> Option.value_or_thunk ~f:(fun () -> of_prod prod) + |> Option.value_or_thunk ~f:(fun () -> of_prod prod) end - and of_reduction = function - | Reduction {code; _} -> last_token_of_code hocc_block code - and of_reductions_tl = function - | ReductionsTlBarReduction {reduction; reductions_tl; _} -> begin + and of_reduction = function + | Reduction {code; _} -> last_token_of_code code + and of_reductions_tl = function + | ReductionsTlBarReduction {reduction; reductions_tl; _} -> begin of_reductions_tl reductions_tl - |> Option.some_or_thunk ~f:(fun () -> Some (of_reduction reduction)) + |> Option.some_or_thunk ~f:(fun () -> Some (of_reduction reduction)) end - | ReductionsTlEpsilon -> None - and of_reductions = function - | ReductionsReduction {reduction; reductions_tl} -> begin + | ReductionsTlEpsilon -> None + and of_reductions = function + | ReductionsReduction {reduction; reductions_tl} -> begin of_reductions_tl reductions_tl - |> Option.value_or_thunk ~f:(fun () -> of_reduction reduction) + |> Option.value_or_thunk ~f:(fun () -> of_reduction reduction) end - and of_nonterm = function - | NontermProds {prods; _} -> of_prods prods - | NontermReductions {reductions; _} -> of_reductions reductions - and of_stmt = function - | StmtPrec {prec_=Prec {uident; prec_rels; _}} -> begin + and of_nonterm = function + | NontermProds {prods; _} -> of_prods prods + | NontermReductions {reductions; _} -> of_reductions reductions + and of_stmt = function + | StmtPrec {prec_=Prec {uident; prec_rels; _}} -> begin of_prec_rels prec_rels - |> Option.value_or_thunk ~f:(fun () -> of_uident uident) + |> Option.value_or_thunk ~f:(fun () -> of_uident uident) end - | StmtToken {token_=Token {cident; token_alias; of_type0; prec_ref; _}} -> begin + | StmtToken {token_=Token {cident; token_alias; of_type0; prec_ref; _}} -> begin of_prec_ref prec_ref - |> Option.some_or_thunk ~f:(fun () -> of_of_type0 of_type0) - |> Option.some_or_thunk ~f:(fun () -> of_token_alias token_alias) - |> Option.value_or_thunk ~f:(fun () -> of_cident cident) - end - | StmtNonterm {nonterm_} -> of_nonterm nonterm_ - | StmtCode {code} -> last_token_of_code hocc_block code - and of_stmts_tl = function - | StmtsTl {stmt; stmts_tl; _} -> begin + |> Option.some_or_thunk ~f:(fun () -> of_of_type0 of_type0) + |> Option.some_or_thunk ~f:(fun () -> of_token_alias token_alias) + |> Option.value_or_thunk ~f:(fun () -> of_cident cident) + end + | StmtNonterm {nonterm_} -> of_nonterm nonterm_ + | StmtCode {code} -> last_token_of_code code + and of_stmts_tl = function + | StmtsTl {stmt; stmts_tl; _} -> begin (of_stmts_tl stmts_tl) - |> Option.some_or_thunk ~f:(fun () -> Some (of_stmt stmt)) + |> Option.some_or_thunk ~f:(fun () -> Some (of_stmt stmt)) end - | StmtsTlEpsilon -> None - in - of_stmts_tl stmts_tl - |> Option.value_or_thunk ~f:(fun () -> of_stmt stmt) - |> Scan.Token.source - |> Hmc.Source.Slice.past + | StmtsTlEpsilon -> None + in + of_stmts_tl stmts_tl + |> Option.value_or_thunk ~f:(fun () -> of_stmt stmt) + |> Scan.Token.source + |> Hmc.Source.Slice.past diff --git a/bootstrap/test/hocc/Example_b.expected.hm b/bootstrap/test/hocc/Example_b.expected.hm index b13b4083..42f17dbd 100644 --- a/bootstrap/test/hocc/Example_b.expected.hm +++ b/bootstrap/test/hocc/Example_b.expected.hm @@ -1193,11 +1193,7 @@ include :: {symbol=Symbol.Nonterm (Expr e); _} :: tl -> Symbol.Nonterm (Answer ( # ________________________________________________________________________________ - [:"./Example_b.hmh":36:4+18]e (* A comment that should be excluded from postlude. *) # And another. - # In `hocc` block; exclude from postlude - # In `hocc` block; exclude from postlude - # In `hocc` block; exclude from postlude -[:] + [:"./Example_b.hmh":36:4+18]e[:] # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ )), tl | _ -> not_reached () @@ -1379,10 +1375,7 @@ include match status with | Status.Prefix -> t |> feed token |> walk | _ -> not_reached () - }[:"./Example_b.hmh":40:0+0] # [First] Outside `hocc` block; include in postlude - # Outside `hocc` block; include in postlude - # Outside `hocc` block; include in postlude -# Outside `hocc` block; include in postlude + }[:"./Example_b.hmh":36:0+23] # Tokenize `s`, e.g. "2 + 3 * 4", and append an `EOI` token. tokenize s = diff --git a/bootstrap/test/hocc/Example_b.hmh b/bootstrap/test/hocc/Example_b.hmh index 6dbca2cf..2386c470 100644 --- a/bootstrap/test/hocc/Example_b.hmh +++ b/bootstrap/test/hocc/Example_b.hmh @@ -33,14 +33,7 @@ include token EOI start Answer of Zint.t ::= - | e:Expr EOI -> e (* A comment that should be excluded from postlude. *) # And another. - # In `hocc` block; exclude from postlude - # In `hocc` block; exclude from postlude - # In `hocc` block; exclude from postlude - # [First] Outside `hocc` block; include in postlude - # Outside `hocc` block; include in postlude - # Outside `hocc` block; include in postlude -# Outside `hocc` block; include in postlude + | e:Expr EOI -> e # Tokenize `s`, e.g. "2 + 3 * 4", and append an `EOI` token. tokenize s = diff --git a/bootstrap/test/hocc/Parse_error_cident.expected b/bootstrap/test/hocc/Parse_error_cident.expected index 7091a0d9..11f62c0e 100644 --- a/bootstrap/test/hocc/Parse_error_cident.expected +++ b/bootstrap/test/hocc/Parse_error_cident.expected @@ -1,2 +1,2 @@ hocc: Parsing "./Parse_error_cident.hmh" -hocc: At ["./Parse_error_cident.hmh":2:10.."./Parse_error_cident.hmh":2:16): Expected cident +hocc: At ["./Parse_error_cident.hmh":2:10.."./Parse_error_cident.hmh":2:16): Unexpected token diff --git a/bootstrap/test/hocc/Parse_error_code.expected b/bootstrap/test/hocc/Parse_error_code.expected index c0ce9ea8..3fed7f71 100644 --- a/bootstrap/test/hocc/Parse_error_code.expected +++ b/bootstrap/test/hocc/Parse_error_code.expected @@ -1,2 +1,2 @@ hocc: Parsing "./Parse_error_code.hmh" -hocc: At ["./Parse_error_code.hmh":3:0.."./Parse_error_code.hmh":3:0): Expected Hemlock code +hocc: At ["./Parse_error_code.hmh":3:0.."./Parse_error_code.hmh":3:0): Unexpected token diff --git a/bootstrap/test/hocc/Parse_error_delimited_rarray.expected b/bootstrap/test/hocc/Parse_error_delimited_rarray.expected index f28b3708..f979ea1f 100644 --- a/bootstrap/test/hocc/Parse_error_delimited_rarray.expected +++ b/bootstrap/test/hocc/Parse_error_delimited_rarray.expected @@ -1,2 +1,2 @@ hocc: Parsing "./Parse_error_delimited_rarray.hmh" -hocc: At ["./Parse_error_delimited_rarray.hmh":4:0.."./Parse_error_delimited_rarray.hmh":4:0): Expected '|]' +hocc: At ["./Parse_error_delimited_rarray.hmh":4:0.."./Parse_error_delimited_rarray.hmh":4:0): Unexpected token diff --git a/bootstrap/test/hocc/Parse_error_delimited_rbrack.expected b/bootstrap/test/hocc/Parse_error_delimited_rbrack.expected index a84be3ab..ea6cbbe0 100644 --- a/bootstrap/test/hocc/Parse_error_delimited_rbrack.expected +++ b/bootstrap/test/hocc/Parse_error_delimited_rbrack.expected @@ -1,2 +1,2 @@ hocc: Parsing "./Parse_error_delimited_rbrack.hmh" -hocc: At ["./Parse_error_delimited_rbrack.hmh":4:0.."./Parse_error_delimited_rbrack.hmh":4:0): Expected ']' +hocc: At ["./Parse_error_delimited_rbrack.hmh":4:0.."./Parse_error_delimited_rbrack.hmh":4:0): Unexpected token diff --git a/bootstrap/test/hocc/Parse_error_delimited_rcapture.expected b/bootstrap/test/hocc/Parse_error_delimited_rcapture.expected index fd3b5acd..e923b975 100644 --- a/bootstrap/test/hocc/Parse_error_delimited_rcapture.expected +++ b/bootstrap/test/hocc/Parse_error_delimited_rcapture.expected @@ -1,2 +1,2 @@ hocc: Parsing "./Parse_error_delimited_rcapture.hmh" -hocc: At ["./Parse_error_delimited_rcapture.hmh":4:0.."./Parse_error_delimited_rcapture.hmh":4:0): Expected '|)' +hocc: At ["./Parse_error_delimited_rcapture.hmh":4:0.."./Parse_error_delimited_rcapture.hmh":4:0): Unexpected token diff --git a/bootstrap/test/hocc/Parse_error_delimited_rcurly.expected b/bootstrap/test/hocc/Parse_error_delimited_rcurly.expected index 2b32e6e9..ae3a77c3 100644 --- a/bootstrap/test/hocc/Parse_error_delimited_rcurly.expected +++ b/bootstrap/test/hocc/Parse_error_delimited_rcurly.expected @@ -1,2 +1,2 @@ hocc: Parsing "./Parse_error_delimited_rcurly.hmh" -hocc: At ["./Parse_error_delimited_rcurly.hmh":4:0.."./Parse_error_delimited_rcurly.hmh":4:0): Expected '}' +hocc: At ["./Parse_error_delimited_rcurly.hmh":4:0.."./Parse_error_delimited_rcurly.hmh":4:0): Unexpected token diff --git a/bootstrap/test/hocc/Parse_error_delimited_rparen.expected b/bootstrap/test/hocc/Parse_error_delimited_rparen.expected index 92ff73f2..99226053 100644 --- a/bootstrap/test/hocc/Parse_error_delimited_rparen.expected +++ b/bootstrap/test/hocc/Parse_error_delimited_rparen.expected @@ -1,2 +1,2 @@ hocc: Parsing "./Parse_error_delimited_rparen.hmh" -hocc: At ["./Parse_error_delimited_rparen.hmh":4:0.."./Parse_error_delimited_rparen.hmh":4:0): Expected ')' +hocc: At ["./Parse_error_delimited_rparen.hmh":4:0.."./Parse_error_delimited_rparen.hmh":4:0): Unexpected token diff --git a/bootstrap/test/hocc/Parse_error_hmhi.expected b/bootstrap/test/hocc/Parse_error_hmhi.expected index 6b736744..9d95333a 100644 --- a/bootstrap/test/hocc/Parse_error_hmhi.expected +++ b/bootstrap/test/hocc/Parse_error_hmhi.expected @@ -1,2 +1,2 @@ hocc: Parsing "./Parse_error_hmhi.hmhi" -hocc: At ["./Parse_error_hmhi.hmhi":1:3.."./Parse_error_hmhi.hmhi":1:3): Expected 'hocc' keyword +hocc: At ["./Parse_error_hmhi.hmhi":2:0.."./Parse_error_hmhi.hmhi":2:0): Unexpected token diff --git a/bootstrap/test/hocc/Parse_error_hocc.expected b/bootstrap/test/hocc/Parse_error_hocc.expected index c8344a1c..f26a59de 100644 --- a/bootstrap/test/hocc/Parse_error_hocc.expected +++ b/bootstrap/test/hocc/Parse_error_hocc.expected @@ -1,2 +1,2 @@ hocc: Parsing "./Parse_error_hocc.hmh" -hocc: At ["./Parse_error_hocc.hmh":2:0.."./Parse_error_hocc.hmh":2:0): Expected 'hocc' statement +hocc: At ["./Parse_error_hocc.hmh":2:0.."./Parse_error_hocc.hmh":2:0): Unexpected token diff --git a/bootstrap/test/hocc/Parse_error_malformed.expected b/bootstrap/test/hocc/Parse_error_malformed.expected index d612efee..bc7351fd 100644 --- a/bootstrap/test/hocc/Parse_error_malformed.expected +++ b/bootstrap/test/hocc/Parse_error_malformed.expected @@ -1,3 +1,3 @@ hocc: Parsing "./Parse_error_malformed.hmh" +hocc: At ["./Parse_error_malformed.hmh":2:16.."./Parse_error_malformed.hmh":2:28): Unexpected token hocc: At ["./Parse_error_malformed.hmh":2:19.."./Parse_error_malformed.hmh":2:24): Invalid codepoint -hocc: At ["./Parse_error_malformed.hmh":3:25.."./Parse_error_malformed.hmh":3:32): Invalid codepoint diff --git a/bootstrap/test/hocc/Parse_error_nonterm_cce.expected b/bootstrap/test/hocc/Parse_error_nonterm_cce.expected index 4a20d884..76af9a99 100644 --- a/bootstrap/test/hocc/Parse_error_nonterm_cce.expected +++ b/bootstrap/test/hocc/Parse_error_nonterm_cce.expected @@ -1,2 +1,2 @@ hocc: Parsing "./Parse_error_nonterm_cce.hmh" -hocc: At ["./Parse_error_nonterm_cce.hmh":3:0.."./Parse_error_nonterm_cce.hmh":3:0): Expected '::=' +hocc: At ["./Parse_error_nonterm_cce.hmh":3:0.."./Parse_error_nonterm_cce.hmh":3:0): Unexpected token diff --git a/bootstrap/test/hocc/Parse_error_of_type_dot.expected b/bootstrap/test/hocc/Parse_error_of_type_dot.expected index 3f4011d3..7585adbe 100644 --- a/bootstrap/test/hocc/Parse_error_of_type_dot.expected +++ b/bootstrap/test/hocc/Parse_error_of_type_dot.expected @@ -1,2 +1,2 @@ hocc: Parsing "./Parse_error_of_type_dot.hmh" -hocc: At ["./Parse_error_of_type_dot.hmh":3:0.."./Parse_error_of_type_dot.hmh":3:0): Expected '.' +hocc: At ["./Parse_error_of_type_dot.hmh":3:0.."./Parse_error_of_type_dot.hmh":3:0): Unexpected token diff --git a/bootstrap/test/hocc/Parse_error_precs.expected b/bootstrap/test/hocc/Parse_error_precs.expected index 2fbe19a6..07f706c2 100644 --- a/bootstrap/test/hocc/Parse_error_precs.expected +++ b/bootstrap/test/hocc/Parse_error_precs.expected @@ -1,2 +1,2 @@ hocc: Parsing "./Parse_error_precs.hmh" -hocc: At ["./Parse_error_precs.hmh":3:0.."./Parse_error_precs.hmh":3:0): Expected uident +hocc: At ["./Parse_error_precs.hmh":3:0.."./Parse_error_precs.hmh":3:0): Unexpected token diff --git a/bootstrap/test/hocc/Parse_error_precs_lt.expected b/bootstrap/test/hocc/Parse_error_precs_lt.expected index eac077b2..2768fd73 100644 --- a/bootstrap/test/hocc/Parse_error_precs_lt.expected +++ b/bootstrap/test/hocc/Parse_error_precs_lt.expected @@ -1,2 +1,2 @@ hocc: Parsing "./Parse_error_precs_lt.hmh" -hocc: At ["./Parse_error_precs_lt.hmh":3:0.."./Parse_error_precs_lt.hmh":3:0): Expected uident +hocc: At ["./Parse_error_precs_lt.hmh":3:0.."./Parse_error_precs_lt.hmh":3:0): Unexpected token diff --git a/bootstrap/test/hocc/Parse_error_prod_param_type.expected b/bootstrap/test/hocc/Parse_error_prod_param_type.expected index 2786ddd2..1e77278d 100644 --- a/bootstrap/test/hocc/Parse_error_prod_param_type.expected +++ b/bootstrap/test/hocc/Parse_error_prod_param_type.expected @@ -1,2 +1,2 @@ hocc: Parsing "./Parse_error_prod_param_type.hmh" -hocc: At ["./Parse_error_prod_param_type.hmh":3:8.."./Parse_error_prod_param_type.hmh":3:9): Expected production parameter symbol +hocc: At ["./Parse_error_prod_param_type.hmh":3:10.."./Parse_error_prod_param_type.hmh":3:12): Unexpected token diff --git a/bootstrap/test/hocc/Parse_error_reduction_arrow.expected b/bootstrap/test/hocc/Parse_error_reduction_arrow.expected index f73d1188..96cff035 100644 --- a/bootstrap/test/hocc/Parse_error_reduction_arrow.expected +++ b/bootstrap/test/hocc/Parse_error_reduction_arrow.expected @@ -1,2 +1,2 @@ hocc: Parsing "./Parse_error_reduction_arrow.hmh" -hocc: At ["./Parse_error_reduction_arrow.hmh":4:0.."./Parse_error_reduction_arrow.hmh":4:0): Expected '->' +hocc: At ["./Parse_error_reduction_arrow.hmh":4:0.."./Parse_error_reduction_arrow.hmh":4:0): Unexpected token diff --git a/bootstrap/test/hocc/Parse_error_uident.expected b/bootstrap/test/hocc/Parse_error_uident.expected index 6f95cc63..4421ae7e 100644 --- a/bootstrap/test/hocc/Parse_error_uident.expected +++ b/bootstrap/test/hocc/Parse_error_uident.expected @@ -1,2 +1,2 @@ hocc: Parsing "./Parse_error_uident.hmh" -hocc: At ["./Parse_error_uident.hmh":2:12.."./Parse_error_uident.hmh":2:18): Expected uident +hocc: At ["./Parse_error_uident.hmh":2:12.."./Parse_error_uident.hmh":2:18): Unexpected token diff --git a/doc/tools/hocc.md b/doc/tools/hocc.md index 16340ae1..4bb52ed8 100644 --- a/doc/tools/hocc.md +++ b/doc/tools/hocc.md @@ -961,7 +961,7 @@ hocc token RCURLY "}" # Miscellaneous Hemlock token in embedded code - token CODE_TOKEN + token OTHER_TOKEN # End of input, used to terminate start symbols token EOI @@ -1022,14 +1022,27 @@ hocc | "[|" Codes0 "|]" | "{" Codes0 "}" + nonterm CodeToken ::= + | OTHER_TOKEN + | UIDENT + | CIDENT + | "_" + | ISTRING + | "of" + | ":" + | "." + | "->" + | "<" + | "," + nonterm CodeTl ::= | Delimited CodeTl - | CODE_TOKEN CodeTl + | OTHER_TOKEN CodeTl | epsilon nonterm Code ::= | Delimited CodeTl - | CODE_TOKEN CodeTl + | CodeToken CodeTl nonterm ProdParamSymbol ::= | Cident @@ -1088,8 +1101,24 @@ hocc nonterm Hocc ::= "hocc" INDENT Stmts DEDENT + nonterm MatterToken ::= + | CodeToken + | Sep + | INDENT + | DEDENT + | "(" + | ")" + | "(|" + | "|)" + | "[" + | "]" + | "[|" + | "|]" + | "{" + | "}" + nonterm Matter ::= - | CODE_TOKEN Matter + | MatterToken Matter | epsilon start Hmh ::= Matter Hocc Matter EOI