Пример #1
0
    // $ANTLR start "likeEscape"
    // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:430:1: likeEscape : ( ESCAPE concatenation )? ;
    public HqlParser.likeEscape_return likeEscape() // throws RecognitionException [1]
    {   
        HqlParser.likeEscape_return retval = new HqlParser.likeEscape_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IToken ESCAPE165 = null;
        HqlParser.concatenation_return concatenation166 = default(HqlParser.concatenation_return);


        IASTNode ESCAPE165_tree=null;

        try 
    	{
            // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:431:2: ( ( ESCAPE concatenation )? )
            // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:431:4: ( ESCAPE concatenation )?
            {
            	root_0 = (IASTNode)adaptor.GetNilNode();

            	// /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:431:4: ( ESCAPE concatenation )?
            	int alt57 = 2;
            	int LA57_0 = input.LA(1);

            	if ( (LA57_0 == ESCAPE) )
            	{
            	    alt57 = 1;
            	}
            	switch (alt57) 
            	{
            	    case 1 :
            	        // /Users/Steve/Projects/NHibernate/Branches/2.1.x/nhibernate/src/NHibernate/Hql/Ast/ANTLR/Hql.g:431:5: ESCAPE concatenation
            	        {
            	        	ESCAPE165=(IToken)Match(input,ESCAPE,FOLLOW_ESCAPE_in_likeEscape2142); 
            	        		ESCAPE165_tree = (IASTNode)adaptor.Create(ESCAPE165);
            	        		root_0 = (IASTNode)adaptor.BecomeRoot(ESCAPE165_tree, root_0);

            	        	PushFollow(FOLLOW_concatenation_in_likeEscape2145);
            	        	concatenation166 = concatenation();
            	        	state.followingStackPointer--;

            	        	adaptor.AddChild(root_0, concatenation166.Tree);

            	        }
            	        break;

            	}


            }

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

            	retval.Tree = (IASTNode)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 = (IASTNode)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }
    // $ANTLR start "likeEscape"
    // Hql.g:448:1: likeEscape : ( ESCAPE concatenation )? ;
    public HqlParser.likeEscape_return likeEscape() // throws RecognitionException [1]
    {   
        HqlParser.likeEscape_return retval = new HqlParser.likeEscape_return();
        retval.Start = input.LT(1);

        IASTNode root_0 = null;

        IToken ESCAPE178 = null;
        HqlParser.concatenation_return concatenation179 = default(HqlParser.concatenation_return);


        IASTNode ESCAPE178_tree=null;

        try 
    	{
            // Hql.g:449:2: ( ( ESCAPE concatenation )? )
            // Hql.g:449:4: ( ESCAPE concatenation )?
            {
            	root_0 = (IASTNode)adaptor.GetNilNode();

            	// Hql.g:449:4: ( ESCAPE concatenation )?
            	int alt63 = 2;
            	int LA63_0 = input.LA(1);

            	if ( (LA63_0 == ESCAPE) )
            	{
            	    alt63 = 1;
            	}
            	switch (alt63) 
            	{
            	    case 1 :
            	        // Hql.g:449:5: ESCAPE concatenation
            	        {
            	        	ESCAPE178=(IToken)Match(input,ESCAPE,FOLLOW_ESCAPE_in_likeEscape2240); 
            	        		ESCAPE178_tree = (IASTNode)adaptor.Create(ESCAPE178);
            	        		root_0 = (IASTNode)adaptor.BecomeRoot(ESCAPE178_tree, root_0);

            	        	PushFollow(FOLLOW_concatenation_in_likeEscape2243);
            	        	concatenation179 = concatenation();
            	        	state.followingStackPointer--;

            	        	adaptor.AddChild(root_0, concatenation179.Tree);

            	        }
            	        break;

            	}


            }

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

            	retval.Tree = (IASTNode)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 = (IASTNode)adaptor.ErrorNode(input, (IToken) retval.Start, input.LT(-1), re);

        }
        finally 
    	{
        }
        return retval;
    }