Top Description Fields Constructors Methods
org.antlr.v4.parse

public Class GrammarToken

extends CommonToken
Class Inheritance
Imports
org.antlr.runtime.CommonToken, .Token, org.antlr.v4.tool.Grammar

A CommonToken that can also track it's original location, derived from options on the element ref like BEGIN<line=34,...>.

Field Summary

Modifier and TypeField and Description
public Grammar
g

public int
Inherited from org.antlr.runtime.CommonToken:
channelcharPositionInLineindexinputlinestartstoptexttype

Constructor Summary

AccessConstructor and Description
public
GrammarToken(Grammar g, Token oldToken)

Method Summary

Modifier and TypeMethod and Description
public int
getCharPositionInLine()

Overrides org.antlr.runtime.CommonToken.getCharPositionInLine.

Implements org.antlr.runtime.Token.getCharPositionInLine.

The index of the first character relative to the beginning of the line 0..n-1
public int
getLine()

Overrides org.antlr.runtime.CommonToken.getLine.

Implements org.antlr.runtime.Token.getLine.

The line number on which this token was matched; line=1..n
public int
public int
public int
getTokenIndex()

Overrides org.antlr.runtime.CommonToken.getTokenIndex.

Implements org.antlr.runtime.Token.getTokenIndex.

An index from 0..n-1 of the token object in the input stream.
public String
toString()

Overrides org.antlr.runtime.CommonToken.toString.

Returns a string representation of the object.
Inherited from org.antlr.runtime.CommonToken:
getChannelgetInputStreamgetTextgetTypesetChannelsetCharPositionInLinesetInputStreamsetLinesetStartIndexsetStopIndexsetTextsetTokenIndexsetType

Field Detail

gback to summary
public Grammar g
originalTokenIndexback to summary
public int originalTokenIndex

Constructor Detail

GrammarTokenback to summary
public GrammarToken(Grammar g, Token oldToken)

Method Detail

getCharPositionInLineback to summary
public int getCharPositionInLine()

Overrides org.antlr.runtime.CommonToken.getCharPositionInLine.

Implements org.antlr.runtime.Token.getCharPositionInLine.

Doc from org.antlr.runtime.Token.getCharPositionInLine.

The index of the first character relative to the beginning of the line 0..n-1

Annotations
@Override
getLineback to summary
public int getLine()

Overrides org.antlr.runtime.CommonToken.getLine.

Implements org.antlr.runtime.Token.getLine.

Doc from org.antlr.runtime.Token.getLine.

The line number on which this token was matched; line=1..n

Annotations
@Override
getStartIndexback to summary
public int getStartIndex()

Overrides org.antlr.runtime.CommonToken.getStartIndex.

Annotations
@Override
getStopIndexback to summary
public int getStopIndex()

Overrides org.antlr.runtime.CommonToken.getStopIndex.

Annotations
@Override
getTokenIndexback to summary
public int getTokenIndex()

Overrides org.antlr.runtime.CommonToken.getTokenIndex.

Implements org.antlr.runtime.Token.getTokenIndex.

Doc from org.antlr.runtime.Token.getTokenIndex.

An index from 0..n-1 of the token object in the input stream. This must be valid in order to use the ANTLRWorks debugger.

Annotations
@Override
toStringback to summary
public String toString()

Overrides org.antlr.runtime.CommonToken.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override