Inheritance: Antlr.Runtime.ParserRuleReturnScope
Exemplo n.º 1
0
    // $ANTLR start "structassign"
    // C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:219:2: structassign returns [StructAssignDeclaration ret] : (el1= variable '.' el2= variable ) ;
    public spinachParser.structassign_return structassign() // throws RecognitionException [1]
    {   
        spinachParser.structassign_return retval = new spinachParser.structassign_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken char_literal89 = null;
        spinachParser.variable_return el1 = null;

        spinachParser.variable_return el2 = null;


        object char_literal89_tree=null;


        retval.ret = new StructAssignDeclaration();

        try 
    	{
            // C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:223:1: ( (el1= variable '.' el2= variable ) )
            // C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:223:2: (el1= variable '.' el2= variable )
            {
            	root_0 = (object)adaptor.GetNilNode();

            	// C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:223:2: (el1= variable '.' el2= variable )
            	// C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:223:3: el1= variable '.' el2= variable
            	{
            		PushFollow(FOLLOW_variable_in_structassign1256);
            		el1 = variable();
            		state.followingStackPointer--;

            		adaptor.AddChild(root_0, el1.Tree);
            		retval.ret.setObjName(((el1 != null) ? el1.ret : null));
            		char_literal89=(IToken)Match(input,DOT,FOLLOW_DOT_in_structassign1259); 
            			char_literal89_tree = (object)adaptor.Create(char_literal89);
            			adaptor.AddChild(root_0, char_literal89_tree);

            		PushFollow(FOLLOW_variable_in_structassign1262);
            		el2 = variable();
            		state.followingStackPointer--;

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

            	}


            }

            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;
    }
Exemplo n.º 2
0
    // throws RecognitionException [1]
    // $ANTLR start "structassign"
    // C:\\Users\\Jegan\\Documents\\MSCE\\FALL 09\\SoftwareStudio\\SPINACH-Srinivasan\\ConsoleApplication1\\ConsoleApplication1\\spinach.g:139:1: structassign returns [StructAssignDeclaration ret] : (el1= variable '.' el2= variable ) ;
    public spinachParser.structassign_return structassign()
    {
        spinachParser.structassign_return retval = new spinachParser.structassign_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken char_literal68 = null;
        spinachParser.variable_return el1 = null;

        spinachParser.variable_return el2 = null;

        object char_literal68_tree=null;

        retval.ret = new StructAssignDeclaration();

        try
        {
            // C:\\Users\\Jegan\\Documents\\MSCE\\FALL 09\\SoftwareStudio\\SPINACH-Srinivasan\\ConsoleApplication1\\ConsoleApplication1\\spinach.g:143:1: ( (el1= variable '.' el2= variable ) )
            // C:\\Users\\Jegan\\Documents\\MSCE\\FALL 09\\SoftwareStudio\\SPINACH-Srinivasan\\ConsoleApplication1\\ConsoleApplication1\\spinach.g:143:2: (el1= variable '.' el2= variable )
            {
                root_0 = (object)adaptor.GetNilNode();

                // C:\\Users\\Jegan\\Documents\\MSCE\\FALL 09\\SoftwareStudio\\SPINACH-Srinivasan\\ConsoleApplication1\\ConsoleApplication1\\spinach.g:143:2: (el1= variable '.' el2= variable )
                // C:\\Users\\Jegan\\Documents\\MSCE\\FALL 09\\SoftwareStudio\\SPINACH-Srinivasan\\ConsoleApplication1\\ConsoleApplication1\\spinach.g:143:3: el1= variable '.' el2= variable
                {
                    PushFollow(FOLLOW_variable_in_structassign769);
                    el1 = variable();
                    state.followingStackPointer--;

                    adaptor.AddChild(root_0, el1.Tree);
                    retval.ret.setName(((el1 != null) ? el1.ret : null));
                    char_literal68=(IToken)Match(input,DOT,FOLLOW_DOT_in_structassign772);
                        char_literal68_tree = (object)adaptor.Create(char_literal68);
                        adaptor.AddChild(root_0, char_literal68_tree);

                    PushFollow(FOLLOW_variable_in_structassign775);
                    el2 = variable();
                    state.followingStackPointer--;

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

                }

            }

            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;
    }