Class: Crokus::Literal

Inherits:
Ast
  • Object
show all
Defined in:
lib/crokus/ast.rb

Overview

literals

Direct Known Subclasses

CharLit, FloatLit, IntLit, StrLit

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ast

#accept, #str

Constructor Details

#initialize(tok) ⇒ Literal

Returns a new instance of Literal.



419
420
421
# File 'lib/crokus/ast.rb', line 419

def initialize tok
  @tok=tok
end

Instance Attribute Details

#tokObject

Returns the value of attribute tok.



418
419
420
# File 'lib/crokus/ast.rb', line 418

def tok
  @tok
end

Instance Method Details

#to_sObject



423
424
425
# File 'lib/crokus/ast.rb', line 423

def to_s
  @tok.val
end