Class: Loxxy::Ast::LoxFunStmt
- Defined in:
- lib/loxxy/ast/lox_fun_stmt.rb
Overview
rubocop: disable Style/AccessorGrouping
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#is_method ⇒ Object
Returns the value of attribute is_method.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Attributes inherited from LoxNode
Instance Method Summary collapse
-
#accept(visitor) ⇒ Object
Part of the 'visitee' role in Visitor design pattern.
-
#initialize(aPosition, aName, paramList, aBody) ⇒ LoxFunStmt
constructor
A new instance of LoxFunStmt.
Methods inherited from LoxNode
Constructor Details
#initialize(aPosition, aName, paramList, aBody) ⇒ LoxFunStmt
Returns a new instance of LoxFunStmt.
18 19 20 21 22 23 24 |
# File 'lib/loxxy/ast/lox_fun_stmt.rb', line 18 def initialize(aPosition, aName, paramList, aBody) super(aPosition) @name = aName.dup @params = paramList @body = aBody @is_method = false end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
11 12 13 |
# File 'lib/loxxy/ast/lox_fun_stmt.rb', line 11 def body @body end |
#is_method ⇒ Object
Returns the value of attribute is_method.
12 13 14 |
# File 'lib/loxxy/ast/lox_fun_stmt.rb', line 12 def is_method @is_method end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/loxxy/ast/lox_fun_stmt.rb', line 9 def name @name end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
10 11 12 |
# File 'lib/loxxy/ast/lox_fun_stmt.rb', line 10 def params @params end |
Instance Method Details
#accept(visitor) ⇒ Object
Part of the 'visitee' role in Visitor design pattern.
28 29 30 |
# File 'lib/loxxy/ast/lox_fun_stmt.rb', line 28 def accept(visitor) visitor.visit_fun_stmt(self) end |