# Autogenerated from a Treetop grammar. Edits may be lost. #encoding: utf-8 module N3Grammer include Treetop::Runtime def root @root ||= :document end def _nt_document start_index = index if node_cache[:document].has_key?(index) cached = node_cache[:document][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end r0 = _nt_statements node_cache[:document][start_index] = r0 r0 end module Barename0 def barename_start elements[0] end end def _nt_barename start_index = index if node_cache[:barename].has_key?(index) cached = node_cache[:barename][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_barename_start s0 << r1 if r1 s2, i2 = [], index loop do r3 = _nt_barename_tail if r3 s2 << r3 else break end end r2 = instantiate_node(SyntaxNode,input, i2...index, s2) s0 << r2 end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Barename0) else @index = i0 r0 = nil end node_cache[:barename][start_index] = r0 r0 end def _nt_barename_start start_index = index if node_cache[:barename_start].has_key?(index) cached = node_cache[:barename_start][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if has_terminal?('\G[A-Z_a-z\\p{Alpha}]', true, index) r0 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else r0 = nil end node_cache[:barename_start][start_index] = r0 r0 end def _nt_barename_tail start_index = index if node_cache[:barename_tail].has_key?(index) cached = node_cache[:barename_tail][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index r1 = _nt_barename_start if r1 r0 = r1 else if has_terminal?('\G[-0-9\\\\]', true, index) r2 = true @index += 1 else r2 = nil end if r2 r0 = r2 else @index = i0 r0 = nil end end node_cache[:barename_tail][start_index] = r0 r0 end def _nt_hexdigit start_index = index if node_cache[:hexdigit].has_key?(index) cached = node_cache[:hexdigit][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end if has_terminal?('\G[0-9a-fA-F]', true, index) r0 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else r0 = nil end node_cache[:hexdigit][start_index] = r0 r0 end module Integer0 end def _nt_integer start_index = index if node_cache[:integer].has_key?(index) cached = node_cache[:integer][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if has_terminal?('\G[+-]', true, index) r2 = true @index += 1 else r2 = nil end if r2 r1 = r2 else r1 = instantiate_node(SyntaxNode,input, index...index) end s0 << r1 if r1 s3, i3 = [], index loop do if has_terminal?('\G[0-9]', true, index) r4 = true @index += 1 else r4 = nil end if r4 s3 << r4 else break end end if s3.empty? @index = i3 r3 = nil else r3 = instantiate_node(SyntaxNode,input, i3...index, s3) end s0 << r3 end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Integer0) else @index = i0 r0 = nil end node_cache[:integer][start_index] = r0 r0 end module BarenameCsl0 def barename elements[1] end def barename_csl_tail elements[2] end end def _nt_barename_csl start_index = index if node_cache[:barename_csl].has_key?(index) cached = node_cache[:barename_csl][index] if cached 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 r3 = _nt_space if r3 s2 << r3 else break end end if s2.empty? @index = i2 r2 = nil else r2 = instantiate_node(SyntaxNode,input, i2...index, s2) end s1 << r2 if r2 r4 = _nt_barename s1 << r4 if r4 r5 = _nt_barename_csl_tail s1 << r5 end end if s1.last r1 = instantiate_node(SyntaxNode,input, i1...index, s1) r1.extend(BarenameCsl0) else @index = i1 r1 = nil end if r1 r0 = r1 else if has_terminal?("", false, index) r6 = instantiate_node(SyntaxNode,input, index...(index + 0)) @index += 0 else terminal_parse_failure("") r6 = nil end if r6 r0 = r6 else @index = i0 r0 = nil end end node_cache[:barename_csl][start_index] = r0 r0 end module BarenameCslTail0 def barename elements[3] end def barename_csl_tail elements[5] end end def _nt_barename_csl_tail start_index = index if node_cache[:barename_csl_tail].has_key?(index) cached = node_cache[:barename_csl_tail][index] if cached 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 r3 = _nt_space if r3 s2 << r3 else break end end r2 = instantiate_node(SyntaxNode,input, i2...index, s2) s1 << r2 if r2 if has_terminal?(",", false, index) r4 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure(",") r4 = nil end s1 << 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) s1 << r5 if r5 r7 = _nt_barename s1 << 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) s1 << r8 if r8 r10 = _nt_barename_csl_tail s1 << r10 end end end end end if s1.last r1 = instantiate_node(SyntaxNode,input, i1...index, s1) r1.extend(BarenameCslTail0) else @index = i1 r1 = nil end if r1 r0 = r1 else if has_terminal?("", false, index) r11 = instantiate_node(SyntaxNode,input, index...(index + 0)) @index += 0 else terminal_parse_failure("") r11 = nil end if r11 r0 = r11 else @index = i0 r0 = nil end end node_cache[:barename_csl_tail][start_index] = r0 r0 end module Boolean0 end def _nt_boolean start_index = index if node_cache[:boolean].has_key?(index) cached = node_cache[:boolean][index] if cached 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?("@", false, index) r2 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("@") r2 = nil end if r2 s1 << r2 else break end end r1 = instantiate_node(SyntaxNode,input, i1...index, s1) s0 << r1 if r1 i3 = index if has_terminal?("true", false, index) r4 = instantiate_node(SyntaxNode,input, index...(index + 4)) @index += 4 else terminal_parse_failure("true") r4 = nil end if r4 r3 = r4 else if has_terminal?("false", false, index) r5 = instantiate_node(SyntaxNode,input, index...(index + 5)) @index += 5 else terminal_parse_failure("false") r5 = nil end if r5 r3 = r5 else @index = i3 r3 = nil end end s0 << r3 end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Boolean0) else @index = i0 r0 = nil end node_cache[:boolean][start_index] = r0 r0 end module Comment0 end module Comment1 end def _nt_comment start_index = index if node_cache[:comment].has_key?(index) cached = node_cache[:comment][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if has_terminal?('#', false, index) r1 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure('#') r1 = nil end s0 << r1 if r1 s2, i2 = [], index loop do i3, s3 = index, [] i4 = index if has_terminal?('\G[\\n\\r]', true, index) r5 = true @index += 1 else r5 = nil end if r5 r4 = nil else @index = i4 r4 = instantiate_node(SyntaxNode,input, index...index) end s3 << r4 if r4 if index < input_length r6 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("any character") r6 = nil end s3 << r6 end if s3.last r3 = instantiate_node(SyntaxNode,input, i3...index, s3) r3.extend(Comment0) else @index = i3 r3 = nil end if r3 s2 << r3 else break end end r2 = instantiate_node(SyntaxNode,input, i2...index, s2) s0 << r2 end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Comment1) else @index = i0 r0 = nil end node_cache[:comment][start_index] = r0 r0 end module Declaration0 def barename_csl elements[2] end end module Declaration1 def declaration; true; end def keywords; true;end end module Declaration2 def explicituri elements[3] end end module Declaration3 def declaration; true; end def base; true; end end module Declaration4 def nprefix elements[3] end def explicituri elements[6] end end module Declaration5 def declaration; true; end end def _nt_declaration start_index = index if node_cache[:declaration].has_key?(index) cached = node_cache[:declaration][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index i1, s1 = index, [] if has_terminal?("@", false, index) r3 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("@") r3 = nil end if r3 r2 = r3 else r2 = instantiate_node(SyntaxNode,input, index...index) end s1 << r2 if r2 if has_terminal?('keywords', false, index) r4 = instantiate_node(SyntaxNode,input, index...(index + 8)) @index += 8 else terminal_parse_failure('keywords') r4 = nil end s1 << r4 if r4 r5 = _nt_barename_csl s1 << r5 end end if s1.last r1 = instantiate_node(SyntaxNode,input, i1...index, s1) r1.extend(Declaration0) r1.extend(Declaration1) else @index = i1 r1 = nil end if r1 r0 = r1 else i6, s6 = index, [] if has_terminal?("@", false, index) r8 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("@") r8 = nil end if r8 r7 = r8 else r7 = instantiate_node(SyntaxNode,input, index...index) end s6 << r7 if r7 if has_terminal?('base', false, index) r9 = instantiate_node(SyntaxNode,input, index...(index + 4)) @index += 4 else terminal_parse_failure('base') r9 = nil end s6 << r9 if r9 s10, i10 = [], index loop do r11 = _nt_space if r11 s10 << r11 else break end end if s10.empty? @index = i10 r10 = nil else r10 = instantiate_node(SyntaxNode,input, i10...index, s10) end s6 << r10 if r10 r12 = _nt_explicituri s6 << r12 end end end if s6.last r6 = instantiate_node(SyntaxNode,input, i6...index, s6) r6.extend(Declaration2) r6.extend(Declaration3) else @index = i6 r6 = nil end if r6 r0 = r6 else i13, s13 = index, [] if has_terminal?("@", false, index) r15 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("@") r15 = nil end if r15 r14 = r15 else r14 = instantiate_node(SyntaxNode,input, index...index) end s13 << r14 if r14 if has_terminal?('prefix', false, index) r16 = instantiate_node(SyntaxNode,input, index...(index + 6)) @index += 6 else terminal_parse_failure('prefix') r16 = nil end s13 << r16 if r16 s17, i17 = [], index loop do r18 = _nt_space if r18 s17 << r18 else break end end if s17.empty? @index = i17 r17 = nil else r17 = instantiate_node(SyntaxNode,input, i17...index, s17) end s13 << r17 if r17 r20 = _nt_nprefix if r20 r19 = r20 else r19 = instantiate_node(SyntaxNode,input, index...index) end s13 << r19 if r19 if has_terminal?(':', false, index) r21 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure(':') r21 = nil end s13 << r21 if r21 s22, i22 = [], index loop do r23 = _nt_space if r23 s22 << r23 else break end end r22 = instantiate_node(SyntaxNode,input, i22...index, s22) s13 << r22 if r22 r24 = _nt_explicituri s13 << r24 end end end end end end if s13.last r13 = instantiate_node(SyntaxNode,input, i13...index, s13) r13.extend(Declaration4) r13.extend(Declaration5) else @index = i13 r13 = nil end if r13 r0 = r13 else @index = i0 r0 = nil end end end node_cache[:declaration][start_index] = r0 r0 end module Decimal0 def integer elements[0] end end def _nt_decimal start_index = index if node_cache[:decimal].has_key?(index) cached = node_cache[:decimal][index] if cached 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 has_terminal?('.', false, index) r2 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure('.') r2 = nil end s0 << r2 if r2 s3, i3 = [], index loop do if has_terminal?('\G[0-9]', true, index) r4 = true @index += 1 else r4 = nil end if r4 s3 << r4 else break end end if s3.empty? @index = i3 r3 = nil else r3 = instantiate_node(SyntaxNode,input, i3...index, s3) end s0 << r3 end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Decimal0) else @index = i0 r0 = nil end node_cache[:decimal][start_index] = r0 r0 end module Double0 def decimal elements[0] end def integer elements[2] end end def _nt_double start_index = index if node_cache[:double].has_key?(index) cached = node_cache[:double][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] r1 = _nt_decimal s0 << r1 if r1 if has_terminal?('\G[eE]', true, index) r2 = true @index += 1 else r2 = nil end s0 << r2 if r2 r3 = _nt_integer s0 << r3 end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Double0) else @index = i0 r0 = nil end node_cache[:double][start_index] = r0 r0 end module Existential0 def symbol_csl elements[3] end end def _nt_existential start_index = index if node_cache[:existential].has_key?(index) cached = node_cache[:existential][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if has_terminal?("@", false, index) r2 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("@") r2 = nil end if r2 r1 = r2 else r1 = instantiate_node(SyntaxNode,input, index...index) end s0 << r1 if r1 if has_terminal?("forSome", false, index) r3 = instantiate_node(SyntaxNode,input, index...(index + 7)) @index += 7 else terminal_parse_failure("forSome") r3 = nil end s0 << r3 if r3 s4, i4 = [], index loop do r5 = _nt_space if r5 s4 << r5 else break end end if s4.empty? @index = i4 r4 = nil else r4 = instantiate_node(SyntaxNode,input, i4...index, s4) end s0 << r4 if r4 r6 = _nt_symbol_csl s0 << r6 end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Existential0) else @index = i0 r0 = nil end node_cache[:existential][start_index] = r0 r0 end module Explicituri0 def uri elements[1] end end def _nt_explicituri start_index = index if node_cache[:explicituri].has_key?(index) cached = node_cache[:explicituri][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if has_terminal?("<", false, index) r1 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("<") r1 = nil end s0 << r1 if r1 r2 = _nt_URI_Reference s0 << r2 if r2 if has_terminal?(">", false, index) r3 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure(">") r3 = nil end s0 << r3 end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Explicituri0) else @index = i0 r0 = nil end node_cache[:explicituri][start_index] = r0 r0 end module Expression0 def pathitem elements[0] end def expression elements[3] end end module Expression1 def pathitem elements[0] end def expression elements[4] end end module Expression2 def pathitem elements[0] end def expression elements[4] end end module Expression3 def reverse; true; end end def _nt_expression start_index = index if node_cache[:expression].has_key?(index) cached = node_cache[:expression][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index i1, s1 = index, [] r2 = _nt_pathitem s1 << r2 if r2 s3, i3 = [], index loop do r4 = _nt_space if r4 s3 << r4 else break end end r3 = instantiate_node(SyntaxNode,input, i3...index, s3) s1 << r3 if r3 if has_terminal?('.', false, index) r5 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure('.') r5 = nil end s1 << r5 if r5 r6 = _nt_expression s1 << r6 end end end if s1.last r1 = instantiate_node(SyntaxNode,input, i1...index, s1) r1.extend(Expression0) else @index = i1 r1 = nil end if r1 r0 = r1 else i7, s7 = index, [] r8 = _nt_pathitem s7 << r8 if r8 s9, i9 = [], index loop do r10 = _nt_space if r10 s9 << r10 else break end end r9 = instantiate_node(SyntaxNode,input, i9...index, s9) s7 << r9 if r9 if has_terminal?("!", false, index) r11 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("!") r11 = nil end s7 << r11 if r11 s12, i12 = [], index loop do r13 = _nt_space if r13 s12 << r13 else break end end r12 = instantiate_node(SyntaxNode,input, i12...index, s12) s7 << r12 if r12 r14 = _nt_expression s7 << r14 end end end end if s7.last r7 = instantiate_node(SyntaxNode,input, i7...index, s7) r7.extend(Expression1) else @index = i7 r7 = nil end if r7 r0 = r7 else i15, s15 = index, [] r16 = _nt_pathitem s15 << r16 if r16 s17, i17 = [], index loop do r18 = _nt_space if r18 s17 << r18 else break end end r17 = instantiate_node(SyntaxNode,input, i17...index, s17) s15 << r17 if r17 if has_terminal?("^", false, index) r19 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("^") r19 = nil end s15 << r19 if r19 s20, i20 = [], index loop do r21 = _nt_space if r21 s20 << r21 else break end end r20 = instantiate_node(SyntaxNode,input, i20...index, s20) s15 << r20 if r20 r22 = _nt_expression s15 << r22 end end end end if s15.last r15 = instantiate_node(SyntaxNode,input, i15...index, s15) r15.extend(Expression2) r15.extend(Expression3) else @index = i15 r15 = nil end if r15 r0 = r15 else r23 = _nt_pathitem if r23 r0 = r23 else @index = i0 r0 = nil end end end end node_cache[:expression][start_index] = r0 r0 end module Language0 end module Language1 end def _nt_language start_index = index if node_cache[:language].has_key?(index) cached = node_cache[:language][index] if cached 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?('\G[a-zA-Z]', true, index) r2 = true @index += 1 else r2 = nil end if r2 s1 << r2 else break end end if s1.empty? @index = i1 r1 = nil else r1 = instantiate_node(SyntaxNode,input, i1...index, s1) end s0 << r1 if r1 s3, i3 = [], index loop do i4, s4 = index, [] if has_terminal?("-", false, index) r5 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("-") r5 = nil end s4 << r5 if r5 s6, i6 = [], index loop do if has_terminal?('\G[a-zA-Z0-9]', true, index) r7 = true @index += 1 else r7 = nil end if r7 s6 << r7 else break end end if s6.empty? @index = i6 r6 = nil else r6 = instantiate_node(SyntaxNode,input, i6...index, s6) end s4 << r6 end if s4.last r4 = instantiate_node(SyntaxNode,input, i4...index, s4) r4.extend(Language0) else @index = i4 r4 = nil end if r4 s3 << r4 else break end end r3 = instantiate_node(SyntaxNode,input, i3...index, s3) s0 << r3 end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Language1) else @index = i0 r0 = nil end node_cache[:language][start_index] = r0 r0 end module Literal0 def symbol elements[1] end end module Literal1 def language elements[1] end end module Literal2 end def _nt_literal start_index = index if node_cache[:literal].has_key?(index) cached = node_cache[:literal][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] i1 = index r2 = _nt_string_single if r2 r1 = r2 else r3 = _nt_string_multi if r3 r1 = r3 else @index = i1 r1 = nil end end s0 << r1 if r1 i5 = index i6, s6 = index, [] if has_terminal?("^^", false, index) r7 = instantiate_node(SyntaxNode,input, index...(index + 2)) @index += 2 else terminal_parse_failure("^^") r7 = nil end s6 << r7 if r7 r8 = _nt_symbol s6 << r8 end if s6.last r6 = instantiate_node(SyntaxNode,input, i6...index, s6) r6.extend(Literal0) else @index = i6 r6 = nil end if r6 r5 = r6 else i9, s9 = index, [] if has_terminal?("@", false, index) r10 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("@") r10 = nil end s9 << r10 if r10 r11 = _nt_language s9 << r11 end if s9.last r9 = instantiate_node(SyntaxNode,input, i9...index, s9) r9.extend(Literal1) else @index = i9 r9 = nil end if r9 r5 = r9 else @index = i5 r5 = nil end end if r5 r4 = r5 else r4 = instantiate_node(SyntaxNode,input, index...index) end s0 << r4 end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Literal2) else @index = i0 r0 = nil end node_cache[:literal][start_index] = r0 r0 end def _nt_localname start_index = index if node_cache[:localname].has_key?(index) cached = node_cache[:localname][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end r0 = _nt_barename node_cache[:localname][start_index] = r0 r0 end def _nt_nprefix start_index = index if node_cache[:nprefix].has_key?(index) cached = node_cache[:nprefix][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end r0 = _nt_barename node_cache[:nprefix][start_index] = r0 r0 end module Numericliteral0 def numericliteral; "double"; end end module Numericliteral1 def numericliteral; "decimal"; end end module Numericliteral2 def numericliteral; "integer"; end end def _nt_numericliteral start_index = index if node_cache[:numericliteral].has_key?(index) cached = node_cache[:numericliteral][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index r1 = _nt_double r1.extend(Numericliteral0) if r1 r0 = r1 else r2 = _nt_decimal r2.extend(Numericliteral1) if r2 r0 = r2 else r3 = _nt_integer r3.extend(Numericliteral2) if r3 r0 = r3 else @index = i0 r0 = nil end end end node_cache[:numericliteral][start_index] = r0 r0 end def _nt_object start_index = index if node_cache[:object].has_key?(index) cached = node_cache[:object][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end r0 = _nt_expression node_cache[:object][start_index] = r0 r0 end module ObjectList0 def object elements[0] end def object_list elements[4] end end def _nt_object_list start_index = index if node_cache[:object_list].has_key?(index) cached = node_cache[:object_list][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index i1, s1 = index, [] r2 = _nt_object s1 << r2 if r2 s3, i3 = [], index loop do r4 = _nt_space if r4 s3 << r4 else break end end r3 = instantiate_node(SyntaxNode,input, i3...index, s3) s1 << r3 if r3 if has_terminal?(",", false, index) r5 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure(",") r5 = nil end s1 << r5 if r5 s6, i6 = [], index loop do r7 = _nt_space if r7 s6 << r7 else break end end r6 = instantiate_node(SyntaxNode,input, i6...index, s6) s1 << r6 if r6 r8 = _nt_object_list s1 << r8 end end end end if s1.last r1 = instantiate_node(SyntaxNode,input, i1...index, s1) r1.extend(ObjectList0) else @index = i1 r1 = nil end if r1 r0 = r1 else r9 = _nt_object if r9 r0 = r9 else @index = i0 r0 = nil end end node_cache[:object_list][start_index] = r0 r0 end module Pathitem0 def boolean; true; end end module Pathitem1 def literal; true; end end module Pathitem2 end module Pathitem3 def anonnode; true; end end module Pathitem4 def property_list elements[2] end end module Pathitem5 def anonnode; true; end end module Pathitem6 def statements elements[2] end end module Pathitem7 def anonnode; true; end end module Pathitem8 def path_list elements[2] end end module Pathitem9 def anonnode; true; end end def _nt_pathitem start_index = index if node_cache[:pathitem].has_key?(index) cached = node_cache[:pathitem][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index r1 = _nt_boolean r1.extend(Pathitem0) if r1 r0 = r1 else r2 = _nt_literal r2.extend(Pathitem1) if r2 r0 = r2 else r3 = _nt_numericliteral if r3 r0 = r3 else r4 = _nt_symbol if r4 r0 = r4 else i5, s5 = index, [] if has_terminal?("[", false, index) r6 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("[") r6 = nil end s5 << r6 if r6 s7, i7 = [], index loop do r8 = _nt_space if r8 s7 << r8 else break end end r7 = instantiate_node(SyntaxNode,input, i7...index, s7) s5 << r7 if r7 if has_terminal?("]", false, index) r9 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("]") r9 = nil end s5 << r9 end end if s5.last r5 = instantiate_node(SyntaxNode,input, i5...index, s5) r5.extend(Pathitem2) r5.extend(Pathitem3) else @index = i5 r5 = nil end if r5 r0 = r5 else i10, s10 = index, [] if has_terminal?("[", false, index) r11 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("[") r11 = nil end s10 << r11 if r11 s12, i12 = [], index loop do r13 = _nt_space if r13 s12 << r13 else break end end r12 = instantiate_node(SyntaxNode,input, i12...index, s12) s10 << r12 if r12 r14 = _nt_property_list s10 << r14 if r14 s15, i15 = [], index loop do r16 = _nt_space if r16 s15 << r16 else break end end r15 = instantiate_node(SyntaxNode,input, i15...index, s15) s10 << r15 if r15 if has_terminal?("]", false, index) r17 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("]") r17 = nil end s10 << r17 end end end end if s10.last r10 = instantiate_node(SyntaxNode,input, i10...index, s10) r10.extend(Pathitem4) r10.extend(Pathitem5) else @index = i10 r10 = nil end if r10 r0 = r10 else i18, s18 = index, [] if has_terminal?("{", false, index) r19 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("{") r19 = nil end s18 << r19 if r19 s20, i20 = [], index loop do r21 = _nt_space if r21 s20 << r21 else break end end r20 = instantiate_node(SyntaxNode,input, i20...index, s20) s18 << r20 if r20 r22 = _nt_statements s18 << r22 if r22 s23, i23 = [], index loop do r24 = _nt_space if r24 s23 << r24 else break end end r23 = instantiate_node(SyntaxNode,input, i23...index, s23) s18 << r23 if r23 if has_terminal?("}", false, index) r25 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("}") r25 = nil end s18 << r25 end end end end if s18.last r18 = instantiate_node(SyntaxNode,input, i18...index, s18) r18.extend(Pathitem6) r18.extend(Pathitem7) else @index = i18 r18 = nil end if r18 r0 = r18 else i26, s26 = index, [] if has_terminal?("(", false, index) r27 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("(") r27 = nil end s26 << r27 if r27 s28, i28 = [], index loop do r29 = _nt_space if r29 s28 << r29 else break end end r28 = instantiate_node(SyntaxNode,input, i28...index, s28) s26 << r28 if r28 r30 = _nt_path_list s26 << r30 if r30 s31, i31 = [], index loop do r32 = _nt_space if r32 s31 << r32 else break end end r31 = instantiate_node(SyntaxNode,input, i31...index, s31) s26 << r31 if r31 if has_terminal?(")", false, index) r33 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure(")") r33 = nil end s26 << r33 end end end end if s26.last r26 = instantiate_node(SyntaxNode,input, i26...index, s26) r26.extend(Pathitem8) r26.extend(Pathitem9) else @index = i26 r26 = nil end if r26 r0 = r26 else @index = i0 r0 = nil end end end end end end end end node_cache[:pathitem][start_index] = r0 r0 end module PathList0 def expression elements[0] end def path_list elements[2] end end def _nt_path_list start_index = index if node_cache[:path_list].has_key?(index) cached = node_cache[:path_list][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index i1, s1 = index, [] r2 = _nt_expression s1 << r2 if r2 s3, i3 = [], index loop do r4 = _nt_space if r4 s3 << r4 else break end end r3 = instantiate_node(SyntaxNode,input, i3...index, s3) s1 << r3 if r3 r5 = _nt_path_list s1 << r5 end end if s1.last r1 = instantiate_node(SyntaxNode,input, i1...index, s1) r1.extend(PathList0) else @index = i1 r1 = nil end if r1 r0 = r1 else if has_terminal?("", false, index) r6 = instantiate_node(SyntaxNode,input, index...(index + 0)) @index += 0 else terminal_parse_failure("") r6 = nil end if r6 r0 = r6 else @index = i0 r0 = nil end end node_cache[:path_list][start_index] = r0 r0 end def _nt_prop start_index = index if node_cache[:prop].has_key?(index) cached = node_cache[:prop][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end r0 = _nt_expression node_cache[:prop][start_index] = r0 r0 end module PropertyList0 def verb elements[0] end def object_list elements[2] end def property_list elements[6] end end module PropertyList1 def verb elements[0] end def object_list elements[2] end end module PropertyList2 def verb elements[0] end end module PropertyList3 def object_missing; true; end end def _nt_property_list start_index = index if node_cache[:property_list].has_key?(index) cached = node_cache[:property_list][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index i1, s1 = index, [] r2 = _nt_verb s1 << r2 if r2 s3, i3 = [], index loop do r4 = _nt_space if r4 s3 << r4 else break end end r3 = instantiate_node(SyntaxNode,input, i3...index, s3) s1 << r3 if r3 r5 = _nt_object_list s1 << r5 if r5 s6, i6 = [], index loop do r7 = _nt_space if r7 s6 << r7 else break end end r6 = instantiate_node(SyntaxNode,input, i6...index, s6) s1 << r6 if r6 s8, i8 = [], index loop do if has_terminal?(";", false, index) r9 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure(";") r9 = nil end if r9 s8 << r9 else break end end if s8.empty? @index = i8 r8 = nil else r8 = instantiate_node(SyntaxNode,input, i8...index, s8) end s1 << r8 if r8 s10, i10 = [], index loop do r11 = _nt_space if r11 s10 << r11 else break end end r10 = instantiate_node(SyntaxNode,input, i10...index, s10) s1 << r10 if r10 r12 = _nt_property_list s1 << r12 end end end end end end if s1.last r1 = instantiate_node(SyntaxNode,input, i1...index, s1) r1.extend(PropertyList0) else @index = i1 r1 = nil end if r1 r0 = r1 else i13, s13 = index, [] r14 = _nt_verb s13 << r14 if r14 s15, i15 = [], index loop do r16 = _nt_space if r16 s15 << r16 else break end end r15 = instantiate_node(SyntaxNode,input, i15...index, s15) s13 << r15 if r15 r17 = _nt_object_list s13 << r17 if r17 s18, i18 = [], index loop do r19 = _nt_space if r19 s18 << r19 else break end end r18 = instantiate_node(SyntaxNode,input, i18...index, s18) s13 << r18 if r18 s20, i20 = [], index loop do if has_terminal?(";", false, index) r21 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure(";") r21 = nil end if r21 s20 << r21 else break end end r20 = instantiate_node(SyntaxNode,input, i20...index, s20) s13 << r20 end end end end if s13.last r13 = instantiate_node(SyntaxNode,input, i13...index, s13) r13.extend(PropertyList1) else @index = i13 r13 = nil end if r13 r0 = r13 else i22, s22 = index, [] r23 = _nt_verb s22 << r23 if r23 s24, i24 = [], index loop do r25 = _nt_space if r25 s24 << r25 else break end end r24 = instantiate_node(SyntaxNode,input, i24...index, s24) s22 << r24 if r24 s26, i26 = [], index loop do if has_terminal?(";", false, index) r27 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure(";") r27 = nil end if r27 s26 << r27 else break end end r26 = instantiate_node(SyntaxNode,input, i26...index, s26) s22 << r26 end end if s22.last r22 = instantiate_node(SyntaxNode,input, i22...index, s22) r22.extend(PropertyList2) r22.extend(PropertyList3) else @index = i22 r22 = nil end if r22 r0 = r22 else if has_terminal?("", false, index) r28 = instantiate_node(SyntaxNode,input, index...(index + 0)) @index += 0 else terminal_parse_failure("") r28 = nil end if r28 r0 = r28 else @index = i0 r0 = nil end end end end node_cache[:property_list][start_index] = r0 r0 end module Qname0 def nprefix elements[0] end def localname elements[2] end end module Qname1 def nprefix elements[0] end end module Qname2 def text_value; ""; end end module Qname3 end module Qname4 def barename; true; end end def _nt_qname start_index = index if node_cache[:qname].has_key?(index) cached = node_cache[:qname][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index i1, s1 = index, [] r2 = _nt_nprefix s1 << r2 if r2 if has_terminal?(":", false, index) r3 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure(":") r3 = nil end s1 << r3 if r3 r4 = _nt_localname s1 << r4 end end if s1.last r1 = instantiate_node(SyntaxNode,input, i1...index, s1) r1.extend(Qname0) else @index = i1 r1 = nil end if r1 r0 = r1 else i5, s5 = index, [] r6 = _nt_nprefix s5 << r6 if r6 if has_terminal?(':', false, index) r7 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure(':') r7 = nil end s5 << r7 end if s5.last r5 = instantiate_node(SyntaxNode,input, i5...index, s5) r5.extend(Qname1) r5.extend(Qname2) else @index = i5 r5 = nil end if r5 r0 = r5 else i8, s8 = index, [] if has_terminal?(':', false, index) r9 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure(':') r9 = nil end s8 << r9 if r9 s10, i10 = [], index loop do r11 = _nt_localname if r11 s10 << r11 else break end end r10 = instantiate_node(SyntaxNode,input, i10...index, s10) s8 << r10 end if s8.last r8 = instantiate_node(SyntaxNode,input, i8...index, s8) r8.extend(Qname3) else @index = i8 r8 = nil end if r8 r0 = r8 else r12 = _nt_localname r12.extend(Qname4) if r12 r0 = r12 else @index = i0 r0 = nil end end end end node_cache[:qname][start_index] = r0 r0 end module SimpleStatement0 def subject elements[0] end def property_list elements[2] end end def _nt_simpleStatement start_index = index if node_cache[:simpleStatement].has_key?(index) cached = node_cache[:simpleStatement][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index i1, s1 = index, [] r2 = _nt_subject s1 << r2 if r2 s3, i3 = [], index loop do r4 = _nt_space if r4 s3 << r4 else break end end if s3.empty? @index = i3 r3 = nil else r3 = instantiate_node(SyntaxNode,input, i3...index, s3) end s1 << r3 if r3 r5 = _nt_property_list s1 << r5 end end if s1.last r1 = instantiate_node(SyntaxNode,input, i1...index, s1) r1.extend(SimpleStatement0) else @index = i1 r1 = nil end if r1 r0 = r1 else r6 = _nt_subject if r6 r0 = r6 else @index = i0 r0 = nil end end node_cache[:simpleStatement][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 cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index s1, i1 = [], index loop do if has_terminal?('\G[ \\t\\n\\r]', true, index) r2 = true @index += 1 else r2 = nil end if r2 s1 << r2 else break end end if s1.empty? @index = i1 r1 = nil else r1 = instantiate_node(SyntaxNode,input, i1...index, s1) end if r1 r0 = r1 else r3 = _nt_comment if r3 r0 = r3 else @index = i0 r0 = nil end end node_cache[:space][start_index] = r0 r0 end def _nt_statement start_index = index if node_cache[:statement].has_key?(index) cached = node_cache[:statement][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index r1 = _nt_declaration if r1 r0 = r1 else r2 = _nt_existential if r2 r0 = r2 else r3 = _nt_simpleStatement if r3 r0 = r3 else r4 = _nt_universal if r4 r0 = r4 else @index = i0 r0 = nil end end end end node_cache[:statement][start_index] = r0 r0 end module Statements0 end module Statements1 def statement elements[0] end end def _nt_statements start_index = index if node_cache[:statements].has_key?(index) cached = node_cache[:statements][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end s0, i0 = [], index loop do i1 = index r2 = _nt_space if r2 r1 = r2 else i3, s3 = index, [] r4 = _nt_statement s3 << 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) s3 << r5 if r5 i8, s8 = index, [] if has_terminal?('.', false, index) r9 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure('.') r9 = nil end s8 << r9 if r9 s10, i10 = [], index loop do r11 = _nt_space if r11 s10 << r11 else break end end r10 = instantiate_node(SyntaxNode,input, i10...index, s10) s8 << r10 end if s8.last r8 = instantiate_node(SyntaxNode,input, i8...index, s8) r8.extend(Statements0) else @index = i8 r8 = nil end if r8 r7 = r8 else r7 = instantiate_node(SyntaxNode,input, index...index) end s3 << r7 end end if s3.last r3 = instantiate_node(SyntaxNode,input, i3...index, s3) r3.extend(Statements1) else @index = i3 r3 = nil end if r3 r1 = r3 else @index = i1 r1 = nil end end if r1 s0 << r1 else break end end r0 = instantiate_node(SyntaxNode,input, i0...index, s0) node_cache[:statements][start_index] = r0 r0 end module StringSingle0 end module StringSingle1 end def _nt_string_single start_index = index if node_cache[:string_single].has_key?(index) cached = node_cache[:string_single][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index i1, s1 = index, [] if has_terminal?('""', false, index) r2 = instantiate_node(SyntaxNode,input, index...(index + 2)) @index += 2 else terminal_parse_failure('""') r2 = nil end s1 << r2 if r2 i3 = index if has_terminal?('\G["]', true, index) r4 = true @index += 1 else r4 = nil end if r4 r3 = nil else @index = i3 r3 = instantiate_node(SyntaxNode,input, index...index) end s1 << r3 end if s1.last r1 = instantiate_node(SyntaxNode,input, i1...index, s1) r1.extend(StringSingle0) else @index = i1 r1 = nil end if r1 r0 = r1 else i5, s5 = index, [] if has_terminal?('"', false, index) r6 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure('"') r6 = nil end s5 << r6 if r6 s7, i7 = [], index loop do r8 = _nt_string_single_char if r8 s7 << r8 else break end end if s7.empty? @index = i7 r7 = nil else r7 = instantiate_node(SyntaxNode,input, i7...index, s7) end s5 << r7 if r7 if has_terminal?('"', false, index) r9 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure('"') r9 = nil end s5 << r9 end end if s5.last r5 = instantiate_node(SyntaxNode,input, i5...index, s5) r5.extend(StringSingle1) else @index = i5 r5 = nil end if r5 r0 = r5 else @index = i0 r0 = nil end end node_cache[:string_single][start_index] = r0 r0 end module StringSingleChar0 end module StringSingleChar1 def hexdigit1 elements[1] end def hexdigit2 elements[2] end def hexdigit3 elements[3] end def hexdigit4 elements[4] end end module StringSingleChar2 def hexdigit1 elements[2] end def hexdigit2 elements[3] end def hexdigit3 elements[4] end def hexdigit4 elements[5] end def hexdigit5 elements[6] end def hexdigit6 elements[7] end end module StringSingleChar3 end def _nt_string_single_char start_index = index if node_cache[:string_single_char].has_key?(index) cached = node_cache[:string_single_char][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] i1 = index if has_terminal?('\G["\\n\\r]', true, index) r2 = true @index += 1 else r2 = nil end if r2 r1 = nil else @index = i1 r1 = instantiate_node(SyntaxNode,input, index...index) end s0 << r1 if r1 i3 = index i4 = index i5, s5 = index, [] if has_terminal?("\\", false, index) r6 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("\\") r6 = nil end s5 << r6 if r6 if has_terminal?('\G[\\\\\\"bfnrt]', true, index) r7 = true @index += 1 else r7 = nil end s5 << r7 end if s5.last r5 = instantiate_node(SyntaxNode,input, i5...index, s5) r5.extend(StringSingleChar0) else @index = i5 r5 = nil end if r5 r4 = r5 else i8, s8 = index, [] if has_terminal?("u", false, index) r9 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("u") r9 = nil end s8 << r9 if r9 r10 = _nt_hexdigit s8 << r10 if r10 r11 = _nt_hexdigit s8 << r11 if r11 r12 = _nt_hexdigit s8 << r12 if r12 r13 = _nt_hexdigit s8 << r13 end end end end if s8.last r8 = instantiate_node(SyntaxNode,input, i8...index, s8) r8.extend(StringSingleChar1) else @index = i8 r8 = nil end if r8 r4 = r8 else i14, s14 = index, [] if has_terminal?("U", false, index) r15 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("U") r15 = nil end s14 << r15 if r15 if has_terminal?("00", false, index) r16 = instantiate_node(SyntaxNode,input, index...(index + 2)) @index += 2 else terminal_parse_failure("00") r16 = nil end s14 << r16 if r16 r17 = _nt_hexdigit s14 << r17 if r17 r18 = _nt_hexdigit s14 << r18 if r18 r19 = _nt_hexdigit s14 << r19 if r19 r20 = _nt_hexdigit s14 << r20 if r20 r21 = _nt_hexdigit s14 << r21 if r21 r22 = _nt_hexdigit s14 << r22 end end end end end end end if s14.last r14 = instantiate_node(SyntaxNode,input, i14...index, s14) r14.extend(StringSingleChar2) else @index = i14 r14 = nil end if r14 r4 = r14 else @index = i4 r4 = nil end end end if r4 r3 = r4 else if index < input_length r23 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("any character") r23 = nil end if r23 r3 = r23 else @index = i3 r3 = nil end end s0 << r3 end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(StringSingleChar3) else @index = i0 r0 = nil end node_cache[:string_single_char][start_index] = r0 r0 end module StringMulti0 end def _nt_string_multi start_index = index if node_cache[:string_multi].has_key?(index) cached = node_cache[:string_multi][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if has_terminal?('"""', false, index) r1 = instantiate_node(SyntaxNode,input, index...(index + 3)) @index += 3 else terminal_parse_failure('"""') r1 = nil end s0 << r1 if r1 s2, i2 = [], index loop do r3 = _nt_string_multi_single_char if r3 s2 << r3 else break end end r2 = instantiate_node(SyntaxNode,input, i2...index, s2) s0 << r2 if r2 if has_terminal?('"""', false, index) r4 = instantiate_node(SyntaxNode,input, index...(index + 3)) @index += 3 else terminal_parse_failure('"""') r4 = nil end s0 << r4 end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(StringMulti0) else @index = i0 r0 = nil end node_cache[:string_multi][start_index] = r0 r0 end module StringMultiSingleChar0 end def _nt_string_multi_single_char start_index = index if node_cache[:string_multi_single_char].has_key?(index) cached = node_cache[:string_multi_single_char][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index if has_terminal?("\\\"", false, index) r1 = instantiate_node(SyntaxNode,input, index...(index + 2)) @index += 2 else terminal_parse_failure("\\\"") r1 = nil end if r1 r0 = r1 else i2, s2 = index, [] i3 = index if has_terminal?('"""', false, index) r4 = instantiate_node(SyntaxNode,input, index...(index + 3)) @index += 3 else terminal_parse_failure('"""') r4 = nil end if r4 r3 = nil else @index = i3 r3 = instantiate_node(SyntaxNode,input, index...index) end s2 << r3 if r3 if index < input_length r5 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("any character") r5 = nil end s2 << r5 end if s2.last r2 = instantiate_node(SyntaxNode,input, i2...index, s2) r2.extend(StringMultiSingleChar0) else @index = i2 r2 = nil end if r2 r0 = r2 else @index = i0 r0 = nil end end node_cache[:string_multi_single_char][start_index] = r0 r0 end def _nt_subject start_index = index if node_cache[:subject].has_key?(index) cached = node_cache[:subject][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end r0 = _nt_expression node_cache[:subject][start_index] = r0 r0 end def _nt_symbol start_index = index if node_cache[:symbol].has_key?(index) cached = node_cache[:symbol][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index r1 = _nt_qname if r1 r0 = r1 else r2 = _nt_explicituri if r2 r0 = r2 else @index = i0 r0 = nil end end node_cache[:symbol][start_index] = r0 r0 end module SymbolCsl0 def symbol elements[0] end def symbol_csl elements[4] end end def _nt_symbol_csl start_index = index if node_cache[:symbol_csl].has_key?(index) cached = node_cache[:symbol_csl][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index i1, s1 = index, [] r2 = _nt_symbol s1 << r2 if r2 s3, i3 = [], index loop do r4 = _nt_space if r4 s3 << r4 else break end end r3 = instantiate_node(SyntaxNode,input, i3...index, s3) s1 << r3 if r3 if has_terminal?(",", false, index) r5 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure(",") r5 = nil end s1 << r5 if r5 s6, i6 = [], index loop do r7 = _nt_space if r7 s6 << r7 else break end end r6 = instantiate_node(SyntaxNode,input, i6...index, s6) s1 << r6 if r6 r8 = _nt_symbol_csl s1 << r8 end end end end if s1.last r1 = instantiate_node(SyntaxNode,input, i1...index, s1) r1.extend(SymbolCsl0) else @index = i1 r1 = nil end if r1 r0 = r1 else r9 = _nt_symbol if r9 r0 = r9 else @index = i0 r0 = nil end end node_cache[:symbol_csl][start_index] = r0 r0 end module Verb0 def prop elements[3] end end module Verb1 def prop elements[3] end end module Verb2 # is xxx of def invert; true; end end module Verb3 end module Verb4 def invert; true; end end def _nt_verb start_index = index if node_cache[:verb].has_key?(index) cached = node_cache[:verb][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0 = index i1, s1 = index, [] if has_terminal?("@", false, index) r3 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("@") r3 = nil end if r3 r2 = r3 else r2 = instantiate_node(SyntaxNode,input, index...index) end s1 << r2 if r2 if has_terminal?("has", false, index) r4 = instantiate_node(SyntaxNode,input, index...(index + 3)) @index += 3 else terminal_parse_failure("has") r4 = nil end s1 << r4 if r4 s5, i5 = [], index loop do r6 = _nt_space if r6 s5 << r6 else break end end if s5.empty? @index = i5 r5 = nil else r5 = instantiate_node(SyntaxNode,input, i5...index, s5) end s1 << r5 if r5 r7 = _nt_prop s1 << r7 end end end if s1.last r1 = instantiate_node(SyntaxNode,input, i1...index, s1) r1.extend(Verb0) else @index = i1 r1 = nil end if r1 r0 = r1 else i8, s8 = index, [] if has_terminal?("@", false, index) r10 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("@") r10 = nil end if r10 r9 = r10 else r9 = instantiate_node(SyntaxNode,input, index...index) end s8 << r9 if r9 if has_terminal?("is", false, index) r11 = instantiate_node(SyntaxNode,input, index...(index + 2)) @index += 2 else terminal_parse_failure("is") r11 = nil end s8 << r11 if r11 s12, i12 = [], index loop do r13 = _nt_space if r13 s12 << r13 else break end end if s12.empty? @index = i12 r12 = nil else r12 = instantiate_node(SyntaxNode,input, i12...index, s12) end s8 << r12 if r12 r14 = _nt_prop s8 << r14 if r14 s15, i15 = [], index loop do r16 = _nt_space if r16 s15 << r16 else break end end if s15.empty? @index = i15 r15 = nil else r15 = instantiate_node(SyntaxNode,input, i15...index, s15) end s8 << r15 if r15 if has_terminal?("@", false, index) r18 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("@") r18 = nil end if r18 r17 = r18 else r17 = instantiate_node(SyntaxNode,input, index...index) end s8 << r17 if r17 if has_terminal?("of", false, index) r19 = instantiate_node(SyntaxNode,input, index...(index + 2)) @index += 2 else terminal_parse_failure("of") r19 = nil end s8 << r19 end end end end end end if s8.last r8 = instantiate_node(SyntaxNode,input, i8...index, s8) r8.extend(Verb1) r8.extend(Verb2) else @index = i8 r8 = nil end if r8 r0 = r8 else i20, s20 = index, [] if has_terminal?("@", false, index) r22 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("@") r22 = nil end if r22 r21 = r22 else r21 = instantiate_node(SyntaxNode,input, index...index) end s20 << r21 if r21 if has_terminal?("a", false, index) r23 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("a") r23 = nil end s20 << r23 if r23 i24 = index if has_terminal?(":", false, index) r25 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure(":") r25 = nil end if r25 r24 = nil else @index = i24 r24 = instantiate_node(SyntaxNode,input, index...index) end s20 << r24 end end if s20.last r20 = instantiate_node(SyntaxNode,input, i20...index, s20) r20.extend(Verb3) else @index = i20 r20 = nil end if r20 r0 = r20 else if has_terminal?("=>", false, index) r26 = instantiate_node(SyntaxNode,input, index...(index + 2)) @index += 2 else terminal_parse_failure("=>") r26 = nil end if r26 r0 = r26 else if has_terminal?("<=", false, index) r27 = instantiate_node(SyntaxNode,input, index...(index + 2)) r27.extend(Verb4) @index += 2 else terminal_parse_failure("<=") r27 = nil end if r27 r0 = r27 else if has_terminal?("=", false, index) r28 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("=") r28 = nil end if r28 r0 = r28 else r29 = _nt_prop if r29 r0 = r29 else @index = i0 r0 = nil end end end end end end end node_cache[:verb][start_index] = r0 r0 end module Universal0 def symbol_csl elements[3] end end def _nt_universal start_index = index if node_cache[:universal].has_key?(index) cached = node_cache[:universal][index] if cached cached = SyntaxNode.new(input, index...(index + 1)) if cached == true @index = cached.interval.end end return cached end i0, s0 = index, [] if has_terminal?("@", false, index) r2 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("@") r2 = nil end if r2 r1 = r2 else r1 = instantiate_node(SyntaxNode,input, index...index) end s0 << r1 if r1 if has_terminal?("forAll", false, index) r3 = instantiate_node(SyntaxNode,input, index...(index + 6)) @index += 6 else terminal_parse_failure("forAll") r3 = nil end s0 << r3 if r3 s4, i4 = [], index loop do r5 = _nt_space if r5 s4 << r5 else break end end if s4.empty? @index = i4 r4 = nil else r4 = instantiate_node(SyntaxNode,input, i4...index, s4) end s0 << r4 if r4 r6 = _nt_symbol_csl s0 << r6 end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Universal0) else @index = i0 r0 = nil end node_cache[:universal][start_index] = r0 r0 end def _nt_URI_Reference start_index = index if node_cache[:URI_Reference].has_key?(index) cached = node_cache[:URI_Reference][index] if cached 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?('\G[^{}<>]', true, index) r1 = true @index += 1 else r1 = nil end if r1 s0 << r1 else break end end r0 = instantiate_node(SyntaxNode,input, i0...index, s0) node_cache[:URI_Reference][start_index] = r0 r0 end end class N3GrammerParser < Treetop::Runtime::CompiledParser include N3Grammer end