• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# antlr.ASTPair类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中antlr.ASTPair的典型用法代码示例。如果您正苦于以下问题:C# antlr.ASTPair类的具体用法?C# antlr.ASTPair怎么用?C# antlr.ASTPair使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



antlr.ASTPair类属于命名空间,在下文中一共展示了antlr.ASTPair类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: boolLiteral

		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;
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:34,代码来源:ExpressionParser.cs


示例2: postFixExpr

        //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;
        }
开发者ID:sametyazak,项目名称:crosscheque,代码行数:73,代码来源:ExpressionParser.cs


示例3: relationalExpr

        //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;
        }
开发者ID:sametyazak,项目名称:crosscheque,代码行数:74,代码来源:ExpressionParser.cs


示例4: inList

        //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;
        }
开发者ID:sametyazak,项目名称:crosscheque,代码行数:39,代码来源:ExpressionParser.cs


示例5: notInExpr

        //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;
        }
开发者ID:sametyazak,项目名称:crosscheque,代码行数:20,代码来源:ExpressionParser.cs


示例6: conditionalExpression

        //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;
        }
开发者ID:sametyazak,项目名称:crosscheque,代码行数:43,代码来源:ExpressionParser.cs


示例7: expr

        //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;
        }
开发者ID:sametyazak,项目名称:crosscheque,代码行数:16,代码来源:ExpressionParser.cs


示例8: listInitializer

		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;
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:44,代码来源:ExpressionParser.cs


示例9: betweenExpr

		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;
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:35,代码来源:ExpressionParser.cs


示例10: sumExpr

		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;
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:54,代码来源:ExpressionParser.cs


示例11: relationalOperator

		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;
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:79,代码来源:ExpressionParser.cs


示例12: relationalExpression

		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:
//.........这里部分代码省略.........
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:101,代码来源:ExpressionParser.cs


示例13: logicalAndExpression

		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;
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:42,代码来源:ExpressionParser.cs


示例14: dateLiteral

		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;
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:42,代码来源:ExpressionParser.cs


示例15: arithmeticExpr

        //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;
        }
开发者ID:sametyazak,项目名称:crosscheque,代码行数:15,代码来源:ExpressionParser.cs


示例16: pattern

		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;
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:55,代码来源:ExpressionParser.cs


示例17: atom

        //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;
        }
开发者ID:sametyazak,项目名称:crosscheque,代码行数:89,代码来源:ExpressionParser.cs


示例18: prodExpr

		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;
		}
开发者ID:GodLesZ,项目名称:svn-dump,代码行数:66,代码来源:ExpressionParser.cs


示例19: equalityExpr

        //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 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# collections.AST类代码示例发布时间:2022-05-24
下一篇:
C# antlr类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap