Inheritance: Antlr.Runtime.ParserRuleReturnScope
Esempio n. 1
0
    // throws RecognitionException [1]
    // $ANTLR start "variable"
    // C:\\Users\\Jegan\\Documents\\MSCE\\FALL 09\\SoftwareStudio\\SPINACH-Srinivasan\\ConsoleApplication1\\ConsoleApplication1\\spinach.g:53:1: variable returns [VariableElement ret] : VARIABLE ;
    public spinachParser.variable_return variable()
    {
        spinachParser.variable_return retval = new spinachParser.variable_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken VARIABLE23 = null;

        object VARIABLE23_tree=null;

          retval.ret = new VariableElement();

        try
        {
            // C:\\Users\\Jegan\\Documents\\MSCE\\FALL 09\\SoftwareStudio\\SPINACH-Srinivasan\\ConsoleApplication1\\ConsoleApplication1\\spinach.g:57:3: ( VARIABLE )
            // C:\\Users\\Jegan\\Documents\\MSCE\\FALL 09\\SoftwareStudio\\SPINACH-Srinivasan\\ConsoleApplication1\\ConsoleApplication1\\spinach.g:57:5: VARIABLE
            {
                root_0 = (object)adaptor.GetNilNode();

                VARIABLE23=(IToken)Match(input,VARIABLE,FOLLOW_VARIABLE_in_variable278);
                    VARIABLE23_tree = (object)adaptor.Create(VARIABLE23);
                    adaptor.AddChild(root_0, VARIABLE23_tree);

                 retval.ret.setText(((VARIABLE23 != null) ? VARIABLE23.Text : 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;
    }
Esempio n. 2
0
    // $ANTLR start "variable"
    // C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:72:1: variable returns [VariableElement ret] : VARIABLE ;
    public spinachParser.variable_return variable() // throws RecognitionException [1]
    {   
        spinachParser.variable_return retval = new spinachParser.variable_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken VARIABLE19 = null;

        object VARIABLE19_tree=null;


          retval.ret = new VariableElement();

        try 
    	{
            // C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:76:3: ( VARIABLE )
            // C:\\Documents and Settings\\Administrator\\Desktop\\Spinach\\InterpreterFrontEnd\\spinach.g:76:5: VARIABLE
            {
            	root_0 = (object)adaptor.GetNilNode();

            	VARIABLE19=(IToken)Match(input,VARIABLE,FOLLOW_VARIABLE_in_variable374); 
            		VARIABLE19_tree = (object)adaptor.Create(VARIABLE19);
            		adaptor.AddChild(root_0, VARIABLE19_tree);

            	 retval.ret.setText(((VARIABLE19 != null) ? VARIABLE19.Text : 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;
    }
Esempio n. 3
0
    // $ANTLR start "variable"
    // spinach.g:75:1: variable returns [VariableElement ret] : VARIABLE ;
    public spinachParser.variable_return variable() // throws RecognitionException [1]
    {   
        spinachParser.variable_return retval = new spinachParser.variable_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken VARIABLE23 = null;

        object VARIABLE23_tree=null;


          retval.ret = new VariableElement();

        try 
    	{
            // spinach.g:79:3: ( VARIABLE )
            // spinach.g:79:5: VARIABLE
            {
            	root_0 = (object)adaptor.GetNilNode();

            	VARIABLE23=(IToken)Match(input,VARIABLE,FOLLOW_VARIABLE_in_variable387); 
            		VARIABLE23_tree = (object)adaptor.Create(VARIABLE23);
            		adaptor.AddChild(root_0, VARIABLE23_tree);

            	 retval.ret.setText(((VARIABLE23 != null) ? VARIABLE23.Text : 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;
    }