示例#1
0
    // $ANTLR start expr
    // CVarTracker/cvartracker.g:40:1: expr : IDENTIFIER SEMI ;
    public expr_return expr() // throws RecognitionException [1]
    {
        expr_return retval = new expr_return();

        retval.start = input.LT(1);

        try
        {
            // CVarTracker/cvartracker.g:41:4: ( IDENTIFIER SEMI )
            // CVarTracker/cvartracker.g:41:4: IDENTIFIER SEMI
            {
                Match(input, IDENTIFIER, FOLLOW_IDENTIFIER_in_expr76);
                Match(input, SEMI, FOLLOW_SEMI_in_expr78);

                names.Add(input.ToString(retval.start, input.LT(-1)));
                System.Console.WriteLine("Hello {0}", input.ToString(retval.start, input.LT(-1)));
            }

            retval.stop = input.LT(-1);
        }
        catch (RecognitionException re)
        {
            ReportError(re);
            Recover(input, re);
        }
        finally
        {
        }
        return(retval);
    }
    // $ANTLR start expr
    // CVarTracker/cvartracker.g:40:1: expr : IDENTIFIER SEMI ;
    public expr_return expr() // throws RecognitionException [1]
    {   
        expr_return retval = new expr_return();
        retval.start = input.LT(1);
    
        try 
    	{
            // CVarTracker/cvartracker.g:41:4: ( IDENTIFIER SEMI )
            // CVarTracker/cvartracker.g:41:4: IDENTIFIER SEMI
            {
            	Match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_expr76); 
            	Match(input,SEMI,FOLLOW_SEMI_in_expr78); 

            			names.Add (input.ToString(retval.start,input.LT(-1)));
            			System.Console.WriteLine ("Hello {0}", input.ToString(retval.start,input.LT(-1)));
            		
            
            }
    
            retval.stop = input.LT(-1);
    
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return retval;
    }