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


    // $ANTLR start "expression"
    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:249:1: expression returns [SGLNode node] : ( ^( '+' a= expression b= expression ) | ^( '-' a= expression b= expression ) | ^( '*' a= expression b= expression ) | ^( '/' a= expression b= expression ) | ^( '%' a= expression b= expression ) | ^( NEGATE a= expression ) | ^( '<' a= expression b= expression ) | ^( '<=' a= expression b= expression ) | ^( '>' a= expression b= expression ) | ^( '>=' a= expression b= expression ) | ^( '!=' a= expression b= expression ) | ^( '==' a= expression b= expression ) | ^( '&&' a= expression b= expression ) | ^( '||' a= expression b= expression ) | ^( '?' a= expression b= expression c= expression ) | IntegerAtom | FloatAtom | BooleanAtom | ^( STRING StringAtom ) | ^( STRINGNOQUOTES Layer ) | ^( STRINGNOQUOTES Origin ) | sbObject | lookup | variableUnaryChangeExpression | methodCall );
    public SGLNode expression() // throws RecognitionException [1]
    {   
        SGLNode node = default(SGLNode);

        CommonTree IntegerAtom44 = null;
        CommonTree FloatAtom45 = null;
        CommonTree BooleanAtom46 = null;
        CommonTree StringAtom47 = null;
        CommonTree Layer48 = null;
        CommonTree Origin49 = null;
        SGLNode a = default(SGLNode);

        SGLNode b = default(SGLNode);

        SGLNode c = default(SGLNode);

        SGLNode sbObject50 = default(SGLNode);

        SGLNode lookup51 = default(SGLNode);

        SGLNode variableUnaryChangeExpression52 = default(SGLNode);

        SGLNode methodCall53 = default(SGLNode);


        try 
    	{
            // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:250:2: ( ^( '+' a= expression b= expression ) | ^( '-' a= expression b= expression ) | ^( '*' a= expression b= expression ) | ^( '/' a= expression b= expression ) | ^( '%' a= expression b= expression ) | ^( NEGATE a= expression ) | ^( '<' a= expression b= expression ) | ^( '<=' a= expression b= expression ) | ^( '>' a= expression b= expression ) | ^( '>=' a= expression b= expression ) | ^( '!=' a= expression b= expression ) | ^( '==' a= expression b= expression ) | ^( '&&' a= expression b= expression ) | ^( '||' a= expression b= expression ) | ^( '?' a= expression b= expression c= expression ) | IntegerAtom | FloatAtom | BooleanAtom | ^( STRING StringAtom ) | ^( STRINGNOQUOTES Layer ) | ^( STRINGNOQUOTES Origin ) | sbObject | lookup | variableUnaryChangeExpression | methodCall )
            int alt10 = 25;
            alt10 = dfa10.Predict(input);
            switch (alt10) 
            {
                case 1 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:250:4: ^( '+' a= expression b= expression )
                    {
                    	Match(input,77,FOLLOW_77_in_expression793); 

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

                    	PushFollow(FOLLOW_expression_in_expression801);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new AddNode(a, b); 

                    }
                    break;
                case 2 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:251:4: ^( '-' a= expression b= expression )
                    {
                    	Match(input,78,FOLLOW_78_in_expression810); 

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

                    	PushFollow(FOLLOW_expression_in_expression818);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new SubNode(a, b); 

                    }
                    break;
                case 3 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:252:4: ^( '*' a= expression b= expression )
                    {
                    	Match(input,79,FOLLOW_79_in_expression827); 

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

                    	PushFollow(FOLLOW_expression_in_expression835);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new MultNode(a, b); 

                    }
                    break;
                case 4 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:253:4: ^( '/' a= expression b= expression )
                    {
                    	Match(input,80,FOLLOW_80_in_expression844); 

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

                    	PushFollow(FOLLOW_expression_in_expression852);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new DivNode(a, b); 

                    }
                    break;
                case 5 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:254:4: ^( '%' a= expression b= expression )
                    {
                    	Match(input,81,FOLLOW_81_in_expression861); 

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

                    	PushFollow(FOLLOW_expression_in_expression869);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new ModNode(a, b); 

                    }
                    break;
                case 6 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:255:4: ^( NEGATE a= expression )
                    {
                    	Match(input,NEGATE,FOLLOW_NEGATE_in_expression878); 

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


                    	Match(input, Token.UP, null); 
                    	 node = new NegateNode(a); 

                    }
                    break;
                case 7 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:256:4: ^( '<' a= expression b= expression )
                    {
                    	Match(input,73,FOLLOW_73_in_expression891); 

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

                    	PushFollow(FOLLOW_expression_in_expression899);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new LTNode(a, b); 

                    }
                    break;
                case 8 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:257:4: ^( '<=' a= expression b= expression )
                    {
                    	Match(input,75,FOLLOW_75_in_expression908); 

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

                    	PushFollow(FOLLOW_expression_in_expression916);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new LTEqualsNode(a, b); 

                    }
                    break;
                case 9 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:258:4: ^( '>' a= expression b= expression )
                    {
                    	Match(input,74,FOLLOW_74_in_expression925); 

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

                    	PushFollow(FOLLOW_expression_in_expression933);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new GTNode(a, b); 

                    }
                    break;
                case 10 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:259:4: ^( '>=' a= expression b= expression )
                    {
                    	Match(input,76,FOLLOW_76_in_expression942); 

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

                    	PushFollow(FOLLOW_expression_in_expression950);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new GTEqualsNode(a, b); 

                    }
                    break;
                case 11 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:260:4: ^( '!=' a= expression b= expression )
                    {
                    	Match(input,72,FOLLOW_72_in_expression959); 

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

                    	PushFollow(FOLLOW_expression_in_expression967);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new NotEqualsNode(a, b); 

                    }
                    break;
                case 12 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:261:4: ^( '==' a= expression b= expression )
                    {
                    	Match(input,71,FOLLOW_71_in_expression976); 

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

                    	PushFollow(FOLLOW_expression_in_expression984);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new EqualsNode(a, b); 

                    }
                    break;
                case 13 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:262:4: ^( '&&' a= expression b= expression )
                    {
                    	Match(input,70,FOLLOW_70_in_expression993); 

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

                    	PushFollow(FOLLOW_expression_in_expression1001);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new AndNode(a, b); 

                    }
                    break;
                case 14 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:263:4: ^( '||' a= expression b= expression )
                    {
                    	Match(input,69,FOLLOW_69_in_expression1010); 

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

                    	PushFollow(FOLLOW_expression_in_expression1018);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new OrNode(a, b); 

                    }
                    break;
                case 15 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:264:4: ^( '?' a= expression b= expression c= expression )
                    {
                    	Match(input,67,FOLLOW_67_in_expression1027); 

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

                    	PushFollow(FOLLOW_expression_in_expression1035);
                    	b = expression();
                    	state.followingStackPointer--;

                    	PushFollow(FOLLOW_expression_in_expression1039);
                    	c = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new TernaryNode(a, b, c); 

                    }
                    break;
                case 16 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:265:6: IntegerAtom
                    {
                    	IntegerAtom44=(CommonTree)Match(input,IntegerAtom,FOLLOW_IntegerAtom_in_expression1049); 
                    	 node = new AtomNode(int.Parse(((IntegerAtom44 != null) ? IntegerAtom44.Text : null), System.Globalization.CultureInfo.InvariantCulture), IntegerAtom44.Line); 

                    }
                    break;
                case 17 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:266:4: FloatAtom
                    {
                    	FloatAtom45=(CommonTree)Match(input,FloatAtom,FOLLOW_FloatAtom_in_expression1056); 
                    	 node = new AtomNode(Double.Parse(((FloatAtom45 != null) ? FloatAtom45.Text : null), System.Globalization.CultureInfo.InvariantCulture), FloatAtom45.Line); 

                    }
                    break;
                case 18 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:267:6: BooleanAtom
                    {
                    	BooleanAtom46=(CommonTree)Match(input,BooleanAtom,FOLLOW_BooleanAtom_in_expression1065); 
                    	 node = new AtomNode(Boolean.Parse(((BooleanAtom46 != null) ? BooleanAtom46.Text : null)), BooleanAtom46.Line); 

                    }
                    break;
                case 19 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:268:4: ^( STRING StringAtom )
                    {
                    	Match(input,STRING,FOLLOW_STRING_in_expression1073); 

                    	Match(input, Token.DOWN, null); 
                    	StringAtom47=(CommonTree)Match(input,StringAtom,FOLLOW_StringAtom_in_expression1075); 

                    	Match(input, Token.UP, null); 
                    	 node = new AtomNode((((StringAtom47 != null) ? StringAtom47.Text : null)).Substring(1, (((StringAtom47 != null) ? StringAtom47.Text : null)).Length-2), StringAtom47.Line); 

                    }
                    break;
                case 20 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:269:4: ^( STRINGNOQUOTES Layer )
                    {
                    	Match(input,STRINGNOQUOTES,FOLLOW_STRINGNOQUOTES_in_expression1084); 

                    	Match(input, Token.DOWN, null); 
                    	Layer48=(CommonTree)Match(input,Layer,FOLLOW_Layer_in_expression1086); 

                    	Match(input, Token.UP, null); 
                    	 node = new AtomNode(((Layer48 != null) ? Layer48.Text : null), Layer48.Line); 

                    }
                    break;
                case 21 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:270:4: ^( STRINGNOQUOTES Origin )
                    {
                    	Match(input,STRINGNOQUOTES,FOLLOW_STRINGNOQUOTES_in_expression1095); 

                    	Match(input, Token.DOWN, null); 
                    	Origin49=(CommonTree)Match(input,Origin,FOLLOW_Origin_in_expression1097); 

                    	Match(input, Token.UP, null); 
                    	 node = new AtomNode(((Origin49 != null) ? Origin49.Text : null), Origin49.Line); 

                    }
                    break;
                case 22 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:271:4: sbObject
                    {
                    	PushFollow(FOLLOW_sbObject_in_expression1105);
                    	sbObject50 = sbObject();
                    	state.followingStackPointer--;

                    	 node = sbObject50; 

                    }
                    break;
                case 23 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:272:4: lookup
                    {
                    	PushFollow(FOLLOW_lookup_in_expression1112);
                    	lookup51 = lookup();
                    	state.followingStackPointer--;

                    	 node = lookup51; 

                    }
                    break;
                case 24 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:273:4: variableUnaryChangeExpression
                    {
                    	PushFollow(FOLLOW_variableUnaryChangeExpression_in_expression1119);
                    	variableUnaryChangeExpression52 = variableUnaryChangeExpression();
                    	state.followingStackPointer--;

                    	 node = variableUnaryChangeExpression52; 

                    }
                    break;
                case 25 :
                    // C:\\Users\\Dominik Halfkann\\Documents\\Visual Studio 2010\\Projects\\SGLParserTester\\SGL\\AntlrParser\\SGLTreeWalker.g:274:4: methodCall
                    {
                    	PushFollow(FOLLOW_methodCall_in_expression1126);
                    	methodCall53 = methodCall();
                    	state.followingStackPointer--;

                    	node = methodCall53;

                    }
                    break;

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


    // $ANTLR start "expression"
    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:255:1: expression returns [SGLNode node] : ( ^( '+' a= expression b= expression ) | ^( '-' a= expression b= expression ) | ^( '*' a= expression b= expression ) | ^( '/' a= expression b= expression ) | ^( '%' a= expression b= expression ) | ^( '^' a= expression b= expression ) | ^( INT_NEGATE a= expression ) | ^( BOOL_NEGATE a= expression ) | ^( '<' a= expression b= expression ) | ^( '<=' a= expression b= expression ) | ^( '>' a= expression b= expression ) | ^( '>=' a= expression b= expression ) | ^( '!=' a= expression b= expression ) | ^( '==' a= expression b= expression ) | ^( '&&' a= expression b= expression ) | ^( '||' a= expression b= expression ) | ^( '?' a= expression b= expression c= expression ) | IntAtom | FloatAtom | BooleanAtom | ^( STRING StringAtom ) | LayerAtom | OriginAtom | LoopTypeAtom | Null | instantiateClass | lookup | unaryExpression );
    public SGLNode expression() // throws RecognitionException [1]
    {   
        SGLNode node = default(SGLNode);

        CommonTree IntAtom35 = null;
        CommonTree FloatAtom36 = null;
        CommonTree BooleanAtom37 = null;
        CommonTree StringAtom38 = null;
        CommonTree LayerAtom39 = null;
        CommonTree OriginAtom40 = null;
        CommonTree LoopTypeAtom41 = null;
        CommonTree Null42 = null;
        SGLNode a = default(SGLNode);

        SGLNode b = default(SGLNode);

        SGLNode c = default(SGLNode);

        SGLNode instantiateClass43 = default(SGLNode);

        SGLNode lookup44 = default(SGLNode);

        SGLNode unaryExpression45 = default(SGLNode);


        try 
    	{
            // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:256:2: ( ^( '+' a= expression b= expression ) | ^( '-' a= expression b= expression ) | ^( '*' a= expression b= expression ) | ^( '/' a= expression b= expression ) | ^( '%' a= expression b= expression ) | ^( '^' a= expression b= expression ) | ^( INT_NEGATE a= expression ) | ^( BOOL_NEGATE a= expression ) | ^( '<' a= expression b= expression ) | ^( '<=' a= expression b= expression ) | ^( '>' a= expression b= expression ) | ^( '>=' a= expression b= expression ) | ^( '!=' a= expression b= expression ) | ^( '==' a= expression b= expression ) | ^( '&&' a= expression b= expression ) | ^( '||' a= expression b= expression ) | ^( '?' a= expression b= expression c= expression ) | IntAtom | FloatAtom | BooleanAtom | ^( STRING StringAtom ) | LayerAtom | OriginAtom | LoopTypeAtom | Null | instantiateClass | lookup | unaryExpression )
            int alt19 = 28;
            switch ( input.LA(1) ) 
            {
            case 73:
            	{
                alt19 = 1;
                }
                break;
            case 74:
            	{
                alt19 = 2;
                }
                break;
            case 75:
            	{
                alt19 = 3;
                }
                break;
            case 76:
            	{
                alt19 = 4;
                }
                break;
            case 77:
            	{
                alt19 = 5;
                }
                break;
            case 78:
            	{
                alt19 = 6;
                }
                break;
            case INT_NEGATE:
            	{
                alt19 = 7;
                }
                break;
            case BOOL_NEGATE:
            	{
                alt19 = 8;
                }
                break;
            case 69:
            	{
                alt19 = 9;
                }
                break;
            case 71:
            	{
                alt19 = 10;
                }
                break;
            case 70:
            	{
                alt19 = 11;
                }
                break;
            case 72:
            	{
                alt19 = 12;
                }
                break;
            case 68:
            	{
                alt19 = 13;
                }
                break;
            case 67:
            	{
                alt19 = 14;
                }
                break;
            case 66:
            	{
                alt19 = 15;
                }
                break;
            case 65:
            	{
                alt19 = 16;
                }
                break;
            case 63:
            	{
                alt19 = 17;
                }
                break;
            case IntAtom:
            	{
                alt19 = 18;
                }
                break;
            case FloatAtom:
            	{
                alt19 = 19;
                }
                break;
            case BooleanAtom:
            	{
                alt19 = 20;
                }
                break;
            case STRING:
            	{
                alt19 = 21;
                }
                break;
            case LayerAtom:
            	{
                alt19 = 22;
                }
                break;
            case OriginAtom:
            	{
                alt19 = 23;
                }
                break;
            case LoopTypeAtom:
            	{
                alt19 = 24;
                }
                break;
            case Null:
            	{
                alt19 = 25;
                }
                break;
            case Sprite:
            case Animation:
            case List:
            	{
                alt19 = 26;
                }
                break;
            case LOOKUP:
            	{
                alt19 = 27;
                }
                break;
            case VARINC:
            case VARDEC:
            	{
                alt19 = 28;
                }
                break;
            	default:
            	    NoViableAltException nvae_d19s0 =
            	        new NoViableAltException("", 19, 0, input);

            	    throw nvae_d19s0;
            }

            switch (alt19) 
            {
                case 1 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:256:4: ^( '+' a= expression b= expression )
                    {
                    	Match(input,73,FOLLOW_73_in_expression766); 

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

                    	PushFollow(FOLLOW_expression_in_expression774);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new AddNode(a, b); 

                    }
                    break;
                case 2 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:257:4: ^( '-' a= expression b= expression )
                    {
                    	Match(input,74,FOLLOW_74_in_expression783); 

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

                    	PushFollow(FOLLOW_expression_in_expression791);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new SubNode(a, b); 

                    }
                    break;
                case 3 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:258:4: ^( '*' a= expression b= expression )
                    {
                    	Match(input,75,FOLLOW_75_in_expression800); 

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

                    	PushFollow(FOLLOW_expression_in_expression808);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new MultNode(a, b); 

                    }
                    break;
                case 4 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:259:4: ^( '/' a= expression b= expression )
                    {
                    	Match(input,76,FOLLOW_76_in_expression817); 

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

                    	PushFollow(FOLLOW_expression_in_expression825);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new DivNode(a, b); 

                    }
                    break;
                case 5 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:260:4: ^( '%' a= expression b= expression )
                    {
                    	Match(input,77,FOLLOW_77_in_expression834); 

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

                    	PushFollow(FOLLOW_expression_in_expression842);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new ModNode(a, b); 

                    }
                    break;
                case 6 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:261:4: ^( '^' a= expression b= expression )
                    {
                    	Match(input,78,FOLLOW_78_in_expression851); 

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

                    	PushFollow(FOLLOW_expression_in_expression859);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new PowNode(a, b); 

                    }
                    break;
                case 7 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:262:4: ^( INT_NEGATE a= expression )
                    {
                    	Match(input,INT_NEGATE,FOLLOW_INT_NEGATE_in_expression868); 

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


                    	Match(input, Token.UP, null); 
                    	 node = new NegateIntNode(a); 

                    }
                    break;
                case 8 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:263:4: ^( BOOL_NEGATE a= expression )
                    {
                    	Match(input,BOOL_NEGATE,FOLLOW_BOOL_NEGATE_in_expression881); 

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


                    	Match(input, Token.UP, null); 
                    	 node = new NegateBoolNode(a); 

                    }
                    break;
                case 9 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:264:4: ^( '<' a= expression b= expression )
                    {
                    	Match(input,69,FOLLOW_69_in_expression894); 

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

                    	PushFollow(FOLLOW_expression_in_expression902);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new LTNode(a, b); 

                    }
                    break;
                case 10 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:265:4: ^( '<=' a= expression b= expression )
                    {
                    	Match(input,71,FOLLOW_71_in_expression911); 

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

                    	PushFollow(FOLLOW_expression_in_expression919);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new LTEqualsNode(a, b); 

                    }
                    break;
                case 11 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:266:4: ^( '>' a= expression b= expression )
                    {
                    	Match(input,70,FOLLOW_70_in_expression928); 

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

                    	PushFollow(FOLLOW_expression_in_expression936);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new GTNode(a, b); 

                    }
                    break;
                case 12 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:267:4: ^( '>=' a= expression b= expression )
                    {
                    	Match(input,72,FOLLOW_72_in_expression945); 

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

                    	PushFollow(FOLLOW_expression_in_expression953);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new GTEqualsNode(a, b); 

                    }
                    break;
                case 13 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:268:4: ^( '!=' a= expression b= expression )
                    {
                    	Match(input,68,FOLLOW_68_in_expression962); 

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

                    	PushFollow(FOLLOW_expression_in_expression970);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new NotEqualsNode(a, b); 

                    }
                    break;
                case 14 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:269:4: ^( '==' a= expression b= expression )
                    {
                    	Match(input,67,FOLLOW_67_in_expression979); 

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

                    	PushFollow(FOLLOW_expression_in_expression987);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new EqualsNode(a, b); 

                    }
                    break;
                case 15 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:270:4: ^( '&&' a= expression b= expression )
                    {
                    	Match(input,66,FOLLOW_66_in_expression996); 

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

                    	PushFollow(FOLLOW_expression_in_expression1004);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new AndNode(a, b); 

                    }
                    break;
                case 16 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:271:4: ^( '||' a= expression b= expression )
                    {
                    	Match(input,65,FOLLOW_65_in_expression1013); 

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

                    	PushFollow(FOLLOW_expression_in_expression1021);
                    	b = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new OrNode(a, b); 

                    }
                    break;
                case 17 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:272:4: ^( '?' a= expression b= expression c= expression )
                    {
                    	Match(input,63,FOLLOW_63_in_expression1030); 

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

                    	PushFollow(FOLLOW_expression_in_expression1038);
                    	b = expression();
                    	state.followingStackPointer--;

                    	PushFollow(FOLLOW_expression_in_expression1042);
                    	c = expression();
                    	state.followingStackPointer--;


                    	Match(input, Token.UP, null); 
                    	 node = new TernaryNode(a, b, c); 

                    }
                    break;
                case 18 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:273:6: IntAtom
                    {
                    	IntAtom35=(CommonTree)Match(input,IntAtom,FOLLOW_IntAtom_in_expression1052); 
                    	 node = new AtomNode(int.Parse(((IntAtom35 != null) ? IntAtom35.Text : null), System.Globalization.CultureInfo.InvariantCulture), ValueType.Integer, IntAtom35.Line); 

                    }
                    break;
                case 19 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:274:4: FloatAtom
                    {
                    	FloatAtom36=(CommonTree)Match(input,FloatAtom,FOLLOW_FloatAtom_in_expression1059); 
                    	 node = new AtomNode(Double.Parse(((FloatAtom36 != null) ? FloatAtom36.Text : null), System.Globalization.CultureInfo.InvariantCulture), ValueType.Double,  FloatAtom36.Line); 

                    }
                    break;
                case 20 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:275:6: BooleanAtom
                    {
                    	BooleanAtom37=(CommonTree)Match(input,BooleanAtom,FOLLOW_BooleanAtom_in_expression1068); 
                    	 node = new AtomNode(Boolean.Parse(((BooleanAtom37 != null) ? BooleanAtom37.Text : null)), ValueType.Boolean, BooleanAtom37.Line); 

                    }
                    break;
                case 21 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:276:4: ^( STRING StringAtom )
                    {
                    	Match(input,STRING,FOLLOW_STRING_in_expression1076); 

                    	Match(input, Token.DOWN, null); 
                    	StringAtom38=(CommonTree)Match(input,StringAtom,FOLLOW_StringAtom_in_expression1078); 

                    	Match(input, Token.UP, null); 
                    	 node = new AtomNode((((StringAtom38 != null) ? StringAtom38.Text : null)).Substring(1, (((StringAtom38 != null) ? StringAtom38.Text : null)).Length-2), ValueType.String, StringAtom38.Line); 

                    }
                    break;
                case 22 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:277:4: LayerAtom
                    {
                    	LayerAtom39=(CommonTree)Match(input,LayerAtom,FOLLOW_LayerAtom_in_expression1086); 
                    	 node = new AtomNode(((LayerAtom39 != null) ? LayerAtom39.Text : null), ValueType.Layer, LayerAtom39.Line); 

                    }
                    break;
                case 23 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:278:4: OriginAtom
                    {
                    	OriginAtom40=(CommonTree)Match(input,OriginAtom,FOLLOW_OriginAtom_in_expression1093); 
                    	 node = new AtomNode(((OriginAtom40 != null) ? OriginAtom40.Text : null), ValueType.Origin, OriginAtom40.Line); 

                    }
                    break;
                case 24 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:279:4: LoopTypeAtom
                    {
                    	LoopTypeAtom41=(CommonTree)Match(input,LoopTypeAtom,FOLLOW_LoopTypeAtom_in_expression1100); 
                    	 node = new AtomNode(((LoopTypeAtom41 != null) ? LoopTypeAtom41.Text : null), ValueType.LoopType, LoopTypeAtom41.Line); 

                    }
                    break;
                case 25 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:281:4: Null
                    {
                    	Null42=(CommonTree)Match(input,Null,FOLLOW_Null_in_expression1109); 
                    	 node = new AtomNode(((Null42 != null) ? Null42.Text : null), Null42.Line); 

                    }
                    break;
                case 26 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:282:4: instantiateClass
                    {
                    	PushFollow(FOLLOW_instantiateClass_in_expression1116);
                    	instantiateClass43 = instantiateClass();
                    	state.followingStackPointer--;

                    	 node = instantiateClass43; 

                    }
                    break;
                case 27 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:283:4: lookup
                    {
                    	PushFollow(FOLLOW_lookup_in_expression1123);
                    	lookup44 = lookup();
                    	state.followingStackPointer--;

                    	 node = lookup44; 

                    }
                    break;
                case 28 :
                    // D:\\sgl4c#\\NewSGLGramma\\SGLTreeWalker.g:284:4: unaryExpression
                    {
                    	PushFollow(FOLLOW_unaryExpression_in_expression1130);
                    	unaryExpression45 = unaryExpression();
                    	state.followingStackPointer--;

                    	 node = unaryExpression45; 

                    }
                    break;

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