📄 javarecognizer.java
字号:
ASTPair currentAST = new ASTPair(); AST exclusiveOrExpression_AST = null; Expression a,b; e=andExpression(); astFactory.addASTChild(currentAST, returnAST); { _loop23: do { if ((LA(1)==BXOR)) { AST tmp19_AST = null; tmp19_AST = astFactory.create(LT(1)); astFactory.makeASTRoot(currentAST, tmp19_AST); match(BXOR); b=andExpression(); astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { e=new ExclusiveOrExpression(e,b); } } else { break _loop23; } } while (true); } exclusiveOrExpression_AST = (AST)currentAST.root; returnAST = exclusiveOrExpression_AST; return e; } public final Expression andExpression() throws RecognitionException, TokenStreamException { Expression e = null; returnAST = null; ASTPair currentAST = new ASTPair(); AST andExpression_AST = null; Expression a,b; e=equalityExpression(); astFactory.addASTChild(currentAST, returnAST); { _loop26: do { if ((LA(1)==BAND)) { AST tmp20_AST = null; tmp20_AST = astFactory.create(LT(1)); astFactory.makeASTRoot(currentAST, tmp20_AST); match(BAND); b=equalityExpression(); astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { e=new AndExpression(e,b); } } else { break _loop26; } } while (true); } andExpression_AST = (AST)currentAST.root; returnAST = andExpression_AST; return e; } public final Expression equalityExpression() throws RecognitionException, TokenStreamException { Expression e = null; returnAST = null; ASTPair currentAST = new ASTPair(); AST equalityExpression_AST = null; Expression a,b; e=relationalExpression(); astFactory.addASTChild(currentAST, returnAST); { _loop30: do { if ((LA(1)==NOT_EQUAL||LA(1)==EQUAL)) { { switch ( LA(1)) { case NOT_EQUAL: { AST tmp21_AST = null; tmp21_AST = astFactory.create(LT(1)); astFactory.makeASTRoot(currentAST, tmp21_AST); match(NOT_EQUAL); a=relationalExpression(); astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { e=new NotEqualExpression(e,a); } break; } case EQUAL: { AST tmp22_AST = null; tmp22_AST = astFactory.create(LT(1)); astFactory.makeASTRoot(currentAST, tmp22_AST); match(EQUAL); a=relationalExpression(); astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { e=new EqualExpression(e,a); } break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } } else { break _loop30; } } while (true); } equalityExpression_AST = (AST)currentAST.root; returnAST = equalityExpression_AST; return e; } public final Expression relationalExpression() throws RecognitionException, TokenStreamException { Expression e = null; returnAST = null; ASTPair currentAST = new ASTPair(); AST relationalExpression_AST = null; Expression a,b; e=shiftExpression(); astFactory.addASTChild(currentAST, returnAST); { { _loop35: do { if (((LA(1) >= LT && LA(1) <= GE))) { { switch ( LA(1)) { case LT: { AST tmp23_AST = null; tmp23_AST = astFactory.create(LT(1)); astFactory.makeASTRoot(currentAST, tmp23_AST); match(LT); a=shiftExpression(); astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { e=new LessThanExpression(e,a); } break; } case GT: { AST tmp24_AST = null; tmp24_AST = astFactory.create(LT(1)); astFactory.makeASTRoot(currentAST, tmp24_AST); match(GT); a=shiftExpression(); astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { e=new GreaterThanExpression(e,a); } break; } case LE: { AST tmp25_AST = null; tmp25_AST = astFactory.create(LT(1)); astFactory.makeASTRoot(currentAST, tmp25_AST); match(LE); a=shiftExpression(); astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { e=new LessThanOrEqualExpression(e,a); } break; } case GE: { AST tmp26_AST = null; tmp26_AST = astFactory.create(LT(1)); astFactory.makeASTRoot(currentAST, tmp26_AST); match(GE); a=shiftExpression(); astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { e=new GreaterThanOrEqualExpression(e,a); } break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } } else { break _loop35; } } while (true); } } relationalExpression_AST = (AST)currentAST.root; returnAST = relationalExpression_AST; return e; } public final Expression shiftExpression() throws RecognitionException, TokenStreamException { Expression e = null; returnAST = null; ASTPair currentAST = new ASTPair(); AST shiftExpression_AST = null; Expression a,b; e=additiveExpression(); astFactory.addASTChild(currentAST, returnAST); { _loop39: do { if (((LA(1) >= SL && LA(1) <= BSR))) { { switch ( LA(1)) { case SL: { AST tmp27_AST = null; tmp27_AST = astFactory.create(LT(1)); astFactory.makeASTRoot(currentAST, tmp27_AST); match(SL); a=additiveExpression(); astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { e=new ShiftLeftExpression(e,a); } break; } case SR: { AST tmp28_AST = null; tmp28_AST = astFactory.create(LT(1)); astFactory.makeASTRoot(currentAST, tmp28_AST); match(SR); a=additiveExpression(); astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { e=new ShiftRightExpression(e,a); } break; } case BSR: { AST tmp29_AST = null; tmp29_AST = astFactory.create(LT(1)); astFactory.makeASTRoot(currentAST, tmp29_AST); match(BSR); a=additiveExpression(); astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { e=new BitShiftRightExpression(e,a); } break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } } else { break _loop39; } } while (true); } shiftExpression_AST = (AST)currentAST.root; returnAST = shiftExpression_AST; return e; } public final Expression additiveExpression() throws RecognitionException, TokenStreamException { Expression e = null; returnAST = null; ASTPair currentAST = new ASTPair(); AST additiveExpression_AST = null; Expression a,b; e=multiplicativeExpression(); astFactory.addASTChild(currentAST, returnAST); { _loop43: do { if ((LA(1)==PLUS||LA(1)==MINUS)) { { switch ( LA(1)) { case PLUS: { AST tmp30_AST = null; tmp30_AST = astFactory.create(LT(1)); astFactory.makeASTRoot(currentAST, tmp30_AST); match(PLUS); a=multiplicativeExpression(); astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { e=new AdditionExpression(e,a); } break; } case MINUS: { AST tmp31_AST = null; tmp31_AST = astFactory.create(LT(1)); astFactory.makeASTRoot(currentAST, tmp31_AST); match(MINUS); a=multiplicativeExpression(); astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { e=new SubtractionExpression(e,a); } break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } } else { break _loop43; } } while (true); } additiveExpression_AST = (AST)currentAST.root; returnAST = additiveExpression_AST; return e; } public final Expression multiplicativeExpression() throws RecognitionException, TokenStreamException { Expression e = null; returnAST = null; ASTPair currentAST = new ASTPair(); AST multiplicativeExpression_AST = null; Expression a,b; e=unaryExpression(); astFactory.addASTChild(currentAST, returnAST); { _loop47: do { if (((LA(1) >= STAR && LA(1) <= MOD))) { { switch ( LA(1)) { case STAR: { AST tmp32_AST = null; tmp32_AST = astFactory.create(LT(1)); astFactory.makeASTRoot(currentAST, tmp32_AST); match(STAR); a=unaryExpression(); astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { e=new MultiplicationExpression(e,a); } break; } case DIV: { AST tmp33_AST = null; tmp33_AST = astFactory.create(LT(1)); astFactory.makeASTRoot(currentAST, tmp33_AST); match(DIV); a=unaryExpression(); astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { e=new DivisionExpression(e,a); } break; } case MOD: { AST tmp34_AST = null; tmp34_AST = astFactory.create(LT(1)); astFactory.makeASTRoot(currentAST, tmp34_AST); match(MOD); a=unaryExpression(); astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { e=new ModuloExpression(e,a); } break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } } else { break _loop47; } } while (true); } multiplicativeExpression_AST = (AST)currentAST.root; returnAST = multiplicativeExpression_AST; return e; } public final Expression unaryExpression() throws RecognitionException, TokenStreamException { Expression e = null; returnAST = null; ASTPair currentAST = new ASTPair(); AST unaryExpression_AST = null; Expression a,b; switch ( LA(1)) { case MINUS: { AST tmp35_AST = null; tmp35_AST = astFactory.create(LT(1)); astFactory.makeASTRoot(currentAST, tmp35_AST); match(MINUS); if ( inputState.guessing==0 ) { tmp35_AST.setType(UNARY_MINUS); } a=unaryExpression(); astFactory.addASTChild(currentAST, returnAST); if ( inputState.guessing==0 ) { e=new NegateExpression(a); } unaryExpression_AST = (AST)currentAST.root; break; } case PLUS: { AST tmp36_AST = null; tmp36_AST = astFactory.create(LT(1)); astFactory.makeASTRoot(currentAST, tmp36_AST); match(PLUS); if ( inputState.guessing==0 ) { tmp36_AST.setType(UNARY_PLUS); } e=unaryExpression(); astFactory.addASTChild(currentAST, returnAST); unaryExpression_AST = (AST)currentAST.root; break; } case IDENT: case BNOT: case LNOT: case LPAREN: case LITERAL_true: case LITERAL_false: case LITERAL_null: case NUM_INT: case CHAR_LITERAL:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -