Class: Ibex::Frontend::Token

Inherits:
Struct
  • Object
show all
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

Instance Method Summary collapse

Instance Attribute Details

#locationObject

Returns the value of attribute location

Returns:

  • (Object)

    the current value of location



26
27
28
# File 'lib/ibex/frontend/source_cursor.rb', line 26

def location
  @location
end

#spanObject

Returns the value of attribute span

Returns:

  • (Object)

    the current value of span



26
27
28
# File 'lib/ibex/frontend/source_cursor.rb', line 26

def span
  @span
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



26
27
28
# File 'lib/ibex/frontend/source_cursor.rb', line 26

def type
  @type
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



26
27
28
# File 'lib/ibex/frontend/source_cursor.rb', line 26

def value
  @value
end

Instance Method Details

#to_hObject



36
37
38
# File 'lib/ibex/frontend/source_cursor.rb', line 36

def to_h
  { type: type, value: value, location: location.to_h }
end