Class: Loxxy::Ast::LoxGetExpr

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

Instance Attribute Summary collapse

Attributes inherited from LoxNode

#position

Instance Method Summary collapse

Methods inherited from LoxNode

#done!

Constructor Details

#initialize(aPosition, aPropertyName) ⇒ LoxGetExpr

Returns a new instance of LoxGetExpr.

Parameters:

  • aPosition (Rley::Lexical::Position)

    Position of the entry in the input stream.

  • aPropertyName (String)

    Name of an object property



16
17
18
19
# File 'lib/loxxy/ast/lox_get_expr.rb', line 16

def initialize(aPosition, aPropertyName)
  super(aPosition)
  @property = aPropertyName
end

Instance Attribute Details

#objectAst::LoxNode

Returns the object to which the property belongs to.

Returns:

  • (Ast::LoxNode)

    the object to which the property belongs to



9
10
11
# File 'lib/loxxy/ast/lox_get_expr.rb', line 9

def object
  @object
end

#propertyString (readonly)

Returns Name of an object property.

Returns:

  • (String)

    Name of an object property



12
13
14
# File 'lib/loxxy/ast/lox_get_expr.rb', line 12

def property
  @property
end

Instance Method Details

#accept(visitor) ⇒ Object

Part of the 'visitee' role in Visitor design pattern.

Parameters:



23
24
25
# File 'lib/loxxy/ast/lox_get_expr.rb', line 23

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