Inheritance: Antlr.Runtime.ParserRuleReturnScope
Exemple #1
0
    // $ANTLR start "matrixvardec"
    // C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:96:1: matrixvardec returns [MatrixVariableDeclaration ret] : ( 'Matrix' '<' (el0= VARTYPE '>' '[' el1= int_literal ']' '[' el2= int_literal ']' (el3= variable ) ASSIGNMENT ( ( '[' ']' ) | ( '[' (el7= int_literal ( ',' el5= int_literal )* ) ']' ) | ( '[' el4= double_literal ( ',' el6= double_literal )* ) ']' ) ) ) END_OF_STATEMENT ;
    public spinachParser.matrixvardec_return matrixvardec() // throws RecognitionException [1]
    {   
        spinachParser.matrixvardec_return retval = new spinachParser.matrixvardec_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken el0 = null;
        IToken string_literal23 = null;
        IToken char_literal24 = null;
        IToken char_literal25 = null;
        IToken char_literal26 = null;
        IToken char_literal27 = null;
        IToken char_literal28 = null;
        IToken char_literal29 = null;
        IToken ASSIGNMENT30 = null;
        IToken char_literal31 = null;
        IToken char_literal32 = null;
        IToken char_literal33 = null;
        IToken char_literal34 = null;
        IToken char_literal35 = null;
        IToken char_literal36 = null;
        IToken char_literal37 = null;
        IToken char_literal38 = null;
        IToken END_OF_STATEMENT39 = null;
        spinachParser.int_literal_return el1 = null;

        spinachParser.int_literal_return el2 = null;

        spinachParser.variable_return el3 = null;

        spinachParser.int_literal_return el7 = null;

        spinachParser.int_literal_return el5 = null;

        spinachParser.double_literal_return el4 = null;

        spinachParser.double_literal_return el6 = null;


        object el0_tree=null;
        object string_literal23_tree=null;
        object char_literal24_tree=null;
        object char_literal25_tree=null;
        object char_literal26_tree=null;
        object char_literal27_tree=null;
        object char_literal28_tree=null;
        object char_literal29_tree=null;
        object ASSIGNMENT30_tree=null;
        object char_literal31_tree=null;
        object char_literal32_tree=null;
        object char_literal33_tree=null;
        object char_literal34_tree=null;
        object char_literal35_tree=null;
        object char_literal36_tree=null;
        object char_literal37_tree=null;
        object char_literal38_tree=null;
        object END_OF_STATEMENT39_tree=null;


        	retval.ret = new MatrixVariableDeclaration();
        	
        try 
    	{
            // C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:100:2: ( ( 'Matrix' '<' (el0= VARTYPE '>' '[' el1= int_literal ']' '[' el2= int_literal ']' (el3= variable ) ASSIGNMENT ( ( '[' ']' ) | ( '[' (el7= int_literal ( ',' el5= int_literal )* ) ']' ) | ( '[' el4= double_literal ( ',' el6= double_literal )* ) ']' ) ) ) END_OF_STATEMENT )
            // C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:100:3: ( 'Matrix' '<' (el0= VARTYPE '>' '[' el1= int_literal ']' '[' el2= int_literal ']' (el3= variable ) ASSIGNMENT ( ( '[' ']' ) | ( '[' (el7= int_literal ( ',' el5= int_literal )* ) ']' ) | ( '[' el4= double_literal ( ',' el6= double_literal )* ) ']' ) ) ) END_OF_STATEMENT
            {
            	root_0 = (object)adaptor.GetNilNode();

            	// C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:100:3: ( 'Matrix' '<' (el0= VARTYPE '>' '[' el1= int_literal ']' '[' el2= int_literal ']' (el3= variable ) ASSIGNMENT ( ( '[' ']' ) | ( '[' (el7= int_literal ( ',' el5= int_literal )* ) ']' ) | ( '[' el4= double_literal ( ',' el6= double_literal )* ) ']' ) ) )
            	// C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:100:4: 'Matrix' '<' (el0= VARTYPE '>' '[' el1= int_literal ']' '[' el2= int_literal ']' (el3= variable ) ASSIGNMENT ( ( '[' ']' ) | ( '[' (el7= int_literal ( ',' el5= int_literal )* ) ']' ) | ( '[' el4= double_literal ( ',' el6= double_literal )* ) ']' ) )
            	{
            		string_literal23=(IToken)Match(input,28,FOLLOW_28_in_matrixvardec466); 
            			string_literal23_tree = (object)adaptor.Create(string_literal23);
            			adaptor.AddChild(root_0, string_literal23_tree);

            		char_literal24=(IToken)Match(input,LESSTHANEXPRESSION,FOLLOW_LESSTHANEXPRESSION_in_matrixvardec468); 
            			char_literal24_tree = (object)adaptor.Create(char_literal24);
            			adaptor.AddChild(root_0, char_literal24_tree);

            		// C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:101:2: (el0= VARTYPE '>' '[' el1= int_literal ']' '[' el2= int_literal ']' (el3= variable ) ASSIGNMENT ( ( '[' ']' ) | ( '[' (el7= int_literal ( ',' el5= int_literal )* ) ']' ) | ( '[' el4= double_literal ( ',' el6= double_literal )* ) ']' ) )
            		// C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:101:3: el0= VARTYPE '>' '[' el1= int_literal ']' '[' el2= int_literal ']' (el3= variable ) ASSIGNMENT ( ( '[' ']' ) | ( '[' (el7= int_literal ( ',' el5= int_literal )* ) ']' ) | ( '[' el4= double_literal ( ',' el6= double_literal )* ) ']' )
            		{
            			el0=(IToken)Match(input,VARTYPE,FOLLOW_VARTYPE_in_matrixvardec475); 
            				el0_tree = (object)adaptor.Create(el0);
            				adaptor.AddChild(root_0, el0_tree);

            			 retval.ret.setType(((el0 != null) ? el0.Text : null));
            			char_literal25=(IToken)Match(input,GREATERTHANEXPRESSION,FOLLOW_GREATERTHANEXPRESSION_in_matrixvardec477); 
            				char_literal25_tree = (object)adaptor.Create(char_literal25);
            				adaptor.AddChild(root_0, char_literal25_tree);

            			char_literal26=(IToken)Match(input,29,FOLLOW_29_in_matrixvardec479); 
            				char_literal26_tree = (object)adaptor.Create(char_literal26);
            				adaptor.AddChild(root_0, char_literal26_tree);

            			PushFollow(FOLLOW_int_literal_in_matrixvardec482);
            			el1 = int_literal();
            			state.followingStackPointer--;

            			adaptor.AddChild(root_0, el1.Tree);
            			 retval.ret.setRow(((el1 != null) ? el1.ret : null));
            			char_literal27=(IToken)Match(input,30,FOLLOW_30_in_matrixvardec485); 
            				char_literal27_tree = (object)adaptor.Create(char_literal27);
            				adaptor.AddChild(root_0, char_literal27_tree);

            			char_literal28=(IToken)Match(input,29,FOLLOW_29_in_matrixvardec488); 
            				char_literal28_tree = (object)adaptor.Create(char_literal28);
            				adaptor.AddChild(root_0, char_literal28_tree);

            			PushFollow(FOLLOW_int_literal_in_matrixvardec492);
            			el2 = int_literal();
            			state.followingStackPointer--;

            			adaptor.AddChild(root_0, el2.Tree);
            			 retval.ret.setColumn(((el2 != null) ? el2.ret : null));
            			char_literal29=(IToken)Match(input,30,FOLLOW_30_in_matrixvardec495); 
            				char_literal29_tree = (object)adaptor.Create(char_literal29);
            				adaptor.AddChild(root_0, char_literal29_tree);

            			// C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:103:3: (el3= variable )
            			// C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:103:4: el3= variable
            			{
            				PushFollow(FOLLOW_variable_in_matrixvardec503);
            				el3 = variable();
            				state.followingStackPointer--;

            				adaptor.AddChild(root_0, el3.Tree);
            				 retval.ret.setVar(((el3 != null) ? el3.ret : null));

            			}

            			ASSIGNMENT30=(IToken)Match(input,ASSIGNMENT,FOLLOW_ASSIGNMENT_in_matrixvardec510); 
            				ASSIGNMENT30_tree = (object)adaptor.Create(ASSIGNMENT30);
            				adaptor.AddChild(root_0, ASSIGNMENT30_tree);

            			// C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:105:3: ( ( '[' ']' ) | ( '[' (el7= int_literal ( ',' el5= int_literal )* ) ']' ) | ( '[' el4= double_literal ( ',' el6= double_literal )* ) ']' )
            			int alt11 = 3;
            			int LA11_0 = input.LA(1);

            			if ( (LA11_0 == 29) )
            			{
            			    switch ( input.LA(2) ) 
            			    {
            			    case 30:
            			    	{
            			        alt11 = 1;
            			        }
            			        break;
            			    case INT_LITERAL:
            			    	{
            			        alt11 = 2;
            			        }
            			        break;
            			    case DOUBLE_LITERAL:
            			    	{
            			        alt11 = 3;
            			        }
            			        break;
            			    	default:
            			    	    NoViableAltException nvae_d11s1 =
            			    	        new NoViableAltException("", 11, 1, input);

            			    	    throw nvae_d11s1;
            			    }

            			}
            			else 
            			{
            			    NoViableAltException nvae_d11s0 =
            			        new NoViableAltException("", 11, 0, input);

            			    throw nvae_d11s0;
            			}
            			switch (alt11) 
            			{
            			    case 1 :
            			        // C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:105:4: ( '[' ']' )
            			        {
            			        	// C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:105:4: ( '[' ']' )
            			        	// C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:105:5: '[' ']'
            			        	{
            			        		char_literal31=(IToken)Match(input,29,FOLLOW_29_in_matrixvardec516); 
            			        			char_literal31_tree = (object)adaptor.Create(char_literal31);
            			        			adaptor.AddChild(root_0, char_literal31_tree);

            			        		char_literal32=(IToken)Match(input,30,FOLLOW_30_in_matrixvardec517); 
            			        			char_literal32_tree = (object)adaptor.Create(char_literal32);
            			        			adaptor.AddChild(root_0, char_literal32_tree);


            			        	}


            			        }
            			        break;
            			    case 2 :
            			        // C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:106:3: ( '[' (el7= int_literal ( ',' el5= int_literal )* ) ']' )
            			        {
            			        	// C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:106:3: ( '[' (el7= int_literal ( ',' el5= int_literal )* ) ']' )
            			        	// C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:106:4: '[' (el7= int_literal ( ',' el5= int_literal )* ) ']'
            			        	{
            			        		char_literal33=(IToken)Match(input,29,FOLLOW_29_in_matrixvardec524); 
            			        			char_literal33_tree = (object)adaptor.Create(char_literal33);
            			        			adaptor.AddChild(root_0, char_literal33_tree);

            			        		// C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:106:7: (el7= int_literal ( ',' el5= int_literal )* )
            			        		// C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:106:8: el7= int_literal ( ',' el5= int_literal )*
            			        		{
            			        			PushFollow(FOLLOW_int_literal_in_matrixvardec528);
            			        			el7 = int_literal();
            			        			state.followingStackPointer--;

            			        			adaptor.AddChild(root_0, el7.Tree);
            			        			retval.ret.addValue(((el7 != null) ? el7.ret : null));
            			        			// C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:106:57: ( ',' el5= int_literal )*
            			        			do 
            			        			{
            			        			    int alt9 = 2;
            			        			    int LA9_0 = input.LA(1);

            			        			    if ( (LA9_0 == 31) )
            			        			    {
            			        			        alt9 = 1;
            			        			    }


            			        			    switch (alt9) 
            			        				{
            			        					case 1 :
            			        					    // C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:106:58: ',' el5= int_literal
            			        					    {
            			        					    	char_literal34=(IToken)Match(input,31,FOLLOW_31_in_matrixvardec533); 
            			        					    		char_literal34_tree = (object)adaptor.Create(char_literal34);
            			        					    		adaptor.AddChild(root_0, char_literal34_tree);

            			        					    	PushFollow(FOLLOW_int_literal_in_matrixvardec536);
            			        					    	el5 = int_literal();
            			        					    	state.followingStackPointer--;

            			        					    	adaptor.AddChild(root_0, el5.Tree);
            			        					    	retval.ret.addValue(((el5 != null) ? el5.ret : null));

            			        					    }
            			        					    break;

            			        					default:
            			        					    goto loop9;
            			        			    }
            			        			} while (true);

            			        			loop9:
            			        				;	// Stops C# compiler whining that label 'loop9' has no statements


            			        		}

            			        		char_literal35=(IToken)Match(input,30,FOLLOW_30_in_matrixvardec542); 
            			        			char_literal35_tree = (object)adaptor.Create(char_literal35);
            			        			adaptor.AddChild(root_0, char_literal35_tree);


            			        	}


            			        }
            			        break;
            			    case 3 :
            			        // C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:107:4: ( '[' el4= double_literal ( ',' el6= double_literal )* ) ']'
            			        {
            			        	// C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:107:4: ( '[' el4= double_literal ( ',' el6= double_literal )* )
            			        	// C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:107:5: '[' el4= double_literal ( ',' el6= double_literal )*
            			        	{
            			        		char_literal36=(IToken)Match(input,29,FOLLOW_29_in_matrixvardec549); 
            			        			char_literal36_tree = (object)adaptor.Create(char_literal36);
            			        			adaptor.AddChild(root_0, char_literal36_tree);

            			        		PushFollow(FOLLOW_double_literal_in_matrixvardec552);
            			        		el4 = double_literal();
            			        		state.followingStackPointer--;

            			        		adaptor.AddChild(root_0, el4.Tree);
            			        		retval.ret.addValue(((el4 != null) ? el4.ret : null));
            			        		// C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:107:59: ( ',' el6= double_literal )*
            			        		do 
            			        		{
            			        		    int alt10 = 2;
            			        		    int LA10_0 = input.LA(1);

            			        		    if ( (LA10_0 == 31) )
            			        		    {
            			        		        alt10 = 1;
            			        		    }


            			        		    switch (alt10) 
            			        			{
            			        				case 1 :
            			        				    // C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:107:60: ',' el6= double_literal
            			        				    {
            			        				    	char_literal37=(IToken)Match(input,31,FOLLOW_31_in_matrixvardec556); 
            			        				    		char_literal37_tree = (object)adaptor.Create(char_literal37);
            			        				    		adaptor.AddChild(root_0, char_literal37_tree);

            			        				    	PushFollow(FOLLOW_double_literal_in_matrixvardec559);
            			        				    	el6 = double_literal();
            			        				    	state.followingStackPointer--;

            			        				    	adaptor.AddChild(root_0, el6.Tree);
            			        				    	retval.ret.addValue(((el6 != null) ? el6.ret : null));

            			        				    }
            			        				    break;

            			        				default:
            			        				    goto loop10;
            			        		    }
            			        		} while (true);

            			        		loop10:
            			        			;	// Stops C# compiler whining that label 'loop10' has no statements


            			        	}

            			        	char_literal38=(IToken)Match(input,30,FOLLOW_30_in_matrixvardec565); 
            			        		char_literal38_tree = (object)adaptor.Create(char_literal38);
            			        		adaptor.AddChild(root_0, char_literal38_tree);


            			        }
            			        break;

            			}


            		}

            		retval.ret.setValue();

            	}

            	END_OF_STATEMENT39=(IToken)Match(input,END_OF_STATEMENT,FOLLOW_END_OF_STATEMENT_in_matrixvardec576); 
            		END_OF_STATEMENT39_tree = (object)adaptor.Create(END_OF_STATEMENT39);
            		adaptor.AddChild(root_0, END_OF_STATEMENT39_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;
    }
Exemple #2
0
    // throws RecognitionException [1]
    // $ANTLR start "matrixvardec"
    // C:\\Users\\Jegan\\Documents\\MSCE\\FALL 09\\SoftwareStudio\\SPINACH-Srinivasan\\ConsoleApplication1\\ConsoleApplication1\\spinach.g:71:1: matrixvardec returns [MatrixVariableDeclaration ret] : ( 'Matrix' '<' VARTYPE '>' '[' el1= int_literal ']' '[' el2= int_literal ']' (el3= variable ) ASSIGNMENT '[' ( (el4= int_literal | el5= double_literal ) ( ',' el6= int_literal | ',' el7= double_literal )* ) ']' ) END_OF_STATEMENT ;
    public spinachParser.matrixvardec_return matrixvardec()
    {
        spinachParser.matrixvardec_return retval = new spinachParser.matrixvardec_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken string_literal25 = null;
        IToken char_literal26 = null;
        IToken VARTYPE27 = null;
        IToken char_literal28 = null;
        IToken char_literal29 = null;
        IToken char_literal30 = null;
        IToken char_literal31 = null;
        IToken char_literal32 = null;
        IToken ASSIGNMENT33 = null;
        IToken char_literal34 = null;
        IToken char_literal35 = null;
        IToken char_literal36 = null;
        IToken char_literal37 = null;
        IToken END_OF_STATEMENT38 = null;
        spinachParser.int_literal_return el1 = null;

        spinachParser.int_literal_return el2 = null;

        spinachParser.variable_return el3 = null;

        spinachParser.int_literal_return el4 = null;

        spinachParser.double_literal_return el5 = null;

        spinachParser.int_literal_return el6 = null;

        spinachParser.double_literal_return el7 = null;

        object string_literal25_tree=null;
        object char_literal26_tree=null;
        object VARTYPE27_tree=null;
        object char_literal28_tree=null;
        object char_literal29_tree=null;
        object char_literal30_tree=null;
        object char_literal31_tree=null;
        object char_literal32_tree=null;
        object ASSIGNMENT33_tree=null;
        object char_literal34_tree=null;
        object char_literal35_tree=null;
        object char_literal36_tree=null;
        object char_literal37_tree=null;
        object END_OF_STATEMENT38_tree=null;

            retval.ret = new MatrixVariableDeclaration();

        try
        {
            // C:\\Users\\Jegan\\Documents\\MSCE\\FALL 09\\SoftwareStudio\\SPINACH-Srinivasan\\ConsoleApplication1\\ConsoleApplication1\\spinach.g:75:2: ( ( 'Matrix' '<' VARTYPE '>' '[' el1= int_literal ']' '[' el2= int_literal ']' (el3= variable ) ASSIGNMENT '[' ( (el4= int_literal | el5= double_literal ) ( ',' el6= int_literal | ',' el7= double_literal )* ) ']' ) END_OF_STATEMENT )
            // C:\\Users\\Jegan\\Documents\\MSCE\\FALL 09\\SoftwareStudio\\SPINACH-Srinivasan\\ConsoleApplication1\\ConsoleApplication1\\spinach.g:75:3: ( 'Matrix' '<' VARTYPE '>' '[' el1= int_literal ']' '[' el2= int_literal ']' (el3= variable ) ASSIGNMENT '[' ( (el4= int_literal | el5= double_literal ) ( ',' el6= int_literal | ',' el7= double_literal )* ) ']' ) END_OF_STATEMENT
            {
                root_0 = (object)adaptor.GetNilNode();

                // C:\\Users\\Jegan\\Documents\\MSCE\\FALL 09\\SoftwareStudio\\SPINACH-Srinivasan\\ConsoleApplication1\\ConsoleApplication1\\spinach.g:75:3: ( 'Matrix' '<' VARTYPE '>' '[' el1= int_literal ']' '[' el2= int_literal ']' (el3= variable ) ASSIGNMENT '[' ( (el4= int_literal | el5= double_literal ) ( ',' el6= int_literal | ',' el7= double_literal )* ) ']' )
                // C:\\Users\\Jegan\\Documents\\MSCE\\FALL 09\\SoftwareStudio\\SPINACH-Srinivasan\\ConsoleApplication1\\ConsoleApplication1\\spinach.g:75:4: 'Matrix' '<' VARTYPE '>' '[' el1= int_literal ']' '[' el2= int_literal ']' (el3= variable ) ASSIGNMENT '[' ( (el4= int_literal | el5= double_literal ) ( ',' el6= int_literal | ',' el7= double_literal )* ) ']'
                {
                    string_literal25=(IToken)Match(input,23,FOLLOW_23_in_matrixvardec341);
                        string_literal25_tree = (object)adaptor.Create(string_literal25);
                        adaptor.AddChild(root_0, string_literal25_tree);

                    char_literal26=(IToken)Match(input,24,FOLLOW_24_in_matrixvardec343);
                        char_literal26_tree = (object)adaptor.Create(char_literal26);
                        adaptor.AddChild(root_0, char_literal26_tree);

                    VARTYPE27=(IToken)Match(input,VARTYPE,FOLLOW_VARTYPE_in_matrixvardec345);
                        VARTYPE27_tree = (object)adaptor.Create(VARTYPE27);
                        adaptor.AddChild(root_0, VARTYPE27_tree);

                     retval.ret.setType(((VARTYPE27 != null) ? VARTYPE27.Text : null));
                    char_literal28=(IToken)Match(input,25,FOLLOW_25_in_matrixvardec348);
                        char_literal28_tree = (object)adaptor.Create(char_literal28);
                        adaptor.AddChild(root_0, char_literal28_tree);

                    char_literal29=(IToken)Match(input,26,FOLLOW_26_in_matrixvardec350);
                        char_literal29_tree = (object)adaptor.Create(char_literal29);
                        adaptor.AddChild(root_0, char_literal29_tree);

                    PushFollow(FOLLOW_int_literal_in_matrixvardec353);
                    el1 = int_literal();
                    state.followingStackPointer--;

                    adaptor.AddChild(root_0, el1.Tree);
                     retval.ret.setRow(((el1 != null) ? el1.ret : null));
                    char_literal30=(IToken)Match(input,27,FOLLOW_27_in_matrixvardec356);
                        char_literal30_tree = (object)adaptor.Create(char_literal30);
                        adaptor.AddChild(root_0, char_literal30_tree);

                    char_literal31=(IToken)Match(input,26,FOLLOW_26_in_matrixvardec359);
                        char_literal31_tree = (object)adaptor.Create(char_literal31);
                        adaptor.AddChild(root_0, char_literal31_tree);

                    PushFollow(FOLLOW_int_literal_in_matrixvardec363);
                    el2 = int_literal();
                    state.followingStackPointer--;

                    adaptor.AddChild(root_0, el2.Tree);
                     retval.ret.setColumn(((el2 != null) ? el2.ret : null));
                    char_literal32=(IToken)Match(input,27,FOLLOW_27_in_matrixvardec366);
                        char_literal32_tree = (object)adaptor.Create(char_literal32);
                        adaptor.AddChild(root_0, char_literal32_tree);

                    // C:\\Users\\Jegan\\Documents\\MSCE\\FALL 09\\SoftwareStudio\\SPINACH-Srinivasan\\ConsoleApplication1\\ConsoleApplication1\\spinach.g:77:3: (el3= variable )
                    // C:\\Users\\Jegan\\Documents\\MSCE\\FALL 09\\SoftwareStudio\\SPINACH-Srinivasan\\ConsoleApplication1\\ConsoleApplication1\\spinach.g:77:4: el3= variable
                    {
                        PushFollow(FOLLOW_variable_in_matrixvardec374);
                        el3 = variable();
                        state.followingStackPointer--;

                        adaptor.AddChild(root_0, el3.Tree);
                         retval.ret.setVar(((el3 != null) ? el3.ret : null));

                    }

                    ASSIGNMENT33=(IToken)Match(input,ASSIGNMENT,FOLLOW_ASSIGNMENT_in_matrixvardec381);
                        ASSIGNMENT33_tree = (object)adaptor.Create(ASSIGNMENT33);
                        adaptor.AddChild(root_0, ASSIGNMENT33_tree);

                    char_literal34=(IToken)Match(input,26,FOLLOW_26_in_matrixvardec385);
                        char_literal34_tree = (object)adaptor.Create(char_literal34);
                        adaptor.AddChild(root_0, char_literal34_tree);

                    // C:\\Users\\Jegan\\Documents\\MSCE\\FALL 09\\SoftwareStudio\\SPINACH-Srinivasan\\ConsoleApplication1\\ConsoleApplication1\\spinach.g:79:6: ( (el4= int_literal | el5= double_literal ) ( ',' el6= int_literal | ',' el7= double_literal )* )
                    // C:\\Users\\Jegan\\Documents\\MSCE\\FALL 09\\SoftwareStudio\\SPINACH-Srinivasan\\ConsoleApplication1\\ConsoleApplication1\\spinach.g:79:7: (el4= int_literal | el5= double_literal ) ( ',' el6= int_literal | ',' el7= double_literal )*
                    {
                        // C:\\Users\\Jegan\\Documents\\MSCE\\FALL 09\\SoftwareStudio\\SPINACH-Srinivasan\\ConsoleApplication1\\ConsoleApplication1\\spinach.g:79:7: (el4= int_literal | el5= double_literal )
                        int alt5 = 2;
                        int LA5_0 = input.LA(1);

                        if ( (LA5_0 == INT_LITERAL) )
                        {
                            alt5 = 1;
                        }
                        else if ( (LA5_0 == DOUBLE_LITERAL) )
                        {
                            alt5 = 2;
                        }
                        else
                        {
                            NoViableAltException nvae_d5s0 =
                                new NoViableAltException("", 5, 0, input);

                            throw nvae_d5s0;
                        }
                        switch (alt5)
                        {
                            case 1 :
                                // C:\\Users\\Jegan\\Documents\\MSCE\\FALL 09\\SoftwareStudio\\SPINACH-Srinivasan\\ConsoleApplication1\\ConsoleApplication1\\spinach.g:79:8: el4= int_literal
                                {
                                    PushFollow(FOLLOW_int_literal_in_matrixvardec390);
                                    el4 = int_literal();
                                    state.followingStackPointer--;

                                    adaptor.AddChild(root_0, el4.Tree);
                                    retval.ret.addValue(((el4 != null) ? el4.ret : null));

                                }
                                break;
                            case 2 :
                                // C:\\Users\\Jegan\\Documents\\MSCE\\FALL 09\\SoftwareStudio\\SPINACH-Srinivasan\\ConsoleApplication1\\ConsoleApplication1\\spinach.g:79:57: el5= double_literal
                                {
                                    PushFollow(FOLLOW_double_literal_in_matrixvardec396);
                                    el5 = double_literal();
                                    state.followingStackPointer--;

                                    adaptor.AddChild(root_0, el5.Tree);
                                    retval.ret.addValue(((el5 != null) ? el5.ret : null));

                                }
                                break;

                        }

                        // C:\\Users\\Jegan\\Documents\\MSCE\\FALL 09\\SoftwareStudio\\SPINACH-Srinivasan\\ConsoleApplication1\\ConsoleApplication1\\spinach.g:80:3: ( ',' el6= int_literal | ',' el7= double_literal )*
                        do
                        {
                            int alt6 = 3;
                            int LA6_0 = input.LA(1);

                            if ( (LA6_0 == 28) )
                            {
                                int LA6_2 = input.LA(2);

                                if ( (LA6_2 == DOUBLE_LITERAL) )
                                {
                                    alt6 = 2;
                                }
                                else if ( (LA6_2 == INT_LITERAL) )
                                {
                                    alt6 = 1;
                                }

                            }

                            switch (alt6)
                            {
                                case 1 :
                                    // C:\\Users\\Jegan\\Documents\\MSCE\\FALL 09\\SoftwareStudio\\SPINACH-Srinivasan\\ConsoleApplication1\\ConsoleApplication1\\spinach.g:80:4: ',' el6= int_literal
                                    {
                                        char_literal35=(IToken)Match(input,28,FOLLOW_28_in_matrixvardec404);
                                            char_literal35_tree = (object)adaptor.Create(char_literal35);
                                            adaptor.AddChild(root_0, char_literal35_tree);

                                        PushFollow(FOLLOW_int_literal_in_matrixvardec407);
                                        el6 = int_literal();
                                        state.followingStackPointer--;

                                        adaptor.AddChild(root_0, el6.Tree);
                                        retval.ret.addValue(((el6 != null) ? el6.ret : null));

                                    }
                                    break;
                                case 2 :
                                    // C:\\Users\\Jegan\\Documents\\MSCE\\FALL 09\\SoftwareStudio\\SPINACH-Srinivasan\\ConsoleApplication1\\ConsoleApplication1\\spinach.g:80:56: ',' el7= double_literal
                                    {
                                        char_literal36=(IToken)Match(input,28,FOLLOW_28_in_matrixvardec411);
                                            char_literal36_tree = (object)adaptor.Create(char_literal36);
                                            adaptor.AddChild(root_0, char_literal36_tree);

                                        PushFollow(FOLLOW_double_literal_in_matrixvardec414);
                                        el7 = double_literal();
                                        state.followingStackPointer--;

                                        adaptor.AddChild(root_0, el7.Tree);
                                        retval.ret.addValue(((el7 != null) ? el7.ret : null));

                                    }
                                    break;

                                default:
                                    goto loop6;
                            }
                        } while (true);

                        loop6:
                            ;	// Stops C# compiler whining that label 'loop6' has no statements

                    }

                    char_literal37=(IToken)Match(input,27,FOLLOW_27_in_matrixvardec420);
                        char_literal37_tree = (object)adaptor.Create(char_literal37);
                        adaptor.AddChild(root_0, char_literal37_tree);

                }

                retval.ret.setValue();
                END_OF_STATEMENT38=(IToken)Match(input,END_OF_STATEMENT,FOLLOW_END_OF_STATEMENT_in_matrixvardec426);
                    END_OF_STATEMENT38_tree = (object)adaptor.Create(END_OF_STATEMENT38);
                    adaptor.AddChild(root_0, END_OF_STATEMENT38_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;
    }
Exemple #3
0
    // $ANTLR start "matrixvardec"
    // spinach.g:79:1: matrixvardec returns [MatrixVariableDeclaration ret] : ( 'Matrix' '<' VARTYPE '>' '[' el1= int_literal ']' '[' el2= int_literal ']' (el3= variable ) ASSIGNMENT '[' ( (el7= int_literal ( ',' el5= int_literal )* ) | (el4= double_literal ( ',' el6= double_literal )* ) ) ']' ) END_OF_STATEMENT ;
    public spinachParser.matrixvardec_return matrixvardec() // throws RecognitionException [1]
    {   
        spinachParser.matrixvardec_return retval = new spinachParser.matrixvardec_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken string_literal17 = null;
        IToken char_literal18 = null;
        IToken VARTYPE19 = null;
        IToken char_literal20 = null;
        IToken char_literal21 = null;
        IToken char_literal22 = null;
        IToken char_literal23 = null;
        IToken char_literal24 = null;
        IToken ASSIGNMENT25 = null;
        IToken char_literal26 = null;
        IToken char_literal27 = null;
        IToken char_literal28 = null;
        IToken char_literal29 = null;
        IToken END_OF_STATEMENT30 = null;
        spinachParser.int_literal_return el1 = null;

        spinachParser.int_literal_return el2 = null;

        spinachParser.variable_return el3 = null;

        spinachParser.int_literal_return el7 = null;

        spinachParser.int_literal_return el5 = null;

        spinachParser.double_literal_return el4 = null;

        spinachParser.double_literal_return el6 = null;


        object string_literal17_tree=null;
        object char_literal18_tree=null;
        object VARTYPE19_tree=null;
        object char_literal20_tree=null;
        object char_literal21_tree=null;
        object char_literal22_tree=null;
        object char_literal23_tree=null;
        object char_literal24_tree=null;
        object ASSIGNMENT25_tree=null;
        object char_literal26_tree=null;
        object char_literal27_tree=null;
        object char_literal28_tree=null;
        object char_literal29_tree=null;
        object END_OF_STATEMENT30_tree=null;


        	retval.ret = new MatrixVariableDeclaration();
        	
        try 
    	{
            // spinach.g:83:2: ( ( 'Matrix' '<' VARTYPE '>' '[' el1= int_literal ']' '[' el2= int_literal ']' (el3= variable ) ASSIGNMENT '[' ( (el7= int_literal ( ',' el5= int_literal )* ) | (el4= double_literal ( ',' el6= double_literal )* ) ) ']' ) END_OF_STATEMENT )
            // spinach.g:83:3: ( 'Matrix' '<' VARTYPE '>' '[' el1= int_literal ']' '[' el2= int_literal ']' (el3= variable ) ASSIGNMENT '[' ( (el7= int_literal ( ',' el5= int_literal )* ) | (el4= double_literal ( ',' el6= double_literal )* ) ) ']' ) END_OF_STATEMENT
            {
            	root_0 = (object)adaptor.GetNilNode();

            	// spinach.g:83:3: ( 'Matrix' '<' VARTYPE '>' '[' el1= int_literal ']' '[' el2= int_literal ']' (el3= variable ) ASSIGNMENT '[' ( (el7= int_literal ( ',' el5= int_literal )* ) | (el4= double_literal ( ',' el6= double_literal )* ) ) ']' )
            	// spinach.g:83:4: 'Matrix' '<' VARTYPE '>' '[' el1= int_literal ']' '[' el2= int_literal ']' (el3= variable ) ASSIGNMENT '[' ( (el7= int_literal ( ',' el5= int_literal )* ) | (el4= double_literal ( ',' el6= double_literal )* ) ) ']'
            	{
            		string_literal17=(IToken)Match(input,28,FOLLOW_28_in_matrixvardec415); 
            			string_literal17_tree = (object)adaptor.Create(string_literal17);
            			adaptor.AddChild(root_0, string_literal17_tree);

            		char_literal18=(IToken)Match(input,LESSTHANEXPRESSION,FOLLOW_LESSTHANEXPRESSION_in_matrixvardec417); 
            			char_literal18_tree = (object)adaptor.Create(char_literal18);
            			adaptor.AddChild(root_0, char_literal18_tree);

            		VARTYPE19=(IToken)Match(input,VARTYPE,FOLLOW_VARTYPE_in_matrixvardec419); 
            			VARTYPE19_tree = (object)adaptor.Create(VARTYPE19);
            			adaptor.AddChild(root_0, VARTYPE19_tree);

            		 retval.ret.setType(((VARTYPE19 != null) ? VARTYPE19.Text : null));
            		char_literal20=(IToken)Match(input,GREATERTHANEXPRESSION,FOLLOW_GREATERTHANEXPRESSION_in_matrixvardec422); 
            			char_literal20_tree = (object)adaptor.Create(char_literal20);
            			adaptor.AddChild(root_0, char_literal20_tree);

            		char_literal21=(IToken)Match(input,29,FOLLOW_29_in_matrixvardec424); 
            			char_literal21_tree = (object)adaptor.Create(char_literal21);
            			adaptor.AddChild(root_0, char_literal21_tree);

            		PushFollow(FOLLOW_int_literal_in_matrixvardec427);
            		el1 = int_literal();
            		state.followingStackPointer--;

            		adaptor.AddChild(root_0, el1.Tree);
            		 retval.ret.setRow(((el1 != null) ? el1.ret : null));
            		char_literal22=(IToken)Match(input,30,FOLLOW_30_in_matrixvardec430); 
            			char_literal22_tree = (object)adaptor.Create(char_literal22);
            			adaptor.AddChild(root_0, char_literal22_tree);

            		char_literal23=(IToken)Match(input,29,FOLLOW_29_in_matrixvardec433); 
            			char_literal23_tree = (object)adaptor.Create(char_literal23);
            			adaptor.AddChild(root_0, char_literal23_tree);

            		PushFollow(FOLLOW_int_literal_in_matrixvardec437);
            		el2 = int_literal();
            		state.followingStackPointer--;

            		adaptor.AddChild(root_0, el2.Tree);
            		 retval.ret.setColumn(((el2 != null) ? el2.ret : null));
            		char_literal24=(IToken)Match(input,30,FOLLOW_30_in_matrixvardec440); 
            			char_literal24_tree = (object)adaptor.Create(char_literal24);
            			adaptor.AddChild(root_0, char_literal24_tree);

            		// spinach.g:85:3: (el3= variable )
            		// spinach.g:85:4: el3= variable
            		{
            			PushFollow(FOLLOW_variable_in_matrixvardec448);
            			el3 = variable();
            			state.followingStackPointer--;

            			adaptor.AddChild(root_0, el3.Tree);
            			 retval.ret.setVar(((el3 != null) ? el3.ret : null));

            		}

            		ASSIGNMENT25=(IToken)Match(input,ASSIGNMENT,FOLLOW_ASSIGNMENT_in_matrixvardec455); 
            			ASSIGNMENT25_tree = (object)adaptor.Create(ASSIGNMENT25);
            			adaptor.AddChild(root_0, ASSIGNMENT25_tree);

            		char_literal26=(IToken)Match(input,29,FOLLOW_29_in_matrixvardec459); 
            			char_literal26_tree = (object)adaptor.Create(char_literal26);
            			adaptor.AddChild(root_0, char_literal26_tree);

            		// spinach.g:87:6: ( (el7= int_literal ( ',' el5= int_literal )* ) | (el4= double_literal ( ',' el6= double_literal )* ) )
            		int alt9 = 2;
            		int LA9_0 = input.LA(1);

            		if ( (LA9_0 == INT_LITERAL) )
            		{
            		    alt9 = 1;
            		}
            		else if ( (LA9_0 == DOUBLE_LITERAL) )
            		{
            		    alt9 = 2;
            		}
            		else 
            		{
            		    NoViableAltException nvae_d9s0 =
            		        new NoViableAltException("", 9, 0, input);

            		    throw nvae_d9s0;
            		}
            		switch (alt9) 
            		{
            		    case 1 :
            		        // spinach.g:87:7: (el7= int_literal ( ',' el5= int_literal )* )
            		        {
            		        	// spinach.g:87:7: (el7= int_literal ( ',' el5= int_literal )* )
            		        	// spinach.g:87:8: el7= int_literal ( ',' el5= int_literal )*
            		        	{
            		        		PushFollow(FOLLOW_int_literal_in_matrixvardec464);
            		        		el7 = int_literal();
            		        		state.followingStackPointer--;

            		        		adaptor.AddChild(root_0, el7.Tree);
            		        		retval.ret.addValue(((el7 != null) ? el7.ret : null));
            		        		// spinach.g:87:57: ( ',' el5= int_literal )*
            		        		do 
            		        		{
            		        		    int alt7 = 2;
            		        		    int LA7_0 = input.LA(1);

            		        		    if ( (LA7_0 == 31) )
            		        		    {
            		        		        alt7 = 1;
            		        		    }


            		        		    switch (alt7) 
            		        			{
            		        				case 1 :
            		        				    // spinach.g:87:58: ',' el5= int_literal
            		        				    {
            		        				    	char_literal27=(IToken)Match(input,31,FOLLOW_31_in_matrixvardec469); 
            		        				    		char_literal27_tree = (object)adaptor.Create(char_literal27);
            		        				    		adaptor.AddChild(root_0, char_literal27_tree);

            		        				    	PushFollow(FOLLOW_int_literal_in_matrixvardec472);
            		        				    	el5 = int_literal();
            		        				    	state.followingStackPointer--;

            		        				    	adaptor.AddChild(root_0, el5.Tree);
            		        				    	retval.ret.addValue(((el5 != null) ? el5.ret : null));

            		        				    }
            		        				    break;

            		        				default:
            		        				    goto loop7;
            		        		    }
            		        		} while (true);

            		        		loop7:
            		        			;	// Stops C# compiler whining that label 'loop7' has no statements


            		        	}


            		        }
            		        break;
            		    case 2 :
            		        // spinach.g:88:3: (el4= double_literal ( ',' el6= double_literal )* )
            		        {
            		        	// spinach.g:88:3: (el4= double_literal ( ',' el6= double_literal )* )
            		        	// spinach.g:88:4: el4= double_literal ( ',' el6= double_literal )*
            		        	{
            		        		PushFollow(FOLLOW_double_literal_in_matrixvardec485);
            		        		el4 = double_literal();
            		        		state.followingStackPointer--;

            		        		adaptor.AddChild(root_0, el4.Tree);
            		        		retval.ret.addValue(((el4 != null) ? el4.ret : null));
            		        		// spinach.g:89:3: ( ',' el6= double_literal )*
            		        		do 
            		        		{
            		        		    int alt8 = 2;
            		        		    int LA8_0 = input.LA(1);

            		        		    if ( (LA8_0 == 31) )
            		        		    {
            		        		        alt8 = 1;
            		        		    }


            		        		    switch (alt8) 
            		        			{
            		        				case 1 :
            		        				    // spinach.g:89:4: ',' el6= double_literal
            		        				    {
            		        				    	char_literal28=(IToken)Match(input,31,FOLLOW_31_in_matrixvardec492); 
            		        				    		char_literal28_tree = (object)adaptor.Create(char_literal28);
            		        				    		adaptor.AddChild(root_0, char_literal28_tree);

            		        				    	PushFollow(FOLLOW_double_literal_in_matrixvardec495);
            		        				    	el6 = double_literal();
            		        				    	state.followingStackPointer--;

            		        				    	adaptor.AddChild(root_0, el6.Tree);
            		        				    	retval.ret.addValue(((el6 != null) ? el6.ret : null));

            		        				    }
            		        				    break;

            		        				default:
            		        				    goto loop8;
            		        		    }
            		        		} while (true);

            		        		loop8:
            		        			;	// Stops C# compiler whining that label 'loop8' has no statements


            		        	}


            		        }
            		        break;

            		}

            		char_literal29=(IToken)Match(input,30,FOLLOW_30_in_matrixvardec502); 
            			char_literal29_tree = (object)adaptor.Create(char_literal29);
            			adaptor.AddChild(root_0, char_literal29_tree);

            		retval.ret.setValue();

            	}

            	END_OF_STATEMENT30=(IToken)Match(input,END_OF_STATEMENT,FOLLOW_END_OF_STATEMENT_in_matrixvardec508); 
            		END_OF_STATEMENT30_tree = (object)adaptor.Create(END_OF_STATEMENT30);
            		adaptor.AddChild(root_0, END_OF_STATEMENT30_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;
    }
Exemple #4
0
    // $ANTLR start "matrixvardec"
    // C:\\Users\\KULDEEP GANDHI\\Desktop\\pinac\\Spinach\\InterpreterFrontEnd\\spinach.g:87:1: matrixvardec returns [MatrixVariableDeclaration ret] : ( 'Matrix' '<' VARTYPE '>' '[' el1= int_literal ']' '[' el2= int_literal ']' (el3= variable ) ASSIGNMENT '[' ( (el7= int_literal ( ',' el5= int_literal )* ) | (el4= double_literal ( ',' el6= double_literal )* ) ) ']' ) END_OF_STATEMENT ;
    public spinachParser.matrixvardec_return matrixvardec() // throws RecognitionException [1]
    {   
        spinachParser.matrixvardec_return retval = new spinachParser.matrixvardec_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken string_literal24 = null;
        IToken char_literal25 = null;
        IToken VARTYPE26 = null;
        IToken char_literal27 = null;
        IToken char_literal28 = null;
        IToken char_literal29 = null;
        IToken char_literal30 = null;
        IToken char_literal31 = null;
        IToken ASSIGNMENT32 = null;
        IToken char_literal33 = null;
        IToken char_literal34 = null;
        IToken char_literal35 = null;
        IToken char_literal36 = null;
        IToken END_OF_STATEMENT37 = null;
        spinachParser.int_literal_return el1 = null;

        spinachParser.int_literal_return el2 = null;

        spinachParser.variable_return el3 = null;

        spinachParser.int_literal_return el7 = null;

        spinachParser.int_literal_return el5 = null;

        spinachParser.double_literal_return el4 = null;

        spinachParser.double_literal_return el6 = null;


        object string_literal24_tree=null;
        object char_literal25_tree=null;
        object VARTYPE26_tree=null;
        object char_literal27_tree=null;
        object char_literal28_tree=null;
        object char_literal29_tree=null;
        object char_literal30_tree=null;
        object char_literal31_tree=null;
        object ASSIGNMENT32_tree=null;
        object char_literal33_tree=null;
        object char_literal34_tree=null;
        object char_literal35_tree=null;
        object char_literal36_tree=null;
        object END_OF_STATEMENT37_tree=null;


        	retval.ret = new MatrixVariableDeclaration();
        	
        try 
    	{
            // C:\\Users\\KULDEEP GANDHI\\Desktop\\pinac\\Spinach\\InterpreterFrontEnd\\spinach.g:91:2: ( ( 'Matrix' '<' VARTYPE '>' '[' el1= int_literal ']' '[' el2= int_literal ']' (el3= variable ) ASSIGNMENT '[' ( (el7= int_literal ( ',' el5= int_literal )* ) | (el4= double_literal ( ',' el6= double_literal )* ) ) ']' ) END_OF_STATEMENT )
            // C:\\Users\\KULDEEP GANDHI\\Desktop\\pinac\\Spinach\\InterpreterFrontEnd\\spinach.g:91:3: ( 'Matrix' '<' VARTYPE '>' '[' el1= int_literal ']' '[' el2= int_literal ']' (el3= variable ) ASSIGNMENT '[' ( (el7= int_literal ( ',' el5= int_literal )* ) | (el4= double_literal ( ',' el6= double_literal )* ) ) ']' ) END_OF_STATEMENT
            {
            	root_0 = (object)adaptor.GetNilNode();

            	// C:\\Users\\KULDEEP GANDHI\\Desktop\\pinac\\Spinach\\InterpreterFrontEnd\\spinach.g:91:3: ( 'Matrix' '<' VARTYPE '>' '[' el1= int_literal ']' '[' el2= int_literal ']' (el3= variable ) ASSIGNMENT '[' ( (el7= int_literal ( ',' el5= int_literal )* ) | (el4= double_literal ( ',' el6= double_literal )* ) ) ']' )
            	// C:\\Users\\KULDEEP GANDHI\\Desktop\\pinac\\Spinach\\InterpreterFrontEnd\\spinach.g:91:4: 'Matrix' '<' VARTYPE '>' '[' el1= int_literal ']' '[' el2= int_literal ']' (el3= variable ) ASSIGNMENT '[' ( (el7= int_literal ( ',' el5= int_literal )* ) | (el4= double_literal ( ',' el6= double_literal )* ) ) ']'
            	{
            		string_literal24=(IToken)Match(input,28,FOLLOW_28_in_matrixvardec429); 
            			string_literal24_tree = (object)adaptor.Create(string_literal24);
            			adaptor.AddChild(root_0, string_literal24_tree);

            		char_literal25=(IToken)Match(input,LESSTHANEXPRESSION,FOLLOW_LESSTHANEXPRESSION_in_matrixvardec431); 
            			char_literal25_tree = (object)adaptor.Create(char_literal25);
            			adaptor.AddChild(root_0, char_literal25_tree);

            		VARTYPE26=(IToken)Match(input,VARTYPE,FOLLOW_VARTYPE_in_matrixvardec433); 
            			VARTYPE26_tree = (object)adaptor.Create(VARTYPE26);
            			adaptor.AddChild(root_0, VARTYPE26_tree);

            		 retval.ret.setType(((VARTYPE26 != null) ? VARTYPE26.Text : null));
            		char_literal27=(IToken)Match(input,GREATERTHANEXPRESSION,FOLLOW_GREATERTHANEXPRESSION_in_matrixvardec436); 
            			char_literal27_tree = (object)adaptor.Create(char_literal27);
            			adaptor.AddChild(root_0, char_literal27_tree);

            		char_literal28=(IToken)Match(input,29,FOLLOW_29_in_matrixvardec438); 
            			char_literal28_tree = (object)adaptor.Create(char_literal28);
            			adaptor.AddChild(root_0, char_literal28_tree);

            		PushFollow(FOLLOW_int_literal_in_matrixvardec441);
            		el1 = int_literal();
            		state.followingStackPointer--;

            		adaptor.AddChild(root_0, el1.Tree);
            		 retval.ret.setRow(((el1 != null) ? el1.ret : null));
            		char_literal29=(IToken)Match(input,30,FOLLOW_30_in_matrixvardec444); 
            			char_literal29_tree = (object)adaptor.Create(char_literal29);
            			adaptor.AddChild(root_0, char_literal29_tree);

            		char_literal30=(IToken)Match(input,29,FOLLOW_29_in_matrixvardec447); 
            			char_literal30_tree = (object)adaptor.Create(char_literal30);
            			adaptor.AddChild(root_0, char_literal30_tree);

            		PushFollow(FOLLOW_int_literal_in_matrixvardec451);
            		el2 = int_literal();
            		state.followingStackPointer--;

            		adaptor.AddChild(root_0, el2.Tree);
            		 retval.ret.setColumn(((el2 != null) ? el2.ret : null));
            		char_literal31=(IToken)Match(input,30,FOLLOW_30_in_matrixvardec454); 
            			char_literal31_tree = (object)adaptor.Create(char_literal31);
            			adaptor.AddChild(root_0, char_literal31_tree);

            		// C:\\Users\\KULDEEP GANDHI\\Desktop\\pinac\\Spinach\\InterpreterFrontEnd\\spinach.g:93:3: (el3= variable )
            		// C:\\Users\\KULDEEP GANDHI\\Desktop\\pinac\\Spinach\\InterpreterFrontEnd\\spinach.g:93:4: el3= variable
            		{
            			PushFollow(FOLLOW_variable_in_matrixvardec462);
            			el3 = variable();
            			state.followingStackPointer--;

            			adaptor.AddChild(root_0, el3.Tree);
            			 retval.ret.setVar(((el3 != null) ? el3.ret : null));

            		}

            		ASSIGNMENT32=(IToken)Match(input,ASSIGNMENT,FOLLOW_ASSIGNMENT_in_matrixvardec469); 
            			ASSIGNMENT32_tree = (object)adaptor.Create(ASSIGNMENT32);
            			adaptor.AddChild(root_0, ASSIGNMENT32_tree);

            		char_literal33=(IToken)Match(input,29,FOLLOW_29_in_matrixvardec473); 
            			char_literal33_tree = (object)adaptor.Create(char_literal33);
            			adaptor.AddChild(root_0, char_literal33_tree);

            		// C:\\Users\\KULDEEP GANDHI\\Desktop\\pinac\\Spinach\\InterpreterFrontEnd\\spinach.g:95:6: ( (el7= int_literal ( ',' el5= int_literal )* ) | (el4= double_literal ( ',' el6= double_literal )* ) )
            		int alt10 = 2;
            		int LA10_0 = input.LA(1);

            		if ( (LA10_0 == INT_LITERAL) )
            		{
            		    alt10 = 1;
            		}
            		else if ( (LA10_0 == DOUBLE_LITERAL) )
            		{
            		    alt10 = 2;
            		}
            		else 
            		{
            		    NoViableAltException nvae_d10s0 =
            		        new NoViableAltException("", 10, 0, input);

            		    throw nvae_d10s0;
            		}
            		switch (alt10) 
            		{
            		    case 1 :
            		        // C:\\Users\\KULDEEP GANDHI\\Desktop\\pinac\\Spinach\\InterpreterFrontEnd\\spinach.g:95:7: (el7= int_literal ( ',' el5= int_literal )* )
            		        {
            		        	// C:\\Users\\KULDEEP GANDHI\\Desktop\\pinac\\Spinach\\InterpreterFrontEnd\\spinach.g:95:7: (el7= int_literal ( ',' el5= int_literal )* )
            		        	// C:\\Users\\KULDEEP GANDHI\\Desktop\\pinac\\Spinach\\InterpreterFrontEnd\\spinach.g:95:8: el7= int_literal ( ',' el5= int_literal )*
            		        	{
            		        		PushFollow(FOLLOW_int_literal_in_matrixvardec478);
            		        		el7 = int_literal();
            		        		state.followingStackPointer--;

            		        		adaptor.AddChild(root_0, el7.Tree);
            		        		retval.ret.addValue(((el7 != null) ? el7.ret : null));
            		        		// C:\\Users\\KULDEEP GANDHI\\Desktop\\pinac\\Spinach\\InterpreterFrontEnd\\spinach.g:95:57: ( ',' el5= int_literal )*
            		        		do 
            		        		{
            		        		    int alt8 = 2;
            		        		    int LA8_0 = input.LA(1);

            		        		    if ( (LA8_0 == 31) )
            		        		    {
            		        		        alt8 = 1;
            		        		    }


            		        		    switch (alt8) 
            		        			{
            		        				case 1 :
            		        				    // C:\\Users\\KULDEEP GANDHI\\Desktop\\pinac\\Spinach\\InterpreterFrontEnd\\spinach.g:95:58: ',' el5= int_literal
            		        				    {
            		        				    	char_literal34=(IToken)Match(input,31,FOLLOW_31_in_matrixvardec483); 
            		        				    		char_literal34_tree = (object)adaptor.Create(char_literal34);
            		        				    		adaptor.AddChild(root_0, char_literal34_tree);

            		        				    	PushFollow(FOLLOW_int_literal_in_matrixvardec486);
            		        				    	el5 = int_literal();
            		        				    	state.followingStackPointer--;

            		        				    	adaptor.AddChild(root_0, el5.Tree);
            		        				    	retval.ret.addValue(((el5 != null) ? el5.ret : null));

            		        				    }
            		        				    break;

            		        				default:
            		        				    goto loop8;
            		        		    }
            		        		} while (true);

            		        		loop8:
            		        			;	// Stops C# compiler whining that label 'loop8' has no statements


            		        	}


            		        }
            		        break;
            		    case 2 :
            		        // C:\\Users\\KULDEEP GANDHI\\Desktop\\pinac\\Spinach\\InterpreterFrontEnd\\spinach.g:96:3: (el4= double_literal ( ',' el6= double_literal )* )
            		        {
            		        	// C:\\Users\\KULDEEP GANDHI\\Desktop\\pinac\\Spinach\\InterpreterFrontEnd\\spinach.g:96:3: (el4= double_literal ( ',' el6= double_literal )* )
            		        	// C:\\Users\\KULDEEP GANDHI\\Desktop\\pinac\\Spinach\\InterpreterFrontEnd\\spinach.g:96:4: el4= double_literal ( ',' el6= double_literal )*
            		        	{
            		        		PushFollow(FOLLOW_double_literal_in_matrixvardec499);
            		        		el4 = double_literal();
            		        		state.followingStackPointer--;

            		        		adaptor.AddChild(root_0, el4.Tree);
            		        		retval.ret.addValue(((el4 != null) ? el4.ret : null));
            		        		// C:\\Users\\KULDEEP GANDHI\\Desktop\\pinac\\Spinach\\InterpreterFrontEnd\\spinach.g:97:3: ( ',' el6= double_literal )*
            		        		do 
            		        		{
            		        		    int alt9 = 2;
            		        		    int LA9_0 = input.LA(1);

            		        		    if ( (LA9_0 == 31) )
            		        		    {
            		        		        alt9 = 1;
            		        		    }


            		        		    switch (alt9) 
            		        			{
            		        				case 1 :
            		        				    // C:\\Users\\KULDEEP GANDHI\\Desktop\\pinac\\Spinach\\InterpreterFrontEnd\\spinach.g:97:4: ',' el6= double_literal
            		        				    {
            		        				    	char_literal35=(IToken)Match(input,31,FOLLOW_31_in_matrixvardec506); 
            		        				    		char_literal35_tree = (object)adaptor.Create(char_literal35);
            		        				    		adaptor.AddChild(root_0, char_literal35_tree);

            		        				    	PushFollow(FOLLOW_double_literal_in_matrixvardec509);
            		        				    	el6 = double_literal();
            		        				    	state.followingStackPointer--;

            		        				    	adaptor.AddChild(root_0, el6.Tree);
            		        				    	retval.ret.addValue(((el6 != null) ? el6.ret : null));

            		        				    }
            		        				    break;

            		        				default:
            		        				    goto loop9;
            		        		    }
            		        		} while (true);

            		        		loop9:
            		        			;	// Stops C# compiler whining that label 'loop9' has no statements


            		        	}


            		        }
            		        break;

            		}

            		char_literal36=(IToken)Match(input,30,FOLLOW_30_in_matrixvardec516); 
            			char_literal36_tree = (object)adaptor.Create(char_literal36);
            			adaptor.AddChild(root_0, char_literal36_tree);

            		retval.ret.setValue();

            	}

            	END_OF_STATEMENT37=(IToken)Match(input,END_OF_STATEMENT,FOLLOW_END_OF_STATEMENT_in_matrixvardec522); 
            		END_OF_STATEMENT37_tree = (object)adaptor.Create(END_OF_STATEMENT37);
            		adaptor.AddChild(root_0, END_OF_STATEMENT37_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;
    }