Пример #1
0
    // $ANTLR end "breakStat"


    // $ANTLR start "objectFunctionCall"
    // E:\\SGL\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:184:1: objectFunctionCall returns [AbstractNode node] : ^( OBJ_FUNC_CALL variable ( indexes )? Identifier ( expressionList )? ) ;
    public AbstractNode objectFunctionCall() // throws RecognitionException [1]
    {   
        AbstractNode node = default(AbstractNode);

        CommonTree Identifier22 = null;
        String variable20 = default(String);

        List<AbstractNode> indexes21 = default(List<AbstractNode>);

        List<AbstractNode> expressionList23 = default(List<AbstractNode>);


        try 
    	{
            // E:\\SGL\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:185:2: ( ^( OBJ_FUNC_CALL variable ( indexes )? Identifier ( expressionList )? ) )
            // E:\\SGL\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:185:4: ^( OBJ_FUNC_CALL variable ( indexes )? Identifier ( expressionList )? )
            {
            	Match(input,OBJ_FUNC_CALL,FOLLOW_OBJ_FUNC_CALL_in_objectFunctionCall355); 

            	Match(input, Token.DOWN, null); 
            	PushFollow(FOLLOW_variable_in_objectFunctionCall357);
            	variable20 = variable();
            	state.followingStackPointer--;

            	// E:\\SGL\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:185:29: ( indexes )?
            	int alt5 = 2;
            	int LA5_0 = input.LA(1);

            	if ( (LA5_0 == INDEXES) )
            	{
            	    alt5 = 1;
            	}
            	switch (alt5) 
            	{
            	    case 1 :
            	        // E:\\SGL\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:185:29: indexes
            	        {
            	        	PushFollow(FOLLOW_indexes_in_objectFunctionCall359);
            	        	indexes21 = indexes();
            	        	state.followingStackPointer--;


            	        }
            	        break;

            	}

            	Identifier22=(CommonTree)Match(input,Identifier,FOLLOW_Identifier_in_objectFunctionCall362); 
            	// E:\\SGL\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:185:49: ( expressionList )?
            	int alt6 = 2;
            	int LA6_0 = input.LA(1);

            	if ( (LA6_0 == EXP_LIST) )
            	{
            	    alt6 = 1;
            	}
            	switch (alt6) 
            	{
            	    case 1 :
            	        // E:\\SGL\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:185:49: expressionList
            	        {
            	        	PushFollow(FOLLOW_expressionList_in_objectFunctionCall364);
            	        	expressionList23 = expressionList();
            	        	state.followingStackPointer--;


            	        }
            	        break;

            	}


            	Match(input, Token.UP, null); 
            	 node = new InvokeFunctionNode(variable20, indexes21, ((Identifier22 != null) ? Identifier22.Text : null), expressionList23, currentScope, Identifier22.Line); 

            }

        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return node;
    }
Пример #2
0
    // $ANTLR end "returnStat"


    // $ANTLR start "functionCall"
    // E:\\SGL\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:176:1: functionCall returns [AbstractNode node] : ^( FUNC_CALL Identifier ( expressionList )? ) ;
    public AbstractNode functionCall() // throws RecognitionException [1]
    {   
        AbstractNode node = default(AbstractNode);

        CommonTree Identifier17 = null;
        List<AbstractNode> expressionList18 = default(List<AbstractNode>);


        try 
    	{
            // E:\\SGL\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:177:2: ( ^( FUNC_CALL Identifier ( expressionList )? ) )
            // E:\\SGL\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:177:4: ^( FUNC_CALL Identifier ( expressionList )? )
            {
            	Match(input,FUNC_CALL,FOLLOW_FUNC_CALL_in_functionCall311); 

            	Match(input, Token.DOWN, null); 
            	Identifier17=(CommonTree)Match(input,Identifier,FOLLOW_Identifier_in_functionCall313); 
            	// E:\\SGL\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:177:27: ( expressionList )?
            	int alt4 = 2;
            	int LA4_0 = input.LA(1);

            	if ( (LA4_0 == EXP_LIST) )
            	{
            	    alt4 = 1;
            	}
            	switch (alt4) 
            	{
            	    case 1 :
            	        // E:\\SGL\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:177:27: expressionList
            	        {
            	        	PushFollow(FOLLOW_expressionList_in_functionCall315);
            	        	expressionList18 = expressionList();
            	        	state.followingStackPointer--;


            	        }
            	        break;

            	}


            	Match(input, Token.UP, null); 
            	 node = new InvokeFunctionNode(((Identifier17 != null) ? Identifier17.Text : null), expressionList18, Identifier17.Line); 

            }

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