Class: Gemite::Token
- Inherits:
-
Struct
- Object
- Struct
- Gemite::Token
- Defined in:
- lib/gemite/token.rb
Overview
字句解析の最小単位。type はSymbol、value はトークン種別ごとの実値、 line はエラーメッセージ用の行番号。
Instance Attribute Summary collapse
-
#line ⇒ Object
Returns the value of attribute line.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
Instance Attribute Details
#line ⇒ Object
Returns the value of attribute line
6 7 8 |
# File 'lib/gemite/token.rb', line 6 def line @line end |
#type ⇒ Object
Returns the value of attribute type
6 7 8 |
# File 'lib/gemite/token.rb', line 6 def type @type end |
#value ⇒ Object
Returns the value of attribute value
6 7 8 |
# File 'lib/gemite/token.rb', line 6 def value @value end |
Instance Method Details
#to_s ⇒ Object
7 8 9 |
# File 'lib/gemite/token.rb', line 7 def to_s "#<Token #{type}:#{value.inspect} @#{line}>" end |