/// <summary> /// Add a child to the current AST /// </summary> /// <param name="currentAST">The AST to add a child to</param> /// <param name="child">The child AST to be added</param> public override void addASTChild(ref ASTPair currentAST, AST child) { if (child != null) { if (currentAST.root == null) { // Make new child the current root currentAST.root = child; ((ASTNode)child).setParent(null); } else { ((ASTNode)child).setParent((ASTNode)currentAST.root); if (currentAST.child == null) { // Add new child to current root currentAST.root.setFirstChild(child); ((ASTNode)child).setPreviousSibling(null); } else { currentAST.child.setNextSibling(child); ((ASTNode)child).setPreviousSibling((ASTNode)currentAST.child); } } // Make new child the current child currentAST.child = child; currentAST.advanceChildToEnd(); } }
/// <summary> /// Make an AST the root of current AST. /// </summary> /// <param name="currentAST"></param> /// <param name="root"></param> public override void makeASTRoot(ref ASTPair currentAST, AST root) { if (root != null) { // Add the current root as a child of new root ((ASTNode)root).addChildEx((ASTNode)currentAST.root); // The new current child is the last sibling of the old root currentAST.child = currentAST.root; currentAST.advanceChildToEnd(); // Set the new root currentAST.root = root; } }
//throws RecognitionException, TokenStreamException public void relationalExpr() { returnAST = null; ASTPair currentAST = new ASTPair(); antlr.CommonAST relationalExpr_AST = null; arithmeticExpr(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } { if (((LA(1) >= LTH && LA(1) <= GTE))) { { switch (LA(1)) { case LTH: { antlr.CommonAST tmp19_AST = null; tmp19_AST = (antlr.CommonAST)astFactory.create(LT(1)); astFactory.makeASTRoot(ref currentAST, (AST)tmp19_AST); match(LTH); break; } case LTE: { antlr.CommonAST tmp20_AST = null; tmp20_AST = (antlr.CommonAST)astFactory.create(LT(1)); astFactory.makeASTRoot(ref currentAST, (AST)tmp20_AST); match(LTE); break; } case GT: { antlr.CommonAST tmp21_AST = null; tmp21_AST = (antlr.CommonAST)astFactory.create(LT(1)); astFactory.makeASTRoot(ref currentAST, (AST)tmp21_AST); match(GT); break; } case GTE: { antlr.CommonAST tmp22_AST = null; tmp22_AST = (antlr.CommonAST)astFactory.create(LT(1)); astFactory.makeASTRoot(ref currentAST, (AST)tmp22_AST); match(GTE); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } arithmeticExpr(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } } else if ((tokenSet_1_.member(LA(1)))) { } else { throw new NoViableAltException(LT(1), getFilename()); } } relationalExpr_AST = (antlr.CommonAST)currentAST.root; returnAST = relationalExpr_AST; }
//throws RecognitionException, TokenStreamException public void postFixExpr() { returnAST = null; ASTPair currentAST = new ASTPair(); antlr.CommonAST postFixExpr_AST = null; //IToken id = null; //antlr.CommonAST id_AST = null; IToken id2 = null; antlr.CommonAST id2_AST = null; bool synPredMatched36 = false; if (((LA(1) == ID))) { int _m36 = mark(); synPredMatched36 = true; inputState.guessing++; try { { match(ID); match(LPAREN); } } catch (RecognitionException) { synPredMatched36 = false; } rewind(_m36); inputState.guessing--; } if (synPredMatched36) { id2 = LT(1); id2_AST = (antlr.CommonAST)astFactory.create(id2); astFactory.makeASTRoot(ref currentAST, (AST)id2_AST); match(ID); { if ((LA(1) == LPAREN)) { parenArgs(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } } else if ((tokenSet_2_.member(LA(1)))) { } else { throw new NoViableAltException(LT(1), getFilename()); } } postFixExpr_AST = (antlr.CommonAST)currentAST.root; } else if ((tokenSet_3_.member(LA(1)))) { atom(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } postFixExpr_AST = (antlr.CommonAST)currentAST.root; } else { throw new NoViableAltException(LT(1), getFilename()); } returnAST = postFixExpr_AST; }
//throws RecognitionException, TokenStreamException public void notInExpr() { returnAST = null; ASTPair currentAST = new ASTPair(); antlr.CommonAST notInExpr_AST = null; antlr.CommonAST tmp27_AST = null; tmp27_AST = (antlr.CommonAST)astFactory.create(LT(1)); astFactory.makeASTRoot(ref currentAST, (AST)tmp27_AST); match(LITERAL_NOT); match(LITERAL_IN); inList(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } notInExpr_AST = (antlr.CommonAST)currentAST.root; returnAST = notInExpr_AST; }
//throws RecognitionException, TokenStreamException public void inList() { returnAST = null; ASTPair currentAST = new ASTPair(); antlr.CommonAST inList_AST = null; match(LPAREN); { arithmeticExpr(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } { // ( ... )* for (; ; ) { if ((LA(1) == COMMA)) { match(COMMA); arithmeticExpr(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } } else { goto _loop24_breakloop; } } _loop24_breakloop: ; } // ( ... )* } match(RPAREN); inList_AST = (antlr.CommonAST)currentAST.root; returnAST = inList_AST; }
//throws RecognitionException, TokenStreamException public void expr() { returnAST = null; ASTPair currentAST = new ASTPair(); antlr.CommonAST expr_AST = null; conditionalExpression(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } match(Token.EOF_TYPE); expr_AST = (antlr.CommonAST)currentAST.root; returnAST = expr_AST; }
//throws RecognitionException, TokenStreamException public void conditionalExpression() { returnAST = null; ASTPair currentAST = new ASTPair(); antlr.CommonAST conditionalExpression_AST = null; logicalOrExpression(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } { if ((LA(1) == QUESTION_MARK)) { antlr.CommonAST tmp10_AST = null; tmp10_AST = (antlr.CommonAST)astFactory.create(LT(1)); astFactory.makeASTRoot(ref currentAST, (AST)tmp10_AST); match(QUESTION_MARK); conditionalExpression(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } match(COLON); conditionalExpression(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } } else if ((tokenSet_0_.member(LA(1)))) { } else { throw new NoViableAltException(LT(1), getFilename()); } } conditionalExpression_AST = (antlr.CommonAST)currentAST.root; returnAST = conditionalExpression_AST; }
//throws RecognitionException, TokenStreamException public void arithmeticExpr() { returnAST = null; ASTPair currentAST = new ASTPair(); antlr.CommonAST arithmeticExpr_AST = null; sumExpr(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } arithmeticExpr_AST = (antlr.CommonAST)currentAST.root; returnAST = arithmeticExpr_AST; }
public void relationalOperator() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); GodLesZ.Library.Amf.Expression.FluorineAST relationalOperator_AST = null; try { // for error handling switch (LA(1)) { case EQUAL: { GodLesZ.Library.Amf.Expression.FluorineAST tmp15_AST = null; tmp15_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp15_AST); match(EQUAL); relationalOperator_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; break; } case NOT_EQUAL: { GodLesZ.Library.Amf.Expression.FluorineAST tmp16_AST = null; tmp16_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp16_AST); match(NOT_EQUAL); relationalOperator_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; break; } case LESS_THAN: { GodLesZ.Library.Amf.Expression.FluorineAST tmp17_AST = null; tmp17_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp17_AST); match(LESS_THAN); relationalOperator_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; break; } case LESS_THAN_OR_EQUAL: { GodLesZ.Library.Amf.Expression.FluorineAST tmp18_AST = null; tmp18_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp18_AST); match(LESS_THAN_OR_EQUAL); relationalOperator_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; break; } case GREATER_THAN: { GodLesZ.Library.Amf.Expression.FluorineAST tmp19_AST = null; tmp19_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp19_AST); match(GREATER_THAN); relationalOperator_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; break; } case GREATER_THAN_OR_EQUAL: { GodLesZ.Library.Amf.Expression.FluorineAST tmp20_AST = null; tmp20_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp20_AST); match(GREATER_THAN_OR_EQUAL); relationalOperator_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; break; } case IS: { GodLesZ.Library.Amf.Expression.FluorineAST tmp21_AST = null; tmp21_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp21_AST); match(IS); relationalOperator_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } catch (RecognitionException ex) { if (0 == inputState.guessing) { reportError(ex); recover(ex, tokenSet_5_); } else { throw ex; } } returnAST = relationalOperator_AST; }
public void sumExpr() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); GodLesZ.Library.Amf.Expression.FluorineAST sumExpr_AST = null; try { // for error handling prodExpr(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } { // ( ... )* for (; ; ) { if ((LA(1) == PLUS || LA(1) == MINUS)) { { if ((LA(1) == PLUS)) { GodLesZ.Library.Amf.Expression.OpADD tmp13_AST = null; tmp13_AST = (GodLesZ.Library.Amf.Expression.OpADD)astFactory.create(LT(1), "GodLesZ.Library.Amf.Expression.OpADD"); astFactory.makeASTRoot(ref currentAST, (AST)tmp13_AST); match(PLUS); } else if ((LA(1) == MINUS)) { GodLesZ.Library.Amf.Expression.OpSUBTRACT tmp14_AST = null; tmp14_AST = (GodLesZ.Library.Amf.Expression.OpSUBTRACT)astFactory.create(LT(1), "GodLesZ.Library.Amf.Expression.OpSUBTRACT"); astFactory.makeASTRoot(ref currentAST, (AST)tmp14_AST); match(MINUS); } else { throw new NoViableAltException(LT(1), getFilename()); } } prodExpr(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } } else { goto _loop14_breakloop; } } _loop14_breakloop: ; } // ( ... )* sumExpr_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; } catch (RecognitionException ex) { if (0 == inputState.guessing) { reportError(ex); recover(ex, tokenSet_4_); } else { throw ex; } } returnAST = sumExpr_AST; }
public void relationalExpression() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); GodLesZ.Library.Amf.Expression.FluorineAST relationalExpression_AST = null; GodLesZ.Library.Amf.Expression.FluorineAST e1_AST = null; GodLesZ.Library.Amf.Expression.FluorineAST op_AST = null; try { // for error handling sumExpr(); if (0 == inputState.guessing) { e1_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)returnAST; astFactory.addASTChild(ref currentAST, (AST)returnAST); } { switch (LA(1)) { case IS: case EQUAL: case NOT_EQUAL: case LESS_THAN: case LESS_THAN_OR_EQUAL: case GREATER_THAN: case GREATER_THAN_OR_EQUAL: { relationalOperator(); if (0 == inputState.guessing) { op_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)returnAST; } sumExpr(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } if (0 == inputState.guessing) { relationalExpression_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; relationalExpression_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.make((AST)(GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.create(EXPR, op_AST.getText(), GetRelationalOperatorNodeType(op_AST.getText())), (AST)relationalExpression_AST); currentAST.root = relationalExpression_AST; if ((null != relationalExpression_AST) && (null != relationalExpression_AST.getFirstChild())) currentAST.child = relationalExpression_AST.getFirstChild(); else currentAST.child = relationalExpression_AST; currentAST.advanceChildToEnd(); } break; } case IN: { match(IN); listInitializer(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } if (0 == inputState.guessing) { relationalExpression_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; relationalExpression_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.make((AST)(GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.create(EXPR, "IN", GetRelationalOperatorNodeType("IN")), (AST)relationalExpression_AST); currentAST.root = relationalExpression_AST; if ((null != relationalExpression_AST) && (null != relationalExpression_AST.getFirstChild())) currentAST.child = relationalExpression_AST.getFirstChild(); else currentAST.child = relationalExpression_AST; currentAST.advanceChildToEnd(); } break; } case BETWEEN: { match(BETWEEN); betweenExpr(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } if (0 == inputState.guessing) { relationalExpression_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; relationalExpression_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.make((AST)(GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.create(EXPR, "BETWEEN", GetRelationalOperatorNodeType("BETWEEN")), (AST)relationalExpression_AST); currentAST.root = relationalExpression_AST; if ((null != relationalExpression_AST) && (null != relationalExpression_AST.getFirstChild())) currentAST.child = relationalExpression_AST.getFirstChild(); else currentAST.child = relationalExpression_AST; currentAST.advanceChildToEnd(); } break; } case LIKE: { match(LIKE); pattern(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } if (0 == inputState.guessing) { relationalExpression_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; relationalExpression_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.make((AST)(GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.create(EXPR, "LIKE", GetRelationalOperatorNodeType("LIKE")), (AST)relationalExpression_AST); currentAST.root = relationalExpression_AST; if ((null != relationalExpression_AST) && (null != relationalExpression_AST.getFirstChild())) currentAST.child = relationalExpression_AST.getFirstChild(); else currentAST.child = relationalExpression_AST; currentAST.advanceChildToEnd(); } break; } case EOF: case AND: case OR: case RPAREN: case COMMA: { break; } default: if ((LA(1) == NOT) && (LA(2) == IN)) { match(NOT); match(IN); listInitializer(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } if (0 == inputState.guessing) { relationalExpression_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; relationalExpression_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.make((AST)(GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.create(EXPR, "NOT", "GodLesZ.Library.Amf.Expression.OpNOT"), (AST)(GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.make((AST)(GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.create(EXPR, "IN", GetRelationalOperatorNodeType("IN")), (AST)relationalExpression_AST)); currentAST.root = relationalExpression_AST; if ((null != relationalExpression_AST) && (null != relationalExpression_AST.getFirstChild())) currentAST.child = relationalExpression_AST.getFirstChild(); else currentAST.child = relationalExpression_AST; currentAST.advanceChildToEnd(); } } else if ((LA(1) == NOT) && (LA(2) == BETWEEN)) { match(NOT); match(BETWEEN); betweenExpr(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } if (0 == inputState.guessing) { relationalExpression_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; relationalExpression_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.make((AST)(GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.create(EXPR, "NOT", "GodLesZ.Library.Amf.Expression.OpNOT"), (AST)(GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.make((AST)(GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.create(EXPR, "BETWEEN", GetRelationalOperatorNodeType("BETWEEN")), (AST)relationalExpression_AST)); currentAST.root = relationalExpression_AST; if ((null != relationalExpression_AST) && (null != relationalExpression_AST.getFirstChild())) currentAST.child = relationalExpression_AST.getFirstChild(); else currentAST.child = relationalExpression_AST; currentAST.advanceChildToEnd(); } } else if ((LA(1) == NOT) && (LA(2) == LIKE)) { match(NOT); match(LIKE); pattern(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } if (0 == inputState.guessing) { relationalExpression_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; relationalExpression_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.make((AST)(GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.create(EXPR, "NOT", "GodLesZ.Library.Amf.Expression.OpNOT"), (AST)(GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.make((AST)(GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.create(EXPR, "LIKE", GetRelationalOperatorNodeType("LIKE")), (AST)relationalExpression_AST)); currentAST.root = relationalExpression_AST; if ((null != relationalExpression_AST) && (null != relationalExpression_AST.getFirstChild())) currentAST.child = relationalExpression_AST.getFirstChild(); else currentAST.child = relationalExpression_AST; currentAST.advanceChildToEnd(); } } else { throw new NoViableAltException(LT(1), getFilename()); } break; } } relationalExpression_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; } catch (RecognitionException ex) { if (0 == inputState.guessing) { reportError(ex); recover(ex, tokenSet_3_); } else { throw ex; } } returnAST = relationalExpression_AST; }
public void logicalAndExpression() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); GodLesZ.Library.Amf.Expression.FluorineAST logicalAndExpression_AST = null; try { // for error handling relationalExpression(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } { // ( ... )* for (; ; ) { if ((LA(1) == AND)) { GodLesZ.Library.Amf.Expression.OpAND tmp3_AST = null; tmp3_AST = (GodLesZ.Library.Amf.Expression.OpAND)astFactory.create(LT(1), "GodLesZ.Library.Amf.Expression.OpAND"); astFactory.makeASTRoot(ref currentAST, (AST)tmp3_AST); match(AND); relationalExpression(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } } else { goto _loop8_breakloop; } } _loop8_breakloop: ; } // ( ... )* logicalAndExpression_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; } catch (RecognitionException ex) { if (0 == inputState.guessing) { reportError(ex); recover(ex, tokenSet_2_); } else { throw ex; } } returnAST = logicalAndExpression_AST; }
public void dateLiteral() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); GodLesZ.Library.Amf.Expression.FluorineAST dateLiteral_AST = null; try { // for error handling GodLesZ.Library.Amf.Expression.DateLiteralNode tmp48_AST = null; tmp48_AST = (GodLesZ.Library.Amf.Expression.DateLiteralNode)astFactory.create(LT(1), "GodLesZ.Library.Amf.Expression.DateLiteralNode"); astFactory.makeASTRoot(ref currentAST, (AST)tmp48_AST); match(LITERAL_date); match(LPAREN); GodLesZ.Library.Amf.Expression.FluorineAST tmp50_AST = null; tmp50_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp50_AST); match(STRING_LITERAL); { if ((LA(1) == COMMA)) { match(COMMA); GodLesZ.Library.Amf.Expression.FluorineAST tmp52_AST = null; tmp52_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp52_AST); match(STRING_LITERAL); } else if ((LA(1) == RPAREN)) { } else { throw new NoViableAltException(LT(1), getFilename()); } } match(RPAREN); dateLiteral_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; } catch (RecognitionException ex) { if (0 == inputState.guessing) { reportError(ex); recover(ex, tokenSet_9_); } else { throw ex; } } returnAST = dateLiteral_AST; }
public void boolLiteral() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); GodLesZ.Library.Amf.Expression.FluorineAST boolLiteral_AST = null; try { // for error handling if ((LA(1) == TRUE)) { GodLesZ.Library.Amf.Expression.BooleanLiteralNode tmp46_AST = null; tmp46_AST = (GodLesZ.Library.Amf.Expression.BooleanLiteralNode)astFactory.create(LT(1), "GodLesZ.Library.Amf.Expression.BooleanLiteralNode"); astFactory.addASTChild(ref currentAST, (AST)tmp46_AST); match(TRUE); boolLiteral_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; } else if ((LA(1) == FALSE)) { GodLesZ.Library.Amf.Expression.BooleanLiteralNode tmp47_AST = null; tmp47_AST = (GodLesZ.Library.Amf.Expression.BooleanLiteralNode)astFactory.create(LT(1), "GodLesZ.Library.Amf.Expression.BooleanLiteralNode"); astFactory.addASTChild(ref currentAST, (AST)tmp47_AST); match(FALSE); boolLiteral_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; } else { throw new NoViableAltException(LT(1), getFilename()); } } catch (RecognitionException ex) { if (0 == inputState.guessing) { reportError(ex); recover(ex, tokenSet_9_); } else { throw ex; } } returnAST = boolLiteral_AST; }
public void methodArgs() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); GodLesZ.Library.Amf.Expression.FluorineAST methodArgs_AST = null; try { // for error handling match(LPAREN); { if ((tokenSet_5_.member(LA(1)))) { argument(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } { // ( ... )* for (; ; ) { if ((LA(1) == COMMA)) { match(COMMA); argument(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } } else { goto _loop33_breakloop; } } _loop33_breakloop: ; } // ( ... )* } else if ((LA(1) == RPAREN)) { } else { throw new NoViableAltException(LT(1), getFilename()); } } match(RPAREN); methodArgs_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; } catch (RecognitionException ex) { if (0 == inputState.guessing) { reportError(ex); recover(ex, tokenSet_9_); } else { throw ex; } } returnAST = methodArgs_AST; }
public void literal() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); GodLesZ.Library.Amf.Expression.FluorineAST literal_AST = null; try { // for error handling switch (LA(1)) { case NULL_LITERAL: { GodLesZ.Library.Amf.Expression.NullLiteralNode tmp35_AST = null; tmp35_AST = (GodLesZ.Library.Amf.Expression.NullLiteralNode)astFactory.create(LT(1), "GodLesZ.Library.Amf.Expression.NullLiteralNode"); astFactory.addASTChild(ref currentAST, (AST)tmp35_AST); match(NULL_LITERAL); literal_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; break; } case INTEGER_LITERAL: { GodLesZ.Library.Amf.Expression.IntLiteralNode tmp36_AST = null; tmp36_AST = (GodLesZ.Library.Amf.Expression.IntLiteralNode)astFactory.create(LT(1), "GodLesZ.Library.Amf.Expression.IntLiteralNode"); astFactory.addASTChild(ref currentAST, (AST)tmp36_AST); match(INTEGER_LITERAL); literal_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; break; } case HEXADECIMAL_INTEGER_LITERAL: { GodLesZ.Library.Amf.Expression.HexLiteralNode tmp37_AST = null; tmp37_AST = (GodLesZ.Library.Amf.Expression.HexLiteralNode)astFactory.create(LT(1), "GodLesZ.Library.Amf.Expression.HexLiteralNode"); astFactory.addASTChild(ref currentAST, (AST)tmp37_AST); match(HEXADECIMAL_INTEGER_LITERAL); literal_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; break; } case REAL_LITERAL: { GodLesZ.Library.Amf.Expression.RealLiteralNode tmp38_AST = null; tmp38_AST = (GodLesZ.Library.Amf.Expression.RealLiteralNode)astFactory.create(LT(1), "GodLesZ.Library.Amf.Expression.RealLiteralNode"); astFactory.addASTChild(ref currentAST, (AST)tmp38_AST); match(REAL_LITERAL); literal_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; break; } case STRING_LITERAL: { GodLesZ.Library.Amf.Expression.StringLiteralNode tmp39_AST = null; tmp39_AST = (GodLesZ.Library.Amf.Expression.StringLiteralNode)astFactory.create(LT(1), "GodLesZ.Library.Amf.Expression.StringLiteralNode"); astFactory.addASTChild(ref currentAST, (AST)tmp39_AST); match(STRING_LITERAL); literal_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; break; } case FALSE: case TRUE: { boolLiteral(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } literal_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; break; } case LITERAL_date: { dateLiteral(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } literal_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } catch (RecognitionException ex) { if (0 == inputState.guessing) { reportError(ex); recover(ex, tokenSet_9_); } else { throw ex; } } returnAST = literal_AST; }
public void listInitializer() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); GodLesZ.Library.Amf.Expression.FluorineAST listInitializer_AST = null; try { // for error handling GodLesZ.Library.Amf.Expression.ListInitializerNode tmp22_AST = null; tmp22_AST = (GodLesZ.Library.Amf.Expression.ListInitializerNode)astFactory.create(LT(1), "GodLesZ.Library.Amf.Expression.ListInitializerNode"); astFactory.makeASTRoot(ref currentAST, (AST)tmp22_AST); match(LPAREN); primaryExpression(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } { // ( ... )* for (; ; ) { if ((LA(1) == COMMA)) { match(COMMA); primaryExpression(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } } else { goto _loop38_breakloop; } } _loop38_breakloop: ; } // ( ... )* match(RPAREN); listInitializer_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; } catch (RecognitionException ex) { if (0 == inputState.guessing) { reportError(ex); recover(ex, tokenSet_3_); } else { throw ex; } } returnAST = listInitializer_AST; }
//throws RecognitionException, TokenStreamException public void atom() { returnAST = null; ASTPair currentAST = new ASTPair(); antlr.CommonAST atom_AST = null; IToken i = null; antlr.CommonAST i_AST = null; switch (LA(1)) { case ID: { antlr.CommonAST tmp37_AST = null; tmp37_AST = (antlr.CommonAST)astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp37_AST); match(ID); atom_AST = (antlr.CommonAST)currentAST.root; break; } case NUMBER: { antlr.CommonAST tmp38_AST = null; tmp38_AST = (antlr.CommonAST)astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp38_AST); match(NUMBER); atom_AST = (antlr.CommonAST)currentAST.root; break; } case MINUS: { match(MINUS); i = LT(1); i_AST = (antlr.CommonAST)astFactory.create(i); astFactory.addASTChild(ref currentAST, (AST)i_AST); match(NUMBER); if (0 == inputState.guessing) { i_AST.setText("-" + i_AST.getText()); } atom_AST = (antlr.CommonAST)currentAST.root; break; } case STRING_LITERAL: { antlr.CommonAST tmp40_AST = null; tmp40_AST = (antlr.CommonAST)astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp40_AST); match(STRING_LITERAL); atom_AST = (antlr.CommonAST)currentAST.root; break; } case LPAREN: { match(LPAREN); conditionalExpression(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } match(RPAREN); atom_AST = (antlr.CommonAST)currentAST.root; break; } case TRUE: { antlr.CommonAST tmp43_AST = null; tmp43_AST = (antlr.CommonAST)astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp43_AST); match(TRUE); atom_AST = (antlr.CommonAST)currentAST.root; break; } case FALSE: { antlr.CommonAST tmp44_AST = null; tmp44_AST = (antlr.CommonAST)astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp44_AST); match(FALSE); atom_AST = (antlr.CommonAST)currentAST.root; break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } returnAST = atom_AST; }
public void betweenExpr() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); GodLesZ.Library.Amf.Expression.FluorineAST betweenExpr_AST = null; GodLesZ.Library.Amf.Expression.FluorineAST e1_AST = null; GodLesZ.Library.Amf.Expression.FluorineAST e2_AST = null; try { // for error handling sumExpr(); if (0 == inputState.guessing) { e1_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)returnAST; astFactory.addASTChild(ref currentAST, (AST)returnAST); } GodLesZ.Library.Amf.Expression.ListInitializerNode tmp25_AST = null; tmp25_AST = (GodLesZ.Library.Amf.Expression.ListInitializerNode)astFactory.create(LT(1), "GodLesZ.Library.Amf.Expression.ListInitializerNode"); astFactory.makeASTRoot(ref currentAST, (AST)tmp25_AST); match(AND); sumExpr(); if (0 == inputState.guessing) { e2_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)returnAST; astFactory.addASTChild(ref currentAST, (AST)returnAST); } betweenExpr_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; } catch (RecognitionException ex) { if (0 == inputState.guessing) { reportError(ex); recover(ex, tokenSet_3_); } else { throw ex; } } returnAST = betweenExpr_AST; }
//throws RecognitionException, TokenStreamException public void equalityExpr() { returnAST = null; ASTPair currentAST = new ASTPair(); antlr.CommonAST equalityExpr_AST = null; relationalExpr(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } { switch (LA(1)) { case EOF: case QUESTION_MARK: case COLON: case LITERAL_OR: case LITERAL_AND: case EQUAL: case NOT_EQUAL: case COMMA: case RPAREN: { { // ( ... )* for (; ; ) { if ((LA(1) == EQUAL || LA(1) == NOT_EQUAL)) { { if ((LA(1) == EQUAL)) { antlr.CommonAST tmp14_AST = null; tmp14_AST = (antlr.CommonAST)astFactory.create(LT(1)); astFactory.makeASTRoot(ref currentAST, (AST)tmp14_AST); match(EQUAL); } else if ((LA(1) == NOT_EQUAL)) { antlr.CommonAST tmp15_AST = null; tmp15_AST = (antlr.CommonAST)astFactory.create(LT(1)); astFactory.makeASTRoot(ref currentAST, (AST)tmp15_AST); match(NOT_EQUAL); } else { throw new NoViableAltException(LT(1), getFilename()); } } relationalExpr(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } } else { goto _loop14_breakloop; } } _loop14_breakloop: ; } // ( ... )* break; } case LITERAL_IN: { antlr.CommonAST tmp16_AST = null; tmp16_AST = (antlr.CommonAST)astFactory.create(LT(1)); astFactory.makeASTRoot(ref currentAST, (AST)tmp16_AST); match(LITERAL_IN); inList(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } break; } case LITERAL_NOT: { antlr.CommonAST tmp17_AST = null; tmp17_AST = (antlr.CommonAST)astFactory.create(LT(1)); astFactory.makeASTRoot(ref currentAST, (AST)tmp17_AST); match(LITERAL_NOT); match(LITERAL_IN); inList(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } equalityExpr_AST = (antlr.CommonAST)currentAST.root; returnAST = equalityExpr_AST; }
public void pattern() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); GodLesZ.Library.Amf.Expression.FluorineAST pattern_AST = null; try { // for error handling switch (LA(1)) { case EOF: case AND: case OR: case RPAREN: case COMMA: { pattern_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; break; } case FALSE: case TRUE: case NULL_LITERAL: case INTEGER_LITERAL: case HEXADECIMAL_INTEGER_LITERAL: case REAL_LITERAL: case STRING_LITERAL: case LITERAL_date: { literal(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } pattern_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; break; } case POUND: case ID: { functionOrVar(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } pattern_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } catch (RecognitionException ex) { if (0 == inputState.guessing) { reportError(ex); recover(ex, tokenSet_3_); } else { throw ex; } } returnAST = pattern_AST; }
//throws RecognitionException, TokenStreamException public void inExpr() { returnAST = null; ASTPair currentAST = new ASTPair(); antlr.CommonAST inExpr_AST = null; if ((LA(1) == LITERAL_IN)) { normalInExpr(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } inExpr_AST = (antlr.CommonAST)currentAST.root; } else if ((LA(1) == LITERAL_NOT)) { notInExpr(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } inExpr_AST = (antlr.CommonAST)currentAST.root; } else { throw new NoViableAltException(LT(1), getFilename()); } returnAST = inExpr_AST; }
public void prodExpr() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); GodLesZ.Library.Amf.Expression.FluorineAST prodExpr_AST = null; try { // for error handling powExpr(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } { // ( ... )* for (; ; ) { if (((LA(1) >= STAR && LA(1) <= MOD))) { { switch (LA(1)) { case STAR: { GodLesZ.Library.Amf.Expression.OpMULTIPLY tmp26_AST = null; tmp26_AST = (GodLesZ.Library.Amf.Expression.OpMULTIPLY)astFactory.create(LT(1), "GodLesZ.Library.Amf.Expression.OpMULTIPLY"); astFactory.makeASTRoot(ref currentAST, (AST)tmp26_AST); match(STAR); break; } case DIV: { GodLesZ.Library.Amf.Expression.OpDIVIDE tmp27_AST = null; tmp27_AST = (GodLesZ.Library.Amf.Expression.OpDIVIDE)astFactory.create(LT(1), "GodLesZ.Library.Amf.Expression.OpDIVIDE"); astFactory.makeASTRoot(ref currentAST, (AST)tmp27_AST); match(DIV); break; } case MOD: { GodLesZ.Library.Amf.Expression.OpMODULUS tmp28_AST = null; tmp28_AST = (GodLesZ.Library.Amf.Expression.OpMODULUS)astFactory.create(LT(1), "GodLesZ.Library.Amf.Expression.OpMODULUS"); astFactory.makeASTRoot(ref currentAST, (AST)tmp28_AST); match(MOD); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } powExpr(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } } else { goto _loop18_breakloop; } } _loop18_breakloop: ; } // ( ... )* prodExpr_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; } catch (RecognitionException ex) { if (0 == inputState.guessing) { reportError(ex); recover(ex, tokenSet_6_); } else { throw ex; } } returnAST = prodExpr_AST; }
//throws RecognitionException, TokenStreamException public void logicalOrExpression() { returnAST = null; ASTPair currentAST = new ASTPair(); antlr.CommonAST logicalOrExpression_AST = null; logicalAndExpression(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } { // ( ... )* for (; ; ) { if ((LA(1) == LITERAL_OR)) { antlr.CommonAST tmp12_AST = null; tmp12_AST = (antlr.CommonAST)astFactory.create(LT(1)); astFactory.makeASTRoot(ref currentAST, (AST)tmp12_AST); match(LITERAL_OR); logicalAndExpression(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } } else { goto _loop6_breakloop; } } _loop6_breakloop: ; } // ( ... )* logicalOrExpression_AST = (antlr.CommonAST)currentAST.root; returnAST = logicalOrExpression_AST; }
public void powExpr() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); GodLesZ.Library.Amf.Expression.FluorineAST powExpr_AST = null; try { // for error handling unaryExpression(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } { if ((LA(1) == POWER)) { GodLesZ.Library.Amf.Expression.OpPOWER tmp29_AST = null; tmp29_AST = (GodLesZ.Library.Amf.Expression.OpPOWER)astFactory.create(LT(1), "GodLesZ.Library.Amf.Expression.OpPOWER"); astFactory.makeASTRoot(ref currentAST, (AST)tmp29_AST); match(POWER); unaryExpression(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } } else if ((tokenSet_7_.member(LA(1)))) { } else { throw new NoViableAltException(LT(1), getFilename()); } } powExpr_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; } catch (RecognitionException ex) { if (0 == inputState.guessing) { reportError(ex); recover(ex, tokenSet_7_); } else { throw ex; } } returnAST = powExpr_AST; }
//throws RecognitionException, TokenStreamException public void parenArgs() { returnAST = null; ASTPair currentAST = new ASTPair(); antlr.CommonAST parenArgs_AST = null; antlr.CommonAST tmp34_AST = null; tmp34_AST = (antlr.CommonAST)astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp34_AST); match(LPAREN); { if ((tokenSet_3_.member(LA(1)))) { conditionalExpression(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } { // ( ... )* for (; ; ) { if ((LA(1) == COMMA)) { match(COMMA); conditionalExpression(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } } else { goto _loop41_breakloop; } } _loop41_breakloop: ; } // ( ... )* } else if ((LA(1) == RPAREN)) { } else { throw new NoViableAltException(LT(1), getFilename()); } } antlr.CommonAST tmp36_AST = null; tmp36_AST = (antlr.CommonAST)astFactory.create(LT(1)); astFactory.addASTChild(ref currentAST, (AST)tmp36_AST); match(RPAREN); parenArgs_AST = (antlr.CommonAST)currentAST.root; returnAST = parenArgs_AST; }
public void unaryExpression() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); GodLesZ.Library.Amf.Expression.FluorineAST unaryExpression_AST = null; try { // for error handling if ((LA(1) == NOT || LA(1) == PLUS || LA(1) == MINUS)) { { switch (LA(1)) { case PLUS: { GodLesZ.Library.Amf.Expression.OpUnaryPlus tmp30_AST = null; tmp30_AST = (GodLesZ.Library.Amf.Expression.OpUnaryPlus)astFactory.create(LT(1), "GodLesZ.Library.Amf.Expression.OpUnaryPlus"); astFactory.makeASTRoot(ref currentAST, (AST)tmp30_AST); match(PLUS); break; } case MINUS: { GodLesZ.Library.Amf.Expression.OpUnaryMinus tmp31_AST = null; tmp31_AST = (GodLesZ.Library.Amf.Expression.OpUnaryMinus)astFactory.create(LT(1), "GodLesZ.Library.Amf.Expression.OpUnaryMinus"); astFactory.makeASTRoot(ref currentAST, (AST)tmp31_AST); match(MINUS); break; } case NOT: { GodLesZ.Library.Amf.Expression.OpNOT tmp32_AST = null; tmp32_AST = (GodLesZ.Library.Amf.Expression.OpNOT)astFactory.create(LT(1), "GodLesZ.Library.Amf.Expression.OpNOT"); astFactory.makeASTRoot(ref currentAST, (AST)tmp32_AST); match(NOT); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } unaryExpression(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } unaryExpression_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; } else if ((tokenSet_8_.member(LA(1)))) { primaryExpression(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } unaryExpression_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; } else { throw new NoViableAltException(LT(1), getFilename()); } } catch (RecognitionException ex) { if (0 == inputState.guessing) { reportError(ex); recover(ex, tokenSet_9_); } else { throw ex; } } returnAST = unaryExpression_AST; }
//throws RecognitionException, TokenStreamException public void prodExpr() { returnAST = null; ASTPair currentAST = new ASTPair(); antlr.CommonAST prodExpr_AST = null; postFixExpr(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } { // ( ... )* for (; ; ) { if (((LA(1) >= MULT && LA(1) <= MOD))) { { switch (LA(1)) { case MULT: { antlr.CommonAST tmp31_AST = null; tmp31_AST = (antlr.CommonAST)astFactory.create(LT(1)); astFactory.makeASTRoot(ref currentAST, (AST)tmp31_AST); match(MULT); break; } case DIV: { antlr.CommonAST tmp32_AST = null; tmp32_AST = (antlr.CommonAST)astFactory.create(LT(1)); astFactory.makeASTRoot(ref currentAST, (AST)tmp32_AST); match(DIV); break; } case MOD: { antlr.CommonAST tmp33_AST = null; tmp33_AST = (antlr.CommonAST)astFactory.create(LT(1)); astFactory.makeASTRoot(ref currentAST, (AST)tmp33_AST); match(MOD); break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } postFixExpr(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } } else { goto _loop33_breakloop; } } _loop33_breakloop: ; } // ( ... )* prodExpr_AST = (antlr.CommonAST)currentAST.root; returnAST = prodExpr_AST; }
public void primaryExpression() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); GodLesZ.Library.Amf.Expression.FluorineAST primaryExpression_AST = null; try { // for error handling switch (LA(1)) { case LPAREN: { parenExpr(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } primaryExpression_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; break; } case FALSE: case TRUE: case NULL_LITERAL: case INTEGER_LITERAL: case HEXADECIMAL_INTEGER_LITERAL: case REAL_LITERAL: case STRING_LITERAL: case LITERAL_date: { literal(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } primaryExpression_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; break; } case POUND: case ID: { functionOrVar(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } if (0 == inputState.guessing) { primaryExpression_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; primaryExpression_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.make((AST)(GodLesZ.Library.Amf.Expression.FluorineAST)astFactory.create(EXPR, "expression", "GodLesZ.Library.Amf.Expression.Expression"), (AST)primaryExpression_AST); currentAST.root = primaryExpression_AST; if ((null != primaryExpression_AST) && (null != primaryExpression_AST.getFirstChild())) currentAST.child = primaryExpression_AST.getFirstChild(); else currentAST.child = primaryExpression_AST; currentAST.advanceChildToEnd(); } primaryExpression_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; break; } default: { throw new NoViableAltException(LT(1), getFilename()); } } } catch (RecognitionException ex) { if (0 == inputState.guessing) { reportError(ex); recover(ex, tokenSet_9_); } else { throw ex; } } returnAST = primaryExpression_AST; }
//throws RecognitionException, TokenStreamException public void sumExpr() { returnAST = null; ASTPair currentAST = new ASTPair(); antlr.CommonAST sumExpr_AST = null; prodExpr(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } { // ( ... )* for (; ; ) { if ((LA(1) == PLUS || LA(1) == MINUS)) { { if ((LA(1) == PLUS)) { antlr.CommonAST tmp29_AST = null; tmp29_AST = (antlr.CommonAST)astFactory.create(LT(1)); astFactory.makeASTRoot(ref currentAST, (AST)tmp29_AST); match(PLUS); } else if ((LA(1) == MINUS)) { antlr.CommonAST tmp30_AST = null; tmp30_AST = (antlr.CommonAST)astFactory.create(LT(1)); astFactory.makeASTRoot(ref currentAST, (AST)tmp30_AST); match(MINUS); } else { throw new NoViableAltException(LT(1), getFilename()); } } prodExpr(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } } else { goto _loop29_breakloop; } } _loop29_breakloop: ; } // ( ... )* sumExpr_AST = (antlr.CommonAST)currentAST.root; returnAST = sumExpr_AST; }
public void parenExpr() //throws RecognitionException, TokenStreamException { returnAST = null; ASTPair currentAST = new ASTPair(); GodLesZ.Library.Amf.Expression.FluorineAST parenExpr_AST = null; try { // for error handling match(LPAREN); expression(); if (0 == inputState.guessing) { astFactory.addASTChild(ref currentAST, (AST)returnAST); } match(RPAREN); parenExpr_AST = (GodLesZ.Library.Amf.Expression.FluorineAST)currentAST.root; } catch (RecognitionException ex) { if (0 == inputState.guessing) { reportError(ex); recover(ex, tokenSet_9_); } else { throw ex; } } returnAST = parenExpr_AST; }