public final void mATOM(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { int _ttype; Token _token=null; int _begin=text.length(); _ttype = ATOM; int _saveIndex; { int _cnt26=0; _loop26: do { if ((_tokenSet_0.member(LA(1)))) { mIDENTIFIER_PART(false); } else { if ( _cnt26>=1 ) { break _loop26; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} } _cnt26++; } while (true); } if ( _createToken && _token==null && _ttype!=Token.SKIP ) { _token = makeToken(_ttype); _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); } _returnToken = _token; }
theRetToken=_returnToken; else if ((_tokenSet_0.member(LA(1)))) { mATOM(true); theRetToken=_returnToken; else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} _ttype = _returnToken.getType(); _ttype = testLiteralsTable(_ttype); _returnToken.setType(_ttype); return _returnToken;
_loop239: do { if ((LA(1)==LITERAL_case||LA(1)==LITERAL_default) && (_tokenSet_58.member(LA(2)))) { aCase(); astFactory.addASTChild(currentAST, returnAST); if ((_tokenSet_36.member(LA(1))) && (_tokenSet_59.member(LA(2)))) { caseSList(); astFactory.addASTChild(currentAST, returnAST); else if ((_tokenSet_60.member(LA(1))) && (_tokenSet_49.member(LA(2)))) { casesGroup_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(CASE_GROUP,"CASE_GROUP")).add(casesGroup_AST)); currentAST.root = casesGroup_AST; currentAST.child = casesGroup_AST!=null &&casesGroup_AST.getFirstChild()!=null ?
lc_AST = astFactory.create(lc); astFactory.makeASTRoot(currentAST, lc_AST); match(LCURLY); if ( inputState.guessing==0 ) { if ((_tokenSet_36.member(LA(1)))) { statement(); astFactory.addASTChild(currentAST, returnAST);
public final void lambdaBody() throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); AST lambdaBody_AST = null; { if ((_tokenSet_12.member(LA(1))) && (_tokenSet_69.member(LA(2)))) { expression(); astFactory.addASTChild(currentAST, returnAST); } else if ((_tokenSet_36.member(LA(1))) && (_tokenSet_69.member(LA(2)))) { statement(); astFactory.addASTChild(currentAST, returnAST); } else { throw new NoViableAltException(LT(1), getFilename()); } } lambdaBody_AST = (AST)currentAST.root; returnAST = lambdaBody_AST; }
tmp243_AST = astFactory.create(LT(1)); astFactory.addASTChild(currentAST, tmp243_AST); match(IDENT); lambdaParameters_AST = (AST)currentAST.root; tmp244_AST = astFactory.create(LT(1)); astFactory.addASTChild(currentAST, tmp244_AST); match(LPAREN); if ((_tokenSet_67.member(LA(1))) && (_tokenSet_68.member(LA(2)))) { parameterDeclarationList(); astFactory.addASTChild(currentAST, returnAST);
pm_AST = (AST)returnAST; if ((_tokenSet_9.member(LA(1))) && (_tokenSet_47.member(LA(2)))) { typeSpec(false); t_AST = (AST)returnAST; else if ((LA(1)==IDENT||LA(1)==LITERAL_this) && (_tokenSet_48.member(LA(2)))) { if ( inputState.guessing==0 ) { parameterDeclaration_AST = (AST)currentAST.root; parameterDeclaration_AST = (AST)astFactory.make( (new ASTArray(4)).add(astFactory.create(PARAMETER_DEF,"PARAMETER_DEF")).add(pm_AST).add((AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(TYPE,"TYPE")).add(pd_AST))).add(id_AST)); currentAST.root = parameterDeclaration_AST; currentAST.child = parameterDeclaration_AST!=null &¶meterDeclaration_AST.getFirstChild()!=null ?
do { if (_t==null) _t=ASTNULL; if ((_tokenSet_4.member(_t.getType()))) { if ( inputState.guessing==0 ) { betweenFunctionArguments();
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); }
public Lookahead look(int k, TokenRangeElement r) { if (DEBUG_ANALYZER) System.out.println("lookTokenRange(" + k + "," + r + ")"); // Skip until analysis hits k==1 if (k > 1) { return r.next.look(k - 1); } BitSet p = BitSet.of(r.begin); for (int i = r.begin + 1; i <= r.end; i++) { p.add(i); } return new Lookahead(p); }
public void hide(int m) { hideMask.add(m); }
public TokenStreamHiddenTokenFilter(TokenStream input) { super(input); hideMask = new BitSet(); }
if ((_tokenSet_0.member(LA(1)))) { mIDENT(true); theRetToken=_returnToken; else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} _ttype = _returnToken.getType(); _returnToken.setType(_ttype); return _returnToken;
astFactory.addASTChild(currentAST, returnAST); if ((LA(1)==SEMI) && (_tokenSet_51.member(LA(2)))) { AST tmp175_AST = null; tmp175_AST = astFactory.create(LT(1)); astFactory.addASTChild(currentAST, tmp175_AST); match(SEMI); resource();
f_AST = astFactory.create(f); astFactory.makeASTRoot(currentAST, f_AST); match(LITERAL_for); AST tmp158_AST = null; tmp158_AST = astFactory.create(LT(1)); astFactory.addASTChild(currentAST, tmp158_AST); match(LPAREN); if (((_tokenSet_56.member(LA(1))) && (_tokenSet_57.member(LA(2))))) { int _m232 = mark(); synPredMatched232 = true; astFactory.addASTChild(currentAST, returnAST); else if ((_tokenSet_51.member(LA(1))) && (_tokenSet_52.member(LA(2)))) { forEachClause(); astFactory.addASTChild(currentAST, returnAST);
public final void annotationArguments() throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); AST annotationArguments_AST = null; if ((_tokenSet_10.member(LA(1))) && (_tokenSet_11.member(LA(2)))) { annotationMemberValueInitializer(); astFactory.addASTChild(currentAST, returnAST); annotationArguments_AST = (AST)currentAST.root; } else if ((LA(1)==IDENT) && (LA(2)==ASSIGN)) { annotationMemberValuePairs(); astFactory.addASTChild(currentAST, returnAST); annotationArguments_AST = (AST)currentAST.root; } else { throw new NoViableAltException(LT(1), getFilename()); } returnAST = annotationArguments_AST; }
public final void argList() throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); AST argList_AST = null; { if (((_tokenSet_12.member(LA(1))))&&(LA(1)!=RPAREN)) { expressionList(); astFactory.addASTChild(currentAST, returnAST); } else if ((LA(1)==RPAREN)) { if ( inputState.guessing==0 ) { argList_AST = (AST)currentAST.root; argList_AST = astFactory.create(ELIST,"ELIST"); currentAST.root = argList_AST; currentAST.child = argList_AST!=null &&argList_AST.getFirstChild()!=null ? argList_AST.getFirstChild() : argList_AST; currentAST.advanceChildToEnd(); } } else { throw new NoViableAltException(LT(1), getFilename()); } } argList_AST = (AST)currentAST.root; returnAST = argList_AST; }
public CharRangeElement(LexerGrammar g, Token t1, Token t2, int autoGenType) { super(g); begin = (char)ANTLRLexer.tokenTypeForCharLiteral(t1.getText()); beginText = t1.getText(); end = (char)ANTLRLexer.tokenTypeForCharLiteral(t2.getText()); endText = t2.getText(); line = t1.getLine(); // track which characters are referenced in the grammar for (int i = begin; i <= end; i++) { g.charVocabulary.add(i); } this.autoGenType = autoGenType; }