Class: Logicality::Parser::Ast::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/logicality/parser/ast/node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token) ⇒ Node

Returns a new instance of Node.



15
16
17
18
# File 'lib/logicality/parser/ast/node.rb', line 15

def initialize(token)
  @token = token
  @name  = ''
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



13
14
15
# File 'lib/logicality/parser/ast/node.rb', line 13

def name
  @name
end

#tokenObject (readonly)

Returns the value of attribute token.



13
14
15
# File 'lib/logicality/parser/ast/node.rb', line 13

def token
  @token
end

Instance Method Details

#to_sObject



20
21
22
# File 'lib/logicality/parser/ast/node.rb', line 20

def to_s
  "AstNode: #{self.class.name}::#{token}"
end