Package org.eclipse.xtext.parser.antlr
Class XtextTokenStream
- java.lang.Object
-
- org.antlr.runtime.CommonTokenStream
-
- org.eclipse.xtext.parser.antlr.XtextTokenStream
-
- All Implemented Interfaces:
org.antlr.runtime.IntStream,org.antlr.runtime.TokenStream
public class XtextTokenStream extends org.antlr.runtime.CommonTokenStreamA token stream that is aware of the current lookahead.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceXtextTokenStream.HiddenTokens
-
Constructor Summary
Constructors Constructor Description XtextTokenStream()XtextTokenStream(org.antlr.runtime.TokenSource tokenSource, int channel)XtextTokenStream(org.antlr.runtime.TokenSource tokenSource, ITokenDefProvider tokenDefProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbasicConsume()Make super-impl ofconsume()accessible to subtypes.protected intbasicMark()Make super-impl ofmark()accessible to subtypes.protected voidbasicRewind(int marker)Make super-impl ofCommonTokenStream.rewind()accessible to subtypes.voidconsume()protected voiddoSetHiddenTokens(java.lang.String... lexerRules)intgetCurrentLookAhead()protected intgetFirstMarker()java.lang.StringgetLexerErrorMessage(org.antlr.runtime.Token invalidToken)protected intgetTokenIndex(org.antlr.runtime.Token tok)voidinitCurrentLookAhead(int currentLookAhead)intLA(int i)org.antlr.runtime.TokenLT(int k)Same asCommonTokenStream.LT(int)except that we skip hidden tokens even fork == 1.intmark()voidrewind(int marker)XtextTokenStream.HiddenTokenssetHiddenTokens(java.lang.String... lexerRules)voidsetInitialHiddenTokens(java.lang.String... lexerRules)protected voidskipHiddenTokens()java.lang.StringtoString(int start, int stop)-
Methods inherited from class org.antlr.runtime.CommonTokenStream
discardOffChannelTokens, discardTokenType, fillBuffer, get, getSourceName, getTokens, getTokens, getTokens, getTokens, getTokens, getTokenSource, index, LB, release, reset, rewind, seek, setTokenSource, setTokenTypeChannel, size, skipOffTokenChannels, skipOffTokenChannelsReverse, toString, toString
-
-
-
-
Constructor Detail
-
XtextTokenStream
public XtextTokenStream()
-
XtextTokenStream
public XtextTokenStream(org.antlr.runtime.TokenSource tokenSource, int channel)
-
XtextTokenStream
public XtextTokenStream(org.antlr.runtime.TokenSource tokenSource, ITokenDefProvider tokenDefProvider)
-
-
Method Detail
-
toString
public java.lang.String toString(int start, int stop)- Specified by:
toStringin interfaceorg.antlr.runtime.TokenStream- Overrides:
toStringin classorg.antlr.runtime.CommonTokenStream
-
setHiddenTokens
public XtextTokenStream.HiddenTokens setHiddenTokens(java.lang.String... lexerRules)
-
setInitialHiddenTokens
public void setInitialHiddenTokens(java.lang.String... lexerRules)
-
doSetHiddenTokens
protected void doSetHiddenTokens(java.lang.String... lexerRules)
-
skipHiddenTokens
protected void skipHiddenTokens()
-
LA
public int LA(int i)
- Specified by:
LAin interfaceorg.antlr.runtime.IntStream- Overrides:
LAin classorg.antlr.runtime.CommonTokenStream
-
getTokenIndex
protected int getTokenIndex(org.antlr.runtime.Token tok)
- Since:
- 2.22
-
consume
public void consume()
- Specified by:
consumein interfaceorg.antlr.runtime.IntStream- Overrides:
consumein classorg.antlr.runtime.CommonTokenStream
-
basicConsume
protected void basicConsume()
Make super-impl ofconsume()accessible to subtypes.- Since:
- 2.22
-
getFirstMarker
protected int getFirstMarker()
- Since:
- 2.1
-
mark
public int mark()
- Specified by:
markin interfaceorg.antlr.runtime.IntStream- Overrides:
markin classorg.antlr.runtime.CommonTokenStream
-
basicMark
protected int basicMark()
Make super-impl ofmark()accessible to subtypes.- Since:
- 2.22
-
rewind
public void rewind(int marker)
- Specified by:
rewindin interfaceorg.antlr.runtime.IntStream- Overrides:
rewindin classorg.antlr.runtime.CommonTokenStream
-
basicRewind
protected void basicRewind(int marker)
Make super-impl ofCommonTokenStream.rewind()accessible to subtypes.- Since:
- 2.22
-
LT
public org.antlr.runtime.Token LT(int k)
Same asCommonTokenStream.LT(int)except that we skip hidden tokens even fork == 1.- Specified by:
LTin interfaceorg.antlr.runtime.TokenStream- Overrides:
LTin classorg.antlr.runtime.CommonTokenStream
-
getCurrentLookAhead
public int getCurrentLookAhead()
-
initCurrentLookAhead
public void initCurrentLookAhead(int currentLookAhead)
-
getLexerErrorMessage
public java.lang.String getLexerErrorMessage(org.antlr.runtime.Token invalidToken)
-
-