コード例 #1
0
    // $ANTLR start "takeClause"
    // Hql.g:309:1: takeClause : TAKE ( NUM_INT | parameter ) ;
    public HqlParser.takeClause_return takeClause() // throws RecognitionException [1]
    {   
        HqlParser.takeClause_return retval = new HqlParser.takeClause_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IToken TAKE134 = null;
        IToken NUM_INT135 = null;
        HqlParser.parameter_return parameter136 = default(HqlParser.parameter_return);


        IASTNode TAKE134_tree=null;
        IASTNode NUM_INT135_tree=null;

        try 
    	{
            // Hql.g:310:2: ( TAKE ( NUM_INT | parameter ) )
            // Hql.g:310:4: TAKE ( NUM_INT | parameter )
            {
            	root_0 = (IASTNode)adaptor.GetNilNode();

            	TAKE134=(IToken)Match(input,TAKE,FOLLOW_TAKE_in_takeClause1662); 
            		TAKE134_tree = (IASTNode)adaptor.Create(TAKE134);
            		root_0 = (IASTNode)adaptor.BecomeRoot(TAKE134_tree, root_0);

            	// Hql.g:310:10: ( NUM_INT | parameter )
            	int alt42 = 2;
            	int LA42_0 = input.LA(1);

            	if ( (LA42_0 == NUM_INT) )
            	{
            	    alt42 = 1;
            	}
            	else if ( ((LA42_0 >= COLON && LA42_0 <= PARAM)) )
            	{
            	    alt42 = 2;
            	}
            	else 
            	{
            	    NoViableAltException nvae_d42s0 =
            	        new NoViableAltException("", 42, 0, input);

            	    throw nvae_d42s0;
            	}
            	switch (alt42) 
            	{
            	    case 1 :
            	        // Hql.g:310:11: NUM_INT
            	        {
            	        	NUM_INT135=(IToken)Match(input,NUM_INT,FOLLOW_NUM_INT_in_takeClause1666); 
            	        		NUM_INT135_tree = (IASTNode)adaptor.Create(NUM_INT135);
            	        		adaptor.AddChild(root_0, NUM_INT135_tree);


            	        }
            	        break;
            	    case 2 :
            	        // Hql.g:310:21: parameter
            	        {
            	        	PushFollow(FOLLOW_parameter_in_takeClause1670);
            	        	parameter136 = parameter();
            	        	state.followingStackPointer--;

            	        	adaptor.AddChild(root_0, parameter136.Tree);

            	        }
            	        break;

            	}


            }

            retval.Stop = input.LT(-1);

            	retval.Tree = (IASTNode)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (IASTNode)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
コード例 #2
0
ファイル: HqlParser.cs プロジェクト: pontillo/PowerNap
    // $ANTLR start "takeClause"
    // Hql.g:309:1: takeClause : TAKE NUM_INT ;
    public HqlParser.takeClause_return takeClause() // throws RecognitionException [1]
    {   
        HqlParser.takeClause_return retval = new HqlParser.takeClause_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IToken TAKE133 = null;
        IToken NUM_INT134 = null;

        IASTNode TAKE133_tree=null;
        IASTNode NUM_INT134_tree=null;

        try 
    	{
            // Hql.g:310:2: ( TAKE NUM_INT )
            // Hql.g:310:4: TAKE NUM_INT
            {
            	root_0 = (IASTNode)adaptor.GetNilNode();

            	TAKE133=(IToken)Match(input,TAKE,FOLLOW_TAKE_in_takeClause1656); 
            		TAKE133_tree = (IASTNode)adaptor.Create(TAKE133);
            		root_0 = (IASTNode)adaptor.BecomeRoot(TAKE133_tree, root_0);

            	NUM_INT134=(IToken)Match(input,NUM_INT,FOLLOW_NUM_INT_in_takeClause1659); 
            		NUM_INT134_tree = (IASTNode)adaptor.Create(NUM_INT134);
            		adaptor.AddChild(root_0, NUM_INT134_tree);


            }

            retval.Stop = input.LT(-1);

            	retval.Tree = (IASTNode)adaptor.RulePostProcessing(root_0);
            	adaptor.SetTokenBoundaries(retval.Tree, (IToken) retval.Start, (IToken) retval.Stop);
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
    	// Conversion of the second argument necessary, but harmless
    	retval.Tree = (IASTNode)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }