Class: Janeway::AST::Number

Inherits:
Expression show all
Defined in:
lib/janeway/ast/number.rb

Overview

Represent a number. From the ABNF grammar: number = (int / “-0”) [ frac ] [ exp ] ; decimal number frac = “.” 1*DIGIT ; decimal fraction exp = “e” [ “-” / “+” ] 1*DIGIT ; decimal exponent

Instance Attribute Summary

Attributes inherited from Expression

#next, #value

Instance Method Summary collapse

Methods inherited from Expression

#indented, #initialize, #singular_query?, #tree, #type

Constructor Details

This class inherits a constructor from Janeway::AST::Expression

Instance Method Details

#literal?Boolean

Return true if this is a literal expression

Returns:



16
17
18
# File 'lib/janeway/ast/number.rb', line 16

def literal?
  true
end

#to_sObject



10
11
12
# File 'lib/janeway/ast/number.rb', line 10

def to_s
  @value.to_s
end