type token = | LBRACK | RBRACK | DEF | PIPE | DOT | EOF | ID of (string) open Parsing;; # 2 "bnf_parser.mly" open Bnf_spec.Bnf open Spec # 15 "bnf_parser.ml" let yytransl_const = [| 257 (* LBRACK *); 258 (* RBRACK *); 259 (* DEF *); 260 (* PIPE *); 261 (* DOT *); 0 (* EOF *); 0|] let yytransl_block = [| 262 (* ID *); 0|] let yylhs = "\255\255\ \001\000\001\000\002\000\002\000\003\000\005\000\005\000\006\000\ \006\000\007\000\007\000\004\000\000\000" let yylen = "\002\000\ \001\000\002\000\001\000\002\000\004\000\001\000\003\000\001\000\ \002\000\001\000\001\000\003\000\002\000" let yydefred = "\000\000\ \000\000\000\000\000\000\001\000\013\000\000\000\003\000\000\000\ \000\000\002\000\004\000\000\000\012\000\010\000\011\000\000\000\ \000\000\008\000\000\000\005\000\009\000\000\000" let yydgoto = "\002\000\ \005\000\006\000\007\000\015\000\016\000\017\000\018\000" let yysindex = "\013\000\ \001\000\000\000\009\255\000\000\000\000\002\000\000\000\013\255\ \015\255\000\000\000\000\255\254\000\000\000\000\000\000\002\255\ \255\254\000\000\255\254\000\000\000\000\255\254" let yyrindex = "\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \006\255\000\000\000\000\000\000\000\000\008\255" let yygindex = "\000\000\ \000\000\000\000\012\000\003\000\000\000\004\000\242\255" let yytablesize = 259 let yytable = "\003\000\ \004\000\010\000\021\000\008\000\014\000\019\000\020\000\021\000\ \008\000\006\000\006\000\007\000\007\000\001\000\009\000\012\000\ \013\000\011\000\000\000\000\000\000\000\000\000\022\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\ \000\000\003\000\003\000" let yycheck = "\001\001\ \000\000\000\000\017\000\001\000\006\001\004\001\005\001\022\000\ \006\000\004\001\005\001\004\001\005\001\001\000\006\001\003\001\ \002\001\006\000\255\255\255\255\255\255\255\255\019\000\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\ \255\255\001\001\001\001" let yynames_const = "\ LBRACK\000\ RBRACK\000\ DEF\000\ PIPE\000\ DOT\000\ EOF\000\ " let yynames_block = "\ ID\000\ " let yyact = [| (fun _ -> failwith "parser") ; (fun __caml_parser_env -> Obj.repr( # 15 "bnf_parser.mly" ( empty ) # 148 "bnf_parser.ml" : Bnf_spec.Bnf.grammar)) ; (fun __caml_parser_env -> let _1 = (Parsing.peek_val __caml_parser_env 1 : 'defs) in Obj.repr( # 16 "bnf_parser.mly" ( _1 ) # 155 "bnf_parser.ml" : Bnf_spec.Bnf.grammar)) ; (fun __caml_parser_env -> let _1 = (Parsing.peek_val __caml_parser_env 0 : 'def) in Obj.repr( # 19 "bnf_parser.mly" ( _1 ) # 162 "bnf_parser.ml" : 'defs)) ; (fun __caml_parser_env -> let _1 = (Parsing.peek_val __caml_parser_env 1 : 'defs) in let _2 = (Parsing.peek_val __caml_parser_env 0 : 'def) in Obj.repr( # 20 "bnf_parser.mly" ( union _1 _2 ) # 170 "bnf_parser.ml" : 'defs)) ; (fun __caml_parser_env -> let _1 = (Parsing.peek_val __caml_parser_env 3 : 'nt) in let _3 = (Parsing.peek_val __caml_parser_env 1 : 'prods) in Obj.repr( # 22 "bnf_parser.mly" ( List.fold_left (fun a -> add_prod a _1 ()) empty _3 ) # 178 "bnf_parser.ml" : 'def)) ; (fun __caml_parser_env -> let _1 = (Parsing.peek_val __caml_parser_env 0 : 'prod) in Obj.repr( # 25 "bnf_parser.mly" ( [List.rev _1] ) # 185 "bnf_parser.ml" : 'prods)) ; (fun __caml_parser_env -> let _1 = (Parsing.peek_val __caml_parser_env 2 : 'prods) in let _3 = (Parsing.peek_val __caml_parser_env 0 : 'prod) in Obj.repr( # 26 "bnf_parser.mly" ( (List.rev _3) :: _1 ) # 193 "bnf_parser.ml" : 'prods)) ; (fun __caml_parser_env -> let _1 = (Parsing.peek_val __caml_parser_env 0 : 'symbol) in Obj.repr( # 29 "bnf_parser.mly" ( [_1] ) # 200 "bnf_parser.ml" : 'prod)) ; (fun __caml_parser_env -> let _1 = (Parsing.peek_val __caml_parser_env 1 : 'prod) in let _2 = (Parsing.peek_val __caml_parser_env 0 : 'symbol) in Obj.repr( # 30 "bnf_parser.mly" ( _2 :: _1 ) # 208 "bnf_parser.ml" : 'prod)) ; (fun __caml_parser_env -> let _1 = (Parsing.peek_val __caml_parser_env 0 : string) in Obj.repr( # 33 "bnf_parser.mly" ( T _1 ) # 215 "bnf_parser.ml" : 'symbol)) ; (fun __caml_parser_env -> let _1 = (Parsing.peek_val __caml_parser_env 0 : 'nt) in Obj.repr( # 34 "bnf_parser.mly" ( NT _1 ) # 222 "bnf_parser.ml" : 'symbol)) ; (fun __caml_parser_env -> let _2 = (Parsing.peek_val __caml_parser_env 1 : string) in Obj.repr( # 36 "bnf_parser.mly" ( _2 ) # 229 "bnf_parser.ml" : 'nt)) (* Entry start *) ; (fun __caml_parser_env -> raise (Parsing.YYexit (Parsing.peek_val __caml_parser_env 0))) |] let yytables = { Parsing.actions=yyact; Parsing.transl_const=yytransl_const; Parsing.transl_block=yytransl_block; Parsing.lhs=yylhs; Parsing.len=yylen; Parsing.defred=yydefred; Parsing.dgoto=yydgoto; Parsing.sindex=yysindex; Parsing.rindex=yyrindex; Parsing.gindex=yygindex; Parsing.tablesize=yytablesize; Parsing.table=yytable; Parsing.check=yycheck; Parsing.error_function=parse_error; Parsing.names_const=yynames_const; Parsing.names_block=yynames_block } let start (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) = (Parsing.yyparse yytables 1 lexfun lexbuf : Bnf_spec.Bnf.grammar)