KDevelop API Documentation

lib/antlr/src/TokenStreamBasicFilter.cpp

Go to the documentation of this file.
00001 /* ANTLR Translator Generator 00002 * Project led by Terence Parr at http://www.jGuru.com 00003 * Software rights: http://www.antlr.org/RIGHTS.html 00004 * 00005 * $Id: TokenStreamBasicFilter.cpp,v 1.2 2003/05/02 00:36:20 okellogg Exp $ 00006 */ 00007 #include "antlr/TokenStreamBasicFilter.hpp" 00008 00009 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE 00010 namespace antlr { 00011 #endif 00012 00017 TokenStreamBasicFilter::TokenStreamBasicFilter(TokenStream& input_) 00018 : input(&input_) 00019 { 00020 } 00021 00022 void TokenStreamBasicFilter::discard(int ttype) 00023 { 00024 discardMask.add(ttype); 00025 } 00026 00027 void TokenStreamBasicFilter::discard(const BitSet& mask) 00028 { 00029 discardMask = mask; 00030 } 00031 00032 RefToken TokenStreamBasicFilter::nextToken() 00033 { 00034 RefToken tok = input->nextToken(); 00035 while ( tok && discardMask.member(tok->getType()) ) { 00036 tok = input->nextToken(); 00037 } 00038 return tok; 00039 } 00040 00041 #ifdef ANTLR_CXX_SUPPORTS_NAMESPACE 00042 } 00043 #endif 00044
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Oct 19 08:01:47 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003