// Implementation file for parser generated by fsyacc
module FsLexYacc.FsLex.Parser
#nowarn "64";; // turn off warnings that type variables used in production annotations are instantiated to concrete type
open FSharp.Text.Lexing
open FSharp.Text.Parsing.ParseHelpers
# 1 "fslexpars.fsy"

(* (c) Microsoft Corporation 2005-2008.  *)

open FsLexYacc.FsLex
open FsLexYacc.FsLex.AST


# 14 "fslexpars.fs"
// This type is the type of tokens accepted by the parser
type token = 
  | EOF
  | BAR
  | DOT
  | PLUS
  | STAR
  | QMARK
  | EQUALS
  | UNDERSCORE
  | LBRACK
  | RBRACK
  | HAT
  | DASH
  | RULE
  | PARSE
  | LET
  | AND
  | LPAREN
  | RPAREN
  | COLON
  | UNICODE_CATEGORY of (string)
  | CHAR of (char)
  | CODE of (AST.Code)
  | STRING of (string)
  | IDENT of (string)
// This type is used to give symbolic names to token indexes, useful for error messages
type tokenId = 
    | TOKEN_EOF
    | TOKEN_BAR
    | TOKEN_DOT
    | TOKEN_PLUS
    | TOKEN_STAR
    | TOKEN_QMARK
    | TOKEN_EQUALS
    | TOKEN_UNDERSCORE
    | TOKEN_LBRACK
    | TOKEN_RBRACK
    | TOKEN_HAT
    | TOKEN_DASH
    | TOKEN_RULE
    | TOKEN_PARSE
    | TOKEN_LET
    | TOKEN_AND
    | TOKEN_LPAREN
    | TOKEN_RPAREN
    | TOKEN_COLON
    | TOKEN_UNICODE_CATEGORY
    | TOKEN_CHAR
    | TOKEN_CODE
    | TOKEN_STRING
    | TOKEN_IDENT
    | TOKEN_end_of_input
    | TOKEN_error
// This type is used to give symbolic names to token indexes, useful for error messages
type nonTerminalId = 
    | NONTERM__startspec
    | NONTERM_spec
    | NONTERM_codeopt
    | NONTERM_Macros
    | NONTERM_macro
    | NONTERM_Rules
    | NONTERM_rule
    | NONTERM_args
    | NONTERM_optbar
    | NONTERM_clauses
    | NONTERM_clause
    | NONTERM_regexp
    | NONTERM_charset

// This function maps tokens to integer indexes
let tagOfToken (t:token) = 
  match t with
  | EOF  -> 0 
  | BAR  -> 1 
  | DOT  -> 2 
  | PLUS  -> 3 
  | STAR  -> 4 
  | QMARK  -> 5 
  | EQUALS  -> 6 
  | UNDERSCORE  -> 7 
  | LBRACK  -> 8 
  | RBRACK  -> 9 
  | HAT  -> 10 
  | DASH  -> 11 
  | RULE  -> 12 
  | PARSE  -> 13 
  | LET  -> 14 
  | AND  -> 15 
  | LPAREN  -> 16 
  | RPAREN  -> 17 
  | COLON  -> 18 
  | UNICODE_CATEGORY _ -> 19 
  | CHAR _ -> 20 
  | CODE _ -> 21 
  | STRING _ -> 22 
  | IDENT _ -> 23 

// This function maps integer indexes to symbolic token ids
let tokenTagToTokenId (tokenIdx:int) = 
  match tokenIdx with
  | 0 -> TOKEN_EOF 
  | 1 -> TOKEN_BAR 
  | 2 -> TOKEN_DOT 
  | 3 -> TOKEN_PLUS 
  | 4 -> TOKEN_STAR 
  | 5 -> TOKEN_QMARK 
  | 6 -> TOKEN_EQUALS 
  | 7 -> TOKEN_UNDERSCORE 
  | 8 -> TOKEN_LBRACK 
  | 9 -> TOKEN_RBRACK 
  | 10 -> TOKEN_HAT 
  | 11 -> TOKEN_DASH 
  | 12 -> TOKEN_RULE 
  | 13 -> TOKEN_PARSE 
  | 14 -> TOKEN_LET 
  | 15 -> TOKEN_AND 
  | 16 -> TOKEN_LPAREN 
  | 17 -> TOKEN_RPAREN 
  | 18 -> TOKEN_COLON 
  | 19 -> TOKEN_UNICODE_CATEGORY 
  | 20 -> TOKEN_CHAR 
  | 21 -> TOKEN_CODE 
  | 22 -> TOKEN_STRING 
  | 23 -> TOKEN_IDENT 
  | 26 -> TOKEN_end_of_input
  | 24 -> TOKEN_error
  | _ -> failwith "tokenTagToTokenId: bad token"

