summaryrefslogtreecommitdiffstats
path: root/poxml/antlr/antlr/TokenStreamBasicFilter.hpp
blob: 5438878bc6ad5384af0863b55b9aa3479c138cc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef INC_TokenStreamBasicFilter_hpp__
#define INC_TokenStreamBasicFilter_hpp__

#include "antlr/config.hpp"
#include "antlr/BitSet.hpp"
#include "antlr/TokenStream.hpp"

ANTLR_BEGIN_NAMESPACE(antlr)

/** 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.
 */
class TokenStreamBasicFilter : public TokenStream {
	/** The set of token types to discard */
protected:
	BitSet discardMask;

	/** The input stream */
protected:
	TokenStream* input;

public:
	TokenStreamBasicFilter(TokenStream& input_);

	void discard(int ttype);

	void discard(const BitSet& mask);

	RefToken nextToken();
};

ANTLR_END_NAMESPACE

#endif //INC_TokenStreamBasicFilter_hpp__