Class: Loxxy::Ast::LoxCompoundExpr
- Defined in:
- lib/loxxy/ast/lox_compound_expr.rb
Direct Known Subclasses
LoxAssignExpr, LoxBinaryExpr, LoxBlockStmt, LoxCallExpr, LoxGroupingExpr, LoxIfStmt, LoxLogicalExpr, LoxPrintStmt, LoxReturnStmt, LoxSeqDecl, LoxUnaryExpr, LoxVarStmt, LoxWhileStmt
Instance Attribute Summary collapse
-
#subnodes ⇒ Array<Ast::LoxNode>
readonly
The children nodes (sub-expressions).
Attributes inherited from LoxNode
Instance Method Summary collapse
-
#accept(visitor) ⇒ Object
Part of the 'visitee' role in Visitor design pattern.
-
#initialize(aPosition, theSubnodes) ⇒ LoxCompoundExpr
constructor
A new instance of LoxCompoundExpr.
Methods inherited from LoxNode
Methods included from ASTVisitee
Constructor Details
#initialize(aPosition, theSubnodes) ⇒ LoxCompoundExpr
Returns a new instance of LoxCompoundExpr.
13 14 15 16 |
# File 'lib/loxxy/ast/lox_compound_expr.rb', line 13 def initialize(aPosition, theSubnodes) super(aPosition) @subnodes = theSubnodes end |
Instance Attribute Details
#subnodes ⇒ Array<Ast::LoxNode> (readonly)
Returns the children nodes (sub-expressions).
9 10 11 |
# File 'lib/loxxy/ast/lox_compound_expr.rb', line 9 def subnodes @subnodes end |
Instance Method Details
#accept(visitor) ⇒ Object
Part of the 'visitee' role in Visitor design pattern.
20 21 22 |
# File 'lib/loxxy/ast/lox_compound_expr.rb', line 20 def accept(visitor) visitor.visit_compound_expr(self) end |