/// This function maps production indexes returned in syntax errors to strings representing the non terminal that would be produced by that production
let prodIdxToNonTerminal (prodIdx:int) = 
  match prodIdx with
    | 0 -> NONTERM__startspec 
    | 1 -> NONTERM_spec 
    | 2 -> NONTERM_codeopt 
    | 3 -> NONTERM_codeopt 
    | 4 -> NONTERM_Macros 
    | 5 -> NONTERM_Macros 
    | 6 -> NONTERM_macro 
    | 7 -> NONTERM_Rules 
    | 8 -> NONTERM_Rules 
    | 9 -> NONTERM_rule 
    | 10 -> NONTERM_args 
    | 11 -> NONTERM_args 
    | 12 -> NONTERM_args 
    | 13 -> NONTERM_optbar 
    | 14 -> NONTERM_optbar 
    | 15 -> NONTERM_clauses 
    | 16 -> NONTERM_clauses 
    | 17 -> NONTERM_clause 
    | 18 -> NONTERM_regexp 
    | 19 -> NONTERM_regexp 
    | 20 -> NONTERM_regexp 
    | 21 -> NONTERM_regexp 
    | 22 -> NONTERM_regexp 
    | 23 -> NONTERM_regexp 
    | 24 -> NONTERM_regexp 
    | 25 -> NONTERM_regexp 
    | 26 -> NONTERM_regexp 
    | 27 -> NONTERM_regexp 
    | 28 -> NONTERM_regexp 
    | 29 -> NONTERM_regexp 
    | 30 -> NONTERM_regexp 
    | 31 -> NONTERM_regexp 
    | 32 -> NONTERM_charset 
    | 33 -> NONTERM_charset 
    | 34 -> NONTERM_charset 
    | _ -> failwith "prodIdxToNonTerminal: bad production index"

let _fsyacc_endOfInputTag = 26 
let _fsyacc_tagOfErrorTerminal = 24

// This function gets the name of a token as a string
let token_to_string (t:token) = 
  match t with 
  | EOF  -> "EOF" 
  | BAR  -> "BAR" 
  | DOT  -> "DOT" 
  | PLUS  -> "PLUS" 
  | STAR  -> "STAR" 
  | QMARK  -> "QMARK" 
  | EQUALS  -> "EQUALS" 
  | UNDERSCORE  -> "UNDERSCORE" 
  | LBRACK  -> "LBRACK" 
  | RBRACK  -> "RBRACK" 
  | HAT  -> "HAT" 
  | DASH  -> "DASH" 
  | RULE  -> "RULE" 
  | PARSE  -> "PARSE" 
  | LET  -> "LET" 
  | AND  -> "AND" 
  | LPAREN  -> "LPAREN" 
  | RPAREN  -> "RPAREN" 
  | COLON  -> "COLON" 
  | UNICODE_CATEGORY _ -> "UNICODE_CATEGORY" 
  | CHAR _ -> "CHAR" 
  | CODE _ -> "CODE" 
  | STRING _ -> "STRING" 
  | IDENT _ -> "IDENT" 

// This function gets the data carried by a token as an object
let _fsyacc_dataOfToken (t:token) = 
  match t with 
  | EOF  -> (null : System.Object) 
  | BAR  -> (null : System.Object) 
  | DOT  -> (null : System.Object) 
  | PLUS  -> (null : System.Object) 
  | STAR  -> (null : System.Object) 
  | QMARK  -> (null : System.Object) 
  | EQUALS  -> (null : System.Object) 
  | UNDERSCORE  -> (null : System.Object) 
  | LBRACK  -> (null : System.Object) 
  | RBRACK  -> (null : System.Object) 
  | HAT  -> (null : System.Object) 
  | DASH  -> (null : System.Object) 
  | RULE  -> (null : System.Object) 
  | PARSE  -> (null : System.Object) 
  | LET  -> (null : System.Object) 
  | AND  -> (null : System.Object) 
  | LPAREN  -> (null : System.Object) 
  | RPAREN  -> (null : System.Object) 
  | COLON  -> (null : System.Object) 
  | UNICODE_CATEGORY _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x 
  | CHAR _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x 
  | CODE _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x 
  | STRING _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x 
  | IDENT _fsyacc_x -> Microsoft.FSharp.Core.Operators.box _fsyacc_x 
