Esempio n. 1
0
    // $ANTLR end "lookup"


    // $ANTLR start "sbObject"
    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:294:1: sbObject returns [SGLNode node] : ( ^( Sprite arguments ) | ^( Animation arguments ) );
    public SGLNode sbObject() // throws RecognitionException [1]
    {   
        SGLNode node = default(SGLNode);

        List<SGLNode> arguments59 = default(List<SGLNode>);

        List<SGLNode> arguments60 = default(List<SGLNode>);


        try 
    	{
            // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:295:2: ( ^( Sprite arguments ) | ^( Animation arguments ) )
            int alt13 = 2;
            int LA13_0 = input.LA(1);

            if ( (LA13_0 == Sprite) )
            {
                alt13 = 1;
            }
            else if ( (LA13_0 == Animation) )
            {
                alt13 = 2;
            }
            else 
            {
                NoViableAltException nvae_d13s0 =
                    new NoViableAltException("", 13, 0, input);

                throw nvae_d13s0;
            }
            switch (alt13) 
            {
                case 1 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:295:4: ^( Sprite arguments )
                    {
                    	Match(input,Sprite,FOLLOW_Sprite_in_sbObject1272); 

                    	if ( input.LA(1) == Token.DOWN )
                    	{
                    	    Match(input, Token.DOWN, null); 
                    	    PushFollow(FOLLOW_arguments_in_sbObject1274);
                    	    arguments59 = arguments();
                    	    state.followingStackPointer--;


                    	    Match(input, Token.UP, null); 
                    	}
                    	  node = new SpriteNode(arguments59); 

                    }
                    break;
                case 2 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:296:4: ^( Animation arguments )
                    {
                    	Match(input,Animation,FOLLOW_Animation_in_sbObject1283); 

                    	if ( input.LA(1) == Token.DOWN )
                    	{
                    	    Match(input, Token.DOWN, null); 
                    	    PushFollow(FOLLOW_arguments_in_sbObject1285);
                    	    arguments60 = arguments();
                    	    state.followingStackPointer--;


                    	    Match(input, Token.UP, null); 
                    	}
                    	  node = new AnimationNode(arguments60); 

                    }
                    break;

            }
        }
        catch (RecognitionException re) 
    	{
            ReportError(re);
            Recover(input,re);
        }
        finally 
    	{
        }
        return node;
    }
Esempio n. 2
0
    // $ANTLR end "unaryExpression"


    // $ANTLR start "instantiateClass"
    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:294:1: instantiateClass returns [SGLNode node] : ( ^( Sprite ( expressionList )? ) | ^( Animation ( expressionList )? ) | ^( List ( expressionList )? ) );
    public SGLNode instantiateClass() // throws RecognitionException [1]
    {   
        SGLNode node = default(SGLNode);

        List<SGLNode> expressionList48 = default(List<SGLNode>);

        List<SGLNode> expressionList49 = default(List<SGLNode>);

        List<SGLNode> expressionList50 = default(List<SGLNode>);


        try 
    	{
            // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:295:2: ( ^( Sprite ( expressionList )? ) | ^( Animation ( expressionList )? ) | ^( List ( expressionList )? ) )
            int alt24 = 3;
            switch ( input.LA(1) ) 
            {
            case Sprite:
            	{
                alt24 = 1;
                }
                break;
            case Animation:
            	{
                alt24 = 2;
                }
                break;
            case List:
            	{
                alt24 = 3;
                }
                break;
            	default:
            	    NoViableAltException nvae_d24s0 =
            	        new NoViableAltException("", 24, 0, input);

            	    throw nvae_d24s0;
            }

            switch (alt24) 
            {
                case 1 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:295:4: ^( Sprite ( expressionList )? )
                    {
                    	Match(input,Sprite,FOLLOW_Sprite_in_instantiateClass1203); 

                    	if ( input.LA(1) == Token.DOWN )
                    	{
                    	    Match(input, Token.DOWN, null); 
                    	    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:295:13: ( expressionList )?
                    	    int alt21 = 2;
                    	    int LA21_0 = input.LA(1);

                    	    if ( (LA21_0 == EXP_LIST) )
                    	    {
                    	        alt21 = 1;
                    	    }
                    	    switch (alt21) 
                    	    {
                    	        case 1 :
                    	            // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:295:13: expressionList
                    	            {
                    	            	PushFollow(FOLLOW_expressionList_in_instantiateClass1205);
                    	            	expressionList48 = expressionList();
                    	            	state.followingStackPointer--;


                    	            }
                    	            break;

                    	    }


                    	    Match(input, Token.UP, null); 
                    	}
                    	  node = new SpriteNode(expressionList48); 

                    }
                    break;
                case 2 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:296:4: ^( Animation ( expressionList )? )
                    {
                    	Match(input,Animation,FOLLOW_Animation_in_instantiateClass1215); 

                    	if ( input.LA(1) == Token.DOWN )
                    	{
                    	    Match(input, Token.DOWN, null); 
                    	    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:296:16: ( expressionList )?
                    	    int alt22 = 2;
                    	    int LA22_0 = input.LA(1);

                    	    if ( (LA22_0 == EXP_LIST) )
                    	    {
                    	        alt22 = 1;
                    	    }
                    	    switch (alt22) 
                    	    {
                    	        case 1 :
                    	            // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:296:16: expressionList
                    	            {
                    	            	PushFollow(FOLLOW_expressionList_in_instantiateClass1217);
                    	            	expressionList49 = expressionList();
                    	            	state.followingStackPointer--;


                    	            }
                    	            break;

                    	    }


                    	    Match(input, Token.UP, null); 
                    	}
                    	  node = new AnimationNode(expressionList49); 

                    }
                    break;
                case 3 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:297:4: ^( List ( expressionList )? )
                    {
                    	Match(input,List,FOLLOW_List_in_instantiateClass1227); 

                    	if ( input.LA(1) == Token.DOWN )
                    	{
                    	    Match(input, Token.DOWN, null); 
                    	    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:297:11: ( expressionList )?
                    	    int alt23 = 2;
                    	    int LA23_0 = input.LA(1);

                    	    if ( (LA23_0 == EXP_LIST) )
                    	    {
                    	        alt23 = 1;
                    	    }
                    	    switch (alt23) 
                    	    {
                    	        case 1 :
                    	            // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:297:11: expressionList
                    	            {
                    	            	PushFollow(FOLLOW_expressionList_in_instantiateClass1229);
                    	            	expressionList50 = expressionList();
                    	            	state.followingStackPointer--;


                    	            }
                    	            break;

                    	    }


                    	    Match(input, Token.UP, null); 
                    	}
                    	  node = new ListNode(expressionList50); 

                    }
                    break;

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