Sha256: ec05d8f3518cf3dc45d040adb69323196996221a785ec8ae41daf8e7f035e094

Contents?: true

Size: 692 Bytes

Versions: 8

Compression:

Stored size: 692 Bytes

Contents

require_relative '../lexical/token_range'

module Rley # This module is used as a namespace
  module SPPF # This module is used as a namespace
    # Abstract class. The generalization for all kinds of nodes
    # occurring in a shared packed parse forest.
    class SPPFNode
    
      # A range of indices for tokens matching this node.
      attr_reader(:range)
      
      def initialize(aRange)
        @range = Lexical::TokenRange.new(aRange)
      end
      
      # Return the origin (= lower bound of the range 
      # = position of first token matched by the symbol)
      def origin()
        return range.low
      end  
    end # class
  end # module
end # module
# End of file

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rley-0.5.13 lib/rley/sppf/sppf_node.rb
rley-0.5.12 lib/rley/sppf/sppf_node.rb
rley-0.5.11 lib/rley/sppf/sppf_node.rb
rley-0.5.10 lib/rley/sppf/sppf_node.rb
rley-0.5.09 lib/rley/sppf/sppf_node.rb
rley-0.5.08 lib/rley/sppf/sppf_node.rb
rley-0.5.07 lib/rley/sppf/sppf_node.rb
rley-0.5.06 lib/rley/sppf/sppf_node.rb