Class: Loxxy::Ast::LoxNode
- Inherits:
-
Object
- Object
- Loxxy::Ast::LoxNode
- Extended by:
- ASTVisitee
- Defined in:
- lib/loxxy/ast/lox_node.rb
Overview
Abstract class. Instances of its subclasses represent nodes of an abstract syntax tree that is the product of the parse of an input text.
Direct Known Subclasses
LoxClassStmt, LoxCompoundExpr, LoxFunStmt, LoxGetExpr, LoxLiteralExpr, LoxNoopExpr, LoxSetExpr, LoxSuperExpr, LoxThisExpr, LoxVariableExpr
Instance Attribute Summary collapse
-
#position ⇒ Rley::Lexical::Position
readonly
Position of the entry in the input stream.
Instance Method Summary collapse
-
#accept(_visitor) ⇒ Object
Abstract method (must be overriden in subclasses).
-
#done! ⇒ Object
Notification that the parsing was successfully completed.
-
#initialize(aPosition) ⇒ LoxNode
constructor
A new instance of LoxNode.
Methods included from ASTVisitee
Constructor Details
#initialize(aPosition) ⇒ LoxNode
Returns a new instance of LoxNode.
18 19 20 |
# File 'lib/loxxy/ast/lox_node.rb', line 18 def initialize(aPosition) @position = aPosition end |
Instance Attribute Details
#position ⇒ Rley::Lexical::Position (readonly)
Returns Position of the entry in the input stream.
15 16 17 |
# File 'lib/loxxy/ast/lox_node.rb', line 15 def position @position end |
Instance Method Details
#accept(_visitor) ⇒ Object
Abstract method (must be overriden in subclasses). Part of the 'visitee' role in Visitor design pattern.
30 31 32 |
# File 'lib/loxxy/ast/lox_node.rb', line 30 def accept(_visitor) raise NotImplementedError end |
#done! ⇒ Object
Notification that the parsing was successfully completed
23 24 25 |
# File 'lib/loxxy/ast/lox_node.rb', line 23 def done! # Default: do nothing ... end |