Class: Pdfrb::Source::Token

Inherits:
Struct
  • Object
show all
Defined in:
lib/pdfrb/source/token.rb

Overview

One lexed token. type is a Symbol; value is the literal bytes/string/number as parsed from source; position is the byte offset in the IO where the token started (used for diagnostics and xref).

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#positionObject

Returns the value of attribute position

Returns:

  • (Object)

    the current value of position



9
10
11
# File 'lib/pdfrb/source/token.rb', line 9

def position
  @position
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



9
10
11
# File 'lib/pdfrb/source/token.rb', line 9

def type
  @type
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



9
10
11
# File 'lib/pdfrb/source/token.rb', line 9

def value
  @value
end

Instance Method Details

#inspectObject



10
11
12
# File 'lib/pdfrb/source/token.rb', line 10

def inspect
  "#<Pdfrb::Source::Token #{type} value=#{value.inspect} pos=#{position}>"
end