Class: Peruby::Lexer::Token
- Inherits:
-
Data
- Object
- Data
- Peruby::Lexer::Token
- Defined in:
- lib/peruby/lexer/token.rb
Overview
One lexical token and its source location.
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column
6 7 8 |
# File 'lib/peruby/lexer/token.rb', line 6 def column @column end |
#file ⇒ Object (readonly)
Returns the value of attribute file
6 7 8 |
# File 'lib/peruby/lexer/token.rb', line 6 def file @file end |
#line ⇒ Object (readonly)
Returns the value of attribute line
6 7 8 |
# File 'lib/peruby/lexer/token.rb', line 6 def line @line end |
#type ⇒ Object (readonly)
Returns the value of attribute type
6 7 8 |
# File 'lib/peruby/lexer/token.rb', line 6 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value
6 7 8 |
# File 'lib/peruby/lexer/token.rb', line 6 def value @value end |
Instance Method Details
#to_a ⇒ Object
7 8 9 |
# File 'lib/peruby/lexer/token.rb', line 7 def to_a [type, value] end |
#to_s ⇒ Object
11 12 13 |
# File 'lib/peruby/lexer/token.rb', line 11 def to_s "#{file}:#{line}:#{column} #{type} #{value.inspect}" end |