#ifndef INC_TokenStreamHiddenTokenFilter_hpp__#define INC_TokenStreamHiddenTokenFilter_hpp__/* ANTLR Translator Generator * Project led by Terence Parr at http://www.jGuru.com * Software rights: http://www.antlr.org/license.html * * $Id: //depot/code/org.antlr/release/antlr-2.7.5/lib/cpp/antlr/TokenStreamHiddenTokenFilter.hpp#1 $ */#include<antlr/config.hpp>#include<antlr/TokenStreamBasicFilter.hpp>#ifdef ANTLR_CXX_SUPPORTS_NAMESPACEnamespaceantlr{#endif/**This object filters a token stream coming from a lexer * or another TokenStream so that only certain token channels * get transmitted to the parser. * * Any of the channels can be filtered off as "hidden" channels whose * tokens can be accessed from the parser. */classANTLR_APITokenStreamHiddenTokenFilter:publicTokenStreamBasicFilter{// protected BitSet discardMask;protected:BitSethideMask;private:RefTokennextMonitoredToken;protected:/** track tail of hidden list emanating from previous * monitored token */RefTokenlastHiddenToken;RefTokenfirstHidden;// = null;public:TokenStreamHiddenTokenFilter(TokenStream&input);protected:voidconsume();private:voidconsumeFirst();public:BitSetgetDiscardMask()const;/** Return a ptr to the hidden token appearing immediately after * token t in the input stream. */RefTokengetHiddenAfter(RefTokent);/** Return a ptr to the hidden token appearing immediately before * token t in the input stream. */RefTokengetHiddenBefore(RefTokent);BitSetgetHideMask()const;/** Return the first hidden token if one appears * before any monitored token. */RefTokengetInitialHiddenToken();voidhide(intm);voidhide(constBitSet&mask);protected:RefTokenLA(inti);public:/** Return the next monitored token. * Test the token following the monitored token. * If following is another monitored token, save it * for the next invocation of nextToken (like a single * lookahead token) and return it then. * If following is unmonitored, nondiscarded (hidden) * channel token, add it to the monitored token. * * Note: EOF must be a monitored Token. */RefTokennextToken();};#ifdef ANTLR_CXX_SUPPORTS_NAMESPACE}#endif#endif //INC_TokenStreamHiddenTokenFilter_hpp__