let _fsyacc_gotos = [| 0us; 65535us; 1us; 65535us; 0us; 1us; 2us; 65535us; 0us; 2us; 5us; 6us; 2us; 65535us; 2us; 3us; 8us; 9us; 2us; 65535us; 2us; 8us; 8us; 8us; 2us; 65535us; 4us; 5us; 15us; 16us; 2us; 65535us; 4us; 14us; 15us; 14us; 3us; 65535us; 17us; 18us; 27us; 28us; 29us; 30us; 1us; 65535us; 20us; 21us; 2us; 65535us; 21us; 22us; 33us; 34us; 2us; 65535us; 21us; 32us; 33us; 32us; 10us; 65535us; 12us; 13us; 13us; 43us; 21us; 35us; 33us; 35us; 35us; 43us; 43us; 43us; 44us; 43us; 45us; 43us; 49us; 44us; 50us; 45us; 5us; 65535us; 52us; 53us; 53us; 61us; 55us; 56us; 56us; 61us; 61us; 61us; |]
let _fsyacc_sparseGotoTableRowOffsets = [|0us; 1us; 3us; 6us; 9us; 12us; 15us; 18us; 22us; 24us; 27us; 30us; 41us; |]
let _fsyacc_stateToProdIdxsTableElements = [| 1us; 0us; 1us; 0us; 1us; 1us; 1us; 1us; 1us; 1us; 1us; 1us; 1us; 1us; 1us; 2us; 1us; 5us; 1us; 5us; 1us; 6us; 1us; 6us; 1us; 6us; 6us; 6us; 24us; 25us; 26us; 27us; 28us; 2us; 7us; 8us; 1us; 7us; 1us; 7us; 1us; 9us; 1us; 9us; 1us; 9us; 1us; 9us; 1us; 9us; 1us; 9us; 1us; 11us; 1us; 11us; 1us; 11us; 1us; 11us; 1us; 11us; 1us; 11us; 1us; 12us; 1us; 12us; 1us; 14us; 2us; 15us; 16us; 1us; 15us; 1us; 15us; 6us; 17us; 24us; 25us; 26us; 27us; 28us; 1us; 17us; 1us; 18us; 1us; 19us; 1us; 20us; 1us; 21us; 1us; 22us; 1us; 23us; 6us; 24us; 24us; 25us; 26us; 27us; 28us; 6us; 24us; 25us; 26us; 27us; 28us; 28us; 6us; 24us; 25us; 26us; 27us; 28us; 29us; 1us; 25us; 1us; 26us; 1us; 27us; 1us; 28us; 1us; 29us; 1us; 29us; 2us; 30us; 31us; 2us; 30us; 34us; 1us; 30us; 1us; 31us; 2us; 31us; 34us; 1us; 31us; 2us; 32us; 33us; 1us; 33us; 1us; 33us; 2us; 34us; 34us; |]
let _fsyacc_stateToProdIdxsTableRowOffsets = [|0us; 2us; 4us; 6us; 8us; 10us; 12us; 14us; 16us; 18us; 20us; 22us; 24us; 26us; 33us; 36us; 38us; 40us; 42us; 44us; 46us; 48us; 50us; 52us; 54us; 56us; 58us; 60us; 62us; 64us; 66us; 68us; 70us; 73us; 75us; 77us; 84us; 86us; 88us; 90us; 92us; 94us; 96us; 98us; 105us; 112us; 119us; 121us; 123us; 125us; 127us; 129us; 131us; 134us; 137us; 139us; 141us; 144us; 146us; 149us; 151us; 153us; |]
let _fsyacc_action_rows = 62
let _fsyacc_actionTableElements = [|1us; 16387us; 21us; 7us; 0us; 49152us; 1us; 16388us; 14us; 10us; 1us; 32768us; 12us; 4us; 1us; 32768us; 23us; 17us; 1us; 16387us; 21us; 7us; 0us; 16385us; 0us; 16386us; 1us; 16388us; 14us; 10us; 0us; 16389us; 1us; 32768us; 23us; 11us; 1us; 32768us; 6us; 12us; 8us; 32768us; 0us; 39us; 7us; 40us; 8us; 52us; 16us; 50us; 19us; 38us; 20us; 37us; 22us; 41us; 23us; 42us; 12us; 16390us; 0us; 39us; 1us; 49us; 3us; 46us; 4us; 47us; 5us; 48us; 7us; 40us; 8us; 52us; 16us; 50us; 19us; 38us; 20us; 37us; 22us; 41us; 23us; 42us; 1us; 16392us; 15us; 15us; 1us; 32768us; 23us; 17us; 0us; 16391us; 2us; 16394us; 16us; 23us; 23us; 29us; 1us; 32768us; 6us; 19us; 1us; 32768us; 13us; 20us; 1us; 16397us; 1us; 31us; 8us; 32768us; 0us; 39us; 7us; 40us; 8us; 52us; 16us; 50us; 19us; 38us; 20us; 37us; 22us; 41us; 23us; 42us; 0us; 16393us; 1us; 32768us; 23us; 24us; 1us; 32768us; 18us; 25us; 1us; 32768us; 23us; 26us; 1us; 32768us; 17us; 27us; 2us; 16394us; 16us; 23us; 23us; 29us; 0us; 16395us; 2us; 16394us; 16us; 23us; 23us; 29us; 0us; 16396us; 0us; 16398us; 1us; 16400us; 1us; 33us; 8us; 32768us; 0us; 39us; 7us; 40us; 8us; 52us; 16us; 50us; 19us; 38us; 20us; 37us; 22us; 41us; 23us; 42us; 0us; 16399us; 13us; 32768us; 0us; 39us; 1us; 49us; 3us; 46us; 4us; 47us; 5us; 48us; 7us; 40us; 8us; 52us; 16us; 50us; 19us; 38us; 20us; 37us; 21us; 36us; 22us; 41us; 23us; 42us; 0us; 16401us; 0us; 16402us; 0us; 16403us; 0us; 16404us; 0us; 16405us; 0us; 16406us; 0us; 16407us; 11us; 16408us; 0us; 39us; 3us; 46us; 4us; 47us; 5us; 48us; 7us; 40us; 8us; 52us; 16us; 50us; 19us; 38us; 20us; 37us; 22us; 41us; 23us; 42us; 11us; 16412us; 0us; 39us; 3us; 46us; 4us; 47us; 5us; 48us; 7us; 40us; 8us; 52us; 16us; 50us; 19us; 38us; 20us; 37us; 22us; 41us; 23us; 42us; 13us; 32768us; 0us; 39us; 1us; 49us; 3us; 46us; 4us; 47us; 5us; 48us; 7us; 40us; 8us; 52us; 16us; 50us; 17us; 51us; 19us; 38us; 20us; 37us; 22us; 41us; 23us; 42us; 0us; 16409us; 0us; 16410us; 0us; 16411us; 8us; 32768us; 0us; 39us; 7us; 40us; 8us; 52us; 16us; 50us; 19us; 38us; 20us; 37us; 22us; 41us; 23us; 42us; 8us; 32768us; 0us; 39us; 7us; 40us; 8us; 52us; 16us; 50us; 19us; 38us; 20us; 37us; 22us; 41us; 23us; 42us; 0us; 16413us; 2us; 32768us; 10us; 55us; 20us; 58us; 2us; 32768us; 9us; 54us; 20us; 58us; 0us; 16414us; 1us; 32768us; 20us; 58us; 2us; 32768us; 9us; 57us; 20us; 58us; 0us; 16415us; 1us; 16416us; 11us; 59us; 1us; 32768us; 20us; 60us; 0us; 16417us; 1us; 16418us; 20us; 58us; |]
let _fsyacc_actionTableRowOffsets = [|0us; 2us; 3us; 5us; 7us; 9us; 11us; 12us; 13us; 15us; 16us; 18us; 20us; 29us; 42us; 44us; 46us; 47us; 50us; 52us; 54us; 56us; 65us; 66us; 68us; 70us; 72us; 74us; 77us; 78us; 81us; 82us; 83us; 85us; 94us; 95us; 109us; 110us; 111us; 112us; 113us; 114us; 115us; 116us; 128us; 140us; 154us; 155us; 156us; 157us; 166us; 175us; 176us; 179us; 182us; 183us; 185us; 188us; 189us; 191us; 193us; 194us; |]
let _fsyacc_reductionSymbolCounts = [|1us; 5us; 1us; 0us; 0us; 2us; 4us; 3us; 1us; 6us; 0us; 6us; 2us; 0us; 1us; 3us; 1us; 2us; 1us; 1us; 1us; 1us; 1us; 1us; 2us; 2us; 2us; 2us; 3us; 3us; 3us; 4us; 1us; 3us; 2us; |]
let _fsyacc_productionToNonTerminalTable = [|0us; 1us; 2us; 2us; 3us; 3us; 4us; 5us; 5us; 6us; 7us; 7us; 7us; 8us; 8us; 9us; 9us; 10us; 11us; 11us; 11us; 11us; 11us; 11us; 11us; 11us; 11us; 11us; 11us; 11us; 11us; 11us; 12us; 12us; 12us; |]
let _fsyacc_immediateActions = [|65535us; 49152us; 65535us; 65535us; 65535us; 65535us; 16385us; 16386us; 65535us; 16389us; 65535us; 65535us; 65535us; 65535us; 65535us; 65535us; 16391us; 65535us; 65535us; 65535us; 65535us; 65535us; 16393us; 65535us; 65535us; 65535us; 65535us; 65535us; 16395us; 65535us; 16396us; 16398us; 65535us; 65535us; 16399us; 65535us; 16401us; 16402us; 16403us; 16404us; 16405us; 16406us; 16407us; 65535us; 65535us; 65535us; 16409us; 16410us; 16411us; 65535us; 65535us; 16413us; 65535us; 65535us; 16414us; 65535us; 65535us; 16415us; 65535us; 65535us; 16417us; 65535us; |]
let _fsyacc_reductions ()  =    [| 
# 253 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _1 = parseState.GetInput(1) :?> AST.Spec in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
                      raise (FSharp.Text.Parsing.Accept(Microsoft.FSharp.Core.Operators.box _1))
                   )
                 : 'gentype__startspec));
