Inheritance: Antlr.Runtime.ParserRuleReturnScope
Ejemplo n.º 1
0
    // $ANTLR start "structobjdec"
    // Interp.g:108:1: structobjdec returns [StructObjectDeclaration ret] : (el1= variable el2= variable ) END_OF_STATEMENT ;
    public InterpParser.structobjdec_return structobjdec() // throws RecognitionException [1]
    {   
        InterpParser.structobjdec_return retval = new InterpParser.structobjdec_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken END_OF_STATEMENT34 = null;
        InterpParser.variable_return el1 = null;

        InterpParser.variable_return el2 = null;


        object END_OF_STATEMENT34_tree=null;


        	retval.ret = new StructObjectDeclaration();
        	
        try 
    	{
            // Interp.g:112:2: ( (el1= variable el2= variable ) END_OF_STATEMENT )
            // Interp.g:112:4: (el1= variable el2= variable ) END_OF_STATEMENT
            {
            	root_0 = (object)adaptor.GetNilNode();

            	// Interp.g:112:4: (el1= variable el2= variable )
            	// Interp.g:112:5: el1= variable el2= variable
            	{
            		PushFollow(FOLLOW_variable_in_structobjdec519);
            		el1 = variable();
            		state.followingStackPointer--;

            		adaptor.AddChild(root_0, el1.Tree);
            		 retval.ret.setStructName(((el1 != null) ? el1.ret : null));
            		PushFollow(FOLLOW_variable_in_structobjdec528);
            		el2 = variable();
            		state.followingStackPointer--;

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

            	}

            	END_OF_STATEMENT34=(IToken)Match(input,END_OF_STATEMENT,FOLLOW_END_OF_STATEMENT_in_structobjdec536); 
            		END_OF_STATEMENT34_tree = (object)adaptor.Create(END_OF_STATEMENT34);
            		adaptor.AddChild(root_0, END_OF_STATEMENT34_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;
    }
Ejemplo n.º 2
0
    // $ANTLR start "structobjdec"
    // C:\\Documents and Settings\\Administrator\\Desktop\\SPINA\\Interp_CSharp\\Interp_CSharp\\Interp.g:101:1: structobjdec returns [StructObjectDeclaration ret] : (el1= variable el2= variable ) END_OF_STATEMENT ;
    public InterpParser.structobjdec_return structobjdec() // throws RecognitionException [1]
    {   
        InterpParser.structobjdec_return retval = new InterpParser.structobjdec_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken END_OF_STATEMENT32 = null;
        InterpParser.variable_return el1 = null;

        InterpParser.variable_return el2 = null;


        object END_OF_STATEMENT32_tree=null;


        	retval.ret = new StructObjectDeclaration();
        	
        try {
        	dbg.EnterRule(GrammarFileName, "structobjdec");
        	if ( RuleLevel==0 ) {dbg.Commence();}
        	IncRuleLevel();
        	dbg.Location(101, 1);

        try 
    	{
            // C:\\Documents and Settings\\Administrator\\Desktop\\SPINA\\Interp_CSharp\\Interp_CSharp\\Interp.g:105:2: ( (el1= variable el2= variable ) END_OF_STATEMENT )
            dbg.EnterAlt(1);

            // C:\\Documents and Settings\\Administrator\\Desktop\\SPINA\\Interp_CSharp\\Interp_CSharp\\Interp.g:105:4: (el1= variable el2= variable ) END_OF_STATEMENT
            {
            	root_0 = (object)adaptor.GetNilNode();

            	dbg.Location(105,4);
            	// C:\\Documents and Settings\\Administrator\\Desktop\\SPINA\\Interp_CSharp\\Interp_CSharp\\Interp.g:105:4: (el1= variable el2= variable )
            	dbg.EnterAlt(1);

            	// C:\\Documents and Settings\\Administrator\\Desktop\\SPINA\\Interp_CSharp\\Interp_CSharp\\Interp.g:105:5: el1= variable el2= variable
            	{
            		dbg.Location(105,8);
            		PushFollow(FOLLOW_variable_in_structobjdec496);
            		el1 = variable();
            		state.followingStackPointer--;

            		adaptor.AddChild(root_0, el1.Tree);
            		dbg.Location(105,18);
            		 retval.ret.setStructName(((el1 != null) ? el1.ret : null));
            		dbg.Location(106,7);
            		PushFollow(FOLLOW_variable_in_structobjdec505);
            		el2 = variable();
            		state.followingStackPointer--;

            		adaptor.AddChild(root_0, el2.Tree);
            		dbg.Location(106,17);
            		 retval.ret.setObjName(((el2 != null) ? el2.ret : null));

            	}

            	dbg.Location(107,4);
            	END_OF_STATEMENT32=(IToken)Match(input,END_OF_STATEMENT,FOLLOW_END_OF_STATEMENT_in_structobjdec513); 
            		END_OF_STATEMENT32_tree = (object)adaptor.Create(END_OF_STATEMENT32);
            		adaptor.AddChild(root_0, END_OF_STATEMENT32_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 
    	{
        }
        dbg.Location(107, 20);

        }
        finally {
            dbg.ExitRule(GrammarFileName, "structobjdec");
            DecRuleLevel();
            if ( RuleLevel==0 ) {dbg.Terminate();}
        }

        return retval;
    }