public TokenStreamHiddenTokenFilter(TokenStream input) { super(input); hideMask = new BitSet(); }
public TokenStreamBasicFilter(TokenStream input) { this.input = input; discardMask = new BitSet(); }
public Lookahead() { fset = new BitSet(); }
public static BitSet of(int el) { BitSet s = new BitSet(el + 1); s.add(el); return s; }
LexerGrammar(String className_, Tool tool_, String superClass) { super(className_, tool_, superClass); // by default, use 0..127 for ASCII char vocabulary BitSet cv = new BitSet(); for (int i = 0; i <= 127; i++) { cv.add(i); } setCharVocabulary(cv); // Lexer usually has no default error handling defaultErrorHandler = false; }
public Lookahead look(int k, WildcardElement wc) { if (DEBUG_ANALYZER) System.out.println("look(" + k + "," + wc + ")"); // Skip until analysis hits k==1 if (k > 1) { return wc.next.look(k - 1); } BitSet b; if (lexicalAnalysis) { // Copy the character vocabulary b = (BitSet)((LexerGrammar)grammar).charVocabulary.clone(); } else { b = new BitSet(1); // Invert the lookahead set against the token vocabulary int maxToken = grammar.tokenManager.maxTokenType(); b.notInPlace(Token.MIN_USER_TYPE, maxToken); if (DEBUG_ANALYZER) System.out.println("look(" + k + "," + wc + ") after not: " + b); } // Remove prediction sets from competing alternatives // removeCompetingPredictionSets(b, wc); return new Lookahead(b); }