#
# DO NOT MODIFY!!!!
# This file is automatically generated by Racc 1.4.9
# from Racc grammer file "".
#

require 'racc/parser.rb'
module ConstraintParser
  class Parser < Racc::Parser


  require 'lexer'
  require 'code_generator'

  def initialize tokenizer, handler = nil
    @tokenizer = tokenizer
    super()
  end

  def next_token
    @tokenizer.next_token
  end

  def parse
    do_parse
  end
##### State transition tables begin ###

racc_action_table = [
    27,    28,    21,    22,    23,    24,    25,    26,    29,    27,
    28,    21,    22,    23,    24,    25,    26,    29,    46,    12,
    14,    11,    12,    14,    11,    30,    36,    32,     6,    13,
    45,     7,    13,    33,    30,    27,    28,    21,    22,    23,
    24,    25,    26,    29,     5,    12,    14,    11,    16,    18,
    17,     9,    39,    40,     8,    13,    42,    37,    16,    44,
    30,    34 ]

racc_action_check = [
    10,    10,    10,    10,    10,    10,    10,    10,    10,    35,
    35,    35,    35,    35,    35,    35,    35,    35,    44,    11,
    11,    11,    20,    20,    20,    10,    30,    15,     0,    11,
    44,     0,    20,    16,    35,    31,    31,    31,    31,    31,
    31,    31,    31,    31,     0,     6,     6,     6,     7,     9,
     8,     5,    32,    33,     1,     6,    38,    31,    39,    42,
    31,    18 ]

racc_action_pointer = [
    16,    54,   nil,   nil,   nil,    33,    29,    30,    50,    33,
    -2,     3,   nil,   nil,   nil,     5,    17,   nil,    37,   nil,
     6,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
    10,    33,    36,    29,   nil,     7,   nil,   nil,    36,    40,
   nil,   nil,    45,   nil,     7,   nil,   nil ]

racc_action_default = [
   -29,   -29,    -1,    -2,    -3,   -29,    -6,   -29,   -29,   -29,
    -5,    -6,   -10,   -11,   -12,   -29,   -29,    47,   -29,    -8,
    -6,   -13,   -14,   -15,   -16,   -17,   -18,   -19,   -20,   -21,
   -29,   -29,   -29,   -29,    -4,    -9,   -22,    -7,   -23,   -29,
   -25,   -24,   -29,   -26,   -29,   -27,   -28 ]

racc_goto_table = [
    15,    10,     1,     4,     3,     2,    31,    38,    41,   nil,
   nil,   nil,   nil,   nil,   nil,    35,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,    43 ]

racc_goto_check = [
     8,     5,     1,     4,     3,     2,     5,     9,    10,   nil,
   nil,   nil,   nil,   nil,   nil,     5,   nil,   nil,   nil,   nil,
   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,   nil,
   nil,   nil,     8 ]

racc_goto_pointer = [
   nil,     2,     5,     4,     3,    -5,   nil,   nil,    -7,   -25,
   -30 ]

racc_goto_default = [
   nil,   nil,   nil,   nil,   nil,   nil,    19,    20,   nil,   nil,
   nil ]

racc_reduce_table = [
  0, 0, :racc_error,
  1, 30, :_reduce_1,
  1, 30, :_reduce_2,
  1, 30, :_reduce_3,
  4, 31, :_reduce_4,
  2, 32, :_reduce_5,
  0, 34, :_reduce_6,
  3, 34, :_reduce_7,
  2, 34, :_reduce_8,
  3, 34, :_reduce_9,
  1, 34, :_reduce_10,
  1, 34, :_reduce_11,
  1, 34, :_reduce_12,
  1, 36, :_reduce_13,
  1, 36, :_reduce_14,
  1, 36, :_reduce_15,
  1, 36, :_reduce_16,
  1, 36, :_reduce_17,
  1, 36, :_reduce_18,
  1, 36, :_reduce_19,
  1, 36, :_reduce_20,
  1, 36, :_reduce_21,
  2, 35, :_reduce_22,
  4, 33, :_reduce_23,
  5, 33, :_reduce_24,
  3, 37, :_reduce_25,
  2, 38, :_reduce_26,
  3, 39, :_reduce_27,
  3, 39, :_reduce_28 ]

racc_reduce_n = 29

racc_shift_n = 47

