Class: PLang::Parser::Token
- Inherits:
-
Object
- Object
- PLang::Parser::Token
- Defined in:
- lib/parser/token.rb
Instance Attribute Summary collapse
-
#i ⇒ Object
Returns the value of attribute i.
-
#line ⇒ Object
Returns the value of attribute line.
-
#src ⇒ Object
Returns the value of attribute src.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(type) ⇒ Token
constructor
A new instance of Token.
- #to_s ⇒ Object
Constructor Details
#initialize(type) ⇒ Token
Returns a new instance of Token.
10 11 12 |
# File 'lib/parser/token.rb', line 10 def initialize(type) @type = type end |
Instance Attribute Details
#i ⇒ Object
Returns the value of attribute i.
7 8 9 |
# File 'lib/parser/token.rb', line 7 def i @i end |
#line ⇒ Object
Returns the value of attribute line.
6 7 8 |
# File 'lib/parser/token.rb', line 6 def line @line end |
#src ⇒ Object
Returns the value of attribute src.
8 9 10 |
# File 'lib/parser/token.rb', line 8 def src @src end |
#type ⇒ Object
Returns the value of attribute type.
5 6 7 |
# File 'lib/parser/token.rb', line 5 def type @type end |
#value ⇒ Object
Returns the value of attribute value.
4 5 6 |
# File 'lib/parser/token.rb', line 4 def value @value end |
Instance Method Details
#to_s ⇒ Object
14 15 16 |
# File 'lib/parser/token.rb', line 14 def to_s "\#{#{type.to_s}: #{value}}" end |