type token =
  | TEXTLINE of (string)
  | SECT_END
  | CARD_END
  | BLANK

open Parsing;;
# 2 "src/RecordParser.mly"
let make_card front back attributes =
    if front = "" or back = "" then
        raise SomeErrorAboutCardFrontBack
    else
        { front = front;
          back = back }, int_of_string (StringMap.find "level" map)
# 16 "src/RecordParser.ml"
let yytransl_const = [|
  258 (* SECT_END *);
  259 (* CARD_END *);
  260 (* BLANK *);
    0|]

let yytransl_block = [|
  257 (* TEXTLINE *);
    0|]

let yylhs = "\255\255\
\001\000\002\000\002\000\004\000\005\000\007\000\008\000\009\000\
\009\000\010\000\010\000\006\000\006\000\011\000\011\000\003\000\
\003\000\000\000"

let yylen = "\002\000\
\002\000\002\000\000\000\004\000\002\000\002\000\001\000\002\000\
\001\000\001\000\001\000\001\000\003\000\001\000\000\000\002\000\
\001\000\002\000"

let yydefred = "\000\000\
\003\000\000\000\018\000\000\000\017\000\000\000\002\000\000\000\
\000\000\016\000\005\000\000\000\010\000\011\000\006\000\000\000\
\009\000\000\000\000\000\008\000\000\000\012\000\004\000\014\000\
\000\000\013\000"

let yydgoto = "\002\000\
\003\000\004\000\006\000\007\000\008\000\023\000\011\000\015\000\
\016\000\017\000\025\000"

let yysindex = "\001\000\
\000\000\000\000\000\000\006\255\000\000\255\254\000\000\007\255\
\000\255\000\000\000\000\006\255\000\000\000\000\000\000\000\255\
\000\000\255\254\003\255\000\000\000\255\000\000\000\000\000\000\
\008\255\000\000"

let yyrindex = "\000\000\
\000\000\000\000\000\000\000\000\000\000\012\000\000\000\000\000\
\000\000\000\000\000\000\000\000\000\000\000\000\000\000\005\255\
\000\000\000\000\000\000\000\000\010\255\000\000\000\000\000\000\
\000\000\000\000"

let yygindex = "\000\000\
\000\000\000\000\002\000\000\000\003\000\000\000\000\000\251\255\
\000\000\004\000\000\000"

let yytablesize = 20
let yytable = "\009\000\
\013\000\001\000\010\000\014\000\021\000\022\000\007\000\007\000\
\012\000\005\000\026\000\001\000\015\000\018\000\019\000\024\000\
\000\000\000\000\000\000\020\000"

let yycheck = "\001\001\
\001\001\001\000\004\001\004\001\002\001\003\001\002\001\003\001\
\002\001\004\001\003\001\000\000\003\001\012\000\012\000\021\000\
\255\255\255\255\255\255\016\000"

let yynames_const = "\
  SECT_END\000\
  CARD_END\000\
  BLANK\000\
  "

let yynames_block = "\
  TEXTLINE\000\
  "

