/** * Creates a 'binary operator' subtree, given the information about the * parent and the two child nodex. * * @param factory The AST factory. * @param parentType The type of the parent node. * @param parentText The text of the parent node. * @param child1 The first child. * @param child2 The second child. * * @return AST - A new sub-tree of the form "(parent child1 child2)" */ public static AST createBinarySubtree( ASTFactory factory, int parentType, String parentText, AST child1, AST child2) { ASTArray array = createAstArray( factory, 3, parentType, parentText, child1 ); array.add( child2 ); return factory.make( array ); }
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 ?
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; }
_loop245: do { if (((_tokenSet_36.member(LA(1))) && (_tokenSet_59.member(LA(2))))&&(LA(1)!=LITERAL_default)) { statement(); astFactory.addASTChild(currentAST, returnAST); caseSList_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(SLIST,"SLIST")).add(caseSList_AST)); currentAST.root = caseSList_AST; currentAST.child = caseSList_AST!=null &&caseSList_AST.getFirstChild()!=null ?
do { if (_t==null) _t=ASTNULL; if ((_tokenSet_4.member(_t.getType()))) { if ( inputState.guessing==0 ) { betweenFunctionArguments();
_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 ?
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; }
if ((LA(1)==SEMI) && (_tokenSet_51.member(LA(2)))) { AST tmp175_AST = null; tmp175_AST = astFactory.create(LT(1)); resources_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(RESOURCES,"RESOURCES")).add(resources_AST)); currentAST.root = resources_AST; currentAST.child = resources_AST!=null &&resources_AST.getFirstChild()!=null ?
do { if (_t==null) _t=ASTNULL; if ((_tokenSet_3.member(_t.getType()))) { e = _t==ASTNULL ? null : (AST)_t; simpleOrTupleExpr(_t);
public final void annotationExpression() throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); AST annotationExpression_AST = null; conditionalExpression(); astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { annotationExpression_AST = (AST)currentAST.root; annotationExpression_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(EXPR,"EXPR")).add(annotationExpression_AST)); currentAST.root = annotationExpression_AST; currentAST.child = annotationExpression_AST!=null &&annotationExpression_AST.getFirstChild()!=null ? annotationExpression_AST.getFirstChild() : annotationExpression_AST; currentAST.advanceChildToEnd(); } annotationExpression_AST = (AST)currentAST.root; returnAST = annotationExpression_AST; }
if ((_tokenSet_4.member(LA(1)))) { modifier(); astFactory.addASTChild(currentAST, returnAST); modifiers_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(MODIFIERS,"MODIFIERS")).add(modifiers_AST)); currentAST.root = modifiers_AST; currentAST.child = modifiers_AST!=null &&modifiers_AST.getFirstChild()!=null ?
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; }
if (((LA(1)==IDENT||LA(1)==LPAREN) && (_tokenSet_15.member(LA(2))))) { int _m270 = mark(); synPredMatched270 = true; expression_AST = (AST)currentAST.root; else if (((_tokenSet_12.member(LA(1))) && (_tokenSet_17.member(LA(2))))&&(LA(1)!=RPAREN)) { assignmentExpression(); astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { expression_AST = (AST)currentAST.root; expression_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(EXPR,"EXPR")).add(expression_AST)); currentAST.root = expression_AST; currentAST.child = expression_AST!=null &&expression_AST.getFirstChild()!=null ?
do { if (_t==null) _t=ASTNULL; if ((_tokenSet_1.member(_t.getType()))) { if ( inputState.guessing==0 ) { out(", ");
if (((LA(1)==IDENT||LA(1)==AT) && (_tokenSet_18.member(LA(2))))&&(LA(1) == AT)) { annotations(); astFactory.addASTChild(currentAST, returnAST); else if ((LA(1)==IDENT) && (_tokenSet_18.member(LA(2)))) { astFactory.addASTChild(currentAST, returnAST); else if ((_tokenSet_18.member(LA(1))) && (_tokenSet_19.member(LA(2)))) { typeParameter_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(TYPE_PARAMETER,"TYPE_PARAMETER")).add(typeParameter_AST)); currentAST.root = typeParameter_AST; currentAST.child = typeParameter_AST!=null &&typeParameter_AST.getFirstChild()!=null ?
match(COLON); else if ((LA(1)==NAME) && (_tokenSet_3.member(LA(2)))) {
resource_AST = (AST)currentAST.root; else if ((_tokenSet_51.member(LA(1))) && (_tokenSet_52.member(LA(2)))) { modifiers(); astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { resource_AST = (AST)currentAST.root; resource_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(RESOURCE,"RESOURCE")).add(resource_AST)); currentAST.root = resource_AST; currentAST.child = resource_AST!=null &&resource_AST.getFirstChild()!=null ?