Sha256: ae9b52b24040a732ca28aa7ae510612d6be31d966637da7b698e0e0c18a01dcc

Contents?: true

Size: 604 Bytes

Versions: 6

Compression:

Stored size: 604 Bytes

Contents

require_relative 'parse_tree_node'  # Load superclass

module Rley # This module is used as a namespace
  module PTree # This module is used as a namespace
    class TerminalNode < ParseTreeNode
      # Link to the input token
      attr(:token, true)

      def initialize(aTerminalSymbol, aRange)
        super(aTerminalSymbol, aRange)
      end
      
      # Part of the 'visitee' role in Visitor design pattern.
      # @param aVisitor[ParseTreeVisitor] the visitor
      def accept(aVisitor)
        aVisitor.visit_terminal(self)
      end
    end # class
  end # module
end # module
# End of file

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rley-0.2.01 lib/rley/ptree/terminal_node.rb
rley-0.2.00 lib/rley/ptree/terminal_node.rb
rley-0.1.12 lib/rley/ptree/terminal_node.rb
rley-0.1.11 lib/rley/ptree/terminal_node.rb
rley-0.1.10 lib/rley/ptree/terminal_node.rb
rley-0.1.09 lib/rley/ptree/terminal_node.rb