# Autogenerated from a Treetop grammar. Edits may be lost. module Timing module NaturalTimeLanguage include Treetop::Runtime def root @root ||= :expression end module Expression0 def moment elements[1] end def zone_offset elements[3] end end def _nt_expression start_index = index if node_cache[:expression].has_key?(index) cached = node_cache[:expression][index] if cached node_cache[:expression][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] s1, i1 = [], index loop do r2 = _nt_space if r2 s1 << r2 else break end end r1 = instantiate_node(SyntaxNode,input, i1...index, s1) s0 << r1 if r1 r3 = _nt_moment s0 << r3 if r3 s4, i4 = [], index loop do r5 = _nt_space if r5 s4 << r5 else break end end r4 = instantiate_node(SyntaxNode,input, i4...index, s4) s0 << r4 if r4 r7 = _nt_zone_offset if r7 r6 = r7 else r6 = instantiate_node(SyntaxNode,input, index...index) end s0 << r6 if r6 s8, i8 = [], index loop do r9 = _nt_space if r9 s8 << r9 else break end end r8 = instantiate_node(SyntaxNode,input, i8...index, s8) s0 << r8 end end end end if s0.last r0 = instantiate_node(Expression,input, i0...index, s0) r0.extend(Expression0) else @index = i0 r0 = nil end node_cache[:expression][start_index] = r0 r0 end def _nt_moment start_index = index if node_cache[:moment].has_key?(index) cached = node_cache[:moment][index] if cached node_cache[:moment][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index r1 = _nt_timestamp if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else r2 = _nt_time_ago if r2 r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true r0 = r2 else r3 = _nt_moment_at_time if r3 r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true r0 = r3 else r4 = _nt_before_from_moment if r4 r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true r0 = r4 else r5 = _nt_date_moment if r5 r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true r0 = r5 else @index = i0 r0 = nil end end end end end node_cache[:moment][start_index] = r0 r0 end def _nt_date_moment start_index = index if node_cache[:date_moment].has_key?(index) cached = node_cache[:date_moment][index] if cached node_cache[:date_moment][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index r1 = _nt_named_moment if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else r2 = _nt_last_next_day_name if r2 r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true r0 = r2 else r3 = _nt_day_month_name_year if r3 r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true r0 = r3 else r4 = _nt_year_month_day if r4 r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true r0 = r4 else r5 = _nt_beginning_end_interval if r5 r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true r0 = r5 else @index = i0 r0 = nil end end end end end node_cache[:date_moment][start_index] = r0 r0 end def _nt_named_moment start_index = index if node_cache[:named_moment].has_key?(index) cached = node_cache[:named_moment][index] if cached node_cache[:named_moment][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index r1 = _nt_now if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else r2 = _nt_today if r2 r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true r0 = r2 else r3 = _nt_tomorrow if r3 r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true r0 = r3 else r4 = _nt_yesterday if r4 r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true r0 = r4 else @index = i0 r0 = nil end end end end node_cache[:named_moment][start_index] = r0 r0 end module LastNextDayName0 def direction elements[0] end def day_name elements[2] end def including_today elements[4] end end def _nt_last_next_day_name start_index = index if node_cache[:last_next_day_name].has_key?(index) cached = node_cache[:last_next_day_name][index] if cached node_cache[:last_next_day_name][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_last_next s0 << r1 if r1 s2, i2 = [], index loop do r3 = _nt_space if r3 s2 << r3 else break end end r2 = instantiate_node(SyntaxNode,input, i2...index, s2) s0 << r2 if r2 r4 = _nt_day_name s0 << r4 if r4 s5, i5 = [], index loop do r6 = _nt_space if r6 s5 << r6 else break end end r5 = instantiate_node(SyntaxNode,input, i5...index, s5) s0 << r5 if r5 if (match_len = has_terminal?('including today', false, index)) r8 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'including today\'') r8 = nil end if r8 r7 = r8 else r7 = instantiate_node(SyntaxNode,input, index...index) end s0 << r7 end end end end if s0.last r0 = instantiate_node(LastNextDayName,input, i0...index, s0) r0.extend(LastNextDayName0) else @index = i0 r0 = nil end node_cache[:last_next_day_name][start_index] = r0 r0 end module DayMonthNameYear0 def day elements[0] end def month elements[2] end def year elements[4] end end def _nt_day_month_name_year start_index = index if node_cache[:day_month_name_year].has_key?(index) cached = node_cache[:day_month_name_year][index] if cached node_cache[:day_month_name_year][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_integer s0 << r1 if r1 s2, i2 = [], index loop do r3 = _nt_space if r3 s2 << r3 else break end end r2 = instantiate_node(SyntaxNode,input, i2...index, s2) s0 << r2 if r2 r4 = _nt_month_name s0 << r4 if r4 s5, i5 = [], index loop do r6 = _nt_space if r6 s5 << r6 else break end end r5 = instantiate_node(SyntaxNode,input, i5...index, s5) s0 << r5 if r5 r8 = _nt_integer if r8 r7 = r8 else r7 = instantiate_node(SyntaxNode,input, index...index) end s0 << r7 if r7 s9, i9 = [], index loop do r10 = _nt_space if r10 s9 << r10 else break end end r9 = instantiate_node(SyntaxNode,input, i9...index, s9) s0 << r9 end end end end end if s0.last r0 = instantiate_node(DayMonthNameYear,input, i0...index, s0) r0.extend(DayMonthNameYear0) else @index = i0 r0 = nil end node_cache[:day_month_name_year][start_index] = r0 r0 end module YearMonthDay0 def year elements[0] end def month elements[2] end def day elements[4] end end def _nt_year_month_day start_index = index if node_cache[:year_month_day].has_key?(index) cached = node_cache[:year_month_day][index] if cached node_cache[:year_month_day][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_integer s0 << r1 if r1 if (match_len = has_terminal?('-', false, index)) r2 = true @index += match_len else terminal_parse_failure('\'-\'') r2 = nil end s0 << r2 if r2 r3 = _nt_integer s0 << r3 if r3 if (match_len = has_terminal?('-', false, index)) r4 = true @index += match_len else terminal_parse_failure('\'-\'') r4 = nil end s0 << r4 if r4 r5 = _nt_integer s0 << r5 end end end end if s0.last r0 = instantiate_node(YearMonthDay,input, i0...index, s0) r0.extend(YearMonthDay0) else @index = i0 r0 = nil end node_cache[:year_month_day][start_index] = r0 r0 end module BeginningEndInterval0 def direction elements[0] end def interval_type elements[2] end end def _nt_beginning_end_interval start_index = index if node_cache[:beginning_end_interval].has_key?(index) cached = node_cache[:beginning_end_interval][index] if cached node_cache[:beginning_end_interval][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_beginning_end s0 << r1 if r1 s2, i2 = [], index loop do r3 = _nt_space if r3 s2 << r3 else break end end r2 = instantiate_node(SyntaxNode,input, i2...index, s2) s0 << r2 if r2 r4 = _nt_interval s0 << r4 end end if s0.last r0 = instantiate_node(BeginningEndInterval,input, i0...index, s0) r0.extend(BeginningEndInterval0) else @index = i0 r0 = nil end node_cache[:beginning_end_interval][start_index] = r0 r0 end module TimeAgo0 def number elements[0] end def interval_type elements[2] end end def _nt_time_ago start_index = index if node_cache[:time_ago].has_key?(index) cached = node_cache[:time_ago][index] if cached node_cache[:time_ago][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_integer s0 << r1 if r1 s2, i2 = [], index loop do r3 = _nt_space if r3 s2 << r3 else break end end r2 = instantiate_node(SyntaxNode,input, i2...index, s2) s0 << r2 if r2 r4 = _nt_interval s0 << r4 if r4 s5, i5 = [], index loop do r6 = _nt_space if r6 s5 << r6 else break end end r5 = instantiate_node(SyntaxNode,input, i5...index, s5) s0 << r5 if r5 if (match_len = has_terminal?('ago', false, index)) r7 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'ago\'') r7 = nil end s0 << r7 end end end end if s0.last r0 = instantiate_node(TimeAgo,input, i0...index, s0) r0.extend(TimeAgo0) else @index = i0 r0 = nil end node_cache[:time_ago][start_index] = r0 r0 end module MomentAtTime0 def moment elements[0] end def time elements[4] end end def _nt_moment_at_time start_index = index if node_cache[:moment_at_time].has_key?(index) cached = node_cache[:moment_at_time][index] if cached node_cache[:moment_at_time][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_date_moment s0 << r1 if r1 s2, i2 = [], index loop do r3 = _nt_space if r3 s2 << r3 else break end end r2 = instantiate_node(SyntaxNode,input, i2...index, s2) s0 << r2 if r2 if (match_len = has_terminal?('at', false, index)) r4 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'at\'') r4 = nil end s0 << r4 if r4 s5, i5 = [], index loop do r6 = _nt_space if r6 s5 << r6 else break end end r5 = instantiate_node(SyntaxNode,input, i5...index, s5) s0 << r5 if r5 r7 = _nt_hour_minute_second s0 << r7 end end end end if s0.last r0 = instantiate_node(MomentAtTime,input, i0...index, s0) r0.extend(MomentAtTime0) else @index = i0 r0 = nil end node_cache[:moment_at_time][start_index] = r0 r0 end module BeforeFromMoment0 def number elements[0] end def interval_type elements[2] end def direction elements[4] end def moment elements[6] end end def _nt_before_from_moment start_index = index if node_cache[:before_from_moment].has_key?(index) cached = node_cache[:before_from_moment][index] if cached node_cache[:before_from_moment][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_integer s0 << r1 if r1 s2, i2 = [], index loop do r3 = _nt_space if r3 s2 << r3 else break end end r2 = instantiate_node(SyntaxNode,input, i2...index, s2) s0 << r2 if r2 r4 = _nt_interval s0 << r4 if r4 s5, i5 = [], index loop do r6 = _nt_space if r6 s5 << r6 else break end end r5 = instantiate_node(SyntaxNode,input, i5...index, s5) s0 << r5 if r5 r7 = _nt_before_from s0 << r7 if r7 s8, i8 = [], index loop do r9 = _nt_space if r9 s8 << r9 else break end end r8 = instantiate_node(SyntaxNode,input, i8...index, s8) s0 << r8 if r8 r10 = _nt_moment s0 << r10 end end end end end end if s0.last r0 = instantiate_node(BeforeFromMoment,input, i0...index, s0) r0.extend(BeforeFromMoment0) else @index = i0 r0 = nil end node_cache[:before_from_moment][start_index] = r0 r0 end module Timestamp0 end def _nt_timestamp start_index = index if node_cache[:timestamp].has_key?(index) cached = node_cache[:timestamp][index] if cached node_cache[:timestamp][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] s1, i1 = [], index loop do if has_terminal?(@regexps[gr = '\A[\\d]'] ||= Regexp.new(gr), :regexp, index) r2 = true @index += 1 else terminal_parse_failure('[\\d]') r2 = nil end if r2 s1 << r2 else break end if s1.size == 4 break end end if s1.size < 4 @index = i1 r1 = nil else if s1.size < 4 @terminal_failures.pop end r1 = instantiate_node(SyntaxNode,input, i1...index, s1) end s0 << r1 if r1 if (match_len = has_terminal?('-', false, index)) r3 = true @index += match_len else terminal_parse_failure('\'-\'') r3 = nil end s0 << r3 if r3 s4, i4 = [], index loop do if has_terminal?(@regexps[gr = '\A[\\d]'] ||= Regexp.new(gr), :regexp, index) r5 = true @index += 1 else terminal_parse_failure('[\\d]') r5 = nil end if r5 s4 << r5 else break end if s4.size == 2 break end end if s4.size < 2 @index = i4 r4 = nil else if s4.size < 2 @terminal_failures.pop end r4 = instantiate_node(SyntaxNode,input, i4...index, s4) end s0 << r4 if r4 if (match_len = has_terminal?('-', false, index)) r6 = true @index += match_len else terminal_parse_failure('\'-\'') r6 = nil end s0 << r6 if r6 s7, i7 = [], index loop do if has_terminal?(@regexps[gr = '\A[\\d]'] ||= Regexp.new(gr), :regexp, index) r8 = true @index += 1 else terminal_parse_failure('[\\d]') r8 = nil end if r8 s7 << r8 else break end if s7.size == 2 break end end if s7.size < 2 @index = i7 r7 = nil else if s7.size < 2 @terminal_failures.pop end r7 = instantiate_node(SyntaxNode,input, i7...index, s7) end s0 << r7 if r7 s9, i9 = [], index loop do r10 = _nt_space if r10 s9 << r10 else break end end r9 = instantiate_node(SyntaxNode,input, i9...index, s9) s0 << r9 if r9 if (match_len = has_terminal?('t', false, index)) r12 = true @index += match_len else terminal_parse_failure('\'t\'') r12 = nil end if r12 r11 = r12 else r11 = instantiate_node(SyntaxNode,input, index...index) end s0 << r11 if r11 s13, i13 = [], index loop do r14 = _nt_space if r14 s13 << r14 else break end end r13 = instantiate_node(SyntaxNode,input, i13...index, s13) s0 << r13 if r13 s15, i15 = [], index loop do if has_terminal?(@regexps[gr = '\A[\\d]'] ||= Regexp.new(gr), :regexp, index) r16 = true @index += 1 else terminal_parse_failure('[\\d]') r16 = nil end if r16 s15 << r16 else break end if s15.size == 2 break end end if s15.size < 2 @index = i15 r15 = nil else if s15.size < 2 @terminal_failures.pop end r15 = instantiate_node(SyntaxNode,input, i15...index, s15) end s0 << r15 if r15 if (match_len = has_terminal?(':', false, index)) r17 = true @index += match_len else terminal_parse_failure('\':\'') r17 = nil end s0 << r17 if r17 s18, i18 = [], index loop do if has_terminal?(@regexps[gr = '\A[\\d]'] ||= Regexp.new(gr), :regexp, index) r19 = true @index += 1 else terminal_parse_failure('[\\d]') r19 = nil end if r19 s18 << r19 else break end if s18.size == 2 break end end if s18.size < 2 @index = i18 r18 = nil else if s18.size < 2 @terminal_failures.pop end r18 = instantiate_node(SyntaxNode,input, i18...index, s18) end s0 << r18 if r18 if (match_len = has_terminal?(':', false, index)) r20 = true @index += match_len else terminal_parse_failure('\':\'') r20 = nil end s0 << r20 if r20 s21, i21 = [], index loop do if has_terminal?(@regexps[gr = '\A[\\d]'] ||= Regexp.new(gr), :regexp, index) r22 = true @index += 1 else terminal_parse_failure('[\\d]') r22 = nil end if r22 s21 << r22 else break end if s21.size == 2 break end end if s21.size < 2 @index = i21 r21 = nil else if s21.size < 2 @terminal_failures.pop end r21 = instantiate_node(SyntaxNode,input, i21...index, s21) end s0 << r21 end end end end end end end end end end end end if s0.last r0 = instantiate_node(Timestamp,input, i0...index, s0) r0.extend(Timestamp0) else @index = i0 r0 = nil end node_cache[:timestamp][start_index] = r0 r0 end def _nt_now start_index = index if node_cache[:now].has_key?(index) cached = node_cache[:now][index] if cached node_cache[:now][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if (match_len = has_terminal?('now', false, index)) r0 = instantiate_node(Now,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'now\'') r0 = nil end node_cache[:now][start_index] = r0 r0 end def _nt_today start_index = index if node_cache[:today].has_key?(index) cached = node_cache[:today][index] if cached node_cache[:today][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if (match_len = has_terminal?('today', false, index)) r0 = instantiate_node(Today,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'today\'') r0 = nil end node_cache[:today][start_index] = r0 r0 end def _nt_tomorrow start_index = index if node_cache[:tomorrow].has_key?(index) cached = node_cache[:tomorrow][index] if cached node_cache[:tomorrow][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if (match_len = has_terminal?('tomorrow', false, index)) r0 = instantiate_node(Tomorrow,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'tomorrow\'') r0 = nil end node_cache[:tomorrow][start_index] = r0 r0 end def _nt_yesterday start_index = index if node_cache[:yesterday].has_key?(index) cached = node_cache[:yesterday][index] if cached node_cache[:yesterday][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if (match_len = has_terminal?('yesterday', false, index)) r0 = instantiate_node(Yesterday,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'yesterday\'') r0 = nil end node_cache[:yesterday][start_index] = r0 r0 end def _nt_last_next start_index = index if node_cache[:last_next].has_key?(index) cached = node_cache[:last_next][index] if cached node_cache[:last_next][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index r1 = _nt_last if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else r2 = _nt_next if r2 r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true r0 = r2 else @index = i0 r0 = nil end end node_cache[:last_next][start_index] = r0 r0 end def _nt_last start_index = index if node_cache[:last].has_key?(index) cached = node_cache[:last][index] if cached node_cache[:last][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if (match_len = has_terminal?('last', false, index)) r0 = instantiate_node(LastNext,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'last\'') r0 = nil end node_cache[:last][start_index] = r0 r0 end def _nt_next start_index = index if node_cache[:next].has_key?(index) cached = node_cache[:next][index] if cached node_cache[:next][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if (match_len = has_terminal?('next', false, index)) r0 = instantiate_node(LastNext,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'next\'') r0 = nil end node_cache[:next][start_index] = r0 r0 end def _nt_beginning_end start_index = index if node_cache[:beginning_end].has_key?(index) cached = node_cache[:beginning_end][index] if cached node_cache[:beginning_end][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index r1 = _nt_beginning_of if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else r2 = _nt_end_of if r2 r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true r0 = r2 else @index = i0 r0 = nil end end node_cache[:beginning_end][start_index] = r0 r0 end module BeginningOf0 def direction elements[0] end end def _nt_beginning_of start_index = index if node_cache[:beginning_of].has_key?(index) cached = node_cache[:beginning_of][index] if cached node_cache[:beginning_of][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if (match_len = has_terminal?('beginning', false, index)) r1 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'beginning\'') r1 = nil end s0 << r1 if r1 s2, i2 = [], index loop do r3 = _nt_space if r3 s2 << r3 else break end end r2 = instantiate_node(SyntaxNode,input, i2...index, s2) s0 << r2 if r2 if (match_len = has_terminal?('of', false, index)) r4 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'of\'') r4 = nil end s0 << r4 end end if s0.last r0 = instantiate_node(BeginningEnd,input, i0...index, s0) r0.extend(BeginningOf0) else @index = i0 r0 = nil end node_cache[:beginning_of][start_index] = r0 r0 end module EndOf0 def direction elements[0] end end def _nt_end_of start_index = index if node_cache[:end_of].has_key?(index) cached = node_cache[:end_of][index] if cached node_cache[:end_of][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if (match_len = has_terminal?('end', false, index)) r1 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'end\'') r1 = nil end s0 << r1 if r1 s2, i2 = [], index loop do r3 = _nt_space if r3 s2 << r3 else break end end r2 = instantiate_node(SyntaxNode,input, i2...index, s2) s0 << r2 if r2 if (match_len = has_terminal?('of', false, index)) r4 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'of\'') r4 = nil end s0 << r4 end end if s0.last r0 = instantiate_node(BeginningEnd,input, i0...index, s0) r0.extend(EndOf0) else @index = i0 r0 = nil end node_cache[:end_of][start_index] = r0 r0 end def _nt_before_from start_index = index if node_cache[:before_from].has_key?(index) cached = node_cache[:before_from][index] if cached node_cache[:before_from][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index r1 = _nt_before if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else r2 = _nt_from if r2 r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true r0 = r2 else @index = i0 r0 = nil end end node_cache[:before_from][start_index] = r0 r0 end def _nt_before start_index = index if node_cache[:before].has_key?(index) cached = node_cache[:before][index] if cached node_cache[:before][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if (match_len = has_terminal?('before', false, index)) r0 = instantiate_node(BeforeFrom,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'before\'') r0 = nil end node_cache[:before][start_index] = r0 r0 end def _nt_from start_index = index if node_cache[:from].has_key?(index) cached = node_cache[:from][index] if cached node_cache[:from][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if (match_len = has_terminal?('from', false, index)) r0 = instantiate_node(BeforeFrom,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'from\'') r0 = nil end node_cache[:from][start_index] = r0 r0 end def _nt_interval start_index = index if node_cache[:interval].has_key?(index) cached = node_cache[:interval][index] if cached node_cache[:interval][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index r1 = _nt_second_interval if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else r2 = _nt_minute_interval if r2 r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true r0 = r2 else r3 = _nt_hour_interval if r3 r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true r0 = r3 else r4 = _nt_day_interval if r4 r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true r0 = r4 else r5 = _nt_week_interval if r5 r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true r0 = r5 else r6 = _nt_month_interval if r6 r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true r0 = r6 else r7 = _nt_year_interval if r7 r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true r0 = r7 else @index = i0 r0 = nil end end end end end end end node_cache[:interval][start_index] = r0 r0 end module SecondInterval0 end def _nt_second_interval start_index = index if node_cache[:second_interval].has_key?(index) cached = node_cache[:second_interval][index] if cached node_cache[:second_interval][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if (match_len = has_terminal?('second', false, index)) r1 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'second\'') r1 = nil end s0 << r1 if r1 if (match_len = has_terminal?('s', false, index)) r3 = true @index += match_len else terminal_parse_failure('\'s\'') r3 = nil end if r3 r2 = r3 else r2 = instantiate_node(SyntaxNode,input, index...index) end s0 << r2 end if s0.last r0 = instantiate_node(SecondInterval,input, i0...index, s0) r0.extend(SecondInterval0) else @index = i0 r0 = nil end node_cache[:second_interval][start_index] = r0 r0 end module MinuteInterval0 end def _nt_minute_interval start_index = index if node_cache[:minute_interval].has_key?(index) cached = node_cache[:minute_interval][index] if cached node_cache[:minute_interval][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if (match_len = has_terminal?('minute', false, index)) r1 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'minute\'') r1 = nil end s0 << r1 if r1 if (match_len = has_terminal?('s', false, index)) r3 = true @index += match_len else terminal_parse_failure('\'s\'') r3 = nil end if r3 r2 = r3 else r2 = instantiate_node(SyntaxNode,input, index...index) end s0 << r2 end if s0.last r0 = instantiate_node(MinuteInterval,input, i0...index, s0) r0.extend(MinuteInterval0) else @index = i0 r0 = nil end node_cache[:minute_interval][start_index] = r0 r0 end module HourInterval0 end def _nt_hour_interval start_index = index if node_cache[:hour_interval].has_key?(index) cached = node_cache[:hour_interval][index] if cached node_cache[:hour_interval][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if (match_len = has_terminal?('hour', false, index)) r1 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'hour\'') r1 = nil end s0 << r1 if r1 if (match_len = has_terminal?('s', false, index)) r3 = true @index += match_len else terminal_parse_failure('\'s\'') r3 = nil end if r3 r2 = r3 else r2 = instantiate_node(SyntaxNode,input, index...index) end s0 << r2 end if s0.last r0 = instantiate_node(HourInterval,input, i0...index, s0) r0.extend(HourInterval0) else @index = i0 r0 = nil end node_cache[:hour_interval][start_index] = r0 r0 end module DayInterval0 end def _nt_day_interval start_index = index if node_cache[:day_interval].has_key?(index) cached = node_cache[:day_interval][index] if cached node_cache[:day_interval][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if (match_len = has_terminal?('day', false, index)) r1 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'day\'') r1 = nil end s0 << r1 if r1 if (match_len = has_terminal?('s', false, index)) r3 = true @index += match_len else terminal_parse_failure('\'s\'') r3 = nil end if r3 r2 = r3 else r2 = instantiate_node(SyntaxNode,input, index...index) end s0 << r2 end if s0.last r0 = instantiate_node(DayInterval,input, i0...index, s0) r0.extend(DayInterval0) else @index = i0 r0 = nil end node_cache[:day_interval][start_index] = r0 r0 end module WeekInterval0 end def _nt_week_interval start_index = index if node_cache[:week_interval].has_key?(index) cached = node_cache[:week_interval][index] if cached node_cache[:week_interval][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if (match_len = has_terminal?('week', false, index)) r1 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'week\'') r1 = nil end s0 << r1 if r1 if (match_len = has_terminal?('s', false, index)) r3 = true @index += match_len else terminal_parse_failure('\'s\'') r3 = nil end if r3 r2 = r3 else r2 = instantiate_node(SyntaxNode,input, index...index) end s0 << r2 end if s0.last r0 = instantiate_node(WeekInterval,input, i0...index, s0) r0.extend(WeekInterval0) else @index = i0 r0 = nil end node_cache[:week_interval][start_index] = r0 r0 end module MonthInterval0 end def _nt_month_interval start_index = index if node_cache[:month_interval].has_key?(index) cached = node_cache[:month_interval][index] if cached node_cache[:month_interval][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if (match_len = has_terminal?('month', false, index)) r1 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'month\'') r1 = nil end s0 << r1 if r1 if (match_len = has_terminal?('s', false, index)) r3 = true @index += match_len else terminal_parse_failure('\'s\'') r3 = nil end if r3 r2 = r3 else r2 = instantiate_node(SyntaxNode,input, index...index) end s0 << r2 end if s0.last r0 = instantiate_node(MonthInterval,input, i0...index, s0) r0.extend(MonthInterval0) else @index = i0 r0 = nil end node_cache[:month_interval][start_index] = r0 r0 end module YearInterval0 end def _nt_year_interval start_index = index if node_cache[:year_interval].has_key?(index) cached = node_cache[:year_interval][index] if cached node_cache[:year_interval][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if (match_len = has_terminal?('year', false, index)) r1 = instantiate_node(SyntaxNode,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'year\'') r1 = nil end s0 << r1 if r1 if (match_len = has_terminal?('s', false, index)) r3 = true @index += match_len else terminal_parse_failure('\'s\'') r3 = nil end if r3 r2 = r3 else r2 = instantiate_node(SyntaxNode,input, index...index) end s0 << r2 end if s0.last r0 = instantiate_node(YearInterval,input, i0...index, s0) r0.extend(YearInterval0) else @index = i0 r0 = nil end node_cache[:year_interval][start_index] = r0 r0 end def _nt_day_name start_index = index if node_cache[:day_name].has_key?(index) cached = node_cache[:day_name][index] if cached node_cache[:day_name][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index r1 = _nt_long_day_name if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else r2 = _nt_short_day_name if r2 r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true r0 = r2 else @index = i0 r0 = nil end end node_cache[:day_name][start_index] = r0 r0 end def _nt_long_day_name start_index = index if node_cache[:long_day_name].has_key?(index) cached = node_cache[:long_day_name][index] if cached node_cache[:long_day_name][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index if (match_len = has_terminal?('sunday', false, index)) r1 = instantiate_node(DayName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'sunday\'') r1 = nil end if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else if (match_len = has_terminal?('monday', false, index)) r2 = instantiate_node(DayName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'monday\'') r2 = nil end if r2 r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true r0 = r2 else if (match_len = has_terminal?('tuesday', false, index)) r3 = instantiate_node(DayName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'tuesday\'') r3 = nil end if r3 r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true r0 = r3 else if (match_len = has_terminal?('wednesday', false, index)) r4 = instantiate_node(DayName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'wednesday\'') r4 = nil end if r4 r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true r0 = r4 else if (match_len = has_terminal?('thursday', false, index)) r5 = instantiate_node(DayName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'thursday\'') r5 = nil end if r5 r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true r0 = r5 else if (match_len = has_terminal?('friday', false, index)) r6 = instantiate_node(DayName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'friday\'') r6 = nil end if r6 r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true r0 = r6 else if (match_len = has_terminal?('saturday', false, index)) r7 = instantiate_node(DayName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'saturday\'') r7 = nil end if r7 r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true r0 = r7 else @index = i0 r0 = nil end end end end end end end node_cache[:long_day_name][start_index] = r0 r0 end def _nt_short_day_name start_index = index if node_cache[:short_day_name].has_key?(index) cached = node_cache[:short_day_name][index] if cached node_cache[:short_day_name][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index if (match_len = has_terminal?('sun', false, index)) r1 = instantiate_node(DayName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'sun\'') r1 = nil end if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else if (match_len = has_terminal?('mon', false, index)) r2 = instantiate_node(DayName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'mon\'') r2 = nil end if r2 r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true r0 = r2 else if (match_len = has_terminal?('tue', false, index)) r3 = instantiate_node(DayName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'tue\'') r3 = nil end if r3 r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true r0 = r3 else if (match_len = has_terminal?('wed', false, index)) r4 = instantiate_node(DayName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'wed\'') r4 = nil end if r4 r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true r0 = r4 else if (match_len = has_terminal?('thu', false, index)) r5 = instantiate_node(DayName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'thu\'') r5 = nil end if r5 r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true r0 = r5 else if (match_len = has_terminal?('fri', false, index)) r6 = instantiate_node(DayName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'fri\'') r6 = nil end if r6 r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true r0 = r6 else if (match_len = has_terminal?('sat', false, index)) r7 = instantiate_node(DayName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'sat\'') r7 = nil end if r7 r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true r0 = r7 else @index = i0 r0 = nil end end end end end end end node_cache[:short_day_name][start_index] = r0 r0 end def _nt_month_name start_index = index if node_cache[:month_name].has_key?(index) cached = node_cache[:month_name][index] if cached node_cache[:month_name][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index r1 = _nt_long_month_name if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else r2 = _nt_short_month_name if r2 r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true r0 = r2 else @index = i0 r0 = nil end end node_cache[:month_name][start_index] = r0 r0 end def _nt_long_month_name start_index = index if node_cache[:long_month_name].has_key?(index) cached = node_cache[:long_month_name][index] if cached node_cache[:long_month_name][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index if (match_len = has_terminal?('january', false, index)) r1 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'january\'') r1 = nil end if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else if (match_len = has_terminal?('february', false, index)) r2 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'february\'') r2 = nil end if r2 r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true r0 = r2 else if (match_len = has_terminal?('march', false, index)) r3 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'march\'') r3 = nil end if r3 r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true r0 = r3 else if (match_len = has_terminal?('april', false, index)) r4 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'april\'') r4 = nil end if r4 r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true r0 = r4 else if (match_len = has_terminal?('may', false, index)) r5 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'may\'') r5 = nil end if r5 r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true r0 = r5 else if (match_len = has_terminal?('june', false, index)) r6 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'june\'') r6 = nil end if r6 r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true r0 = r6 else if (match_len = has_terminal?('july', false, index)) r7 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'july\'') r7 = nil end if r7 r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true r0 = r7 else if (match_len = has_terminal?('august', false, index)) r8 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'august\'') r8 = nil end if r8 r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true r0 = r8 else if (match_len = has_terminal?('september', false, index)) r9 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'september\'') r9 = nil end if r9 r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true r0 = r9 else if (match_len = has_terminal?('october', false, index)) r10 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'october\'') r10 = nil end if r10 r10 = SyntaxNode.new(input, (index-1)...index) if r10 == true r0 = r10 else if (match_len = has_terminal?('november', false, index)) r11 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'november\'') r11 = nil end if r11 r11 = SyntaxNode.new(input, (index-1)...index) if r11 == true r0 = r11 else if (match_len = has_terminal?('december', false, index)) r12 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'december\'') r12 = nil end if r12 r12 = SyntaxNode.new(input, (index-1)...index) if r12 == true r0 = r12 else @index = i0 r0 = nil end end end end end end end end end end end end node_cache[:long_month_name][start_index] = r0 r0 end def _nt_short_month_name start_index = index if node_cache[:short_month_name].has_key?(index) cached = node_cache[:short_month_name][index] if cached node_cache[:short_month_name][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index if (match_len = has_terminal?('jan', false, index)) r1 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'jan\'') r1 = nil end if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else if (match_len = has_terminal?('feb', false, index)) r2 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'feb\'') r2 = nil end if r2 r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true r0 = r2 else if (match_len = has_terminal?('mar', false, index)) r3 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'mar\'') r3 = nil end if r3 r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true r0 = r3 else if (match_len = has_terminal?('apr', false, index)) r4 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'apr\'') r4 = nil end if r4 r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true r0 = r4 else if (match_len = has_terminal?('may', false, index)) r5 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'may\'') r5 = nil end if r5 r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true r0 = r5 else if (match_len = has_terminal?('jun', false, index)) r6 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'jun\'') r6 = nil end if r6 r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true r0 = r6 else if (match_len = has_terminal?('jul', false, index)) r7 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'jul\'') r7 = nil end if r7 r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true r0 = r7 else if (match_len = has_terminal?('aug', false, index)) r8 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'aug\'') r8 = nil end if r8 r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true r0 = r8 else if (match_len = has_terminal?('sep', false, index)) r9 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'sep\'') r9 = nil end if r9 r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true r0 = r9 else if (match_len = has_terminal?('oct', false, index)) r10 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'oct\'') r10 = nil end if r10 r10 = SyntaxNode.new(input, (index-1)...index) if r10 == true r0 = r10 else if (match_len = has_terminal?('nov', false, index)) r11 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'nov\'') r11 = nil end if r11 r11 = SyntaxNode.new(input, (index-1)...index) if r11 == true r0 = r11 else if (match_len = has_terminal?('dec', false, index)) r12 = instantiate_node(MonthName,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'dec\'') r12 = nil end if r12 r12 = SyntaxNode.new(input, (index-1)...index) if r12 == true r0 = r12 else @index = i0 r0 = nil end end end end end end end end end end end end node_cache[:short_month_name][start_index] = r0 r0 end module ZoneOffset0 end def _nt_zone_offset start_index = index if node_cache[:zone_offset].has_key?(index) cached = node_cache[:zone_offset][index] if cached node_cache[:zone_offset][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if has_terminal?(@regexps[gr = '\A[+-]'] ||= Regexp.new(gr), :regexp, index) r1 = true @index += 1 else terminal_parse_failure('[+-]') r1 = nil end s0 << r1 if r1 s2, i2 = [], index loop do if has_terminal?(@regexps[gr = '\A[\\d]'] ||= Regexp.new(gr), :regexp, index) r3 = true @index += 1 else terminal_parse_failure('[\\d]') r3 = nil end if r3 s2 << r3 else break end if s2.size == 2 break end end if s2.size < 2 @index = i2 r2 = nil else if s2.size < 2 @terminal_failures.pop end r2 = instantiate_node(SyntaxNode,input, i2...index, s2) end s0 << r2 if r2 if (match_len = has_terminal?(':', false, index)) r5 = true @index += match_len else terminal_parse_failure('\':\'') r5 = nil end if r5 r4 = r5 else r4 = instantiate_node(SyntaxNode,input, index...index) end s0 << r4 if r4 s6, i6 = [], index loop do if has_terminal?(@regexps[gr = '\A[\\d]'] ||= Regexp.new(gr), :regexp, index) r7 = true @index += 1 else terminal_parse_failure('[\\d]') r7 = nil end if r7 s6 << r7 else break end if s6.size == 2 break end end if s6.size < 2 @index = i6 r6 = nil else if s6.size < 2 @terminal_failures.pop end r6 = instantiate_node(SyntaxNode,input, i6...index, s6) end s0 << r6 end end end if s0.last r0 = instantiate_node(ZoneOffset,input, i0...index, s0) r0.extend(ZoneOffset0) else @index = i0 r0 = nil end node_cache[:zone_offset][start_index] = r0 r0 end module HourMinuteSecond0 end module HourMinuteSecond1 end def _nt_hour_minute_second start_index = index if node_cache[:hour_minute_second].has_key?(index) cached = node_cache[:hour_minute_second][index] if cached node_cache[:hour_minute_second][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index i1, s1 = index, [] s2, i2 = [], index loop do if has_terminal?(@regexps[gr = '\A[\\d]'] ||= Regexp.new(gr), :regexp, index) r3 = true @index += 1 else terminal_parse_failure('[\\d]') r3 = nil end if r3 s2 << r3 else break end if s2.size == 2 break end end if s2.size < 2 @index = i2 r2 = nil else if s2.size < 2 @terminal_failures.pop end r2 = instantiate_node(SyntaxNode,input, i2...index, s2) end s1 << r2 if r2 if (match_len = has_terminal?(':', false, index)) r4 = true @index += match_len else terminal_parse_failure('\':\'') r4 = nil end s1 << r4 if r4 s5, i5 = [], index loop do if has_terminal?(@regexps[gr = '\A[\\d]'] ||= Regexp.new(gr), :regexp, index) r6 = true @index += 1 else terminal_parse_failure('[\\d]') r6 = nil end if r6 s5 << r6 else break end if s5.size == 2 break end end if s5.size < 2 @index = i5 r5 = nil else if s5.size < 2 @terminal_failures.pop end r5 = instantiate_node(SyntaxNode,input, i5...index, s5) end s1 << r5 if r5 i8, s8 = index, [] if (match_len = has_terminal?(':', false, index)) r9 = true @index += match_len else terminal_parse_failure('\':\'') r9 = nil end s8 << r9 if r9 s10, i10 = [], index loop do if has_terminal?(@regexps[gr = '\A[\\d]'] ||= Regexp.new(gr), :regexp, index) r11 = true @index += 1 else terminal_parse_failure('[\\d]') r11 = nil end if r11 s10 << r11 else break end if s10.size == 2 break end end if s10.size < 2 @index = i10 r10 = nil else if s10.size < 2 @terminal_failures.pop end r10 = instantiate_node(SyntaxNode,input, i10...index, s10) end s8 << r10 end if s8.last r8 = instantiate_node(SyntaxNode,input, i8...index, s8) r8.extend(HourMinuteSecond0) else @index = i8 r8 = nil end if r8 r7 = r8 else r7 = instantiate_node(SyntaxNode,input, index...index) end s1 << r7 end end end if s1.last r1 = instantiate_node(HourMinuteSecond,input, i1...index, s1) r1.extend(HourMinuteSecond1) else @index = i1 r1 = nil end if r1 r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true r0 = r1 else if (match_len = has_terminal?('beginning', false, index)) r12 = instantiate_node(HourMinuteSecond,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'beginning\'') r12 = nil end if r12 r12 = SyntaxNode.new(input, (index-1)...index) if r12 == true r0 = r12 else if (match_len = has_terminal?('end', false, index)) r13 = instantiate_node(HourMinuteSecond,input, index...(index + match_len)) @index += match_len else terminal_parse_failure('\'end\'') r13 = nil end if r13 r13 = SyntaxNode.new(input, (index-1)...index) if r13 == true r0 = r13 else @index = i0 r0 = nil end end end node_cache[:hour_minute_second][start_index] = r0 r0 end def _nt_integer start_index = index if node_cache[:integer].has_key?(index) cached = node_cache[:integer][index] if cached node_cache[:integer][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end s0, i0 = [], index loop do if has_terminal?(@regexps[gr = '\A[\\d]'] ||= Regexp.new(gr), :regexp, index) r1 = true @index += 1 else terminal_parse_failure('[\\d]') r1 = nil end if r1 s0 << r1 else break end end if s0.empty? @index = i0 r0 = nil else r0 = instantiate_node(Int,input, i0...index, s0) end node_cache[:integer][start_index] = r0 r0 end def _nt_space start_index = index if node_cache[:space].has_key?(index) cached = node_cache[:space][index] if cached node_cache[:space][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if has_terminal?(@regexps[gr = '\A[\\s\\t\\n]'] ||= Regexp.new(gr), :regexp, index) r0 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure('[\\s\\t\\n]') r0 = nil end node_cache[:space][start_index] = r0 r0 end end class NaturalTimeLanguageParser < Treetop::Runtime::CompiledParser include NaturalTimeLanguage end end