# 262 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _1 = parseState.GetInput(1) :?> 'gentype_codeopt in
            let _2 = parseState.GetInput(2) :?> 'gentype_Macros in
            let _4 = parseState.GetInput(4) :?> 'gentype_Rules in
            let _5 = parseState.GetInput(5) :?> 'gentype_codeopt in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 25 "fslexpars.fsy"
                                                          
                         { TopCode=_1;Macros=_2;Rules=_4;BottomCode=_5 }
                   )
# 25 "fslexpars.fsy"
                 : AST.Spec));
# 277 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _1 = parseState.GetInput(1) :?> AST.Code in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 30 "fslexpars.fsy"
                              _1 
                   )
# 30 "fslexpars.fsy"
                 : 'gentype_codeopt));
# 288 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 31 "fslexpars.fsy"
                         "", (parseState.ResultRange |> fst) 
                   )
# 31 "fslexpars.fsy"
                 : 'gentype_codeopt));
# 298 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 34 "fslexpars.fsy"
                         [] 
                   )
# 34 "fslexpars.fsy"
                 : 'gentype_Macros));
# 308 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _1 = parseState.GetInput(1) :?> 'gentype_macro in
            let _2 = parseState.GetInput(2) :?> 'gentype_Macros in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 35 "fslexpars.fsy"
                                     
                         _1 :: _2
                   )
