Class: Ibex::BisonImport::Tokenizer::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/ibex/bison_import/tokenizer.rb,
sig/ibex/bison_import/tokenizer.rbs

Overview

One structural token with a byte-oriented source position.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, value:, line:, column:) ⇒ Token

Returns a new instance of Token.

RBS:

  • (type: Symbol, value: String, line: Integer, column: Integer) -> void

Parameters:

  • type: (Symbol)
  • value: (String)
  • line: (Integer)
  • column: (Integer)


16
17
18
19
20
21
22
# File 'lib/ibex/bison_import/tokenizer.rb', line 16

def initialize(type:, value:, line:, column:)
  @type = type
  @value = value.freeze
  @line = line
  @column = column
  freeze
end

Instance Attribute Details

#columnInteger (readonly)

Signature:

  • Integer

Returns:

  • (Integer)


13
14
15
# File 'lib/ibex/bison_import/tokenizer.rb', line 13

def column
  @column
end

#lineInteger (readonly)

Signature:

  • Integer

Returns:

  • (Integer)


12
13
14
# File 'lib/ibex/bison_import/tokenizer.rb', line 12

def line
  @line
end

#typeSymbol (readonly)

Signature:

  • Symbol

Returns:

  • (Symbol)


10
11
12
# File 'lib/ibex/bison_import/tokenizer.rb', line 10

def type
  @type
end

#valueString (readonly)

Signature:

  • String

Returns:

  • (String)


11
12
13
# File 'lib/ibex/bison_import/tokenizer.rb', line 11

def value
  @value
end