Example #1
0
    // $ANTLR start "bitwiseANDExpressionNoIn"
    // AS3_ex.g3:2296:1: bitwiseANDExpressionNoIn : equalityExpressionNoIn (A= AND equalityExpressionNoIn )* ;
    public AS3_exParser.bitwiseANDExpressionNoIn_return bitwiseANDExpressionNoIn() // throws RecognitionException [1]
    {   
        AS3_exParser.bitwiseANDExpressionNoIn_return retval = new AS3_exParser.bitwiseANDExpressionNoIn_return();
        retval.Start = input.LT(1);
        int bitwiseANDExpressionNoIn_StartIndex = input.Index();
        object root_0 = null;

        IToken A = null;
        AS3_exParser.equalityExpressionNoIn_return equalityExpressionNoIn279 = null;

        AS3_exParser.equalityExpressionNoIn_return equalityExpressionNoIn280 = null;


        object A_tree=null;

        try 
    	{
    	    if ( (state.backtracking > 0) && AlreadyParsedRule(input, 117) ) 
    	    {
    	    	return retval; 
    	    }
            // AS3_ex.g3:2297:5: ( equalityExpressionNoIn (A= AND equalityExpressionNoIn )* )
            // AS3_ex.g3:2297:9: equalityExpressionNoIn (A= AND equalityExpressionNoIn )*
            {
            	root_0 = (object)adaptor.GetNilNode();

            	PushFollow(FOLLOW_equalityExpressionNoIn_in_bitwiseANDExpressionNoIn11002);
            	equalityExpressionNoIn279 = equalityExpressionNoIn();
            	state.followingStackPointer--;
            	if (state.failed) return retval;
            	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, equalityExpressionNoIn279.Tree);
            	// AS3_ex.g3:2297:32: (A= AND equalityExpressionNoIn )*
            	do 
            	{
            	    int alt128 = 2;
            	    int LA128_0 = input.LA(1);

            	    if ( (LA128_0 == AND) )
            	    {
            	        alt128 = 1;
            	    }


            	    switch (alt128) 
            		{
            			case 1 :
            			    // AS3_ex.g3:2297:34: A= AND equalityExpressionNoIn
            			    {
            			    	A=(IToken)Match(input,AND,FOLLOW_AND_in_bitwiseANDExpressionNoIn11008); if (state.failed) return retval;
            			    	if ( state.backtracking == 0 )
            			    	{A_tree = (object)adaptor.Create(A);
            			    		adaptor.AddChild(root_0, A_tree);
            			    	}
            			    	if ( state.backtracking == 0 ) 
            			    	{
            			    	  IndentEmit((CommonToken)A);
            			    	}
            			    	PushFollow(FOLLOW_equalityExpressionNoIn_in_bitwiseANDExpressionNoIn11012);
            			    	equalityExpressionNoIn280 = equalityExpressionNoIn();
            			    	state.followingStackPointer--;
            			    	if (state.failed) return retval;
            			    	if ( state.backtracking == 0 ) adaptor.AddChild(root_0, equalityExpressionNoIn280.Tree);
            			    	if ( state.backtracking == 0 ) 
            			    	{
            			    	  PopIndent();
            			    	}

            			    }
            			    break;

            			default:
            			    goto loop128;
            	    }
            	} while (true);

            	loop128:
            		;	// Stops C# compiler whining that label 'loop128' has no statements


            }

            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {	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 
    	{
            if ( state.backtracking > 0 ) 
            {
            	Memoize(input, 117, bitwiseANDExpressionNoIn_StartIndex); 
            }
        }
        return retval;
    }
Example #2
0
    // $ANTLR start "bitwiseANDExpressionNoIn"
    // AS3_ex.g3:3204:1: bitwiseANDExpressionNoIn : equalityExpressionNoIn (A= AND equalityExpressionNoIn )* ;
    public AS3_exParser.bitwiseANDExpressionNoIn_return bitwiseANDExpressionNoIn() // throws RecognitionException [1]
    {   
        AS3_exParser.bitwiseANDExpressionNoIn_return retval = new AS3_exParser.bitwiseANDExpressionNoIn_return();
        retval.Start = input.LT(1);
        int bitwiseANDExpressionNoIn_StartIndex = input.Index();
        object root_0 = null;

        IToken A = null;
        AS3_exParser.equalityExpressionNoIn_return equalityExpressionNoIn290 = null;

        AS3_exParser.equalityExpressionNoIn_return equalityExpressionNoIn291 = null;


        object A_tree=null;


            WrapOptions options=mPrinter.getExpressionWrapOptions();
            bool pushedWrapInfo=false;

        try 
        {
            if ( (state.backtracking > 0) && AlreadyParsedRule(input, 117) ) 
            {
                return retval; 
            }
            // AS3_ex.g3:3209:5: ( equalityExpressionNoIn (A= AND equalityExpressionNoIn )* )
            // AS3_ex.g3:3209:9: equalityExpressionNoIn (A= AND equalityExpressionNoIn )*
            {
                root_0 = (object)adaptor.GetNilNode();

                if ( state.backtracking == 0 ) 
                {
                  pushedWrapInfo=pushWrapInfo(options, true);
                }
                PushFollow(FOLLOW_equalityExpressionNoIn_in_bitwiseANDExpressionNoIn12579);
                equalityExpressionNoIn290 = equalityExpressionNoIn();
                state.followingStackPointer--;
                if (state.failed) return retval;
                if ( state.backtracking == 0 ) adaptor.AddChild(root_0, equalityExpressionNoIn290.Tree);
                // AS3_ex.g3:3210:32: (A= AND equalityExpressionNoIn )*
                do 
                {
                    int alt135 = 2;
                    int LA135_0 = input.LA(1);

                    if ( (LA135_0 == AND) )
                    {
                        alt135 = 1;
                    }


                    switch (alt135) 
                    {
                        case 1 :
                            // AS3_ex.g3:3210:34: A= AND equalityExpressionNoIn
                            {
                                A=(IToken)Match(input,AND,FOLLOW_AND_in_bitwiseANDExpressionNoIn12585); if (state.failed) return retval;
                                if ( state.backtracking == 0 )
                                {A_tree = (object)adaptor.Create(A);
                                    adaptor.AddChild(root_0, A_tree);
                                }
                                if ( state.backtracking == 0 ) 
                                {
                                  indentEmit(A, ASPrettyPrinter.Break_Arithmetic_Ops_code);
                                }
                                PushFollow(FOLLOW_equalityExpressionNoIn_in_bitwiseANDExpressionNoIn12589);
                                equalityExpressionNoIn291 = equalityExpressionNoIn();
                                state.followingStackPointer--;
                                if (state.failed) return retval;
                                if ( state.backtracking == 0 ) adaptor.AddChild(root_0, equalityExpressionNoIn291.Tree);
                                if ( state.backtracking == 0 ) 
                                {
                                  popIndent();
                                }

                            }
                            break;

                        default:
                            goto loop135;
                    }
                } while (true);

                loop135:
                    ;   // Stops C# compiler whining that label 'loop135' has no statements

                if ( state.backtracking == 0 ) 
                {
                  if (pushedWrapInfo) mPrinter.popWrapContext();
                }

            }

            retval.Stop = input.LT(-1);

            if ( state.backtracking==0 )
            {   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 
        {
            if ( state.backtracking > 0 ) 
            {
                Memoize(input, 117, bitwiseANDExpressionNoIn_StartIndex); 
            }
        }
        return retval;
    }