# 35 "fslexpars.fsy"
                 : 'gentype_Macros));
# 321 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _2 = parseState.GetInput(2) :?> string in
            let _4 = parseState.GetInput(4) :?> 'gentype_regexp in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 40 "fslexpars.fsy"
                                                
                         (_2, _4)
                   )
# 40 "fslexpars.fsy"
                 : 'gentype_macro));
# 334 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _1 = parseState.GetInput(1) :?> 'gentype_rule in
            let _3 = parseState.GetInput(3) :?> 'gentype_Rules in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 45 "fslexpars.fsy"
                                       
                         _1 :: _3
                   )
# 45 "fslexpars.fsy"
                 : 'gentype_Rules));
# 347 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _1 = parseState.GetInput(1) :?> 'gentype_rule in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 48 "fslexpars.fsy"
                              [_1] 
                   )
# 48 "fslexpars.fsy"
                 : 'gentype_Rules));
# 358 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _1 = parseState.GetInput(1) :?> string in
            let _2 = parseState.GetInput(2) :?> 'gentype_args in
            let _5 = parseState.GetInput(5) :?> 'gentype_optbar in
            let _6 = parseState.GetInput(6) :?> 'gentype_clauses in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 51 "fslexpars.fsy"
                                                               
                         (_1,_2,_6)
                   )