let yyact = [|
  (fun _ -> failwith "parser")
; (fun parser_env ->
    let _1 = (peek_val parser_env 1 : 'r_card_list) in
    let _2 = (peek_val parser_env 0 : 'blanks) in
    Obj.repr(
# 15 "src/RecordParser.mly"
                                             ( List.rev _1 )
# 92 "src/RecordParser.ml"
               : Deck.card list))
; (fun parser_env ->
    let _1 = (peek_val parser_env 1 : 'r_card_list) in
    let _2 = (peek_val parser_env 0 : 'card) in
    Obj.repr(
# 17 "src/RecordParser.mly"
                                           ( _2 :: _1 )
# 100 "src/RecordParser.ml"
               : 'r_card_list))
; (fun parser_env ->
    Obj.repr(
# 18 "src/RecordParser.mly"
                                           ( [] )
# 106 "src/RecordParser.ml"
               : 'r_card_list))
; (fun parser_env ->
    let _1 = (peek_val parser_env 3 : 'section) in
    let _3 = (peek_val parser_env 1 : 'section) in
    let _4 = (peek_val parser_env 0 : 'card_tail) in
    Obj.repr(
# 21 "src/RecordParser.mly"
                                           ( make_card _1 _3 _4 )
# 115 "src/RecordParser.ml"
               : 'card))
; (fun parser_env ->
    let _1 = (peek_val parser_env 1 : 'blanks) in
    let _2 = (peek_val parser_env 0 : 'section_body) in
    Obj.repr(
# 23 "src/RecordParser.mly"
                                           ( _2 )
# 123 "src/RecordParser.ml"
               : 'section))
; (fun parser_env ->
    let _1 = (peek_val parser_env 1 : string) in
    let _2 = (peek_val parser_env 0 : 'line_list) in
    Obj.repr(
# 25 "src/RecordParser.mly"
                                           ( _1 :: _2 )
# 131 "src/RecordParser.ml"
               : 'section_body))
; (fun parser_env ->
    let _1 = (peek_val parser_env 0 : 'r_line_list) in
    Obj.repr(
# 27 "src/RecordParser.mly"
                                           ( List.rev _1 )
# 138 "src/RecordParser.ml"
               : 'line_list))
; (fun parser_env ->
    let _1 = (peek_val parser_env 1 : 'r_line_list) in
    let _2 = (peek_val parser_env 0 : 'line) in
    Obj.repr(
# 28 "src/RecordParser.mly"
                                           ( _2 :: _1 )
# 146 "src/RecordParser.ml"
               : 'r_line_list))
; (fun parser_env ->
    let _1 = (peek_val parser_env 0 : 'line) in
    Obj.repr(
# 29 "src/RecordParser.mly"
                                           ( [_1] )
# 153 "src/RecordParser.ml"
               : 'r_line_list))
; (fun parser_env ->
    let _1 = (peek_val parser_env 0 : string) in
    Obj.repr(
# 31 "src/RecordParser.mly"
                                           ( _1 )
# 160 "src/RecordParser.ml"
               : 'line))
; (fun parser_env ->
    Obj.repr(
# 32 "src/RecordParser.mly"
                                           ( "" )
# 166 "src/RecordParser.ml"
               : 'line))
; (fun parser_env ->
    Obj.repr(
# 34 "src/RecordParser.mly"
                                           ( StringMap.empty )
# 172 "src/RecordParser.ml"
               : 'card_tail))
; (fun parser_env ->
    let _2 = (peek_val parser_env 1 : 'attributes) in
    Obj.repr(
# 35 "src/RecordParser.mly"
                                           ( _2 )
# 179 "src/RecordParser.ml"
               : 'card_tail))
; (fun parser_env ->
    let _1 = (peek_val parser_env 0 : 'line_list) in
    Obj.repr(
# 37 "src/RecordParser.mly"
                                           ( process_attrib_line_list _1 )
# 186 "src/RecordParser.ml"
               : 'attributes))
; (fun parser_env ->
    Obj.repr(
# 38 "src/RecordParser.mly"
                                           ( StringMap.empty )
# 192 "src/RecordParser.ml"
               : 'attributes))
; (fun parser_env ->
    let _1 = (peek_val parser_env 1 : 'blanks) in
    Obj.repr(
# 40 "src/RecordParser.mly"
                                           ( () )
# 199 "src/RecordParser.ml"
               : 'blanks))
; (fun parser_env ->
    Obj.repr(
# 41 "src/RecordParser.mly"
                                           ( () )
# 205 "src/RecordParser.ml"
               : 'blanks))
(* Entry deck *)
; (fun parser_env -> raise (YYexit (peek_val parser_env 0)))
|]
let yytables =
  { actions=yyact;
    transl_const=yytransl_const;
    transl_block=yytransl_block;
    lhs=yylhs;
    len=yylen;
    defred=yydefred;
    dgoto=yydgoto;
    sindex=yysindex;
    rindex=yyrindex;
    gindex=yygindex;
    tablesize=yytablesize;
    table=yytable;
    check=yycheck;
    error_function=parse_error;
    names_const=yynames_const;
    names_block=yynames_block }
let deck (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) =
   (yyparse yytables 1 lexfun lexbuf : Deck.card list)
