# # DO NOT MODIFY!!!! # This file is automatically generated by Racc 1.4.11 # from Racc grammer file "". # require 'racc/parser.rb' require 'strscan' require 'ddbcli/ddb-binary' module DynamoDB class Parser < Racc::Parser module_eval(<<'...end ddb-parser.y/module_eval...', 'ddb-parser.y', 554) KEYWORDS = %w( ADD ALL ALTER AND ASC BEGINS_WITH BETWEEN BINARY CHANGE CREATE CONTAINS COUNT DELETE DESCRIBE DESC DROP FROM GET GLOBAL HASH HAVING INCLUDE INDEX INSERT INTO IN IS KEYS_ONLY LIKE LIMIT NEXT NOT NUMBER ORDER RANGE READ REGIONS SELECT SET SHOW STATUS STRING TABLES TABLE UPDATE VALUES WHERE WRITE USE ) KEYWORD_REGEXP = Regexp.compile("(?:#{KEYWORDS.join '|'})\\b", Regexp::IGNORECASE) def initialize(obj) src = obj.is_a?(IO) ? obj.read : obj.to_s @ss = StringScanner.new(src) end @@structs = {} def struct(name, attrs = {}) unless (clazz = @@structs[name]) clazz = attrs.empty? ? Struct.new(name.to_s) : Struct.new(name.to_s, *attrs.keys) @@structs[name] = clazz end obj = clazz.new attrs.each do |key, val| obj.send("#{key}=", val) end return obj end private :struct def scan tok = nil @prev_tokens = [] until @ss.eos? if (tok = @ss.scan /\s+/) # nothing to do elsif (tok = @ss.scan /(?:>>|<>|!=|>=|<=|>|<|=)/) sym = { '>>' => :GTGT, '<>' => :NE, '!=' => :NE, '>=' => :GE, '<=' => :LE, '>' => :GT, '<' => :LT, '=' => :EQ, }.fetch(tok) yield [sym, tok] elsif (tok = @ss.scan KEYWORD_REGEXP) yield [tok.upcase.to_sym, tok] elsif (tok = @ss.scan /NULL/i) yield [:NULL, nil] elsif (tok = @ss.scan /`(?:[^`]|``)*`/) yield [:IDENTIFIER, tok.slice(1...-1).gsub(/``/, '`')] elsif (tok = @ss.scan /x'(?:[^']|'')*'/) #' hex = tok.slice(2...-1).gsub(/''/, "'") bin = DynamoDB::Binary.new([hex].pack('H*')) yield [:BINARY_VALUE, bin] elsif (tok = @ss.scan /x"(?:[^"]|"")*"/) #" hex = tok.slice(2...-1).gsub(/""/, '"') bin = DynamoDB::Binary.new([hex].pack('H*')) yield [:BINARY_VALUE, bin] elsif (tok = @ss.scan /'(?:[^']|'')*'/) #' yield [:STRING_VALUE, tok.slice(1...-1).gsub(/''/, "'")] elsif (tok = @ss.scan /"(?:[^"]|"")*"/) #" yield [:STRING_VALUE, tok.slice(1...-1).gsub(/""/, '"')] elsif (tok = @ss.scan /\d+(?:\.\d+)?/) yield [:NUMBER_VALUE, (tok =~ /\./ ? tok.to_f : tok.to_i)] elsif (tok = @ss.scan /[,\(\)\*\/]/) yield [tok, tok] elsif (tok = @ss.scan /\|(?:.*)/) yield [:RUBY_SCRIPT, tok.slice(1..-1)] elsif (tok = @ss.scan /\!(?:.*)/) yield [:SHELL_SCRIPT, tok.slice(1..-1)] elsif (tok = @ss.scan %r|[-.0-9a-z_:/]*|i) yield [:IDENTIFIER, tok] else raise_error(tok, @prev_tokens, @ss) end @prev_tokens << tok end yield [false, ''] end private :scan def raise_error(error_value, prev_tokens, scanner) errmsg = ["__#{error_value}__"] if prev_tokens and not prev_tokens.empty? toks = prev_tokens.reverse[0, 5].reverse toks.unshift('...') if prev_tokens.length > toks.length errmsg.unshift(toks.join.strip) end if scanner and not (rest = (scanner.rest || '').strip).empty? str = rest[0, 16] str += '...' if rest.length > str.length errmsg << str end raise Racc::ParseError, ('parse error on value: %s' % errmsg.join(' ')) end private :raise_error def parse yyparse self, :scan end def on_error(error_token_id, error_value, value_stack) raise_error(error_value, @prev_tokens, @ss) end def self.parse(obj) self.new(obj).parse end ...end ddb-parser.y/module_eval... ##### State transition tables begin ### racc_action_table = [ 3, 4, 57, 163, 163, 18, 163, 163, 195, 56, 21, 175, 297, 19, 52, 163, 20, 165, 165, 176, 165, 165, 130, 163, 163, 260, 163, 162, 162, 165, 162, 162, 194, 22, 23, 24, 25, 165, 165, 162, 165, 26, 50, 115, 108, 52, 259, 162, 162, 95, 162, 163, 205, 52, 94, 130, 177, 159, 116, 27, 163, 178, 28, 29, 256, 165, 30, 164, 164, 163, 164, 164, 196, 50, 165, 162, 201, 136, 257, 164, 73, 50, 117, 165, 162, 205, 119, 164, 164, 52, 164, 111, 54, 162, 209, 202, 203, 204, 206, 208, 210, 213, 214, 215, 316, 49, 256, 317, 48, 201, 25, 55, 90, 120, 254, 164, 47, 50, 256, 91, 257, 121, 92, 91, 164, 123, 92, 227, 202, 203, 204, 206, 257, 164, 32, 33, 34, 124, 35, 36, 37, 91, 38, 39, 92, 91, 78, 79, 92, 310, 311, 312, 310, 311, 312, 145, 146, 147, 233, 235, 234, 236, 237, 125, 238, 145, 146, 147, 145, 146, 147, 287, 325, 288, 326, 301, 126, 288, 145, 146, 147, 145, 146, 147, 245, 244, 78, 79, 110, 108, 108, 131, 106, 135, 136, 69, 140, 141, 142, 143, 106, 103, 150, 151, 152, 136, 154, 155, 106, 102, 101, 167, 168, 171, 63, 173, 96, 100, 99, 98, 97, 180, 182, 185, 186, 187, 63, 189, 190, 96, 63, 135, 88, 200, 85, 216, 217, 218, 219, 220, 221, 223, 171, 225, 86, 229, 123, 231, 136, 85, 83, 82, 171, 81, 165, 80, 76, 246, 248, 249, 250, 251, 252, 75, 63, 74, 200, 185, 71, 70, 264, 150, 136, 63, 268, 269, 270, 271, 272, 273, 69, 276, 277, 278, 67, 280, 281, 282, 182, 63, 66, 286, 65, 64, 290, 291, 292, 63, 223, 61, 60, 114, 298, 299, 63, 59, 58, 45, 305, 278, 306, 307, 44, 43, 42, 314, 315, 41, 319, 321, 322, 323, 40, 31, 327, 328, 329, 176, 178 ] racc_action_check = [ 0, 0, 28, 227, 282, 0, 131, 286, 165, 28, 0, 141, 290, 0, 26, 168, 0, 227, 282, 141, 131, 286, 104, 288, 226, 223, 207, 227, 282, 168, 131, 286, 165, 0, 0, 0, 0, 288, 226, 168, 207, 0, 26, 90, 104, 101, 223, 288, 226, 67, 207, 209, 171, 48, 67, 132, 142, 131, 91, 0, 271, 142, 0, 0, 278, 209, 0, 227, 282, 248, 131, 286, 165, 101, 271, 209, 171, 132, 278, 168, 48, 48, 92, 248, 271, 185, 94, 288, 226, 25, 207, 83, 27, 248, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 313, 25, 297, 313, 25, 185, 83, 27, 66, 95, 221, 209, 25, 25, 221, 143, 297, 96, 143, 66, 271, 97, 66, 185, 185, 185, 185, 185, 221, 248, 2, 2, 2, 98, 2, 18, 18, 120, 18, 18, 120, 140, 80, 80, 140, 307, 307, 307, 306, 306, 306, 305, 305, 305, 191, 192, 191, 192, 193, 99, 193, 298, 298, 298, 254, 254, 254, 274, 320, 274, 320, 295, 100, 295, 119, 119, 119, 319, 319, 319, 210, 210, 54, 54, 82, 103, 81, 106, 107, 108, 110, 111, 115, 116, 117, 118, 77, 76, 122, 123, 124, 125, 126, 127, 130, 75, 74, 133, 135, 136, 137, 138, 139, 73, 72, 71, 70, 144, 149, 150, 151, 152, 153, 154, 155, 68, 166, 167, 65, 169, 64, 173, 175, 176, 177, 178, 180, 181, 182, 183, 63, 186, 187, 189, 190, 62, 58, 57, 200, 56, 208, 55, 53, 215, 216, 217, 218, 219, 220, 51, 222, 49, 224, 225, 47, 46, 229, 230, 231, 232, 234, 236, 238, 242, 245, 247, 43, 249, 251, 253, 42, 256, 257, 263, 265, 266, 40, 273, 39, 37, 279, 280, 281, 36, 283, 35, 34, 85, 291, 292, 294, 31, 29, 24, 299, 302, 303, 304, 23, 22, 21, 308, 312, 20, 314, 315, 316, 317, 19, 1, 322, 323, 326, 327, 328 ] racc_action_pointer = [ -2, 323, 132, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 131, 313, 304, 305, 304, 299, 294, 76, 1, 79, -30, 240, nil, 305, nil, nil, 295, 294, 238, 283, nil, 283, 277, nil, 271, 267, nil, nil, 230, 249, 40, 223, nil, 241, nil, 217, 124, 242, 240, 212, 237, nil, nil, nil, 235, 215, 220, 219, 96, 35, 207, nil, 207, 178, 179, 198, 181, 196, 188, 187, nil, nil, 84, 146, 175, 72, nil, 296, nil, nil, nil, nil, 26, 30, 54, nil, 73, 100, 108, 107, 117, 150, 135, 32, nil, 145, 0, nil, 163, 179, 180, nil, 150, 182, nil, nil, nil, 183, 168, 169, 179, 154, 114, nil, 158, 186, 165, 161, 186, 168, nil, nil, 195, 1, 33, 166, nil, 184, 200, 155, 195, 194, 118, -11, 34, 92, 200, nil, nil, nil, nil, 162, 210, 205, 212, 167, 188, 215, nil, nil, nil, nil, nil, nil, nil, nil, nil, 3, 171, 218, 10, 188, nil, 48, nil, 168, nil, 206, 209, 211, 211, nil, 218, 184, 229, 198, nil, 81, 232, 228, nil, 234, 204, 138, 139, 142, nil, nil, nil, nil, nil, nil, 239, nil, nil, nil, nil, nil, nil, 21, 235, 46, 129, nil, nil, nil, nil, 203, 239, 231, 231, 233, 233, 101, 205, -12, 221, 254, 19, -2, nil, 250, 227, 228, 214, nil, 245, nil, 270, nil, 207, nil, nil, nil, 232, nil, nil, 222, nil, 257, 64, 252, nil, 253, nil, 261, 144, nil, 272, 269, nil, nil, nil, nil, nil, 242, nil, 228, 230, nil, nil, nil, nil, 55, nil, 272, 151, nil, nil, nil, 47, 271, 276, 283, -1, 241, nil, nil, 2, nil, 18, nil, -10, 289, 284, nil, 245, 155, nil, 89, 141, 295, nil, nil, 287, 290, 291, 131, 120, 117, 293, nil, nil, nil, 297, 77, 305, 306, 292, 293, nil, 157, 152, nil, 295, 296, nil, nil, 313, 297, 301, nil ] racc_action_default = [ -147, -147, -1, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16, -17, -18, -19, -20, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -147, -128, -147, -2, -3, -147, -147, -103, -147, -23, -147, -147, -29, -147, -147, -58, -59, -147, -147, -147, -147, -66, -67, -68, -147, -147, -147, -147, -147, -147, 330, -4, -5, -25, -147, -25, -147, -147, -147, -57, -145, -147, -147, -147, -147, -147, -147, -147, -147, -109, -110, -147, -147, -147, -147, -21, -147, -104, -22, -24, -27, -147, -147, -147, -42, -147, -147, -147, -70, -147, -147, -147, -147, -69, -147, -147, -111, -147, -147, -147, -118, -85, -147, -121, -122, -26, -147, -147, -147, -147, -147, -31, -146, -72, -147, -147, -85, -147, -147, -65, -107, -147, -147, -85, -114, -115, -147, -147, -103, -147, -123, -147, -147, -147, -147, -147, -37, -38, -39, -32, -105, -147, -147, -147, -103, -147, -147, -112, -113, -129, -130, -131, -132, -133, -134, -135, -147, -103, -147, -147, -86, -87, -147, -119, -147, -28, -147, -147, -147, -147, -30, -33, -100, -147, -73, -74, -147, -147, -70, -62, -147, -85, -147, -147, -147, -139, -141, -143, -108, -116, -117, -147, -79, -80, -81, -82, -83, -84, -147, -147, -147, -147, -93, -94, -95, -96, -147, -147, -147, -147, -147, -147, -147, -103, -147, -106, -147, -147, -147, -78, -147, -72, -85, -103, -136, -147, -137, -147, -138, -147, -88, -89, -90, -147, -92, -98, -147, -97, -120, -147, -147, -43, -147, -44, -34, -147, -45, -147, -147, -60, -101, -102, -75, -76, -147, -71, -105, -103, -64, -140, -142, -144, -147, -99, -147, -147, -126, -40, -41, -147, -147, -147, -147, -147, -100, -63, -91, -147, -124, -147, -46, -35, -147, -147, -77, -103, -147, -127, -147, -147, -147, -61, -125, -36, -147, -147, -147, -147, -147, -50, -47, -52, -53, -147, -48, -147, -147, -147, -147, -49, -147, -147, -55, -147, -147, -51, -54, -147, -147, -147, -56 ] racc_goto_table = [ 62, 144, 158, 137, 181, 149, 222, 11, 12, 122, 89, 184, 253, 46, 53, 134, 169, 68, 153, 274, 104, 77, 109, 211, 84, 166, 87, 309, 313, 1, 320, 289, 318, 304, 118, 17, 72, 228, 16, 199, 15, 14, 183, 13, 128, 129, 226, 107, 10, 9, 132, 8, 239, 207, 241, 243, 212, 295, 7, 6, 156, 157, 224, 133, 148, 5, 138, 247, 2, 191, 192, 193, nil, nil, 198, nil, nil, nil, 240, nil, 242, nil, nil, 232, 174, 139, 261, 179, 302, 127, 112, 113, nil, nil, nil, nil, nil, 262, 263, 230, nil, 172, nil, nil, nil, nil, nil, nil, 294, nil, nil, nil, nil, 265, nil, nil, nil, 188, nil, nil, 283, nil, nil, nil, 266, nil, nil, nil, nil, nil, 197, nil, nil, nil, nil, nil, 279, nil, nil, nil, nil, nil, 285, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 293, nil, nil, nil, nil, nil, 296, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 303, nil, nil, nil, nil, nil, 258, 308, nil, nil, nil, nil, nil, nil, nil, nil, 267, nil, nil, nil, nil, 324, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 284, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 300 ] racc_goto_check = [ 16, 20, 39, 33, 31, 30, 32, 9, 10, 29, 18, 37, 21, 28, 28, 52, 41, 27, 33, 55, 48, 47, 34, 40, 17, 33, 17, 24, 24, 1, 26, 23, 22, 25, 19, 15, 28, 40, 14, 39, 13, 12, 36, 11, 34, 34, 38, 47, 8, 7, 48, 6, 42, 43, 44, 45, 46, 55, 5, 4, 49, 50, 41, 51, 18, 3, 53, 54, 2, 57, 58, 59, nil, nil, 52, nil, nil, nil, 39, nil, 39, nil, nil, 33, 18, 27, 37, 18, 21, 28, 9, 10, nil, nil, nil, nil, nil, 39, 39, 29, nil, 16, nil, nil, nil, nil, nil, nil, 32, nil, nil, nil, nil, 30, nil, nil, nil, 16, nil, nil, 31, nil, nil, nil, 33, nil, nil, nil, nil, nil, 16, nil, nil, nil, nil, nil, 20, nil, nil, nil, nil, nil, 39, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 39, nil, nil, nil, nil, nil, 39, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 20, nil, nil, nil, nil, nil, 16, 20, nil, nil, nil, nil, nil, nil, nil, nil, 16, nil, nil, nil, nil, 20, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 16, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 16 ] racc_goto_pointer = [ nil, 29, 68, 65, 59, 58, 51, 49, 48, 7, 8, 43, 41, 40, 38, 35, -36, -38, -56, -60, -118, -209, -281, -247, -279, -266, -285, -26, -12, -88, -117, -145, -175, -107, -59, nil, -108, -139, -139, -129, -148, -120, -148, -118, -154, -155, -115, -33, -57, -70, -70, -45, -93, -45, -149, -229, nil, -96, -95, -94 ] racc_goto_default = [ nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 93, 255, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 51, nil, nil, nil, 275, nil, nil, 170, nil, 161, nil, nil, nil, nil, 105, nil, nil, nil, nil, nil, nil, 160, nil, nil, nil ] racc_reduce_table = [ 0, 0, :racc_error, 1, 71, :_reduce_1, 2, 71, :_reduce_2, 2, 71, :_reduce_3, 3, 71, :_reduce_4, 3, 71, :_reduce_5, 1, 71, :_reduce_6, 1, 71, :_reduce_7, 1, 72, :_reduce_none, 1, 72, :_reduce_none, 1, 72, :_reduce_none, 1, 72, :_reduce_none, 1, 72, :_reduce_none, 1, 72, :_reduce_none, 1, 72, :_reduce_none, 1, 72, :_reduce_none, 1, 72, :_reduce_none, 1, 72, :_reduce_none, 1, 72, :_reduce_none, 1, 72, :_reduce_none, 1, 72, :_reduce_none, 4, 73, :_reduce_21, 4, 73, :_reduce_22, 2, 73, :_reduce_23, 4, 73, :_reduce_24, 0, 87, :_reduce_none, 2, 87, :_reduce_26, 4, 74, :_reduce_27, 7, 74, :_reduce_28, 2, 75, :_reduce_29, 7, 76, :_reduce_30, 5, 76, :_reduce_31, 6, 76, :_reduce_32, 3, 89, :_reduce_33, 5, 89, :_reduce_34, 7, 89, :_reduce_35, 9, 89, :_reduce_36, 1, 90, :_reduce_37, 1, 90, :_reduce_38, 1, 90, :_reduce_39, 7, 88, :_reduce_40, 7, 88, :_reduce_41, 1, 88, :_reduce_none, 6, 92, :_reduce_43, 6, 92, :_reduce_44, 1, 91, :_reduce_45, 3, 91, :_reduce_46, 7, 93, :_reduce_47, 7, 93, :_reduce_48, 8, 93, :_reduce_49, 2, 95, :_reduce_50, 5, 95, :_reduce_51, 1, 94, :_reduce_52, 1, 94, :_reduce_53, 4, 94, :_reduce_54, 1, 96, :_reduce_55, 3, 96, :_reduce_56, 3, 77, :_reduce_57, 2, 78, :_reduce_58, 2, 78, :_reduce_59, 9, 79, :_reduce_60, 12, 79, :_reduce_61, 7, 80, :_reduce_62, 10, 80, :_reduce_63, 9, 80, :_reduce_64, 5, 81, :_reduce_65, 1, 98, :_reduce_66, 1, 98, :_reduce_67, 1, 105, :_reduce_68, 3, 105, :_reduce_69, 0, 99, :_reduce_none, 5, 99, :_reduce_71, 0, 100, :_reduce_none, 2, 100, :_reduce_73, 1, 106, :_reduce_74, 3, 106, :_reduce_75, 3, 107, :_reduce_76, 5, 107, :_reduce_77, 1, 108, :_reduce_none, 1, 110, :_reduce_79, 1, 110, :_reduce_80, 1, 110, :_reduce_81, 1, 110, :_reduce_82, 1, 110, :_reduce_83, 1, 110, :_reduce_none, 0, 103, :_reduce_none, 2, 103, :_reduce_86, 1, 111, :_reduce_87, 3, 111, :_reduce_88, 3, 112, :_reduce_89, 3, 112, :_reduce_90, 5, 112, :_reduce_91, 3, 112, :_reduce_92, 1, 113, :_reduce_none, 1, 113, :_reduce_none, 1, 113, :_reduce_95, 1, 116, :_reduce_none, 2, 116, :_reduce_97, 1, 115, :_reduce_98, 2, 115, :_reduce_99, 0, 102, :_reduce_none, 2, 102, :_reduce_101, 2, 102, :_reduce_102, 0, 86, :_reduce_none, 2, 86, :_reduce_104, 0, 101, :_reduce_none, 2, 101, :_reduce_106, 5, 82, :_reduce_107, 7, 82, :_reduce_108, 1, 117, :_reduce_109, 1, 117, :_reduce_110, 1, 118, :_reduce_111, 3, 118, :_reduce_112, 3, 119, :_reduce_113, 2, 104, :_reduce_114, 1, 121, :_reduce_115, 3, 121, :_reduce_116, 3, 122, :_reduce_117, 4, 83, :_reduce_118, 6, 83, :_reduce_119, 8, 84, :_reduce_120, 4, 84, :_reduce_121, 4, 84, :_reduce_122, 1, 123, :_reduce_none, 3, 124, :_reduce_124, 5, 124, :_reduce_125, 1, 125, :_reduce_126, 3, 125, :_reduce_127, 1, 85, :_reduce_128, 1, 120, :_reduce_none, 1, 120, :_reduce_none, 1, 109, :_reduce_none, 1, 109, :_reduce_none, 1, 126, :_reduce_none, 1, 126, :_reduce_none, 1, 126, :_reduce_none, 3, 114, :_reduce_136, 3, 114, :_reduce_137, 3, 114, :_reduce_138, 1, 127, :_reduce_139, 3, 127, :_reduce_140, 1, 128, :_reduce_141, 3, 128, :_reduce_142, 1, 129, :_reduce_143, 3, 129, :_reduce_144, 1, 97, :_reduce_145, 3, 97, :_reduce_146 ] racc_reduce_n = 147 racc_shift_n = 330 racc_token_table = { false => 0, :error => 1, :RUBY_SCRIPT => 2, :SHELL_SCRIPT => 3, :GT => 4, :STRING_VALUE => 5, :GTGT => 6, :SHOW => 7, :TABLES => 8, :TABLE => 9, :STATUS => 10, :REGIONS => 11, :CREATE => 12, :IDENTIFIER => 13, :LIKE => 14, :ALTER => 15, :CHANGE => 16, :INDEX => 17, :USE => 18, "(" => 19, ")" => 20, :HASH => 21, "," => 22, :RANGE => 23, :STRING => 24, :NUMBER => 25, :BINARY => 26, :READ => 27, :EQ => 28, :NUMBER_VALUE => 29, :WRITE => 30, :GLOBAL => 31, :ALL => 32, :KEYS_ONLY => 33, :INCLUDE => 34, :DROP => 35, :DESCRIBE => 36, :DESC => 37, :SELECT => 38, :FROM => 39, :COUNT => 40, "*" => 41, "/" => 42, :GET => 43, :WHERE => 44, :AND => 45, :BETWEEN => 46, :LE => 47, :LT => 48, :GE => 49, :BEGINS_WITH => 50, :IN => 51, :IS => 52, :NE => 53, :CONTAINS => 54, :NOT => 55, :NULL => 56, :ORDER => 57, :ASC => 58, :LIMIT => 59, :HAVING => 60, :UPDATE => 61, :SET => 62, :ADD => 63, :DELETE => 64, :INSERT => 65, :INTO => 66, :VALUES => 67, :NEXT => 68, :BINARY_VALUE => 69 } racc_nt_base = 70 racc_use_result_var = false 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", "RUBY_SCRIPT", "SHELL_SCRIPT", "GT", "STRING_VALUE", "GTGT", "SHOW", "TABLES", "TABLE", "STATUS", "REGIONS", "CREATE", "IDENTIFIER", "LIKE", "ALTER", "CHANGE", "INDEX", "USE", "\"(\"", "\")\"", "HASH", "\",\"", "RANGE", "STRING", "NUMBER", "BINARY", "READ", "EQ", "NUMBER_VALUE", "WRITE", "GLOBAL", "ALL", "KEYS_ONLY", "INCLUDE", "DROP", "DESCRIBE", "DESC", "SELECT", "FROM", "COUNT", "\"*\"", "\"/\"", "GET", "WHERE", "AND", "BETWEEN", "LE", "LT", "GE", "BEGINS_WITH", "IN", "IS", "NE", "CONTAINS", "NOT", "NULL", "ORDER", "ASC", "LIMIT", "HAVING", "UPDATE", "SET", "ADD", "DELETE", "INSERT", "INTO", "VALUES", "NEXT", "BINARY_VALUE", "$start", "stmt", "query", "show_stmt", "alter_stmt", "use_stmt", "create_stmt", "drop_stmt", "describe_stmt", "select_stmt", "scan_stmt", "get_stmt", "update_stmt", "delete_stmt", "insert_stmt", "next_stmt", "limit_clause", "like_clause", "capacity_clause", "create_definition", "attr_type_list", "index_definition_list", "strict_capacity_clause", "index_definition", "index_type_definition", "global_index_keys", "index_include_attr_list", "identifier_list", "attrs_to_get", "use_index_clause", "select_where_clause", "having_clause", "order_clause", "scan_where_clause", "update_where_clause", "attrs_list", "select_expr_list", "select_expr", "select_operator", "value", "common_operator", "scan_expr_list", "scan_expr", "scan_operator", "value_list", "null_operator", "contains_operator", "set_or_add", "attr_to_update_list", "attr_to_update", "value_or_null", "update_expr_list", "update_expr", "attr_to_insert_list", "insert_value_clause", "insert_value_list", "single_value", "number_list", "string_list", "binary_list" ] Racc_debug_parser = false ##### State transition tables end ##### # reduce 0 omitted module_eval(<<'.,.,', 'ddb-parser.y', 5) def _reduce_1(val, _values) [val[0], nil, nil] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 9) def _reduce_2(val, _values) [val[0], :ruby, val[1]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 13) def _reduce_3(val, _values) [val[0], :shell, val[1]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 17) def _reduce_4(val, _values) [val[0], :overwrite, val[2]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 21) def _reduce_5(val, _values) [val[0], :append, val[2]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 25) def _reduce_6(val, _values) [struct(:NULL), :ruby, val[0]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 29) def _reduce_7(val, _values) [struct(:NULL), :shell, val[0]] end .,., # reduce 8 omitted # reduce 9 omitted # reduce 10 omitted # reduce 11 omitted # reduce 12 omitted # reduce 13 omitted # reduce 14 omitted # reduce 15 omitted # reduce 16 omitted # reduce 17 omitted # reduce 18 omitted # reduce 19 omitted # reduce 20 omitted module_eval(<<'.,.,', 'ddb-parser.y', 48) def _reduce_21(val, _values) struct(:SHOW_TABLES, :limit => val[2], :like => val[3]) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 52) def _reduce_22(val, _values) struct(:SHOW_TABLE_STATUS, :like => val[3]) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 56) def _reduce_23(val, _values) struct(:SHOW_REGIONS) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 60) def _reduce_24(val, _values) struct(:SHOW_CREATE_TABLE, :table => val[3]) end .,., # reduce 25 omitted module_eval(<<'.,.,', 'ddb-parser.y', 66) def _reduce_26(val, _values) val[1] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 71) def _reduce_27(val, _values) struct(:ALTER_TABLE, :table => val[2], :index_name => nil, :capacity => val[3]) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 76) def _reduce_28(val, _values) struct(:ALTER_TABLE, :table => val[2], :index_name => val[5], :capacity => val[6]) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 81) def _reduce_29(val, _values) struct(:USE, :endpoint_or_region => val[1]) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 86) def _reduce_30(val, _values) struct(:CREATE, val[4].merge(:table => val[2], :capacity => val[6])) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 90) def _reduce_31(val, _values) struct(:CREATE_LIKE, :table => val[2], :like => val[4], :capacity => nil) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 94) def _reduce_32(val, _values) struct(:CREATE_LIKE, :table => val[2], :like => val[4], :capacity => val[5]) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 99) def _reduce_33(val, _values) {:hash => {:name => val[0], :type => val[1]}, :range => nil, :indices => nil} end .,., module_eval(<<'.,.,', 'ddb-parser.y', 103) def _reduce_34(val, _values) {:hash => {:name => val[0], :type => val[1]}, :range => nil, :indices => val[4]} end .,., module_eval(<<'.,.,', 'ddb-parser.y', 107) def _reduce_35(val, _values) {:hash => {:name => val[0], :type => val[1]}, :range => {:name => val[4], :type => val[5]}, :indices => nil} end .,., module_eval(<<'.,.,', 'ddb-parser.y', 111) def _reduce_36(val, _values) {:hash => {:name => val[0], :type => val[1]}, :range => {:name => val[4], :type => val[5]}, :indices => val[8]} end .,., module_eval(<<'.,.,', 'ddb-parser.y', 116) def _reduce_37(val, _values) 'S' end .,., module_eval(<<'.,.,', 'ddb-parser.y', 120) def _reduce_38(val, _values) 'N' end .,., module_eval(<<'.,.,', 'ddb-parser.y', 124) def _reduce_39(val, _values) 'B' end .,., module_eval(<<'.,.,', 'ddb-parser.y', 129) def _reduce_40(val, _values) {:read => val[2], :write => val[6]} end .,., module_eval(<<'.,.,', 'ddb-parser.y', 133) def _reduce_41(val, _values) {:read => val[6], :write => val[2]} end .,., # reduce 42 omitted module_eval(<<'.,.,', 'ddb-parser.y', 139) def _reduce_43(val, _values) {:read => val[2], :write => val[5]} end .,., module_eval(<<'.,.,', 'ddb-parser.y', 143) def _reduce_44(val, _values) {:read => val[5], :write => val[2]} end .,., module_eval(<<'.,.,', 'ddb-parser.y', 148) def _reduce_45(val, _values) [val[0]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 152) def _reduce_46(val, _values) val[0] + [val[2]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 157) def _reduce_47(val, _values) {:name => val[1], :key => val[3], :type => val[4], :projection => val[6]} end .,., module_eval(<<'.,.,', 'ddb-parser.y', 161) def _reduce_48(val, _values) {:name => val[2], :keys => val[4], :projection => val[6], :global => true} end .,., module_eval(<<'.,.,', 'ddb-parser.y', 165) def _reduce_49(val, _values) {:name => val[2], :keys => val[4], :projection => val[6], :capacity => val[7], :global => true} end .,., module_eval(<<'.,.,', 'ddb-parser.y', 170) def _reduce_50(val, _values) {:hash => {:key => val[0], :type => val[1]}} end .,., module_eval(<<'.,.,', 'ddb-parser.y', 174) def _reduce_51(val, _values) { :hash => {:key => val[0], :type => val[1]}, :range => {:key => val[3], :type => val[4]}, } end .,., module_eval(<<'.,.,', 'ddb-parser.y', 182) def _reduce_52(val, _values) {:type => 'ALL'} end .,., module_eval(<<'.,.,', 'ddb-parser.y', 186) def _reduce_53(val, _values) {:type => 'KEYS_ONLY'} end .,., module_eval(<<'.,.,', 'ddb-parser.y', 190) def _reduce_54(val, _values) {:type => 'INCLUDE', :attrs => val[2]} end .,., module_eval(<<'.,.,', 'ddb-parser.y', 195) def _reduce_55(val, _values) [val[0]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 199) def _reduce_56(val, _values) val[0] + [val[2]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 204) def _reduce_57(val, _values) struct(:DROP, :tables => val[2]) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 209) def _reduce_58(val, _values) struct(:DESCRIBE, :table => val[1]) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 213) def _reduce_59(val, _values) struct(:DESCRIBE, :table => val[1]) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 218) def _reduce_60(val, _values) struct(:SELECT, :attrs => val[1], :table => val[3], :index => val[4], :conds => val[5], :having => val[6], :order_asc => val[7], :limit => val[8], :count => false) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 222) def _reduce_61(val, _values) struct(:SELECT, :attrs => [], :table => val[6], :index => val[7], :conds => val[8], :having => val[9], :order_asc => val[10], :limit => val[11], :count => true) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 227) def _reduce_62(val, _values) struct(:SCAN, :attrs => val[2], :table => val[4], :conds => val[5], :limit => val[6], :count => false, :segment => nil, :total_segments => nil) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 231) def _reduce_63(val, _values) struct(:SCAN, :attrs => [], :table => val[7], :conds => val[8], :limit => val[9], :count => true, :segment => nil, :total_segments => nil) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 235) def _reduce_64(val, _values) struct(:SCAN, :attrs => val[4], :table => val[6], :conds => val[7], :limit => val[8], :count => false, :segment => val[1], :total_segments => val[3]) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 240) def _reduce_65(val, _values) struct(:GET, :attrs => val[1], :table => val[3], :conds => val[4]) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 245) def _reduce_66(val, _values) [] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 249) def _reduce_67(val, _values) val[0] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 254) def _reduce_68(val, _values) [val[0]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 258) def _reduce_69(val, _values) val[0] + [val[2]] end .,., # reduce 70 omitted module_eval(<<'.,.,', 'ddb-parser.y', 264) def _reduce_71(val, _values) val[3] end .,., # reduce 72 omitted module_eval(<<'.,.,', 'ddb-parser.y', 270) def _reduce_73(val, _values) val[1] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 275) def _reduce_74(val, _values) [val[0]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 279) def _reduce_75(val, _values) val[0] + [val[2]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 284) def _reduce_76(val, _values) [val[0], val[1].to_s.upcase.to_sym, [val[2]]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 288) def _reduce_77(val, _values) [val[0], val[1].to_s.upcase.to_sym, [val[2], val[4]]] end .,., # reduce 78 omitted module_eval(<<'.,.,', 'ddb-parser.y', 295) def _reduce_79(val, _values) :EQ end .,., module_eval(<<'.,.,', 'ddb-parser.y', 299) def _reduce_80(val, _values) :LE end .,., module_eval(<<'.,.,', 'ddb-parser.y', 303) def _reduce_81(val, _values) :LT end .,., module_eval(<<'.,.,', 'ddb-parser.y', 307) def _reduce_82(val, _values) :GE end .,., module_eval(<<'.,.,', 'ddb-parser.y', 311) def _reduce_83(val, _values) :GT end .,., # reduce 84 omitted # reduce 85 omitted module_eval(<<'.,.,', 'ddb-parser.y', 318) def _reduce_86(val, _values) val[1] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 323) def _reduce_87(val, _values) [val[0]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 327) def _reduce_88(val, _values) val[0] + [val[2]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 332) def _reduce_89(val, _values) [val[0], val[1].to_s.upcase.to_sym, [val[2]]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 336) def _reduce_90(val, _values) [val[0], val[1].to_s.upcase.to_sym, val[2]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 340) def _reduce_91(val, _values) [val[0], val[1].to_s.upcase.to_sym, [val[2], val[4]]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 344) def _reduce_92(val, _values) [val[0], val[2].to_s.upcase.to_sym, []] end .,., # reduce 93 omitted # reduce 94 omitted module_eval(<<'.,.,', 'ddb-parser.y', 350) def _reduce_95(val, _values) :NE end .,., # reduce 96 omitted module_eval(<<'.,.,', 'ddb-parser.y', 356) def _reduce_97(val, _values) :NOT_CONTAINS end .,., module_eval(<<'.,.,', 'ddb-parser.y', 360) def _reduce_98(val, _values) :NULL end .,., module_eval(<<'.,.,', 'ddb-parser.y', 364) def _reduce_99(val, _values) :NOT_NULL end .,., # reduce 100 omitted module_eval(<<'.,.,', 'ddb-parser.y', 370) def _reduce_101(val, _values) true end .,., module_eval(<<'.,.,', 'ddb-parser.y', 374) def _reduce_102(val, _values) false end .,., # reduce 103 omitted module_eval(<<'.,.,', 'ddb-parser.y', 380) def _reduce_104(val, _values) val[1] end .,., # reduce 105 omitted module_eval(<<'.,.,', 'ddb-parser.y', 386) def _reduce_106(val, _values) val[1] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 391) def _reduce_107(val, _values) struct(:UPDATE, :table => val[1], :action => val[2], :attrs => val[3], :conds => val[4]) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 395) def _reduce_108(val, _values) struct(:UPDATE_ALL, :table => val[2], :action => val[3], :attrs => val[4], :conds => val[5], :limit => val[6]) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 400) def _reduce_109(val, _values) :PUT end .,., module_eval(<<'.,.,', 'ddb-parser.y', 404) def _reduce_110(val, _values) :ADD end .,., module_eval(<<'.,.,', 'ddb-parser.y', 409) def _reduce_111(val, _values) [val[0]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 413) def _reduce_112(val, _values) val[0] + [val[2]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 418) def _reduce_113(val, _values) [val[0], val[2]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 423) def _reduce_114(val, _values) val[1] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 428) def _reduce_115(val, _values) [val[0]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 432) def _reduce_116(val, _values) val[0] + [val[2]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 437) def _reduce_117(val, _values) [val[0], val[2]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 442) def _reduce_118(val, _values) struct(:DELETE, :table => val[2], :conds => val[3]) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 446) def _reduce_119(val, _values) struct(:DELETE_ALL, :table => val[3], :conds => val[4], :limit => val[5]) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 451) def _reduce_120(val, _values) struct(:INSERT, :table => val[2], :attrs => val[4], :values => val[7]) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 455) def _reduce_121(val, _values) struct(:INSERT_SELECT, :table => val[2], :select => val[3]) end .,., module_eval(<<'.,.,', 'ddb-parser.y', 459) def _reduce_122(val, _values) struct(:INSERT_SCAN, :table => val[2], :select => val[3]) end .,., # reduce 123 omitted module_eval(<<'.,.,', 'ddb-parser.y', 466) def _reduce_124(val, _values) [val[1]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 470) def _reduce_125(val, _values) val[0] + [val[3]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 475) def _reduce_126(val, _values) [val[0]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 479) def _reduce_127(val, _values) val[0] + [val[2]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 484) def _reduce_128(val, _values) struct(:NEXT) end .,., # reduce 129 omitted # reduce 130 omitted # reduce 131 omitted # reduce 132 omitted # reduce 133 omitted # reduce 134 omitted # reduce 135 omitted module_eval(<<'.,.,', 'ddb-parser.y', 498) def _reduce_136(val, _values) val[1] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 502) def _reduce_137(val, _values) val[1] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 506) def _reduce_138(val, _values) val[1] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 511) def _reduce_139(val, _values) [val[0]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 515) def _reduce_140(val, _values) val[0] + [val[2]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 520) def _reduce_141(val, _values) [val[0]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 524) def _reduce_142(val, _values) val[0] + [val[2]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 529) def _reduce_143(val, _values) [val[0]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 533) def _reduce_144(val, _values) val[0] + [val[2]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 538) def _reduce_145(val, _values) [val[0]] end .,., module_eval(<<'.,.,', 'ddb-parser.y', 542) def _reduce_146(val, _values) val[0] + [val[2]] end .,., def _reduce_none(val, _values) val[0] end end # class Parser end # DynamoDB