Package org.eclipse.xtext.parser.antlr
Class TokenTool
- java.lang.Object
-
- org.eclipse.xtext.parser.antlr.TokenTool
-
public class TokenTool extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringLEXER_RULE_PREFIX
-
Constructor Summary
Constructors Constructor Description TokenTool()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetLength(org.antlr.runtime.Token t)static java.lang.StringgetLexerRuleName(java.lang.String antlrTokenDef)static intgetLine(org.antlr.runtime.Token t)static intgetOffset(org.antlr.runtime.Token t)static java.lang.StringgetText(org.antlr.runtime.Token t)static booleanisLexerRule(java.lang.String antlrTokenDef)
-
-
-
Field Detail
-
LEXER_RULE_PREFIX
public static final java.lang.String LEXER_RULE_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
getText
public static java.lang.String getText(org.antlr.runtime.Token t)
- Parameters:
t- the token- Returns:
- the parsed text or
nullif theTokent wasnullor the token's text wasnull.
-
getLine
public static int getLine(org.antlr.runtime.Token t)
- Parameters:
t- the token- Returns:
- the line of the token or
-1if theTokent wasnullor the token did not provide line information.
-
getOffset
public static int getOffset(org.antlr.runtime.Token t)
- Parameters:
t- the token- Returns:
- the offset of the token or
-1if theTokent wasnullor the token did not provide offset information.
-
getLength
public static int getLength(org.antlr.runtime.Token t)
- Parameters:
t- the token- Returns:
- the length of the token or
0if theTokent wasnullor the token did not provide line information.
-
isLexerRule
public static boolean isLexerRule(java.lang.String antlrTokenDef)
-
getLexerRuleName
public static java.lang.String getLexerRuleName(java.lang.String antlrTokenDef)
-
-