class Tokn::Token

Tokens read by Tokenizer

Attributes

column[R]
id[R]
lineNumber[R]
text[R]

Public Class Methods

new(id, text, lineNumber, column) click to toggle source
# File lib/tokn/tokenizer.rb, line 252
def initialize(id, text, lineNumber, column)
  @id = id
  @text = text
  @lineNumber = lineNumber
  @column = column
end

Public Instance Methods

inspect() click to toggle source

Construct description of token location within text

# File lib/tokn/tokenizer.rb, line 265
def inspect
  s = "(line "+lineNumber.to_s+", col "+column.to_s+")"
  if !unknown?
    s = s.ljust(17) + " : " + text
  end
  s
end
unknown?() click to toggle source
# File lib/tokn/tokenizer.rb, line 259
def unknown?
  id == ToknInternal::UNKNOWN_TOKEN
end