Esempio n. 1
0
    // $ANTLR start "takeClause"
    // HqlSqlWalker.g:154:1: takeClause : ^( TAKE NUM_INT ) ;
    public HqlSqlWalker.takeClause_return takeClause() // throws RecognitionException [1]
    {   
        HqlSqlWalker.takeClause_return retval = new HqlSqlWalker.takeClause_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IASTNode _first_0 = null;
        IASTNode _last = null;

        IASTNode TAKE34 = null;
        IASTNode NUM_INT35 = null;

        IASTNode TAKE34_tree=null;
        IASTNode NUM_INT35_tree=null;

        try 
    	{
            // HqlSqlWalker.g:155:2: ( ^( TAKE NUM_INT ) )
            // HqlSqlWalker.g:155:4: ^( TAKE NUM_INT )
            {
            	root_0 = (IASTNode)adaptor.GetNilNode();

            	_last = (IASTNode)input.LT(1);
            	{
            	IASTNode _save_last_1 = _last;
            	IASTNode _first_1 = null;
            	IASTNode root_1 = (IASTNode)adaptor.GetNilNode();_last = (IASTNode)input.LT(1);
            	TAKE34=(IASTNode)Match(input,TAKE,FOLLOW_TAKE_in_takeClause713); 
            		TAKE34_tree = (IASTNode)adaptor.DupNode(TAKE34);

            		root_1 = (IASTNode)adaptor.BecomeRoot(TAKE34_tree, root_1);



            	Match(input, Token.DOWN, null); 
            	_last = (IASTNode)input.LT(1);
            	NUM_INT35=(IASTNode)Match(input,NUM_INT,FOLLOW_NUM_INT_in_takeClause715); 
            		NUM_INT35_tree = (IASTNode)adaptor.DupNode(NUM_INT35);

            		adaptor.AddChild(root_1, NUM_INT35_tree);


            	Match(input, Token.UP, null); adaptor.AddChild(root_0, root_1);_last = _save_last_1;
            	}


            }

            	retval.Tree = (IASTNode)adaptor.RulePostProcessing(root_0);

        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR start "takeClause"
    // HqlSqlWalker.g:154:1: takeClause : ^( TAKE ( NUM_INT | parameter ) ) ;
    public HqlSqlWalker.takeClause_return takeClause() // throws RecognitionException [1]
    {   
        HqlSqlWalker.takeClause_return retval = new HqlSqlWalker.takeClause_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IASTNode _first_0 = null;
        IASTNode _last = null;

        IASTNode TAKE37 = null;
        IASTNode NUM_INT38 = null;
        HqlSqlWalker.parameter_return parameter39 = default(HqlSqlWalker.parameter_return);


        IASTNode TAKE37_tree=null;
        IASTNode NUM_INT38_tree=null;

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

            	_last = (IASTNode)input.LT(1);
            	{
            	IASTNode _save_last_1 = _last;
            	IASTNode _first_1 = null;
            	IASTNode root_1 = (IASTNode)adaptor.GetNilNode();_last = (IASTNode)input.LT(1);
            	TAKE37=(IASTNode)Match(input,TAKE,FOLLOW_TAKE_in_takeClause735); 
            		TAKE37_tree = (IASTNode)adaptor.DupNode(TAKE37);

            		root_1 = (IASTNode)adaptor.BecomeRoot(TAKE37_tree, root_1);



            	Match(input, Token.DOWN, null); 
            	// HqlSqlWalker.g:155:11: ( NUM_INT | parameter )
            	int alt21 = 2;
            	int LA21_0 = input.LA(1);

            	if ( (LA21_0 == NUM_INT) )
            	{
            	    alt21 = 1;
            	}
            	else if ( ((LA21_0 >= COLON && LA21_0 <= PARAM)) )
            	{
            	    alt21 = 2;
            	}
            	else 
            	{
            	    NoViableAltException nvae_d21s0 =
            	        new NoViableAltException("", 21, 0, input);

            	    throw nvae_d21s0;
            	}
            	switch (alt21) 
            	{
            	    case 1 :
            	        // HqlSqlWalker.g:155:12: NUM_INT
            	        {
            	        	_last = (IASTNode)input.LT(1);
            	        	NUM_INT38=(IASTNode)Match(input,NUM_INT,FOLLOW_NUM_INT_in_takeClause738); 
            	        		NUM_INT38_tree = (IASTNode)adaptor.DupNode(NUM_INT38);

            	        		adaptor.AddChild(root_1, NUM_INT38_tree);


            	        }
            	        break;
            	    case 2 :
            	        // HqlSqlWalker.g:155:22: parameter
            	        {
            	        	_last = (IASTNode)input.LT(1);
            	        	PushFollow(FOLLOW_parameter_in_takeClause742);
            	        	parameter39 = parameter();
            	        	state.followingStackPointer--;

            	        	adaptor.AddChild(root_1, parameter39.Tree);

            	        }
            	        break;

            	}


            	Match(input, Token.UP, null); adaptor.AddChild(root_0, root_1);_last = _save_last_1;
            	}


            }

            	retval.Tree = (IASTNode)adaptor.RulePostProcessing(root_0);

        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return retval;
    }