Sha256: 2b815abd690352cb1ed62de1176e5e83658e099676f3e1e09b46b259d827b4e8

Contents?: true

Size: 999 Bytes

Versions: 3

Compression:

Stored size: 999 Bytes

Contents

# Autogenerated from a Treetop grammar. Edits may be lost.


module InnerOuter
  include Treetop::Runtime

  def root
    @root ||= :inner_outer
  end

  module InnerOuter0
	def inner
	end
  end

  module InnerOuter1
    def outer
    end
  end

  def _nt_inner_outer
    start_index = index
    if node_cache[:inner_outer].has_key?(index)
      cached = node_cache[:inner_outer][index]
      if cached
        node_cache[:inner_outer][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
        @index = cached.interval.end
      end
      return cached
    end

    if (match_len = has_terminal?("foo", false, index))
      r0 = instantiate_node(SyntaxNode,input, index...(index + match_len))
      r0.extend(InnerOuter0)
      @index += match_len
    else
      terminal_parse_failure('"foo"')
      r0 = nil
    end

    node_cache[:inner_outer][start_index] = r0

    r0
  end

end

class InnerOuterParser < Treetop::Runtime::CompiledParser
  include InnerOuter
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
swift-pyrite-0.1.1 vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/examples/inner_outer.rb
swift-pyrite-0.1.0 vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/examples/inner_outer.rb
treetop-1.6.3 examples/inner_outer.rb