Class: Archsight::Query::Lexer::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/archsight/query/lexer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, value, position) ⇒ Token

Returns a new instance of Token.



9
10
11
12
13
# File 'lib/archsight/query/lexer.rb', line 9

def initialize(type, value, position)
  @type = type
  @value = value
  @position = position
end

Instance Attribute Details

#positionObject (readonly)

Returns the value of attribute position.



7
8
9
# File 'lib/archsight/query/lexer.rb', line 7

def position
  @position
end

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'lib/archsight/query/lexer.rb', line 7

def type
  @type
end

#valueObject (readonly)

Returns the value of attribute value.



7
8
9
# File 'lib/archsight/query/lexer.rb', line 7

def value
  @value
end

Instance Method Details

#to_sObject



15
16
17
# File 'lib/archsight/query/lexer.rb', line 15

def to_s
  "Token(#{@type}, #{@value.inspect}, pos=#{@position})"
end