ANTLR Support Libraries 2.7.1+
 All Classes Namespaces Files Functions Variables Typedefs Friends Defines
antlr/TokenStreamHiddenTokenFilter.hpp
Go to the documentation of this file.
00001 #ifndef INC_TokenStreamHiddenTokenFilter_hpp__
00002 #define INC_TokenStreamHiddenTokenFilter_hpp__
00003 
00004 /* ANTLR Translator Generator
00005  * Project led by Terence Parr at http://www.jGuru.com
00006  * Software rights: http://www.antlr.org/license.html
00007  *
00008  * $Id: //depot/code/org.antlr/release/antlr-2.7.7/lib/cpp/antlr/TokenStreamHiddenTokenFilter.hpp#2 $
00009  */
00010 
00011 #include <antlr/config.hpp>
00012 #include <antlr/TokenStreamBasicFilter.hpp>
00013 
00014 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
00015 namespace antlr {
00016 #endif
00017 
00025 class ANTLR_API TokenStreamHiddenTokenFilter : public TokenStreamBasicFilter {
00026    // protected BitSet discardMask;
00027 protected:
00028    BitSet hideMask;
00029 
00030 private:
00031    RefToken nextMonitoredToken;
00032 
00033 protected:
00037    RefToken lastHiddenToken;
00038 
00039    RefToken firstHidden; // = null;
00040 
00041 public:
00042    TokenStreamHiddenTokenFilter(TokenStream& input);
00043 
00044 protected:
00045    void consume();
00046 
00047 private:
00048    void consumeFirst();
00049 
00050 public:
00051    BitSet getDiscardMask() const;
00052 
00056    RefToken getHiddenAfter(RefToken t);
00057 
00061    RefToken getHiddenBefore(RefToken t);
00062 
00063    BitSet getHideMask() const;
00064 
00068    RefToken getInitialHiddenToken();
00069 
00070    void hide(int m);
00071 
00072    void hide(const BitSet& mask);
00073 
00074 protected:
00075    RefToken LA(int i);
00076 
00077 public:
00088    RefToken nextToken();
00089 };
00090 
00091 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE
00092 }
00093 #endif
00094 
00095 #endif //INC_TokenStreamHiddenTokenFilter_hpp__