Class: Loxxy::Ast::LoxClassStmt
- Defined in:
- lib/loxxy/ast/lox_class_stmt.rb
Overview
A parse tree node that represents a Lox class declaration.
Instance Attribute Summary collapse
-
#body ⇒ Array<Ast::LoxFunStmt>
readonly
The methods.
-
#name ⇒ String
readonly
The class name.
-
#superclass ⇒ Ast::LoxVariableExpr
readonly
Variable referencing the superclass (if any).
Attributes inherited from LoxNode
Instance Method Summary collapse
-
#initialize(aPosition, aName, aSuperclassName, theMethods) ⇒ LoxClassStmt
constructor
Constructor for a parse node that represents a Lox function declaration.
Methods inherited from LoxNode
Methods included from ASTVisitee
Constructor Details
#initialize(aPosition, aName, aSuperclassName, theMethods) ⇒ LoxClassStmt
Constructor for a parse node that represents a Lox function declaration
23 24 25 26 27 28 |
# File 'lib/loxxy/ast/lox_class_stmt.rb', line 23 def initialize(aPosition, aName, aSuperclassName, theMethods) super(aPosition) @name = aName.dup @superclass = aSuperclassName @body = theMethods end |
Instance Attribute Details
#body ⇒ Array<Ast::LoxFunStmt> (readonly)
Returns the methods.
16 17 18 |
# File 'lib/loxxy/ast/lox_class_stmt.rb', line 16 def body @body end |
#name ⇒ String (readonly)
Returns the class name.
10 11 12 |
# File 'lib/loxxy/ast/lox_class_stmt.rb', line 10 def name @name end |
#superclass ⇒ Ast::LoxVariableExpr (readonly)
Returns variable referencing the superclass (if any).
13 14 15 |
# File 'lib/loxxy/ast/lox_class_stmt.rb', line 13 def superclass @superclass end |