Class: Cooklang::Token

Inherits:
Struct
  • Object
show all
Defined in:
lib/cooklang/lexer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, value, position = 0, line = 1, column = 1) ⇒ Token

Returns a new instance of Token.



7
8
9
# File 'lib/cooklang/lexer.rb', line 7

def initialize(type, value, position = 0, line = 1, column = 1)
  super
end

Instance Attribute Details

#columnObject

Returns the value of attribute column

Returns:

  • (Object)

    the current value of column



6
7
8
# File 'lib/cooklang/lexer.rb', line 6

def column
  @column
end

#lineObject

Returns the value of attribute line

Returns:

  • (Object)

    the current value of line



6
7
8
# File 'lib/cooklang/lexer.rb', line 6

def line
  @line
end

#positionObject

Returns the value of attribute position

Returns:

  • (Object)

    the current value of position



6
7
8
# File 'lib/cooklang/lexer.rb', line 6

def position
  @position
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



6
7
8
# File 'lib/cooklang/lexer.rb', line 6

def type
  @type
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



6
7
8
# File 'lib/cooklang/lexer.rb', line 6

def value
  @value
end