Method: CommonToken#initialize

Defined in:
lib/antlr4/Token.rb

#initialize(source = EMPTY_SOURCE, type = nil, channel = Token::DEFAULT_CHANNEL, start = -1,, stop = -1)) ⇒ CommonToken

Returns a new instance of CommonToken.



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/antlr4/Token.rb', line 58

def initialize(source = EMPTY_SOURCE, type = nil, channel=Token::DEFAULT_CHANNEL, start=-1, stop=-1)
    super()
    self.source = source
    self.type = type
    self.channel = channel
    self.start = start
    self.stop = stop
    self.tokenIndex = -1
    if source[0] then
        self.line = source[0].line
        self.column = source[0].column
    else
        self.column = -1
        self.line = nil
    end
end