Example #1
0
    // $ANTLR end "atStatement"


    // $ANTLR start "returnStat"
    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:146:1: returnStat returns [SGLNode node] : ^( RETURN expression ) ;
    public SGLNode returnStat() // throws RecognitionException [1]
    {   
        SGLNode node = default(SGLNode);

        SGLNode expression16 = default(SGLNode);


        try 
    	{
            // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:147:2: ( ^( RETURN expression ) )
            // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:147:4: ^( RETURN expression )
            {
            	Match(input,RETURN,FOLLOW_RETURN_in_returnStat276); 

            	Match(input, Token.DOWN, null); 
            	PushFollow(FOLLOW_expression_in_returnStat278);
            	expression16 = expression();
            	state.followingStackPointer--;


            	Match(input, Token.UP, null); 
            	 node = new ReturnNode(expression16); 

            }

        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return node;
    }
Example #2
0
    // $ANTLR end "atStatement"


    // $ANTLR start "returnStat"
    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:172:1: returnStat returns [SGLNode node] : ^( RETURN ( expression )? ) ;
    public SGLNode returnStat() // throws RecognitionException [1]
    {   
        SGLNode node = default(SGLNode);

        SGLNode expression15 = default(SGLNode);


        try 
    	{
            // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:173:2: ( ^( RETURN ( expression )? ) )
            // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:173:4: ^( RETURN ( expression )? )
            {
            	Match(input,RETURN,FOLLOW_RETURN_in_returnStat279); 

            	if ( input.LA(1) == Token.DOWN )
            	{
            	    Match(input, Token.DOWN, null); 
            	    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:173:13: ( expression )?
            	    int alt3 = 2;
            	    int LA3_0 = input.LA(1);

            	    if ( ((LA3_0 >= STRING && LA3_0 <= VARDEC) || LA3_0 == LOOKUP || (LA3_0 >= IntAtom && LA3_0 <= LoopTypeAtom) || (LA3_0 >= Null && LA3_0 <= List) || LA3_0 == 63 || (LA3_0 >= 65 && LA3_0 <= 78)) )
            	    {
            	        alt3 = 1;
            	    }
            	    switch (alt3) 
            	    {
            	        case 1 :
            	            // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:173:13: expression
            	            {
            	            	PushFollow(FOLLOW_expression_in_returnStat281);
            	            	expression15 = expression();
            	            	state.followingStackPointer--;


            	            }
            	            break;

            	    }


            	    Match(input, Token.UP, null); 
            	}
            	 node = new ReturnNode(expression15); 

            }

        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return node;
    }