Java org.antlr.v4.runtime Token fields, constructors, methods, implement or subclass

Example usage for Java org.antlr.v4.runtime Token fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.antlr.v4.runtime Token.

The text is from its open source code.

Implementation

org.antlr.v4.runtime.Token has the following implementations.
Click this link to see all its implementation.

Field

intINVALID_TYPE
intEPSILON
During lookahead operations, this "token" signifies we hit rule end ATN state and did not follow it despite needing to.
intMIN_USER_TOKEN_TYPE
intEOF
intDEFAULT_CHANNEL
All tokens go to the parser (unless skip() is called in that rule) on a particular "channel".
intHIDDEN_CHANNEL
Anything on different channel than DEFAULT_CHANNEL is not parsed by parser.

Method

intgetChannel()
Return the channel this token.
intgetCharPositionInLine()
The index of the first character of this token relative to the beginning of the line at which it occurs, 0..n-1
CharStreamgetInputStream()
Gets the CharStream from which this token was derived.
intgetLine()
The line number on which the 1st character of this token was matched, line=1..n
intgetStartIndex()
The starting character index of the token This method is optional; return -1 if not implemented.
intgetStopIndex()
The last character index of the token.
StringgetText()
Get the text of the token.
intgetTokenIndex()
An index from 0..n-1 of the token object in the input stream.
TokenSourcegetTokenSource()
Gets the TokenSource which created this token.
intgetType()
Get the token type of the token