Inheritance: Antlr.Runtime.ParserRuleReturnScope
Beispiel #1
0
    // $ANTLR start "variable"
    // H:\\Interp_CSharp\\Interp_CSharp\\Interp_CSharp\\Interp.g:91:1: variable returns [VariableElement ret] : VARIABLE ;
    public InterpParser.variable_return variable() // throws RecognitionException [1]
    {   
        InterpParser.variable_return retval = new InterpParser.variable_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken VARIABLE11 = null;

        object VARIABLE11_tree=null;


          retval.ret = new VariableElement();

        try {
        	dbg.EnterRule(GrammarFileName, "variable");
        	if ( RuleLevel==0 ) {dbg.Commence();}
        	IncRuleLevel();
        	dbg.Location(91, 1);

        try 
    	{
            // H:\\Interp_CSharp\\Interp_CSharp\\Interp_CSharp\\Interp.g:99:3: ( VARIABLE )
            dbg.EnterAlt(1);

            // H:\\Interp_CSharp\\Interp_CSharp\\Interp_CSharp\\Interp.g:99:5: VARIABLE
            {
            	root_0 = (object)adaptor.GetNilNode();

            	dbg.Location(99,5);
            	VARIABLE11=(IToken)Match(input,VARIABLE,FOLLOW_VARIABLE_in_variable257); 
            		VARIABLE11_tree = (object)adaptor.Create(VARIABLE11);
            		adaptor.AddChild(root_0, VARIABLE11_tree);

            	dbg.Location(99,14);
            	 retval.ret.setText(((VARIABLE11 != null) ? VARIABLE11.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 
    	{
        }
        dbg.Location(99, 53);

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

        return retval;
    }
Beispiel #2
0
    // $ANTLR start "variable"
    // Interp.g:63:1: variable returns [VariableElement ret] : VARIABLE ;
    public InterpParser.variable_return variable() // throws RecognitionException [1]
    {   
        InterpParser.variable_return retval = new InterpParser.variable_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken VARIABLE17 = null;

        object VARIABLE17_tree=null;


          retval.ret = new VariableElement();

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

            	VARIABLE17=(IToken)Match(input,VARIABLE,FOLLOW_VARIABLE_in_variable276); 
            		VARIABLE17_tree = (object)adaptor.Create(VARIABLE17);
            		adaptor.AddChild(root_0, VARIABLE17_tree);

            	retval.ret.setText(((VARIABLE17 != null) ? VARIABLE17.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;
    }
Beispiel #3
0
    // throws RecognitionException [1]
    // $ANTLR start "variable"
    // Interp.g:102:1: variable returns [VariableElement ret] : VARIABLE ;
    public InterpParser.variable_return variable()
    {
        InterpParser.variable_return retval = new InterpParser.variable_return();
        retval.Start = input.LT(1);

        object root_0 = null;

        IToken VARIABLE20 = null;

        object VARIABLE20_tree=null;

          retval.ret = new VariableElement();

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

                VARIABLE20=(IToken)Match(input,VARIABLE,FOLLOW_VARIABLE_in_variable383);
                    VARIABLE20_tree = (object)adaptor.Create(VARIABLE20);
                    adaptor.AddChild(root_0, VARIABLE20_tree);

                 retval.ret.setText(((VARIABLE20 != null) ? VARIABLE20.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 e) {
                throw e;
            }
        finally
        {
        }
        return retval;
    }