Class: Loxxy::Ast::LoxLiteralExpr

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

Instance Attribute Summary collapse

Attributes inherited from LoxNode

#position

Instance Method Summary collapse

Methods inherited from LoxNode

#done!

Constructor Details

#initialize(aPosition, aLiteral) ⇒ LoxLiteralExpr

Returns a new instance of LoxLiteralExpr.

Parameters:



13
14
15
16
# File 'lib/loxxy/ast/lox_literal_expr.rb', line 13

def initialize(aPosition, aLiteral)
  super(aPosition)
  @literal = aLiteral
end

Instance Attribute Details

#literalLoxxy::Datatype::BuiltinDatatype (readonly)



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

def literal
  @literal
end

Instance Method Details

#accept(visitor) ⇒ Object

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

Parameters:



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

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