racc_token_table = {
  false => 0,
  :error => 1,
  :PLUS => 2,
  :MATCH_OP => 3,
  :GTEQ => 4,
  :LTEQ => 5,
  :NEQ => 6,
  :EQ => 7,
  :GT => 8,
  :LT => 9,
  :AND => 10,
  :CASCADE => 11,
  :CHECK => 12,
  :COMMA => 13,
  :DELETE => 14,
  :FOREIGN_KEY => 15,
  :IDENT => 16,
  :INT => 17,
  :LPAREN => 18,
  :NEWLINE => 19,
  :ON => 20,
  :PRIMARY_KEY => 21,
  :REFERENCES => 22,
  :RESTRICT => 23,
  :RPAREN => 24,
  :SPACE => 25,
  :STRLIT => 26,
  :TYPE => 27,
  :UNIQUE => 28 }

racc_nt_base = 29

racc_use_result_var = true

Racc_arg = [
  racc_action_table,
  racc_action_check,
  racc_action_default,
  racc_action_pointer,
  racc_goto_table,
  racc_goto_check,
  racc_goto_default,
  racc_goto_pointer,
  racc_nt_base,
  racc_reduce_table,
  racc_token_table,
  racc_shift_n,
  racc_reduce_n,
  racc_use_result_var ]

Racc_token_to_s_table = [
  "$end",
  "error",
  "PLUS",
  "MATCH_OP",
  "GTEQ",
  "LTEQ",
  "NEQ",
  "EQ",
  "GT",
  "LT",
  "AND",
  "CASCADE",
  "CHECK",
  "COMMA",
  "DELETE",
  "FOREIGN_KEY",
  "IDENT",
  "INT",
  "LPAREN",
  "NEWLINE",
  "ON",
  "PRIMARY_KEY",
  "REFERENCES",
  "RESTRICT",
  "RPAREN",
  "SPACE",
  "STRLIT",
  "TYPE",
  "UNIQUE",
  "$start",
  "constraint",
  "unique_column",
  "check_statement",
  "foreign_key",
  "expr",
  "type_signature",
  "operator",
  "column_spec",
  "table_spec",
  "action_spec" ]

Racc_debug_parser = false

##### State transition tables end #####

# reduce 0 omitted

def _reduce_1(val, _values, result)
 result = val[0] 
    result
end

def _reduce_2(val, _values, result)
 result = val[0] 
    result
end

def _reduce_3(val, _values, result)
 result = val[0] 
    result
end

def _reduce_4(val, _values, result)
 result = UniqueNode.new(IdentNode.new(val[2])) 
    result
end

def _reduce_5(val, _values, result)
 result = CheckNode.new(val[1]) 
    result
end

def _reduce_6(val, _values, result)
 result = EmptyExprNode.new :empty 
    result
end

def _reduce_7(val, _values, result)
 result = ExprNode.new(val[1]) 
    result
end

def _reduce_8(val, _values, result)
 result = TypedExprNode.new(val[0], val[1]) 
    result
end

def _reduce_9(val, _values, result)
 result = OperatorNode.new(val[1], val[0], val[2]) 
    result
end

def _reduce_10(val, _values, result)
 result = IdentNode.new(val[0]) 
    result
end

def _reduce_11(val, _values, result)
 result = StrLitNode.new(val[0]) 
    result
end

def _reduce_12(val, _values, result)
 result = IntNode.new(val[0]) 
    result
end

def _reduce_13(val, _values, result)
 result = :gteq  
    result
end

def _reduce_14(val, _values, result)
 result = :lteq  
    result
end

def _reduce_15(val, _values, result)
 result = :neq   
    result
end

def _reduce_16(val, _values, result)
 result = :eq    
    result
end

def _reduce_17(val, _values, result)
 result = :gt    
    result
end

def _reduce_18(val, _values, result)
 result = :lt    
    result
end

def _reduce_19(val, _values, result)
 result = :plus  
    result
end

def _reduce_20(val, _values, result)
 result = :match 
    result
end

def _reduce_21(val, _values, result)
 result = :and 
    result
end

def _reduce_22(val, _values, result)
 result = IdentNode.new(val[1]) 
    result
end

def _reduce_23(val, _values, result)
 result = ForeignKeyNode.new(val[1], val[3]) 
    result
end

def _reduce_24(val, _values, result)
 result = ForeignKeyNode.new(val[1], val[3], val[4]) 
    result
end

def _reduce_25(val, _values, result)
 result = IdentNode.new(val[1]) 
    result
end

def _reduce_26(val, _values, result)
 result = TableNode.new(IdentNode.new(val[0]), val[1]) 
    result
end

def _reduce_27(val, _values, result)
 result = ActionNode.new(:delete, :restrict) 
    result
end

def _reduce_28(val, _values, result)
 result = ActionNode.new(:delete, :cascade) 
    result
end

def _reduce_none(val, _values, result)
  val[0]
end

  end   # class Parser
  end   # module ConstraintParser
