Class: Logicality::Parser::Ast::Node
- Inherits:
-
Object
- Object
- Logicality::Parser::Ast::Node
- Defined in:
- lib/logicality/parser/ast/node.rb
Overview
Base construct defining all nodes.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(token) ⇒ Node
constructor
A new instance of Node.
- #to_s ⇒ Object
Constructor Details
#initialize(token) ⇒ Node
Returns a new instance of Node.
17 18 19 20 |
# File 'lib/logicality/parser/ast/node.rb', line 17 def initialize(token) @token = token @name = '' end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
15 16 17 |
# File 'lib/logicality/parser/ast/node.rb', line 15 def name @name end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
15 16 17 |
# File 'lib/logicality/parser/ast/node.rb', line 15 def token @token end |
Instance Method Details
#to_s ⇒ Object
22 23 24 |
# File 'lib/logicality/parser/ast/node.rb', line 22 def to_s "AstNode: #{self.class.name}::#{token}" end |