Class: Ibex::Frontend::Token
- Inherits:
-
Struct
- Object
- Struct
- Ibex::Frontend::Token
- Defined in:
- lib/ibex/frontend/source_cursor.rb,
lib/ibex/frontend/source_cursor.rb
Overview
A grammar token and its source coordinate.
Instance Attribute Summary collapse
-
#location ⇒ Object
Returns the value of attribute location.
-
#span ⇒ Object
Returns the value of attribute span.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
Instance Attribute Details
#location ⇒ Object
Returns the value of attribute location
26 27 28 |
# File 'lib/ibex/frontend/source_cursor.rb', line 26 def location @location end |
#span ⇒ Object
Returns the value of attribute span
26 27 28 |
# File 'lib/ibex/frontend/source_cursor.rb', line 26 def span @span end |
#type ⇒ Object
Returns the value of attribute type
26 27 28 |
# File 'lib/ibex/frontend/source_cursor.rb', line 26 def type @type end |
#value ⇒ Object
Returns the value of attribute value
26 27 28 |
# File 'lib/ibex/frontend/source_cursor.rb', line 26 def value @value end |
Instance Method Details
#to_h ⇒ Object
36 37 38 |
# File 'lib/ibex/frontend/source_cursor.rb', line 36 def to_h { type: type, value: value, location: location.to_h } end |