Package antlr
Class TokenStreamBasicFilter
java.lang.Object
antlr.TokenStreamBasicFilter
- All Implemented Interfaces:
IASDebugStream,TokenStream
- Direct Known Subclasses:
TokenStreamHiddenTokenFilter
This object is a TokenStream that passes through all
tokens except for those that you tell it to discard.
There is no buffering of the tokens.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BitSetThe set of token types to discardprotected TokenStreamThe input stream -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddiscard(int ttype) voidReturns the entire text input to the lexer.getOffsetInfo(Token token) Returns the offset information for the token
-
Field Details
-
discardMask
The set of token types to discard -
input
The input stream
-
-
Constructor Details
-
TokenStreamBasicFilter
-
-
Method Details
-
discard
public void discard(int ttype) -
discard
-
nextToken
- Specified by:
nextTokenin interfaceTokenStream- Throws:
TokenStreamException
-
getEntireText
Description copied from interface:IASDebugStreamReturns the entire text input to the lexer.- Specified by:
getEntireTextin interfaceIASDebugStream- Returns:
- The entire text or
null, if error occured or System.in was used.
-
getOffsetInfo
Description copied from interface:IASDebugStreamReturns the offset information for the token- Specified by:
getOffsetInfoin interfaceIASDebugStream- Parameters:
token- the token whose information need to be retrieved- Returns:
- offset info, or
null
-