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 BitSet
The set of token types to discardprotected TokenStream
The input stream -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
discard
(int ttype) void
Returns 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:
nextToken
in interfaceTokenStream
- Throws:
TokenStreamException
-
getEntireText
Description copied from interface:IASDebugStream
Returns the entire text input to the lexer.- Specified by:
getEntireText
in interfaceIASDebugStream
- Returns:
- The entire text or
null
, if error occured or System.in was used.
-
getOffsetInfo
Description copied from interface:IASDebugStream
Returns the offset information for the token- Specified by:
getOffsetInfo
in interfaceIASDebugStream
- Parameters:
token
- the token whose information need to be retrieved- Returns:
- offset info, or
null
-