Class: Gemite::Token

Inherits:
Struct
  • Object
show all
Defined in:
lib/gemite/token.rb

Overview

字句解析の最小単位。type はSymbol、value はトークン種別ごとの実値、 line はエラーメッセージ用の行番号。

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#lineObject

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



6
7
8
# File 'lib/gemite/token.rb', line 6

def line
  @line
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



6
7
8
# File 'lib/gemite/token.rb', line 6

def type
  @type
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



6
7
8
# File 'lib/gemite/token.rb', line 6

def value
  @value
end

Instance Method Details

#to_sObject



7
8
9
# File 'lib/gemite/token.rb', line 7

def to_s
  "#<Token #{type}:#{value.inspect} @#{line}>"
end