2
using BitSet = antlr.collections.impl.BitSet;
6
/*ANTLR Translator Generator
7
* Project led by Terence Parr at http://www.jGuru.com
8
* Software rights: http://www.antlr.org/license.html
14
// ANTLR C# Code Generator by Micheal Jordan
15
// Kunle Odutola : kunle UNDERSCORE odutola AT hotmail DOT com
16
// Anthony Oguntimehin
18
// With many thanks to Eric V. Smith from the ANTLR list.
21
/*This object is a TokenStream that passes through all
22
* tokens except for those that you tell it to discard.
23
* There is no buffering of the tokens.
25
public class TokenStreamBasicFilter : TokenStream
27
/*The set of token types to discard */
28
protected internal BitSet discardMask;
31
protected internal TokenStream input;
33
public TokenStreamBasicFilter(TokenStream input)
36
discardMask = new BitSet();
38
public virtual void discard(int ttype)
40
discardMask.add(ttype);
42
public virtual void discard(BitSet mask)
46
public virtual Token nextToken()
48
Token tok = input.nextToken();
49
while (tok != null && discardMask.member(tok.Type))
51
tok = input.nextToken();
2
using BitSet = antlr.collections.impl.BitSet;
6
/*ANTLR Translator Generator
7
* Project led by Terence Parr at http://www.jGuru.com
8
* Software rights: http://www.antlr.org/license.html
14
// ANTLR C# Code Generator by Micheal Jordan
15
// Kunle Odutola : kunle UNDERSCORE odutola AT hotmail DOT com
16
// Anthony Oguntimehin
18
// With many thanks to Eric V. Smith from the ANTLR list.
21
/*This object is a TokenStream that passes through all
22
* tokens except for those that you tell it to discard.
23
* There is no buffering of the tokens.
25
public class TokenStreamBasicFilter : TokenStream
27
/*The set of token types to discard */
28
protected internal BitSet discardMask;
31
protected internal TokenStream input;
33
public TokenStreamBasicFilter(TokenStream input)
36
discardMask = new BitSet();
38
public virtual void discard(int ttype)
40
discardMask.add(ttype);
42
public virtual void discard(BitSet mask)
46
public virtual IToken nextToken()
48
IToken tok = input.nextToken();
49
while (tok != null && discardMask.member(tok.Type))
51
tok = input.nextToken();
b'\\ No newline at end of file'