# 51 "fslexpars.fsy"
                 : 'gentype_rule));
# 373 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 56 "fslexpars.fsy"
                          [] 
                   )
# 56 "fslexpars.fsy"
                 : 'gentype_args));
# 383 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _2 = parseState.GetInput(2) :?> string in
            let _4 = parseState.GetInput(4) :?> string in
            let _6 = parseState.GetInput(6) :?> 'gentype_args in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 57 "fslexpars.fsy"
                                                              RuleArgument.Typed(_2, _4) :: _6 
                   )
# 57 "fslexpars.fsy"
                 : 'gentype_args));
# 396 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _1 = parseState.GetInput(1) :?> string in
            let _2 = parseState.GetInput(2) :?> 'gentype_args in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 58 "fslexpars.fsy"
                                    RuleArgument.Ident(_1) :: _2 
                   )
# 58 "fslexpars.fsy"
                 : 'gentype_args));
# 408 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 61 "fslexpars.fsy"
                         
                   )
# 61 "fslexpars.fsy"
                 : 'gentype_optbar));
# 418 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 62 "fslexpars.fsy"
                             
                   )
# 62 "fslexpars.fsy"
                 : 'gentype_optbar));
# 428 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _1 = parseState.GetInput(1) :?> 'gentype_clause in
            let _3 = parseState.GetInput(3) :?> 'gentype_clauses in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 65 "fslexpars.fsy"
                                           _1 :: _3 
                   )
# 65 "fslexpars.fsy"
                 : 'gentype_clauses));
# 440 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _1 = parseState.GetInput(1) :?> 'gentype_clause in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 66 "fslexpars.fsy"
                                [_1] 
                   )
# 66 "fslexpars.fsy"
                 : 'gentype_clauses));
# 451 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _1 = parseState.GetInput(1) :?> 'gentype_regexp in
            let _2 = parseState.GetInput(2) :?> AST.Code in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 69 "fslexpars.fsy"
                                     _1, _2 
                   )
# 69 "fslexpars.fsy"
                 : 'gentype_clause));
# 463 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _1 = parseState.GetInput(1) :?> char in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 72 "fslexpars.fsy"
                              Inp(Alphabet(EncodeChar _1))
                   )
# 72 "fslexpars.fsy"
                 : 'gentype_regexp));
# 474 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _1 = parseState.GetInput(1) :?> string in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 73 "fslexpars.fsy"
                                          Inp(UnicodeCategory _1)
                   )
# 73 "fslexpars.fsy"
                 : 'gentype_regexp));
# 485 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 74 "fslexpars.fsy"
                             Inp(Alphabet(fun ctx -> Eof))
                   )
# 74 "fslexpars.fsy"
                 : 'gentype_regexp));
# 495 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 75 "fslexpars.fsy"
                                    Inp Any 
                   )
# 75 "fslexpars.fsy"
                 : 'gentype_regexp));
# 505 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _1 = parseState.GetInput(1) :?> string in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 76 "fslexpars.fsy"
                                Seq([ for n in 0 .. _1.Length - 1 -> Inp(Alphabet(EncodeChar _1.[n]))])
                   )
# 76 "fslexpars.fsy"
                 : 'gentype_regexp));
# 516 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _1 = parseState.GetInput(1) :?> string in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 77 "fslexpars.fsy"
                               Macro(_1) 
                   )
# 77 "fslexpars.fsy"
                 : 'gentype_regexp));
# 527 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _1 = parseState.GetInput(1) :?> 'gentype_regexp in
            let _2 = parseState.GetInput(2) :?> 'gentype_regexp in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 78 "fslexpars.fsy"
                                                         Seq[_1;_2] 
                   )
# 78 "fslexpars.fsy"
                 : 'gentype_regexp));
# 539 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _1 = parseState.GetInput(1) :?> 'gentype_regexp in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 79 "fslexpars.fsy"
                                                        Seq[_1;Star _1] 
                   )
# 79 "fslexpars.fsy"
                 : 'gentype_regexp));
