function CommonToken(source, type, channel, start, stop) { Token.call(this); this.source = source !== undefined ? source : CommonToken.EMPTY_SOURCE; this.type = type !== undefined ? type : null; this.channel = channel !== undefined ? channel : Token.DEFAULT_CHANNEL; this.start = start !== undefined ? start : -1; this.stop = stop !== undefined ? stop : -1; this.tokenIndex = -1; if (this.source[0] !== null) { this.line = source[0].line; this.column = source[0].column; } else { this.column = -1; } return this; }
function CommonToken(source, type, channel, start, stop) { Token.call(this); this.source = source !== undefined ? source : CommonToken.EMPTY_SOURCE; this.type = type !== undefined ? type : null; this.channel = channel !== undefined ? channel : Token.DEFAULT_CHANNEL; this.start = start !== undefined ? start : -1; this.stop = stop !== undefined ? stop : -1; this.tokenIndex = -1; if (this.source[0] !== null) { this.line = source[0].line; this.column = source[0].column; } else { this.column = -1; } return this; }