Class: Loxxy::Ast::LoxSetExpr

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

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, anObject) ⇒ LoxSetExpr

Returns a new instance of LoxSetExpr.

Parameters:

  • aPosition (Rley::Lexical::Position)

    Position of the entry in the input stream.

  • anObject (Ast::LoxNode)

    The object which the given property is being set



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

def initialize(aPosition, anObject)
  super(aPosition)
  @object = anObject
end

Instance Attribute Details

#objectAst::LoxNode (readonly)

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_set_expr.rb', line 9

def object
  @object
end

#propertyString

Returns Name of an object property.

Returns:

  • (String)

    Name of an object property



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

def property
  @property
end

#valueLoxNode, Datatype

Returns value to assign.

Returns:



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

def value
  @value
end