Class: Loxxy::Ast::LoxCompoundExpr

Inherits:
LoxNode
  • Object
show all
Defined in:
lib/loxxy/ast/lox_compound_expr.rb

Instance Attribute Summary collapse

Attributes inherited from LoxNode

#position

Instance Method Summary collapse

Methods inherited from LoxNode

#done!

Methods included from ASTVisitee

#define_accept, #snake_case

Constructor Details

#initialize(aPosition, theSubnodes) ⇒ LoxCompoundExpr

Returns a new instance of LoxCompoundExpr.

Parameters:

  • aPosition (Rley::Lexical::Position)

    Position of the entry in the input stream.

  • theSubnodes (Array<Ast::LoxNode>)


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

#subnodesArray<Ast::LoxNode> (readonly)

Returns the children nodes (sub-expressions).

Returns:

  • (Array<Ast::LoxNode>)

    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.

Parameters:



20
21
22
# File 'lib/loxxy/ast/lox_compound_expr.rb', line 20

def accept(visitor)
  visitor.visit_compound_expr(self)
end