FileDocCategorySizeDatePackage
TokenStreamBasicFilter.javaAPI DocGlassfish v2 API1104Wed Aug 30 15:34:10 BST 2006persistence.antlr

TokenStreamBasicFilter

public class TokenStreamBasicFilter extends Object implements TokenStream
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.

Fields Summary
protected BitSet
discardMask
The set of token types to discard
protected TokenStream
input
The input stream
Constructors Summary
public TokenStreamBasicFilter(TokenStream input)

        this.input = input;
        discardMask = new BitSet();
    
Methods Summary
public voiddiscard(int ttype)

        discardMask.add(ttype);
    
public voiddiscard(persistence.antlr.collections.impl.BitSet mask)

        discardMask = mask;
    
public persistence.antlr.TokennextToken()

        Token tok = input.nextToken();
        while (tok != null && discardMask.member(tok.getType())) {
            tok = input.nextToken();
        }
        return tok;