Inheritance: Antlr.Runtime.ParserRuleReturnScope
Example #1
0
    // $ANTLR start "matrixtranspose"
    // spinach.g:349:1: matrixtranspose returns [MatrixTranspose ret] : 'T' LEFTBRACE variable ')' ;
    public spinachParser.matrixtranspose_return matrixtranspose() // throws RecognitionException [1]
    {   
        spinachParser.matrixtranspose_return retval = new spinachParser.matrixtranspose_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken char_literal157 = null;
        IToken LEFTBRACE158 = null;
        IToken char_literal160 = null;
        spinachParser.variable_return variable159 = null;


        object char_literal157_tree=null;
        object LEFTBRACE158_tree=null;
        object char_literal160_tree=null;


        retval.ret = new MatrixTranspose();

        try 
    	{
            // spinach.g:354:1: ( 'T' LEFTBRACE variable ')' )
            // spinach.g:354:3: 'T' LEFTBRACE variable ')'
            {
            	root_0 = (object)adaptor.GetNilNode();

            	char_literal157=(IToken)Match(input,45,FOLLOW_45_in_matrixtranspose2038); 
            		char_literal157_tree = (object)adaptor.Create(char_literal157);
            		adaptor.AddChild(root_0, char_literal157_tree);

            	LEFTBRACE158=(IToken)Match(input,LEFTBRACE,FOLLOW_LEFTBRACE_in_matrixtranspose2040); 
            		LEFTBRACE158_tree = (object)adaptor.Create(LEFTBRACE158);
            		adaptor.AddChild(root_0, LEFTBRACE158_tree);

            	PushFollow(FOLLOW_variable_in_matrixtranspose2042);
            	variable159 = variable();
            	state.followingStackPointer--;

            	adaptor.AddChild(root_0, variable159.Tree);
            	retval.ret.setvariable(((variable159 != null) ? variable159.ret : null)); 
            	char_literal160=(IToken)Match(input,RIGHTBRACE,FOLLOW_RIGHTBRACE_in_matrixtranspose2045); 
            		char_literal160_tree = (object)adaptor.Create(char_literal160);
            		adaptor.AddChild(root_0, char_literal160_tree);


            }

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

            	retval.Tree = (object)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 = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
Example #2
0
    // $ANTLR start "matrixtranspose"
    // C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:325:1: matrixtranspose returns [MatrixTranspose ret] : 'T' LEFTBRACE variable ')' ;
    public spinachParser.matrixtranspose_return matrixtranspose() // throws RecognitionException [1]
    {   
        spinachParser.matrixtranspose_return retval = new spinachParser.matrixtranspose_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken char_literal173 = null;
        IToken LEFTBRACE174 = null;
        IToken char_literal176 = null;
        spinachParser.variable_return variable175 = null;


        object char_literal173_tree=null;
        object LEFTBRACE174_tree=null;
        object char_literal176_tree=null;


        retval.ret = new MatrixTranspose();

        try 
    	{
            // C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:330:1: ( 'T' LEFTBRACE variable ')' )
            // C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:330:3: 'T' LEFTBRACE variable ')'
            {
            	root_0 = (object)adaptor.GetNilNode();

            	char_literal173=(IToken)Match(input,45,FOLLOW_45_in_matrixtranspose2016); 
            		char_literal173_tree = (object)adaptor.Create(char_literal173);
            		adaptor.AddChild(root_0, char_literal173_tree);

            	LEFTBRACE174=(IToken)Match(input,LEFTBRACE,FOLLOW_LEFTBRACE_in_matrixtranspose2018); 
            		LEFTBRACE174_tree = (object)adaptor.Create(LEFTBRACE174);
            		adaptor.AddChild(root_0, LEFTBRACE174_tree);

            	PushFollow(FOLLOW_variable_in_matrixtranspose2020);
            	variable175 = variable();
            	state.followingStackPointer--;

            	adaptor.AddChild(root_0, variable175.Tree);
            	retval.ret.setvariable(((variable175 != null) ? variable175.ret : null)); 
            	char_literal176=(IToken)Match(input,RIGHTBRACE,FOLLOW_RIGHTBRACE_in_matrixtranspose2023); 
            		char_literal176_tree = (object)adaptor.Create(char_literal176);
            		adaptor.AddChild(root_0, char_literal176_tree);


            }

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

            	retval.Tree = (object)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 = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
Example #3
0
    // $ANTLR start "matrixtranspose"
    // C:\\Users\\KULDEEP GANDHI\\Desktop\\pinac\\Spinach\\InterpreterFrontEnd\\spinach.g:316:1: matrixtranspose returns [MatrixTranspose ret] : 'T' LEFTBRACE variable ')' ;
    public spinachParser.matrixtranspose_return matrixtranspose() // throws RecognitionException [1]
    {   
        spinachParser.matrixtranspose_return retval = new spinachParser.matrixtranspose_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken char_literal165 = null;
        IToken LEFTBRACE166 = null;
        IToken char_literal168 = null;
        spinachParser.variable_return variable167 = null;


        object char_literal165_tree=null;
        object LEFTBRACE166_tree=null;
        object char_literal168_tree=null;


        retval.ret = new MatrixTranspose();

        try 
    	{
            // C:\\Users\\KULDEEP GANDHI\\Desktop\\pinac\\Spinach\\InterpreterFrontEnd\\spinach.g:321:1: ( 'T' LEFTBRACE variable ')' )
            // C:\\Users\\KULDEEP GANDHI\\Desktop\\pinac\\Spinach\\InterpreterFrontEnd\\spinach.g:321:3: 'T' LEFTBRACE variable ')'
            {
            	root_0 = (object)adaptor.GetNilNode();

            	char_literal165=(IToken)Match(input,45,FOLLOW_45_in_matrixtranspose1955); 
            		char_literal165_tree = (object)adaptor.Create(char_literal165);
            		adaptor.AddChild(root_0, char_literal165_tree);

            	LEFTBRACE166=(IToken)Match(input,LEFTBRACE,FOLLOW_LEFTBRACE_in_matrixtranspose1957); 
            		LEFTBRACE166_tree = (object)adaptor.Create(LEFTBRACE166);
            		adaptor.AddChild(root_0, LEFTBRACE166_tree);

            	PushFollow(FOLLOW_variable_in_matrixtranspose1959);
            	variable167 = variable();
            	state.followingStackPointer--;

            	adaptor.AddChild(root_0, variable167.Tree);
            	retval.ret.setvariable(((variable167 != null) ? variable167.ret : null)); 
            	char_literal168=(IToken)Match(input,RIGHTBRACE,FOLLOW_RIGHTBRACE_in_matrixtranspose1962); 
            		char_literal168_tree = (object)adaptor.Create(char_literal168);
            		adaptor.AddChild(root_0, char_literal168_tree);


            }

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

            	retval.Tree = (object)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 = (object)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }