Class: Loxxy::Ast::LoxVariableExpr

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

Overview

This AST node represents a mention of a variable

Instance Attribute Summary collapse

Attributes inherited from LoxNode

#position

Instance Method Summary collapse

Methods inherited from LoxNode

#accept, #done!

Methods included from ASTVisitee

#define_accept, #snake_case

Constructor Details

#initialize(aPosition, aName) ⇒ LoxVariableExpr

Returns a new instance of LoxVariableExpr.

Parameters:

  • aPosition (Rley::Lexical::Position)

    Position of the entry in the input stream.

  • aName (String)

    name of the variable



14
15
16
17
# File 'lib/loxxy/ast/lox_variable_expr.rb', line 14

def initialize(aPosition, aName)
  super(aPosition)
  @name = aName
end

Instance Attribute Details

#nameString (readonly)

Returns variable name.

Returns:

  • (String)

    variable name



10
11
12
# File 'lib/loxxy/ast/lox_variable_expr.rb', line 10

def name
  @name
end