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.



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

def initialize tok
  @tok=tok
end

Instance Attribute Details

#tokObject

Returns the value of attribute tok.



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

def tok
  @tok
end

Instance Method Details

#to_sObject



427
428
429
# File 'lib/crokus/ast.rb', line 427

def to_s
  @tok.val
end