Class: Rlex::Token

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

Overview

Simple class to represent tokens matched from the input.

Author:

Instance Attribute Summary collapse

Instance Attribute Details

#typeSymbol (readonly)

Type of the token, such as the name of the rule used to match it

Returns:

  • (Symbol)

    the current value of type



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

def type
  @type
end

#valueString (readonly)

Text matched from the input

Returns:

  • (String)

    the current value of value



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

def value
  @value
end