# Autogenerated from a Treetop grammar. Edits may be lost. # Treetop (http://treetop.rubyforge.org/) grammar for package definitions in v1 # format. # Some aspects of this grammar are significantly dumber than they could be # because: # # * We want to treat statements as identically as possible to their # command-line equivalents. # * Treetop parse errors are pretty inscrutable at times and we can make # error messages clearer by validating a lot of the terminals ourselves. require 'treetop' require 'fig/grammar/base' require 'fig/grammar/version' module Fig module Grammar module V1 include Treetop::Runtime def root @root ||= :package end include Fig::Grammar::Base include Fig::Grammar::Version module Package0 def optional_ws_or_comment1 elements[0] end def grammar_version elements[1] end def statements elements[2] end def optional_ws_or_comment2 elements[3] end end module Package1 def to_package(directory, build_state) return build_state.new_package_statement( directory, grammar_version, statements ) end end def _nt_package start_index = index if node_cache[:package].has_key?(index) cached = node_cache[:package][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_optional_ws_or_comment s0 << r1 if r1 r3 = _nt_grammar_version if r3 r2 = r3 else r2 = instantiate_node(SyntaxNode,input, index...index) end s0 << r2 if r2 s4, i4 = [], index loop do r5 = _nt_package_statement_with_ws if r5 s4 << r5 else break end end r4 = instantiate_node(SyntaxNode,input, i4...index, s4) s0 << r4 if r4 r6 = _nt_optional_ws_or_comment s0 << r6 end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Package0) r0.extend(Package1) else @index = i0 r0 = nil end node_cache[:package][start_index] = r0 r0 end module PackageStatementWithWs0 def package_statement elements[0] end end module PackageStatementWithWs1 def to_package_statement(build_state) return package_statement.to_package_statement(build_state) end end def _nt_package_statement_with_ws start_index = index if node_cache[:package_statement_with_ws].has_key?(index) cached = node_cache[:package_statement_with_ws][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_package_statement s0 << r1 if r1 s2, i2 = [], index loop do r3 = _nt_ws_or_comment 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 s0 << r2 end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(PackageStatementWithWs0) r0.extend(PackageStatementWithWs1) else @index = i0 r0 = nil end node_cache[:package_statement_with_ws][start_index] = r0 r0 end def _nt_package_statement start_index = index if node_cache[:package_statement].has_key?(index) cached = node_cache[:package_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_archive if r1 r0 = r1 else r2 = _nt_resource if r2 r0 = r2 else r3 = _nt_retrieve if r3 r0 = r3 else r4 = _nt_config if r4 r0 = r4 else @index = i0 r0 = nil end end end end node_cache[:package_statement][start_index] = r0 r0 end module Archive0 def statement_start elements[0] end def location elements[2] end end module Archive1 def to_package_statement(build_state) return build_state.new_asset_statement( Statement::Archive, statement_start, location ) end end def _nt_archive start_index = index if node_cache[:archive].has_key?(index) cached = node_cache[:archive][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?('archive', false, index) r1 = instantiate_node(SyntaxNode,input, index...(index + 7)) @index += 7 else terminal_parse_failure('archive') r1 = nil end s0 << r1 if r1 s2, i2 = [], index loop do r3 = _nt_ws_or_comment 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 s0 << r2 if r2 r4 = _nt_quoted_or_bare_string s0 << r4 end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Archive0) r0.extend(Archive1) else @index = i0 r0 = nil end node_cache[:archive][start_index] = r0 r0 end module Resource0 def statement_start elements[0] end def location elements[2] end end module Resource1 def to_package_statement(build_state) return build_state.new_asset_statement( Statement::Resource, statement_start, location ) end end def _nt_resource start_index = index if node_cache[:resource].has_key?(index) cached = node_cache[:resource][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?('resource', false, index) r1 = instantiate_node(SyntaxNode,input, index...(index + 8)) @index += 8 else terminal_parse_failure('resource') r1 = nil end s0 << r1 if r1 s2, i2 = [], index loop do r3 = _nt_ws_or_comment 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 s0 << r2 if r2 r4 = _nt_quoted_or_bare_string s0 << r4 end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Resource0) r0.extend(Resource1) else @index = i0 r0 = nil end node_cache[:resource][start_index] = r0 r0 end module Retrieve0 def statement_start elements[0] end def variable elements[2] end def path elements[4] end end module Retrieve1 def to_package_statement(build_state) return build_state.new_retrieve_statement( statement_start, variable, path ) end end def _nt_retrieve start_index = index if node_cache[:retrieve].has_key?(index) cached = node_cache[:retrieve][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?('retrieve', false, index) r1 = instantiate_node(SyntaxNode,input, index...(index + 8)) @index += 8 else terminal_parse_failure('retrieve') r1 = nil end s0 << r1 if r1 s2, i2 = [], index loop do r3 = _nt_ws_or_comment 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 s0 << r2 if r2 r4 = _nt_environment_variable_name s0 << r4 if r4 if has_terminal?('->', false, index) r5 = instantiate_node(SyntaxNode,input, index...(index + 2)) @index += 2 else terminal_parse_failure('->') r5 = nil end s0 << r5 if r5 r6 = _nt_quoted_or_bare_string s0 << r6 end end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Retrieve0) r0.extend(Retrieve1) else @index = i0 r0 = nil end node_cache[:retrieve][start_index] = r0 r0 end module Config0 def statement_start elements[0] end def config_name elements[2] end def statements elements[4] end end module Config1 def to_package_statement(build_state) return build_state.new_configuration_statement( statement_start, config_name, statements ) end end def _nt_config start_index = index if node_cache[:config].has_key?(index) cached = node_cache[:config][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?('config', false, index) r1 = instantiate_node(SyntaxNode,input, index...(index + 6)) @index += 6 else terminal_parse_failure('config') r1 = nil end s0 << r1 if r1 s2, i2 = [], index loop do r3 = _nt_ws_or_comment 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 s0 << r2 if r2 r4 = _nt_config_name s0 << r4 if r4 s5, i5 = [], index loop do r6 = _nt_ws_or_comment 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 s0 << r5 if r5 s7, i7 = [], index loop do r8 = _nt_config_statement_with_ws if r8 s7 << r8 else break end end r7 = instantiate_node(SyntaxNode,input, i7...index, s7) s0 << r7 if r7 if has_terminal?('end', false, index) r9 = instantiate_node(SyntaxNode,input, index...(index + 3)) @index += 3 else terminal_parse_failure('end') r9 = nil end s0 << r9 end end end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Config0) r0.extend(Config1) else @index = i0 r0 = nil end node_cache[:config][start_index] = r0 r0 end module ConfigStatementWithWs0 def config_statement elements[0] end end module ConfigStatementWithWs1 def to_config_statement(build_state) return config_statement.to_config_statement(build_state) end end def _nt_config_statement_with_ws start_index = index if node_cache[:config_statement_with_ws].has_key?(index) cached = node_cache[:config_statement_with_ws][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_config_statement s0 << r1 if r1 s2, i2 = [], index loop do r3 = _nt_ws_or_comment 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 s0 << r2 end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(ConfigStatementWithWs0) r0.extend(ConfigStatementWithWs1) else @index = i0 r0 = nil end node_cache[:config_statement_with_ws][start_index] = r0 r0 end def _nt_config_statement start_index = index if node_cache[:config_statement].has_key?(index) cached = node_cache[:config_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_override if r1 r0 = r1 else r2 = _nt_include if r2 r0 = r2 else r3 = _nt_command if r3 r0 = r3 else r4 = _nt_path if r4 r0 = r4 else r5 = _nt_set if r5 r0 = r5 else @index = i0 r0 = nil end end end end end node_cache[:config_statement][start_index] = r0 r0 end module Include0 def statement_start elements[0] end def descriptor_string elements[2] end end module Include1 def to_config_statement(build_state) return build_state.new_include_statement( statement_start, descriptor_string ) end end def _nt_include start_index = index if node_cache[:include].has_key?(index) cached = node_cache[:include][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?('include', false, index) r1 = instantiate_node(SyntaxNode,input, index...(index + 7)) @index += 7 else terminal_parse_failure('include') r1 = nil end s0 << r1 if r1 s2, i2 = [], index loop do r3 = _nt_ws_or_comment 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 s0 << r2 if r2 r4 = _nt_descriptor_string s0 << r4 end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Include0) r0.extend(Include1) else @index = i0 r0 = nil end node_cache[:include][start_index] = r0 r0 end module Override0 def statement_start elements[0] end def descriptor_string elements[2] end end module Override1 def to_config_statement(build_state) return build_state.new_override_statement( statement_start, descriptor_string ) end end def _nt_override start_index = index if node_cache[:override].has_key?(index) cached = node_cache[:override][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?('override', false, index) r1 = instantiate_node(SyntaxNode,input, index...(index + 8)) @index += 8 else terminal_parse_failure('override') r1 = nil end s0 << r1 if r1 s2, i2 = [], index loop do r3 = _nt_ws_or_comment 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 s0 << r2 if r2 r4 = _nt_descriptor_string s0 << r4 end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Override0) r0.extend(Override1) else @index = i0 r0 = nil end node_cache[:override][start_index] = r0 r0 end module Set0 def statement_start elements[0] end def environment_variable_name_value elements[2] end end module Set1 def to_config_statement(build_state) return build_state.new_environment_variable_statement( Statement::Set, statement_start, environment_variable_name_value ) end end def _nt_set start_index = index if node_cache[:set].has_key?(index) cached = node_cache[:set][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?('set', false, index) r1 = instantiate_node(SyntaxNode,input, index...(index + 3)) @index += 3 else terminal_parse_failure('set') r1 = nil end s0 << r1 if r1 s2, i2 = [], index loop do r3 = _nt_ws_or_comment 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 s0 << r2 if r2 r4 = _nt_environment_variable_name_value s0 << r4 end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Set0) r0.extend(Set1) else @index = i0 r0 = nil end node_cache[:set][start_index] = r0 r0 end module Path0 def statement_start elements[0] end def environment_variable_name_value elements[2] end end module Path1 def to_config_statement(build_state) return build_state.new_environment_variable_statement( Statement::Path, statement_start, environment_variable_name_value ) end end def _nt_path start_index = index if node_cache[:path].has_key?(index) cached = node_cache[:path][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?('add', false, index) r2 = instantiate_node(SyntaxNode,input, index...(index + 3)) @index += 3 else terminal_parse_failure('add') r2 = nil end if r2 r1 = r2 else if has_terminal?('append', false, index) r3 = instantiate_node(SyntaxNode,input, index...(index + 6)) @index += 6 else terminal_parse_failure('append') r3 = nil end if r3 r1 = r3 else if has_terminal?('path', false, index) r4 = instantiate_node(SyntaxNode,input, index...(index + 4)) @index += 4 else terminal_parse_failure('path') r4 = nil end if r4 r1 = r4 else @index = i1 r1 = nil end end end s0 << r1 if r1 s5, i5 = [], index loop do r6 = _nt_ws_or_comment 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 s0 << r5 if r5 r7 = _nt_environment_variable_name_value s0 << r7 end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Path0) r0.extend(Path1) else @index = i0 r0 = nil end node_cache[:path][start_index] = r0 r0 end module Command0 def statement_start elements[0] end def command_line elements[2] end end module Command1 def to_config_statement(build_state) return build_state.new_v1_command_statement( statement_start, gather_command_argument_nodes(command_line) ) end def gather_command_argument_nodes(node, arguments = []) if node.respond_to? 'quoted_or_bare_string?' arguments << node return arguments end return arguments if not node.elements node.elements.each do |element| gather_command_argument_nodes(element, arguments) end return arguments end end def _nt_command start_index = index if node_cache[:command].has_key?(index) cached = node_cache[:command][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?('command', false, index) r1 = instantiate_node(SyntaxNode,input, index...(index + 7)) @index += 7 else terminal_parse_failure('command') r1 = nil end s0 << r1 if r1 s2, i2 = [], index loop do r3 = _nt_ws_or_comment 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 s0 << r2 if r2 r4 = _nt_command_line s0 << r4 if r4 s5, i5 = [], index loop do r6 = _nt_ws_or_comment 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 s0 << r5 if r5 if has_terminal?('end', false, index) r7 = instantiate_node(SyntaxNode,input, index...(index + 3)) @index += 3 else terminal_parse_failure('end') r7 = nil end s0 << r7 end end end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(Command0) r0.extend(Command1) else @index = i0 r0 = nil end node_cache[:command][start_index] = r0 r0 end module CommandLine0 def quoted_or_bare_string elements[1] end end module CommandLine1 def quoted_or_bare_string elements[0] end end def _nt_command_line start_index = index if node_cache[:command_line].has_key?(index) cached = node_cache[:command_line][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_quoted_or_bare_string s0 << r1 if r1 i2 = index r3 = lambda { |sequence| sequence[-1].text_value == 'end' }.call(s0) if r3 r2 = nil else @index = i2 r2 = instantiate_node(SyntaxNode,input, index...index) end s0 << r2 if r2 s4, i4 = [], index loop do i5, s5 = index, [] s6, i6 = [], index loop do r7 = _nt_ws_or_comment 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 s5 << r6 if r6 r8 = _nt_quoted_or_bare_string s5 << r8 if r8 i9 = index r10 = lambda { |sequence| sequence[-1].text_value == 'end' }.call(s5) if r10 r9 = nil else @index = i9 r9 = instantiate_node(SyntaxNode,input, index...index) end s5 << r9 end end if s5.last r5 = instantiate_node(SyntaxNode,input, i5...index, s5) r5.extend(CommandLine0) else @index = i5 r5 = nil end if r5 s4 << r5 else break end end r4 = instantiate_node(SyntaxNode,input, i4...index, s4) s0 << r4 end end if s0.last r0 = instantiate_node(SyntaxNode,input, i0...index, s0) r0.extend(CommandLine1) else @index = i0 r0 = nil end node_cache[:command_line][start_index] = r0 r0 end def _nt_descriptor_string start_index = index if node_cache[:descriptor_string].has_key?(index) cached = node_cache[:descriptor_string][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[^\\s#]', true, index) r1 = true @index += 1 else r1 = nil end if r1 s0 << r1 else break end end if s0.empty? @index = i0 r0 = nil else r0 = instantiate_node(SyntaxNode,input, i0...index, s0) end node_cache[:descriptor_string][start_index] = r0 r0 end def _nt_config_name start_index = index if node_cache[:config_name].has_key?(index) cached = node_cache[:config_name][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[a-zA-Z0-9_.-]', true, index) r1 = true @index += 1 else r1 = nil end if r1 s0 << r1 else break end end if s0.empty? @index = i0 r0 = nil else r0 = instantiate_node(SyntaxNode,input, i0...index, s0) end node_cache[:config_name][start_index] = r0 r0 end module QuotedOrBareString0 end module QuotedOrBareString1 end module QuotedOrBareString2 def quoted_or_bare_string?() return true end end module QuotedOrBareString3 end module QuotedOrBareString4 end module QuotedOrBareString5 def quoted_or_bare_string?() return true end end module QuotedOrBareString6 def quoted_or_bare_string?() return true end end def _nt_quoted_or_bare_string start_index = index if node_cache[:quoted_or_bare_string].has_key?(index) cached = node_cache[:quoted_or_bare_string][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 if has_terminal?('\G[^\\s#\\\\"]', true, index) r3 = true @index += 1 else r3 = nil end 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 i6 = index if has_terminal?('\G[^"\\\\]', true, index) r7 = true @index += 1 else r7 = nil end if r7 r6 = r7 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 if index < input_length r10 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("any character") r10 = nil end s8 << r10 end if s8.last r8 = instantiate_node(SyntaxNode,input, i8...index, s8) r8.extend(QuotedOrBareString0) else @index = i8 r8 = nil end if r8 r6 = r8 else @index = i6 r6 = nil end end if r6 s5 << r6 else break end end r5 = instantiate_node(SyntaxNode,input, i5...index, s5) s1 << r5 if r5 if has_terminal?('"', false, index) r11 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure('"') r11 = nil end s1 << r11 end end end if s1.last r1 = instantiate_node(SyntaxNode,input, i1...index, s1) r1.extend(QuotedOrBareString1) r1.extend(QuotedOrBareString2) else @index = i1 r1 = nil end if r1 r0 = r1 else i12, s12 = index, [] s13, i13 = [], index loop do if has_terminal?('\G[^\\s#\\\\\']', true, index) r14 = true @index += 1 else r14 = nil end if r14 s13 << r14 else break end end r13 = instantiate_node(SyntaxNode,input, i13...index, s13) s12 << r13 if r13 if has_terminal?("'", false, index) r15 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("'") r15 = nil end s12 << r15 if r15 s16, i16 = [], index loop do i17 = index if has_terminal?('\G[^\'\\\\]', true, index) r18 = true @index += 1 else r18 = nil end if r18 r17 = r18 else i19, s19 = index, [] if has_terminal?('\\', false, index) r20 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure('\\') r20 = nil end s19 << r20 if r20 if index < input_length r21 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("any character") r21 = nil end s19 << r21 end if s19.last r19 = instantiate_node(SyntaxNode,input, i19...index, s19) r19.extend(QuotedOrBareString3) else @index = i19 r19 = nil end if r19 r17 = r19 else @index = i17 r17 = nil end end if r17 s16 << r17 else break end end r16 = instantiate_node(SyntaxNode,input, i16...index, s16) s12 << r16 if r16 if has_terminal?("'", false, index) r22 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("'") r22 = nil end s12 << r22 end end end if s12.last r12 = instantiate_node(SyntaxNode,input, i12...index, s12) r12.extend(QuotedOrBareString4) r12.extend(QuotedOrBareString5) else @index = i12 r12 = nil end if r12 r0 = r12 else s23, i23 = [], index loop do if has_terminal?('\G[^\\s#]', true, index) r24 = true @index += 1 else r24 = nil end if r24 s23 << r24 else break end end if s23.empty? @index = i23 r23 = nil else r23 = instantiate_node(SyntaxNode,input, i23...index, s23) r23.extend(QuotedOrBareString6) end if r23 r0 = r23 else @index = i0 r0 = nil end end end node_cache[:quoted_or_bare_string][start_index] = r0 r0 end def _nt_environment_variable_name start_index = index if node_cache[:environment_variable_name].has_key?(index) cached = node_cache[:environment_variable_name][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[a-zA-Z0-9_]', true, index) r1 = true @index += 1 else r1 = nil end if r1 s0 << r1 else break end end if s0.empty? @index = i0 r0 = nil else r0 = instantiate_node(SyntaxNode,input, i0...index, s0) end node_cache[:environment_variable_name][start_index] = r0 r0 end module EnvironmentVariableNameValue0 end module EnvironmentVariableNameValue1 end module EnvironmentVariableNameValue2 end module EnvironmentVariableNameValue3 end def _nt_environment_variable_name_value start_index = index if node_cache[:environment_variable_name_value].has_key?(index) cached = node_cache[:environment_variable_name_value][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 if has_terminal?('\G[^\\s#\\\\\'"]', true, index) r3 = true @index += 1 else r3 = nil end 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 i6 = index if has_terminal?('\G[^"\\\\]', true, index) r7 = true @index += 1 else r7 = nil end if r7 r6 = r7 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 if index < input_length r10 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("any character") r10 = nil end s8 << r10 end if s8.last r8 = instantiate_node(SyntaxNode,input, i8...index, s8) r8.extend(EnvironmentVariableNameValue0) else @index = i8 r8 = nil end if r8 r6 = r8 else @index = i6 r6 = nil end end if r6 s5 << r6 else break end end r5 = instantiate_node(SyntaxNode,input, i5...index, s5) s1 << r5 if r5 if has_terminal?('"', false, index) r11 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure('"') r11 = nil end s1 << r11 end end end if s1.last r1 = instantiate_node(SyntaxNode,input, i1...index, s1) r1.extend(EnvironmentVariableNameValue1) else @index = i1 r1 = nil end if r1 r0 = r1 else i12, s12 = index, [] s13, i13 = [], index loop do if has_terminal?('\G[^\\s#\\\\\'"]', true, index) r14 = true @index += 1 else r14 = nil end if r14 s13 << r14 else break end end r13 = instantiate_node(SyntaxNode,input, i13...index, s13) s12 << r13 if r13 if has_terminal?("'", false, index) r15 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("'") r15 = nil end s12 << r15 if r15 s16, i16 = [], index loop do i17 = index if has_terminal?('\G[^\'\\\\]', true, index) r18 = true @index += 1 else r18 = nil end if r18 r17 = r18 else i19, s19 = index, [] if has_terminal?('\\', false, index) r20 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure('\\') r20 = nil end s19 << r20 if r20 if index < input_length r21 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("any character") r21 = nil end s19 << r21 end if s19.last r19 = instantiate_node(SyntaxNode,input, i19...index, s19) r19.extend(EnvironmentVariableNameValue2) else @index = i19 r19 = nil end if r19 r17 = r19 else @index = i17 r17 = nil end end if r17 s16 << r17 else break end end r16 = instantiate_node(SyntaxNode,input, i16...index, s16) s12 << r16 if r16 if has_terminal?("'", false, index) r22 = instantiate_node(SyntaxNode,input, index...(index + 1)) @index += 1 else terminal_parse_failure("'") r22 = nil end s12 << r22 end end end if s12.last r12 = instantiate_node(SyntaxNode,input, i12...index, s12) r12.extend(EnvironmentVariableNameValue3) else @index = i12 r12 = nil end if r12 r0 = r12 else s23, i23 = [], index loop do if has_terminal?('\G[^\\s#]', true, index) r24 = true @index += 1 else r24 = nil end if r24 s23 << r24 else break end end if s23.empty? @index = i23 r23 = nil else r23 = instantiate_node(SyntaxNode,input, i23...index, s23) end if r23 r0 = r23 else @index = i0 r0 = nil end end end node_cache[:environment_variable_name_value][start_index] = r0 r0 end end class V1Parser < Treetop::Runtime::CompiledParser include V1 end end end