# 550 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _1 = parseState.GetInput(1) :?> 'gentype_regexp in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 80 "fslexpars.fsy"
                                                        Star _1 
                   )
# 80 "fslexpars.fsy"
                 : 'gentype_regexp));
# 561 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _1 = parseState.GetInput(1) :?> 'gentype_regexp in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 81 "fslexpars.fsy"
                                                        Alt(fun ctx -> [Seq[];_1])
                   )
# 81 "fslexpars.fsy"
                 : 'gentype_regexp));
# 572 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _1 = parseState.GetInput(1) :?> 'gentype_regexp in
            let _3 = parseState.GetInput(3) :?> 'gentype_regexp in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 82 "fslexpars.fsy"
                                                            Alt(fun ctx -> [_1;_3])
                   )
# 82 "fslexpars.fsy"
                 : 'gentype_regexp));
# 584 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _2 = parseState.GetInput(2) :?> 'gentype_regexp in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 83 "fslexpars.fsy"
                                               _2 
                   )
# 83 "fslexpars.fsy"
                 : 'gentype_regexp));
# 595 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _2 = parseState.GetInput(2) :?> 'gentype_charset in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 84 "fslexpars.fsy"
                                                 Alt (fun ctx -> [ for c in (_2 ctx) -> Inp(Alphabet(fun ctx -> c)) ])
                   )
# 84 "fslexpars.fsy"
                 : 'gentype_regexp));
# 606 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _3 = parseState.GetInput(3) :?> 'gentype_charset in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 85 "fslexpars.fsy"
                                                     Inp(NotCharSet(fun ctx -> _3 ctx))
                   )
# 85 "fslexpars.fsy"
                 : 'gentype_regexp));
# 617 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _1 = parseState.GetInput(1) :?> char in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 88 "fslexpars.fsy"
                               fun ctx -> Set.singleton(EncodeChar _1 ctx)
                   )
# 88 "fslexpars.fsy"
                 : 'gentype_charset));
# 628 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _1 = parseState.GetInput(1) :?> char in
            let _3 = parseState.GetInput(3) :?> char in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 89 "fslexpars.fsy"
                                         fun ctx -> Set.ofSeq [ for c in _1 .. _3 -> EncodeChar c ctx ]
                   )
# 89 "fslexpars.fsy"
                 : 'gentype_charset));
# 640 "fslexpars.fs"
        (fun (parseState : FSharp.Text.Parsing.IParseState) ->
            let _1 = parseState.GetInput(1) :?> 'gentype_charset in
            let _2 = parseState.GetInput(2) :?> 'gentype_charset in
            Microsoft.FSharp.Core.Operators.box
                (
                   (
# 90 "fslexpars.fsy"
                                          fun ctx -> Set.union (_1 ctx) (_2 ctx)
                   )
# 90 "fslexpars.fsy"
                 : 'gentype_charset));
|]
# 653 "fslexpars.fs"
let tables : FSharp.Text.Parsing.Tables<_> = 
  { reductions= _fsyacc_reductions ();
    endOfInputTag = _fsyacc_endOfInputTag;
    tagOfToken = tagOfToken;
    dataOfToken = _fsyacc_dataOfToken; 
    actionTableElements = _fsyacc_actionTableElements;
    actionTableRowOffsets = _fsyacc_actionTableRowOffsets;
    stateToProdIdxsTableElements = _fsyacc_stateToProdIdxsTableElements;
    stateToProdIdxsTableRowOffsets = _fsyacc_stateToProdIdxsTableRowOffsets;
    reductionSymbolCounts = _fsyacc_reductionSymbolCounts;
    immediateActions = _fsyacc_immediateActions;
    gotos = _fsyacc_gotos;
    sparseGotoTableRowOffsets = _fsyacc_sparseGotoTableRowOffsets;
    tagOfErrorTerminal = _fsyacc_tagOfErrorTerminal;
    parseError = (fun (ctxt:FSharp.Text.Parsing.ParseErrorContext<_>) -> 
                              match parse_error_rich with 
                              | Some f -> f ctxt
                              | None -> parse_error ctxt.Message);
    numTerminals = 27;
    productionToNonTerminalTable = _fsyacc_productionToNonTerminalTable  }
let engine lexer lexbuf startState = tables.Interpret(lexer, lexbuf, startState)
let spec lexer lexbuf : AST.Spec =
    engine lexer lexbuf 0 :?> _
