# # DO NOT MODIFY!!!! # This file is automatically generated by Racc 1.4.6 # from Racc grammer file "". # require 'racc/parser.rb' require 'strscan' module EDTF class Parser < Racc::Parser module_eval(<<'...end parser.y/module_eval...', 'parser.y', 270) @defaults = { :level => 2, :debug => false } class << self; attr_reader :defaults; end attr_reader :options def initialize(options = {}) @options = Parser.defaults.merge(options) end def parse(input) @yydebug = @options[:debug] || ENV['DEBUG'] scan(input) do_parse end def next_token @stack.shift end def on_error(tid, val, vstack) warn "failed to parse extended date time %s (%s) %s" % [val.inspect, token_to_str(tid) || '?', vstack.inspect] end def scan(input) @src = StringScanner.new(input) @stack = [] tokenize end private def tokenize until @src.eos? case # when @src.scan(/\s+/) # ignore whitespace when @src.scan(/\(/) @stack << [:LP, @src.matched] when @src.scan(/\)/) @stack << [:RP, @src.matched] when @src.scan(/\[/) @stack << [:LSQUARE, @src.matched] when @src.scan(/\]/) @stack << [:RSQUARE, @src.matched] when @src.scan(/\{/) @stack << [:LBRACE, @src.matched] when @src.scan(/\}/) @stack << [:RBRACE, @src.matched] when @src.scan(/T/) @stack << [:T, @src.matched] when @src.scan(/Z/) @stack << [:Z, @src.matched] when @src.scan(/\?/) @stack << [:UNCERTAIN, @src.matched] when @src.scan(/~/) @stack << [:APPROXIMATE, @src.matched] when @src.scan(/open/i) @stack << [:OPEN, @src.matched] when @src.scan(/unkn?own/i) # matches 'unkown' typo too @stack << [:UNKNOWN, @src.matched] when @src.scan(/u/) @stack << [:UNSPECIFIED, @src.matched] when @src.scan(/x/i) @stack << [:X, @src.matched] when @src.scan(/y/) @stack << [:LONGYEAR, @src.matched] when @src.scan(/e/) @stack << [:E, @src.matched] when @src.scan(/\+/) @stack << [:PLUS, @src.matched] when @src.scan(/-/) @stack << [:MINUS, @src.matched] when @src.scan(/:/) @stack << [:COLON, @src.matched] when @src.scan(/\//) @stack << [:SLASH, @src.matched] when @src.scan(/\s*\.\.\s*/) @stack << [:DOTS, '..'] when @src.scan(/\s*,\s*/) @stack << [:COMMA, ','] when @src.scan(/\^\w+/) @stack << [:CARET, @src.matched[1..-1]] when @src.scan(/\d/) @stack << [['D', @src.matched].join.intern, @src.matched] else @src.scan(/./) @stack << [:UNMATCHED, @src.rest] end end @stack end # -*- racc -*- ...end parser.y/module_eval... ##### State transition tables begin ### racc_action_table = [ 12, 129, 235, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 53, 47, 99, 100, 98, 24, 140, 25, -52, 142, 141, 130, 34, 135, 33, 136, 96, 103, 91, 104, 107, 49, 50, 131, 209, 12, 210, 51, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 203, 91, 104, 205, 206, 207, 49, 50, 12, 132, 81, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 103, 91, 104, 205, 206, 207, 173, 128, 99, 100, 81, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 114, 182, 99, 100, 172, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 213, 118, 12, 138, 113, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 103, 91, 104, 107, 143, 24, 123, 103, 91, 104, 107, 90, 91, 88, 233, 103, 91, 104, 107, 99, 100, 229, 203, 91, 104, 205, 206, 207, 179, 212, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 153, 154, 155, 156, 113, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 103, 91, 104, 107, 172, 248, 91, 104, 205, 206, 207, 64, 168, 169, 102, 37, 38, 39, 40, 41, 42, 43, 44, 45, 12, 200, 195, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 12, 196, 195, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 12, 49, 50, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 12, 216, 109, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 222, 37, 38, 39, 40, 41, 42, 43, 44, 45, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 145, 146, 147, 148, 162, 163, 164, 165, 166, 167, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 224, 37, 38, 39, 40, 41, 42, 43, 44, 45, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 150, 37, 38, 39, 40, 41, 42, 43, 44, 45, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 251, 37, 38, 39, 40, 41, 42, 43, 44, 45, 35, 37, 38, 39, 40, 41, 42, 43, 44, 45, 221, 37, 38, 39, 40, 41, 42, 43, 44, 45, 37, 38, 39, 40, 41, 42, 43, 44, 45, 37, 38, 39, 40, 41, 42, 43, 44, 45, 37, 38, 39, 40, 41, 42, 43, 44, 45, 37, 38, 39, 40, 41, 42, 43, 44, 45, 37, 38, 39, 40, 41, 42, 43, 44, 45, 37, 38, 39, 40, 41, 42, 43, 44, 45, 203, 91, 104, 205, 206, 207, 145, 146, 147, 148, 144, 158, 159, 160, 220, 219, 158, 159, 160, 110, 110, 217, 218, 152, 109, 93, 223, 178, 83, 62, 61, 228, 60, 231, 59, -53, 53, 134, 52, 177, 238, 239, 240, 175, 243, 244, 245, 229, 246, 174, 161, 249, 250, 46, 252, 253 ] racc_action_check = [ 0, 67, 216, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 68, 5, 52, 52, 52, 0, 85, 0, 5, 85, 85, 67, 0, 74, 0, 75, 52, 110, 110, 110, 110, 5, 5, 68, 144, 34, 152, 5, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 143, 143, 143, 143, 143, 143, 119, 119, 33, 69, 34, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 239, 239, 239, 239, 239, 239, 112, 66, 129, 129, 33, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 58, 129, 61, 61, 112, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 178, 61, 62, 82, 58, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 213, 213, 213, 213, 86, 62, 62, 210, 210, 210, 210, 47, 47, 47, 213, 177, 177, 177, 177, 109, 109, 210, 223, 223, 223, 223, 223, 223, 126, 177, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 98, 98, 98, 98, 133, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 53, 53, 53, 53, 188, 240, 240, 240, 240, 240, 240, 25, 107, 107, 53, 25, 25, 25, 25, 25, 25, 25, 25, 25, 217, 142, 142, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 81, 141, 141, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 135, 71, 71, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 136, 182, 184, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 70, 70, 70, 70, 70, 70, 70, 70, 70, 70, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 103, 103, 103, 103, 103, 103, 103, 103, 103, 128, 128, 128, 128, 128, 128, 128, 128, 128, 59, 59, 59, 59, 59, 59, 59, 59, 59, 179, 179, 179, 179, 179, 179, 179, 179, 179, 99, 99, 99, 99, 99, 99, 99, 99, 99, 64, 64, 64, 64, 64, 64, 64, 64, 64, 218, 218, 218, 218, 218, 218, 88, 88, 88, 88, 88, 195, 195, 195, 195, 195, 100, 100, 100, 186, 55, 189, 194, 96, 54, 49, 201, 118, 46, 23, 19, 209, 18, 212, 17, 14, 10, 73, 9, 117, 219, 221, 222, 114, 228, 229, 233, 235, 238, 113, 102, 243, 246, 1, 249, 252 ] racc_action_pointer = [ -7, 641, nil, nil, nil, 12, nil, nil, nil, 619, 617, nil, 334, 324, 614, nil, nil, 618, 592, 611, nil, nil, nil, 608, nil, 182, nil, nil, nil, nil, nil, nil, nil, 52, 31, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 616, 124, nil, 590, nil, nil, 5, 168, 605, 601, nil, 364, 88, 541, nil, 85, 103, 284, 568, 304, 75, -6, 6, 30, 244, 207, nil, 590, -5, -3, nil, nil, nil, nil, nil, 208, 78, nil, nil, 16, 119, nil, 584, nil, 454, 464, nil, nil, nil, nil, 587, nil, 152, 559, 594, nil, 614, 523, 404, nil, nil, 180, nil, 132, 20, 504, 73, 613, 626, 484, nil, 620, 591, 35, nil, nil, nil, nil, nil, 474, 147, 444, 532, 70, 424, 414, 394, 143, nil, 221, 234, nil, nil, nil, nil, 206, 193, 41, 29, nil, nil, nil, nil, nil, nil, nil, 32, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 344, nil, nil, nil, nil, nil, nil, 128, 101, 550, 294, 254, 218, nil, 236, nil, 600, nil, 158, 578, nil, nil, nil, nil, 602, 589, 514, nil, nil, nil, 354, 606, nil, 434, nil, 374, 264, 274, nil, 609, 120, nil, 597, 113, 314, 384, -5, 195, 578, 620, nil, 621, 622, 135, nil, nil, nil, nil, 622, 609, nil, nil, nil, 610, nil, 611, nil, nil, 626, 62, 173, nil, nil, 631, nil, nil, 630, nil, 494, 632, nil, nil, 633, nil ] racc_action_default = [ -155, -155, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -155, -155, -33, -34, -35, -36, -37, -42, -43, -44, -45, -155, -54, -155, -66, -67, -68, -69, -70, -71, -72, -155, -155, -107, -108, -109, -110, -111, -112, -113, -114, -115, -116, -117, -155, -155, -38, -39, -40, -77, -155, -155, -8, -9, -11, -155, -155, -155, -73, -155, -155, -57, -155, -149, -155, -8, -9, -10, -155, -91, -42, -155, -82, -87, -88, -89, -92, -93, -94, -155, -155, 254, -12, -13, -155, -16, -155, -30, -155, -155, -131, -41, -27, -28, -155, -61, -155, -155, -155, -29, -155, -155, -155, -132, -139, -155, -141, -155, -155, -155, -155, -155, -155, -74, -153, -155, -155, -52, -51, -53, -55, -56, -60, -58, -155, -150, -155, -155, -98, -97, -96, -155, -80, -155, -155, -95, -81, -14, -18, -155, -155, -155, -155, -126, -127, -128, -129, -124, -130, -125, -48, -62, -63, -64, -65, -118, -119, -120, -121, -49, -133, -134, -135, -136, -137, -138, -140, -142, -155, -26, -46, -78, -47, -79, -154, -155, -155, -155, -151, -75, -155, -101, -155, -100, -155, -99, -155, -84, -85, -86, -90, -19, -155, -155, -155, -122, -20, -21, -155, -155, -31, -155, -143, -155, -155, -155, -148, -155, -155, -102, -155, -155, -76, -152, -48, -155, -155, -155, -123, -155, -155, -155, -147, -144, -145, -146, -155, -155, -106, -105, -103, -155, -59, -155, -83, -23, -155, -155, -155, -15, -32, -155, -50, -104, -155, -25, -155, -155, -24, -22, -155, -17 ] racc_goto_table = [ 65, 10, 11, 13, 204, 5, 115, 190, 191, 192, 9, 63, 201, 55, 11, 23, 58, 66, 14, 211, 193, 199, 54, 73, 82, 197, 197, 247, 247, 56, 117, 198, 86, 89, 116, 242, 70, 70, 84, 65, 15, 16, 17, 18, 19, 85, 120, 87, 6, 97, 125, 26, 230, 27, 28, 232, 126, 29, 30, 31, 111, 112, 32, 55, 11, 149, 124, 119, 127, 4, 241, 139, 54, 133, 157, 181, 189, 122, 149, 204, 121, 3, 55, 11, 204, 2, 137, 237, 92, 236, 192, 54, 1, nil, 151, nil, nil, nil, nil, nil, 204, 204, nil, 116, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 170, 171, nil, nil, 176, nil, nil, nil, nil, nil, nil, nil, 214, nil, 124, nil, 180, nil, 185, 186, 187, nil, 188, nil, 70, 70, 183, 184, 184, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 116, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 157, nil, 171, nil, 157, nil, nil, 149, nil, nil, nil, nil, 215, 176, nil, nil, nil, nil, nil, nil, 171, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 225, 226, 227, nil, nil, nil, nil, nil, nil, 176, 234, nil, 70, nil, nil, 149 ] racc_goto_check = [ 42, 10, 11, 23, 60, 5, 51, 56, 56, 57, 9, 41, 16, 10, 11, 39, 23, 52, 29, 26, 19, 19, 9, 53, 53, 25, 25, 22, 22, 7, 24, 20, 15, 27, 42, 28, 23, 23, 12, 42, 30, 31, 32, 33, 35, 13, 40, 18, 6, 43, 41, 44, 26, 45, 46, 26, 52, 47, 48, 49, 23, 23, 50, 10, 11, 42, 23, 5, 23, 4, 17, 14, 9, 23, 42, 51, 55, 39, 42, 60, 29, 3, 10, 11, 60, 2, 5, 16, 59, 56, 57, 9, 1, nil, 23, nil, nil, nil, nil, nil, 60, 60, nil, 42, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 23, 23, nil, nil, 23, nil, nil, nil, nil, nil, nil, nil, 51, nil, 23, nil, 23, nil, 10, 10, 11, nil, 23, nil, 23, 23, 9, 9, 9, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 42, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 42, nil, 23, nil, 42, nil, nil, 42, nil, nil, nil, nil, 23, 23, nil, nil, nil, nil, nil, nil, 23, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 23, 23, 23, nil, nil, nil, nil, nil, nil, 23, 23, nil, 23, nil, nil, 42 ] racc_goto_pointer = [ nil, 92, 85, 81, 69, 5, 48, 17, nil, 10, 1, 2, -9, -2, -14, -15, -131, -153, 0, -121, -111, nil, -212, 3, -31, -116, -158, -14, -188, 18, 40, 41, 42, 43, nil, 44, nil, nil, nil, 15, -16, -14, -25, -3, 51, 53, 54, 57, 58, 59, 62, -53, -8, -10, nil, -59, -128, -127, nil, 41, -139, nil ] racc_goto_default = [ nil, nil, nil, nil, nil, 71, nil, 7, 8, 67, 68, 69, nil, nil, nil, nil, nil, nil, nil, nil, nil, 194, 208, 57, 95, 94, 101, nil, 202, 78, 79, nil, nil, nil, 48, 72, 20, 21, 22, nil, nil, nil, 36, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 74, 75, 76, 77, 80, 105, 106, 108 ] racc_reduce_table = [ 0, 0, :racc_error, 1, 37, :_reduce_none, 1, 37, :_reduce_none, 1, 37, :_reduce_none, 1, 38, :_reduce_none, 1, 38, :_reduce_none, 1, 41, :_reduce_none, 1, 41, :_reduce_none, 1, 43, :_reduce_8, 1, 43, :_reduce_9, 1, 43, :_reduce_10, 2, 44, :_reduce_11, 3, 42, :_reduce_12, 1, 48, :_reduce_none, 2, 48, :_reduce_14, 5, 49, :_reduce_15, 1, 49, :_reduce_none, 8, 54, :_reduce_17, 1, 50, :_reduce_18, 2, 50, :_reduce_19, 2, 50, :_reduce_20, 1, 56, :_reduce_none, 5, 56, :_reduce_22, 3, 55, :_reduce_23, 5, 55, :_reduce_24, 4, 55, :_reduce_25, 4, 45, :_reduce_26, 1, 60, :_reduce_none, 3, 46, :_reduce_28, 3, 47, :_reduce_29, 1, 51, :_reduce_none, 1, 52, :_reduce_none, 1, 53, :_reduce_none, 1, 39, :_reduce_none, 1, 39, :_reduce_none, 1, 39, :_reduce_none, 1, 39, :_reduce_none, 1, 39, :_reduce_none, 2, 65, :_reduce_38, 1, 70, :_reduce_39, 1, 70, :_reduce_40, 2, 70, :_reduce_41, 1, 66, :_reduce_42, 1, 66, :_reduce_none, 1, 66, :_reduce_none, 1, 66, :_reduce_none, 4, 71, :_reduce_46, 4, 71, :_reduce_47, 4, 72, :_reduce_48, 4, 73, :_reduce_49, 7, 74, :_reduce_50, 3, 67, :_reduce_51, 1, 75, :_reduce_none, 1, 75, :_reduce_none, 1, 75, :_reduce_54, 1, 76, :_reduce_none, 1, 76, :_reduce_56, 2, 68, :_reduce_57, 3, 68, :_reduce_58, 5, 77, :_reduce_59, 2, 77, :_reduce_60, 3, 69, :_reduce_61, 2, 79, :_reduce_62, 2, 79, :_reduce_63, 2, 79, :_reduce_64, 2, 79, :_reduce_65, 1, 40, :_reduce_none, 1, 40, :_reduce_none, 1, 40, :_reduce_none, 1, 40, :_reduce_none, 1, 40, :_reduce_none, 1, 40, :_reduce_none, 1, 40, :_reduce_none, 2, 80, :_reduce_73, 3, 86, :_reduce_74, 4, 86, :_reduce_75, 5, 86, :_reduce_76, 2, 85, :_reduce_77, 4, 84, :_reduce_78, 4, 84, :_reduce_79, 3, 82, :_reduce_80, 3, 83, :_reduce_81, 1, 89, :_reduce_82, 5, 89, :_reduce_83, 3, 89, :_reduce_84, 3, 89, :_reduce_85, 3, 89, :_reduce_86, 1, 89, :_reduce_none, 1, 89, :_reduce_88, 1, 91, :_reduce_89, 3, 91, :_reduce_90, 1, 93, :_reduce_none, 1, 93, :_reduce_none, 1, 93, :_reduce_none, 1, 93, :_reduce_94, 2, 90, :_reduce_95, 2, 92, :_reduce_96, 2, 92, :_reduce_97, 2, 92, :_reduce_98, 3, 94, :_reduce_none, 3, 94, :_reduce_none, 3, 94, :_reduce_101, 5, 81, :_reduce_102, 6, 81, :_reduce_103, 7, 81, :_reduce_104, 6, 81, :_reduce_105, 6, 81, :_reduce_106, 1, 59, :_reduce_107, 1, 59, :_reduce_none, 1, 78, :_reduce_109, 1, 78, :_reduce_110, 1, 78, :_reduce_111, 1, 78, :_reduce_112, 1, 78, :_reduce_113, 1, 78, :_reduce_114, 1, 78, :_reduce_115, 1, 78, :_reduce_116, 1, 78, :_reduce_117, 2, 61, :_reduce_118, 2, 61, :_reduce_119, 2, 61, :_reduce_120, 2, 61, :_reduce_121, 1, 57, :_reduce_none, 2, 57, :_reduce_123, 2, 95, :_reduce_124, 2, 95, :_reduce_125, 2, 95, :_reduce_126, 2, 95, :_reduce_127, 2, 95, :_reduce_128, 2, 95, :_reduce_129, 2, 63, :_reduce_130, 1, 63, :_reduce_none, 1, 96, :_reduce_none, 2, 96, :_reduce_133, 2, 96, :_reduce_134, 2, 96, :_reduce_135, 2, 96, :_reduce_136, 2, 96, :_reduce_137, 2, 96, :_reduce_138, 1, 97, :_reduce_none, 2, 97, :_reduce_140, 1, 62, :_reduce_none, 2, 62, :_reduce_142, 1, 58, :_reduce_none, 2, 58, :_reduce_144, 2, 58, :_reduce_145, 2, 58, :_reduce_146, 2, 64, :_reduce_147, 1, 64, :_reduce_none, 1, 88, :_reduce_149, 2, 88, :_reduce_150, 3, 88, :_reduce_151, 4, 88, :_reduce_152, 1, 87, :_reduce_153, 2, 87, :_reduce_154 ] racc_reduce_n = 155 racc_shift_n = 254 racc_token_table = { false => 0, :error => 1, :T => 2, :Z => 3, :E => 4, :X => 5, :PLUS => 6, :MINUS => 7, :COLON => 8, :SLASH => 9, :D0 => 10, :D1 => 11, :D2 => 12, :D3 => 13, :D4 => 14, :D5 => 15, :D6 => 16, :D7 => 17, :D8 => 18, :D9 => 19, :LP => 20, :RP => 21, :UNCERTAIN => 22, :APPROXIMATE => 23, :UNSPECIFIED => 24, :UNKNOWN => 25, :OPEN => 26, :LONGYEAR => 27, :CARET => 28, :UNMATCHED => 29, :DOTS => 30, :COMMA => 31, :LBRACE => 32, :RBRACE => 33, :LSQUARE => 34, :RSQUARE => 35 } racc_nt_base = 36 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", "T", "Z", "E", "X", "PLUS", "MINUS", "COLON", "SLASH", "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7", "D8", "D9", "LP", "RP", "UNCERTAIN", "APPROXIMATE", "UNSPECIFIED", "UNKNOWN", "OPEN", "LONGYEAR", "CARET", "UNMATCHED", "DOTS", "COMMA", "LBRACE", "RBRACE", "LSQUARE", "RSQUARE", "$start", "edtf", "level_0_expression", "level_1_expression", "level_2_expression", "date", "date_time", "positive_date", "negative_date", "year", "year_month", "year_month_day", "time", "base_time", "zone_offset", "hour", "minute", "second", "midnight", "zone_offset_hour", "positive_zone_offset", "d01_13", "d01_59", "digit", "month", "d01_12", "d01_31", "d00_23", "d00_59", "uncertain_or_approximate_date", "unspecified", "level_1_interval", "long_year_simple", "season", "uncertain_or_approximate", "unspecified_year", "unspecified_month", "unspecified_day", "unspecified_day_and_month", "level_1_start", "level_1_end", "long_year", "positive_digit", "season_number", "season_qualified", "internal_unspecified", "choice_list", "inclusive_list", "masked_precision", "date_and_calendar", "long_year_scientific", "integer", "int1_4", "list", "earlier", "list_elements", "later", "list_element", "consecutives", "d01_23", "d01_29", "d01_30" ] Racc_debug_parser = false ##### State transition tables end ##### # reduce 0 omitted # reduce 1 omitted # reduce 2 omitted # reduce 3 omitted # reduce 4 omitted # reduce 5 omitted # reduce 6 omitted # reduce 7 omitted module_eval(<<'.,.,', 'parser.y', 27) def _reduce_8(val, _values, result) result = Date.new(val[0]); result.precision = :year result end .,., module_eval(<<'.,.,', 'parser.y', 28) def _reduce_9(val, _values, result) result = Date.new(*val.flatten); result.precision = :month result end .,., module_eval(<<'.,.,', 'parser.y', 29) def _reduce_10(val, _values, result) result = Date.new(*val.flatten); result.precision = :day result end .,., module_eval(<<'.,.,', 'parser.y', 31) def _reduce_11(val, _values, result) result = -val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 34) def _reduce_12(val, _values, result) result = DateTime.new(val[0].year, val[0].month, val[0].day, *val[2]) result end .,., # reduce 13 omitted module_eval(<<'.,.,', 'parser.y', 37) def _reduce_14(val, _values, result) result = val.flatten result end .,., module_eval(<<'.,.,', 'parser.y', 39) def _reduce_15(val, _values, result) result = [val[0], val[2], val[4]] result end .,., # reduce 16 omitted module_eval(<<'.,.,', 'parser.y', 42) def _reduce_17(val, _values, result) result = [24, 0, 0] result end .,., module_eval(<<'.,.,', 'parser.y', 44) def _reduce_18(val, _values, result) result = 0 result end .,., module_eval(<<'.,.,', 'parser.y', 45) def _reduce_19(val, _values, result) result = -1 * val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 46) def _reduce_20(val, _values, result) result = val[1] result end .,., # reduce 21 omitted module_eval(<<'.,.,', 'parser.y', 49) def _reduce_22(val, _values, result) result = 0 result end .,., module_eval(<<'.,.,', 'parser.y', 52) def _reduce_23(val, _values, result) result = Rational(val[0] * 60 + val[2], 1440) result end .,., module_eval(<<'.,.,', 'parser.y', 53) def _reduce_24(val, _values, result) result = Rational(840, 1440) result end .,., module_eval(<<'.,.,', 'parser.y', 54) def _reduce_25(val, _values, result) result = Rational(val[3], 1440) result end .,., module_eval(<<'.,.,', 'parser.y', 56) def _reduce_26(val, _values, result) result = val.zip([1000,100,10,1]).reduce(0) { |s,(a,b)| s += a * b } result end .,., # reduce 27 omitted module_eval(<<'.,.,', 'parser.y', 60) def _reduce_28(val, _values, result) result = [val[0], val[2]] result end .,., module_eval(<<'.,.,', 'parser.y', 66) def _reduce_29(val, _values, result) result = val[0] << val[2]; raise ArgumentError, "invalid date (invalid days #{result[2]} for month #{result[1]})" if result[2] > 31 || (result[2] > 30 && [2,4,6,9,11].include?(result[1])) || (result[2] > 29 && result[1] == 2) result end .,., # reduce 30 omitted # reduce 31 omitted # reduce 32 omitted # reduce 33 omitted # reduce 34 omitted # reduce 35 omitted # reduce 36 omitted # reduce 37 omitted module_eval(<<'.,.,', 'parser.y', 86) def _reduce_38(val, _values, result) result = val[0]; val[1].each { |m| result.send(m) } result end .,., module_eval(<<'.,.,', 'parser.y', 88) def _reduce_39(val, _values, result) result = [:uncertain!] result end .,., module_eval(<<'.,.,', 'parser.y', 89) def _reduce_40(val, _values, result) result = [:approximate!] result end .,., module_eval(<<'.,.,', 'parser.y', 90) def _reduce_41(val, _values, result) result = [:uncertain!, :approximate!] result end .,., module_eval(<<'.,.,', 'parser.y', 93) def _reduce_42(val, _values, result) result = Date.new(val[0][0]); result.unspecified.year[2,2] = val[0][1]; result.precision = :year result end .,., # reduce 43 omitted # reduce 44 omitted # reduce 45 omitted module_eval(<<'.,.,', 'parser.y', 98) def _reduce_46(val, _values, result) result = [val[0,3].zip([1000,100,10]).reduce(0) { |s,(a,b)| s += a * b }, [false,true]] result end .,., module_eval(<<'.,.,', 'parser.y', 99) def _reduce_47(val, _values, result) result = [val[0,2].zip([1000,100]).reduce(0) { |s,(a,b)| s += a * b }, [true, true]] result end .,., module_eval(<<'.,.,', 'parser.y', 101) def _reduce_48(val, _values, result) result = Date.new(val[0]).unspecified!(:month); result.precision = :month result end .,., module_eval(<<'.,.,', 'parser.y', 103) def _reduce_49(val, _values, result) result = Date.new(*val[0]).unspecified!(:day) result end .,., module_eval(<<'.,.,', 'parser.y', 105) def _reduce_50(val, _values, result) result = Date.new(val[0]).unspecified!([:day,:month]) result end .,., module_eval(<<'.,.,', 'parser.y', 108) def _reduce_51(val, _values, result) result = Interval.new(val[0], val[2]) result end .,., # reduce 52 omitted # reduce 53 omitted module_eval(<<'.,.,', 'parser.y', 112) def _reduce_54(val, _values, result) result = :unknown result end .,., # reduce 55 omitted module_eval(<<'.,.,', 'parser.y', 115) def _reduce_56(val, _values, result) result = :open result end .,., module_eval(<<'.,.,', 'parser.y', 118) def _reduce_57(val, _values, result) result = Date.new(val[1]); result.precision = :year result end .,., module_eval(<<'.,.,', 'parser.y', 119) def _reduce_58(val, _values, result) result = Date.new(-1 * val[2]); result.precision = :year result end .,., module_eval(<<'.,.,', 'parser.y', 121) def _reduce_59(val, _values, result) result = val.zip([10000,1000,100,10,1]).reduce(0) { |s,(a,b)| s += a * b } result end .,., module_eval(<<'.,.,', 'parser.y', 122) def _reduce_60(val, _values, result) result = 10 * val[0] + val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 125) def _reduce_61(val, _values, result) result = Date.new(val[0]); result.season = val[2]; result.precision = :year result end .,., module_eval(<<'.,.,', 'parser.y', 127) def _reduce_62(val, _values, result) result = 21 result end .,., module_eval(<<'.,.,', 'parser.y', 128) def _reduce_63(val, _values, result) result = 22 result end .,., module_eval(<<'.,.,', 'parser.y', 129) def _reduce_64(val, _values, result) result = 23 result end .,., module_eval(<<'.,.,', 'parser.y', 130) def _reduce_65(val, _values, result) result = 24 result end .,., # reduce 66 omitted # reduce 67 omitted # reduce 68 omitted # reduce 69 omitted # reduce 70 omitted # reduce 71 omitted # reduce 72 omitted module_eval(<<'.,.,', 'parser.y', 146) def _reduce_73(val, _values, result) result = val[0]; result.qualifier = val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 149) def _reduce_74(val, _values, result) result = Date.new(val[0].year * 10 ** val[2]); result.precision = :year result end .,., module_eval(<<'.,.,', 'parser.y', 150) def _reduce_75(val, _values, result) result = Date.new(val[1] * 10 ** val[3]); result.precision = :year result end .,., module_eval(<<'.,.,', 'parser.y', 151) def _reduce_76(val, _values, result) result = Date.new(-1 * val[2] * 10 ** val[4]); result.precision = :year result end .,., module_eval(<<'.,.,', 'parser.y', 154) def _reduce_77(val, _values, result) result = val[0]; result.calendar = val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 157) def _reduce_78(val, _values, result) d = val[0,3].zip([1000,100,10]).reduce(0) { |s,(a,b)| s += a * b }; result = Date.new(d) ... Date.new(d+10) result end .,., module_eval(<<'.,.,', 'parser.y', 158) def _reduce_79(val, _values, result) d = val[0,2].zip([1000,100]).reduce(0) { |s,(a,b)| s += a * b }; result = Date.new(d) ... Date.new(d+100) result end .,., module_eval(<<'.,.,', 'parser.y', 161) def _reduce_80(val, _values, result) result = val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 163) def _reduce_81(val, _values, result) result = val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 165) def _reduce_82(val, _values, result) result = [val[0]] result end .,., module_eval(<<'.,.,', 'parser.y', 166) def _reduce_83(val, _values, result) result = [val[0]] + val[2] + [val[4]] result end .,., module_eval(<<'.,.,', 'parser.y', 167) def _reduce_84(val, _values, result) result = [val[0]] + val[2] result end .,., module_eval(<<'.,.,', 'parser.y', 168) def _reduce_85(val, _values, result) result = [val[0]] + [val[2]] result end .,., module_eval(<<'.,.,', 'parser.y', 169) def _reduce_86(val, _values, result) result = val[0] + [val[2]] result end .,., # reduce 87 omitted module_eval(<<'.,.,', 'parser.y', 171) def _reduce_88(val, _values, result) result = [val[0]] result end .,., module_eval(<<'.,.,', 'parser.y', 173) def _reduce_89(val, _values, result) result = [val[0]].flatten result end .,., module_eval(<<'.,.,', 'parser.y', 174) def _reduce_90(val, _values, result) result = val[0] + [val[2]].flatten result end .,., # reduce 91 omitted # reduce 92 omitted # reduce 93 omitted module_eval(<<'.,.,', 'parser.y', 180) def _reduce_94(val, _values, result) result = val[0].map { |d| Date.new(*d) } result end .,., module_eval(<<'.,.,', 'parser.y', 182) def _reduce_95(val, _values, result) result = val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 184) def _reduce_96(val, _values, result) result = Date.new(*val[0]); result.precision = :day result end .,., module_eval(<<'.,.,', 'parser.y', 185) def _reduce_97(val, _values, result) result = Date.new(*val[0]); result.precision = :month result end .,., module_eval(<<'.,.,', 'parser.y', 186) def _reduce_98(val, _values, result) result = Date.new(val[0]); result.precision = :year result end .,., # reduce 99 omitted # reduce 100 omitted module_eval(<<'.,.,', 'parser.y', 190) def _reduce_101(val, _values, result) result = (val[0]..val[2]).to_a.map result end .,., module_eval(<<'.,.,', 'parser.y', 193) def _reduce_102(val, _values, result) result = Date.new(val[0][0], val[2], val[4]); result.unspecified.year[2,2] = val[0][1] result end .,., module_eval(<<'.,.,', 'parser.y', 194) def _reduce_103(val, _values, result) result = Date.new(val[0][0], 1, val[5]); result.unspecified.year[2,2] = val[0][1]; result.unspecified!(:month) result end .,., module_eval(<<'.,.,', 'parser.y', 195) def _reduce_104(val, _values, result) result = Date.new(val[0][0], 1, 1); result.unspecified.year[2,2] = val[0][1]; result.unspecified!([:month, :day]) result end .,., module_eval(<<'.,.,', 'parser.y', 196) def _reduce_105(val, _values, result) result = Date.new(val[0][0], val[2], 1); result.unspecified.year[2,2] = val[0][1]; result.unspecified!(:day) result end .,., module_eval(<<'.,.,', 'parser.y', 197) def _reduce_106(val, _values, result) result = Date.new(val[0], 1, val[5]); result.unspecified!(:month) result end .,., module_eval(<<'.,.,', 'parser.y', 202) def _reduce_107(val, _values, result) result = 0 result end .,., # reduce 108 omitted module_eval(<<'.,.,', 'parser.y', 205) def _reduce_109(val, _values, result) result = 1 result end .,., module_eval(<<'.,.,', 'parser.y', 206) def _reduce_110(val, _values, result) result = 2 result end .,., module_eval(<<'.,.,', 'parser.y', 207) def _reduce_111(val, _values, result) result = 3 result end .,., module_eval(<<'.,.,', 'parser.y', 208) def _reduce_112(val, _values, result) result = 4 result end .,., module_eval(<<'.,.,', 'parser.y', 209) def _reduce_113(val, _values, result) result = 5 result end .,., module_eval(<<'.,.,', 'parser.y', 210) def _reduce_114(val, _values, result) result = 6 result end .,., module_eval(<<'.,.,', 'parser.y', 211) def _reduce_115(val, _values, result) result = 7 result end .,., module_eval(<<'.,.,', 'parser.y', 212) def _reduce_116(val, _values, result) result = 8 result end .,., module_eval(<<'.,.,', 'parser.y', 213) def _reduce_117(val, _values, result) result = 9 result end .,., module_eval(<<'.,.,', 'parser.y', 215) def _reduce_118(val, _values, result) result = val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 216) def _reduce_119(val, _values, result) result = 10 result end .,., module_eval(<<'.,.,', 'parser.y', 217) def _reduce_120(val, _values, result) result = 11 result end .,., module_eval(<<'.,.,', 'parser.y', 218) def _reduce_121(val, _values, result) result = 12 result end .,., # reduce 122 omitted module_eval(<<'.,.,', 'parser.y', 221) def _reduce_123(val, _values, result) result = 13 result end .,., module_eval(<<'.,.,', 'parser.y', 223) def _reduce_124(val, _values, result) result = val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 224) def _reduce_125(val, _values, result) result = 10 + val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 225) def _reduce_126(val, _values, result) result = 20 result end .,., module_eval(<<'.,.,', 'parser.y', 226) def _reduce_127(val, _values, result) result = 21 result end .,., module_eval(<<'.,.,', 'parser.y', 227) def _reduce_128(val, _values, result) result = 22 result end .,., module_eval(<<'.,.,', 'parser.y', 228) def _reduce_129(val, _values, result) result = 23 result end .,., module_eval(<<'.,.,', 'parser.y', 230) def _reduce_130(val, _values, result) result = 0 result end .,., # reduce 131 omitted # reduce 132 omitted module_eval(<<'.,.,', 'parser.y', 234) def _reduce_133(val, _values, result) result = 24 result end .,., module_eval(<<'.,.,', 'parser.y', 235) def _reduce_134(val, _values, result) result = 25 result end .,., module_eval(<<'.,.,', 'parser.y', 236) def _reduce_135(val, _values, result) result = 26 result end .,., module_eval(<<'.,.,', 'parser.y', 237) def _reduce_136(val, _values, result) result = 27 result end .,., module_eval(<<'.,.,', 'parser.y', 238) def _reduce_137(val, _values, result) result = 28 result end .,., module_eval(<<'.,.,', 'parser.y', 239) def _reduce_138(val, _values, result) result = 29 result end .,., # reduce 139 omitted module_eval(<<'.,.,', 'parser.y', 242) def _reduce_140(val, _values, result) result = 30 result end .,., # reduce 141 omitted module_eval(<<'.,.,', 'parser.y', 245) def _reduce_142(val, _values, result) result = 31 result end .,., # reduce 143 omitted module_eval(<<'.,.,', 'parser.y', 248) def _reduce_144(val, _values, result) result = 30 + val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 249) def _reduce_145(val, _values, result) result = 40 + val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 250) def _reduce_146(val, _values, result) result = 50 + val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 252) def _reduce_147(val, _values, result) result = 0 result end .,., # reduce 148 omitted module_eval(<<'.,.,', 'parser.y', 255) def _reduce_149(val, _values, result) result = val[0] result end .,., module_eval(<<'.,.,', 'parser.y', 256) def _reduce_150(val, _values, result) result = 10 * val[0] + val[1] result end .,., module_eval(<<'.,.,', 'parser.y', 257) def _reduce_151(val, _values, result) result = val.zip([100,10,1]).reduce(0) { |s,(a,b)| s += a * b } result end .,., module_eval(<<'.,.,', 'parser.y', 258) def _reduce_152(val, _values, result) result = val.zip([1000,100,10,1]).reduce(0) { |s,(a,b)| s += a * b } result end .,., module_eval(<<'.,.,', 'parser.y', 260) def _reduce_153(val, _values, result) result = val[0] result end .,., module_eval(<<'.,.,', 'parser.y', 261) def _reduce_154(val, _values, result) result = 10 * val[0] + val[1] result end .,., def _reduce_none(val, _values, result) val[0] end end # class Parser end # module EDTF