CommonToken constructor

CommonToken(
  1. int type, {
  2. Pair<TokenSource?, CharStream?> source = EMPTY_SOURCE,
  3. int channel = Token.DEFAULT_CHANNEL,
  4. int startIndex = -1,
  5. int stopIndex = -1,
  6. dynamic text,
})

Constructs a new CommonToken with the specified token type and text.

@param type The token type. @param text The text of the token.

Implementation

CommonToken(
  this.type, {
  this.source = EMPTY_SOURCE,
  this.channel = Token.DEFAULT_CHANNEL,
  this.startIndex = -1,
  this.stopIndex = -1,
  text,
}) {
  _text = text;
  if (source.a != null) {
    line = source.a!.line;
    charPositionInLine = source.a!.charPositionInLine;
  }
}