Ejemplo n.º 1
0
/**
 * $ANTLR start start_point
 * /home/cross/workspace/djondb/db/grammars/filter_expression.g:63:1: start_point returns [BaseExpression* val] : filter_expr EOF ;
 */
static BaseExpression*
start_point(pfilter_expressionParser ctx)
{
    BaseExpression* val;


    BaseExpression* filter_expr1;
    #undef	RETURN_TYPE_filter_expr1
    #define	RETURN_TYPE_filter_expr1 BaseExpression*

    /* Initialize rule variables
     */


    	
    {
        // /home/cross/workspace/djondb/db/grammars/filter_expression.g:65:4: ( filter_expr EOF )
        // /home/cross/workspace/djondb/db/grammars/filter_expression.g:65:6: filter_expr EOF
        {
            FOLLOWPUSH(FOLLOW_filter_expr_in_start_point69);
            filter_expr1=filter_expr(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto rulestart_pointEx;
            }


             MATCHT(EOF, &FOLLOW_EOF_in_start_point71);
            if  (HASEXCEPTION())
            {
                goto rulestart_pointEx;
            }


            {

                	    val= 
                filter_expr1
                ;

                	
            }


        }

    }

    // This is where rules clean up and exit
    //
    goto rulestart_pointEx; /* Prevent compiler warnings */
    rulestart_pointEx: ;



    return val;
}
Ejemplo n.º 2
0
/**
 * $ANTLR start filter_expr
 * /home/cross/workspace/djondb/db/grammars/filter_expression.g:70:1: filter_expr returns [BaseExpression* val] : boolean_expr ;
 */
static BaseExpression*
filter_expr(pfilter_expressionParser ctx)
{
    BaseExpression* val;


    BaseExpression* boolean_expr2;
    #undef	RETURN_TYPE_boolean_expr2
    #define	RETURN_TYPE_boolean_expr2 BaseExpression*

    /* Initialize rule variables
     */

    {
        // /home/cross/workspace/djondb/db/grammars/filter_expression.g:71:2: ( boolean_expr )
        // /home/cross/workspace/djondb/db/grammars/filter_expression.g:72:2: boolean_expr
        {
            FOLLOWPUSH(FOLLOW_boolean_expr_in_filter_expr89);
            boolean_expr2=boolean_expr(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto rulefilter_exprEx;
            }


            {

                	val= 
                boolean_expr2
                ;

                	
            }


        }

    }

    // This is where rules clean up and exit
    //
    goto rulefilter_exprEx; /* Prevent compiler warnings */
    rulefilter_exprEx: ;



    return val;
}
Ejemplo n.º 3
0
/** 
 * $ANTLR start line
 * corpconf.g:72:1: line[CorpInfo &c] : ( ( 'ATTRIBUTE' v= value | 'STRUCTURE' v= value | 'PROCESS' v= value ) ( LBRACE NL block[*b] r= RBRACE )? NL | a= ATTR v= value NL );
 */
static corpconfParser_line_return
line(pcorpconfParser ctx, CorpInfo &c)
{   
    corpconfParser_line_return retval;

    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    r;
    pANTLR3_COMMON_TOKEN    a;
    pANTLR3_COMMON_TOKEN    string_literal5;
    pANTLR3_COMMON_TOKEN    string_literal6;
    pANTLR3_COMMON_TOKEN    string_literal7;
    pANTLR3_COMMON_TOKEN    LBRACE8;
    pANTLR3_COMMON_TOKEN    NL9;
    pANTLR3_COMMON_TOKEN    NL11;
    pANTLR3_COMMON_TOKEN    NL12;
    corpconfParser_value_return v;
    #undef	RETURN_TYPE_v
    #define	RETURN_TYPE_v corpconfParser_value_return

    corpconfParser_block_return block10;
    #undef	RETURN_TYPE_block10
    #define	RETURN_TYPE_block10 corpconfParser_block_return

    pANTLR3_BASE_TREE r_tree;
    pANTLR3_BASE_TREE a_tree;
    pANTLR3_BASE_TREE string_literal5_tree;
    pANTLR3_BASE_TREE string_literal6_tree;
    pANTLR3_BASE_TREE string_literal7_tree;
    pANTLR3_BASE_TREE LBRACE8_tree;
    pANTLR3_BASE_TREE NL9_tree;
    pANTLR3_BASE_TREE NL11_tree;
    pANTLR3_BASE_TREE NL12_tree;

    /* Initialize rule variables
     */


    root_0 = NULL;

    CorpInfo *b;
    r       = NULL;
    a       = NULL;
    string_literal5       = NULL;
    string_literal6       = NULL;
    string_literal7       = NULL;
    LBRACE8       = NULL;
    NL9       = NULL;
    NL11       = NULL;
    NL12       = NULL;
    v.tree = NULL;

    block10.tree = NULL;

    retval.start = LT(1); retval.stop = retval.start;

    r_tree   = NULL;
    a_tree   = NULL;
    string_literal5_tree   = NULL;
    string_literal6_tree   = NULL;
    string_literal7_tree   = NULL;
    LBRACE8_tree   = NULL;
    NL9_tree   = NULL;
    NL11_tree   = NULL;
    NL12_tree   = NULL;


    retval.tree  = NULL;
    {
        {
            //  corpconf.g:74:2: ( ( 'ATTRIBUTE' v= value | 'STRUCTURE' v= value | 'PROCESS' v= value ) ( LBRACE NL block[*b] r= RBRACE )? NL | a= ATTR v= value NL )
            
            ANTLR3_UINT32 alt4;

            alt4=2;

            switch ( LA(1) ) 
            {
            case 11:
            case 12:
            case 13:
            	{
            		alt4=1;
            	}
                break;
            case ATTR:
            	{
            		alt4=2;
            	}
                break;

            default:
                CONSTRUCTEX();
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                EXCEPTION->message      = (void *)"";
                EXCEPTION->decisionNum  = 4;
                EXCEPTION->state        = 0;


                goto rulelineEx;
            }

            switch (alt4) 
            {
        	case 1:
        	    // corpconf.g:75:3: ( 'ATTRIBUTE' v= value | 'STRUCTURE' v= value | 'PROCESS' v= value ) ( LBRACE NL block[*b] r= RBRACE )? NL
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


        	        // corpconf.g:75:3: ( 'ATTRIBUTE' v= value | 'STRUCTURE' v= value | 'PROCESS' v= value )
        	        {
        	            int alt2=3;
        	            switch ( LA(1) ) 
        	            {
        	            case 11:
        	            	{
        	            		alt2=1;
        	            	}
        	                break;
        	            case 12:
        	            	{
        	            		alt2=2;
        	            	}
        	                break;
        	            case 13:
        	            	{
        	            		alt2=3;
        	            	}
        	                break;

        	            default:
        	                CONSTRUCTEX();
        	                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
        	                EXCEPTION->message      = (void *)"";
        	                EXCEPTION->decisionNum  = 2;
        	                EXCEPTION->state        = 0;


        	                goto rulelineEx;
        	            }

        	            switch (alt2) 
        	            {
        	        	case 1:
        	        	    // corpconf.g:75:5: 'ATTRIBUTE' v= value
        	        	    {
        	        	        string_literal5 = (pANTLR3_COMMON_TOKEN) MATCHT(11, &FOLLOW_11_in_line319); 
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulelineEx;
        	        	        }

        	        	        string_literal5_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, string_literal5));
        	        	        ADAPTOR->addChild(ADAPTOR, root_0, string_literal5_tree);

        	        	        FOLLOWPUSH(FOLLOW_value_in_line323);
        	        	        v=value(ctx);

        	        	        FOLLOWPOP();
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulelineEx;
        	        	        }

        	        	        ADAPTOR->addChild(ADAPTOR, root_0, v.tree);
        	        	        {
        	        	             b = new CorpInfo();
        	        	            			  c.attrs.push_back (std::pair<std::string,CorpInfo*>(v.v, b)); 
        	        	            			
        	        	        }

        	        	    }
        	        	    break;
        	        	case 2:
        	        	    // corpconf.g:79:5: 'STRUCTURE' v= value
        	        	    {
        	        	        string_literal6 = (pANTLR3_COMMON_TOKEN) MATCHT(12, &FOLLOW_12_in_line334); 
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulelineEx;
        	        	        }

        	        	        string_literal6_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, string_literal6));
        	        	        ADAPTOR->addChild(ADAPTOR, root_0, string_literal6_tree);

        	        	        FOLLOWPUSH(FOLLOW_value_in_line338);
        	        	        v=value(ctx);

        	        	        FOLLOWPOP();
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulelineEx;
        	        	        }

        	        	        ADAPTOR->addChild(ADAPTOR, root_0, v.tree);
        	        	        {
        	        	             b = new CorpInfo();
        	        	            			  c.structs.push_back (std::pair<std::string,CorpInfo*>(v.v, b)); 
        	        	            			
        	        	        }

        	        	    }
        	        	    break;
        	        	case 3:
        	        	    // corpconf.g:83:5: 'PROCESS' v= value
        	        	    {
        	        	        string_literal7 = (pANTLR3_COMMON_TOKEN) MATCHT(13, &FOLLOW_13_in_line349); 
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulelineEx;
        	        	        }

        	        	        string_literal7_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, string_literal7));
        	        	        ADAPTOR->addChild(ADAPTOR, root_0, string_literal7_tree);

        	        	        FOLLOWPUSH(FOLLOW_value_in_line353);
        	        	        v=value(ctx);

        	        	        FOLLOWPOP();
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulelineEx;
        	        	        }

        	        	        ADAPTOR->addChild(ADAPTOR, root_0, v.tree);
        	        	        {
        	        	             b = new CorpInfo();
        	        	            			  c.procs.push_back (std::pair<std::string,CorpInfo*>(v.v, b)); 
        	        	            			
        	        	        }

        	        	    }
        	        	    break;

        	            }
        	        }

        	        // corpconf.g:88:3: ( LBRACE NL block[*b] r= RBRACE )?
        	        {
        	            int alt3=2;
        	            switch ( LA(1) ) 
        	            {
        	                case LBRACE:
        	                	{
        	                		alt3=1;
        	                	}
        	                    break;
        	            }

        	            switch (alt3) 
        	            {
        	        	case 1:
        	        	    // corpconf.g:88:4: LBRACE NL block[*b] r= RBRACE
        	        	    {
        	        	        LBRACE8 = (pANTLR3_COMMON_TOKEN) MATCHT(LBRACE, &FOLLOW_LBRACE_in_line367); 
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulelineEx;
        	        	        }

        	        	        LBRACE8_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, LBRACE8));
        	        	        ADAPTOR->addChild(ADAPTOR, root_0, LBRACE8_tree);

        	        	        NL9 = (pANTLR3_COMMON_TOKEN) MATCHT(NL, &FOLLOW_NL_in_line369); 
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulelineEx;
        	        	        }

        	        	        NL9_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, NL9));
        	        	        ADAPTOR->addChild(ADAPTOR, root_0, NL9_tree);

        	        	        FOLLOWPUSH(FOLLOW_block_in_line371);
        	        	        block10=block(ctx, *b);

        	        	        FOLLOWPOP();
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulelineEx;
        	        	        }

        	        	        ADAPTOR->addChild(ADAPTOR, root_0, block10.tree);
        	        	        r = (pANTLR3_COMMON_TOKEN) MATCHT(RBRACE, &FOLLOW_RBRACE_in_line376); 
        	        	        if  (HASEXCEPTION())
        	        	        {
        	        	            goto rulelineEx;
        	        	        }

        	        	        r_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, r));
        	        	        ADAPTOR->addChild(ADAPTOR, root_0, r_tree);


        	        	    }
        	        	    break;

        	            }
        	        }
        	        NL11 = (pANTLR3_COMMON_TOKEN) MATCHT(NL, &FOLLOW_NL_in_line380); 
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulelineEx;
        	        }

        	        NL11_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, NL11));
        	        ADAPTOR->addChild(ADAPTOR, root_0, NL11_tree);


        	    }
        	    break;
        	case 2:
        	    // corpconf.g:89:4: a= ATTR v= value NL
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));

        	        a = (pANTLR3_COMMON_TOKEN) MATCHT(ATTR, &FOLLOW_ATTR_in_line387); 
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulelineEx;
        	        }

        	        a_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, a));
        	        ADAPTOR->addChild(ADAPTOR, root_0, a_tree);

        	        FOLLOWPUSH(FOLLOW_value_in_line391);
        	        v=value(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulelineEx;
        	        }

        	        ADAPTOR->addChild(ADAPTOR, root_0, v.tree);
        	        NL12 = (pANTLR3_COMMON_TOKEN) MATCHT(NL, &FOLLOW_NL_in_line393); 
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulelineEx;
        	        }

        	        NL12_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, NL12));
        	        ADAPTOR->addChild(ADAPTOR, root_0, NL12_tree);

        	        {
        	            c.opts [std::string((const char *) (a->getText(a))->chars)] = v.v;
        	        }

        	    }
        	    break;

            }
        }
    }
    

    // This is where rules clean up and exit
    //
    goto rulelineEx; /* Prevent compiler warnings */
    rulelineEx: ;
    retval.stop = LT(-1);

    	retval.stop = LT(-1);
    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);

    if	(HASEXCEPTION())
    {
	/* catch(decl,action)
	 */
	{

	    		PREPORTERROR();
	    		RECOGNIZER->consumeUntil(RECOGNIZER, NL);
	    		block(CTX, *b);
	    	
	}


    }
    else
    {
    }

    return retval;
}
Ejemplo n.º 4
0
/** 
 * $ANTLR start block
 * corpconf.g:68:1: block[CorpInfo &c] : ( line[c] | NL )* ;
 */
static corpconfParser_block_return
block(pcorpconfParser ctx, CorpInfo &c)
{   
    corpconfParser_block_return retval;

    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    NL4;
    corpconfParser_line_return line3;
    #undef	RETURN_TYPE_line3
    #define	RETURN_TYPE_line3 corpconfParser_line_return

    pANTLR3_BASE_TREE NL4_tree;

    /* Initialize rule variables
     */


    root_0 = NULL;

    NL4       = NULL;
    line3.tree = NULL;

    retval.start = LT(1); retval.stop = retval.start;

    NL4_tree   = NULL;


    retval.tree  = NULL;
    {
        // corpconf.g:69:2: ( ( line[c] | NL )* )
        // corpconf.g:69:4: ( line[c] | NL )*
        {
            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));


            // corpconf.g:69:4: ( line[c] | NL )*

            for (;;)
            {
                int alt1=3;
                switch ( LA(1) ) 
                {
                case ATTR:
                case 11:
                case 12:
                case 13:
                	{
                		alt1=1;
                	}
                    break;
                case NL:
                	{
                		alt1=2;
                	}
                    break;

                }

                switch (alt1) 
                {
            	case 1:
            	    // corpconf.g:69:5: line[c]
            	    {
            	        FOLLOWPUSH(FOLLOW_line_in_block293);
            	        line3=line(ctx, c);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleblockEx;
            	        }

            	        ADAPTOR->addChild(ADAPTOR, root_0, line3.tree);

            	    }
            	    break;
            	case 2:
            	    // corpconf.g:69:13: NL
            	    {
            	        NL4 = (pANTLR3_COMMON_TOKEN) MATCHT(NL, &FOLLOW_NL_in_block296); 
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleblockEx;
            	        }

            	        NL4_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, NL4));
            	        ADAPTOR->addChild(ADAPTOR, root_0, NL4_tree);


            	    }
            	    break;

            	default:
            	    goto loop1;	/* break out of the loop */
            	    break;
                }
            }
            loop1: ; /* Jump out to here if this rule does not match */


        }

    }
    

    // This is where rules clean up and exit
    //
    goto ruleblockEx; /* Prevent compiler warnings */
    ruleblockEx: ;
    retval.stop = LT(-1);

    	retval.stop = LT(-1);
    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);

            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
                retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->errorNode(ADAPTOR, INPUT, retval.start, LT(-1), EXCEPTION));
            }


    return retval;
}
Ejemplo n.º 5
0
/** 
 * $ANTLR start config
 * corpconf.g:59:1: config[CorpInfo &c] : block[c] EOF ;
 */
static corpconfParser_config_return
config(pcorpconfParser ctx, CorpInfo &c)
{   
    corpconfParser_config_return retval;

    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    EOF2;
    corpconfParser_block_return block1;
    #undef	RETURN_TYPE_block1
    #define	RETURN_TYPE_block1 corpconfParser_block_return

    pANTLR3_BASE_TREE EOF2_tree;

    /* Initialize rule variables
     */


    root_0 = NULL;

    EOF2       = NULL;
    block1.tree = NULL;

    retval.start = LT(1); retval.stop = retval.start;

    EOF2_tree   = NULL;


    retval.tree  = NULL;
    {
        // corpconf.g:60:2: ( block[c] EOF )
        // corpconf.g:60:4: block[c] EOF
        {
            root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));

            FOLLOWPUSH(FOLLOW_block_in_config269);
            block1=block(ctx, c);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto ruleconfigEx;
            }

            ADAPTOR->addChild(ADAPTOR, root_0, block1.tree);
            EOF2 = (pANTLR3_COMMON_TOKEN) MATCHT(EOF, &FOLLOW_EOF_in_config272); 
            if  (HASEXCEPTION())
            {
                goto ruleconfigEx;
            }

            EOF2_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, EOF2));
            ADAPTOR->addChild(ADAPTOR, root_0, EOF2_tree);


        }

    }
    

    // This is where rules clean up and exit
    //
    goto ruleconfigEx; /* Prevent compiler warnings */
    ruleconfigEx: ;
    retval.stop = LT(-1);

    	retval.stop = LT(-1);
    	retval.tree = (pANTLR3_BASE_TREE)(ADAPTOR->rulePostProcessing(ADAPTOR, root_0));
    	ADAPTOR->setTokenBoundaries(ADAPTOR, retval.tree, retval.start, retval.stop);

    if	(HASEXCEPTION())
    {
	/* catch(decl,action)
	 */
	{

	    		PREPORTERROR();
	    		RECOGNIZER->consumeUntil(RECOGNIZER, NL);
	    		config(CTX, c);
	    	
	}


    }
    else
    {
    }

    return retval;
}
Ejemplo n.º 6
0
/**
 * $ANTLR start parenthesized_boolean
 * /home/cross/workspace/djondb/db/grammars/filter_expression.g:109:1: parenthesized_boolean returns [BaseExpression* val] : LPAREN boolean_expr RPAREN ;
 */
static BaseExpression*
parenthesized_boolean(pfilter_expressionParser ctx)
{
    BaseExpression* val;


    BaseExpression* boolean_expr5;
    #undef	RETURN_TYPE_boolean_expr5
    #define	RETURN_TYPE_boolean_expr5 BaseExpression*

    /* Initialize rule variables
     */

    {
        // /home/cross/workspace/djondb/db/grammars/filter_expression.g:110:2: ( LPAREN boolean_expr RPAREN )
        // /home/cross/workspace/djondb/db/grammars/filter_expression.g:110:4: LPAREN boolean_expr RPAREN
        {
             MATCHT(LPAREN, &FOLLOW_LPAREN_in_parenthesized_boolean193);
            if  (HASEXCEPTION())
            {
                goto ruleparenthesized_booleanEx;
            }


            FOLLOWPUSH(FOLLOW_boolean_expr_in_parenthesized_boolean195);
            boolean_expr5=boolean_expr(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto ruleparenthesized_booleanEx;
            }


            {

                	   val= 
                boolean_expr5
                ;

                	
            }


             MATCHT(RPAREN, &FOLLOW_RPAREN_in_parenthesized_boolean199);
            if  (HASEXCEPTION())
            {
                goto ruleparenthesized_booleanEx;
            }


        }

    }

    // This is where rules clean up and exit
    //
    goto ruleparenthesized_booleanEx; /* Prevent compiler warnings */
    ruleparenthesized_booleanEx: ;



    return val;
}
Ejemplo n.º 7
0
/**
 * $ANTLR start boolean_value
 * /home/cross/workspace/djondb/db/grammars/filter_expression.g:101:1: boolean_value returns [BaseExpression* val] : ( parenthesized_boolean | nonparentherized_boolean );
 */
static BaseExpression*
boolean_value(pfilter_expressionParser ctx)
{
    BaseExpression* val;


    BaseExpression* parenthesized_boolean3;
    #undef	RETURN_TYPE_parenthesized_boolean3
    #define	RETURN_TYPE_parenthesized_boolean3 BaseExpression*

    BaseExpression* nonparentherized_boolean4;
    #undef	RETURN_TYPE_nonparentherized_boolean4
    #define	RETURN_TYPE_nonparentherized_boolean4 BaseExpression*

    /* Initialize rule variables
     */

    {
        {
            //  /home/cross/workspace/djondb/db/grammars/filter_expression.g:102:2: ( parenthesized_boolean | nonparentherized_boolean )

            ANTLR3_UINT32 alt3;

            alt3=2;

            switch ( LA(1) )
            {
            case LPAREN:
            	{
            		alt3=1;
            	}
                break;
            case INT:
            case STRING:
            case XPATH:
            	{
            		alt3=2;
            	}
                break;

            default:
                CONSTRUCTEX();
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                EXCEPTION->message      = (void *)"";
                EXCEPTION->decisionNum  = 3;
                EXCEPTION->state        = 0;


                goto ruleboolean_valueEx;

            }

            switch (alt3)
            {
        	case 1:
        	    // /home/cross/workspace/djondb/db/grammars/filter_expression.g:102:4: parenthesized_boolean
        	    {
        	        FOLLOWPUSH(FOLLOW_parenthesized_boolean_in_boolean_value170);
        	        parenthesized_boolean3=parenthesized_boolean(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleboolean_valueEx;
        	        }


        	        {

        	            	   val= 
        	            parenthesized_boolean3
        	            ;

        	            	
        	        }


        	    }
        	    break;
        	case 2:
        	    // /home/cross/workspace/djondb/db/grammars/filter_expression.g:105:2: nonparentherized_boolean
        	    {
        	        FOLLOWPUSH(FOLLOW_nonparentherized_boolean_in_boolean_value177);
        	        nonparentherized_boolean4=nonparentherized_boolean(ctx);

        	        FOLLOWPOP();
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleboolean_valueEx;
        	        }


        	        {

        	            	   val= 
        	            nonparentherized_boolean4
        	            ;

        	            	
        	        }


        	    }
        	    break;

            }
        }
    }

    // This is where rules clean up and exit
    //
    goto ruleboolean_valueEx; /* Prevent compiler warnings */
    ruleboolean_valueEx: ;



    return val;
}
Ejemplo n.º 8
0
/**
 * $ANTLR start boolean_term
 * /home/cross/workspace/djondb/db/grammars/filter_expression.g:88:1: boolean_term returns [BaseExpression* val] : b1= boolean_value ( AND b2= boolean_value )* ;
 */
static BaseExpression*
boolean_term(pfilter_expressionParser ctx)
{
    BaseExpression* val;


    BaseExpression* b1;
    #undef	RETURN_TYPE_b1
    #define	RETURN_TYPE_b1 BaseExpression*

    BaseExpression* b2;
    #undef	RETURN_TYPE_b2
    #define	RETURN_TYPE_b2 BaseExpression*

    /* Initialize rule variables
     */

    {
        // /home/cross/workspace/djondb/db/grammars/filter_expression.g:89:2: (b1= boolean_value ( AND b2= boolean_value )* )
        // /home/cross/workspace/djondb/db/grammars/filter_expression.g:89:4: b1= boolean_value ( AND b2= boolean_value )*
        {
            FOLLOWPUSH(FOLLOW_boolean_value_in_boolean_term138);
            b1=boolean_value(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto ruleboolean_termEx;
            }


            {

                	   val= 
                b1
                ;

                	
            }


            // /home/cross/workspace/djondb/db/grammars/filter_expression.g:93:3: ( AND b2= boolean_value )*

            for (;;)
            {
                int alt2=2;
                switch ( LA(1) )
                {
                case AND:
                	{
                		alt2=1;
                	}
                    break;

                }

                switch (alt2)
                {
            	case 1:
            	    // /home/cross/workspace/djondb/db/grammars/filter_expression.g:93:4: AND b2= boolean_value
            	    {
            	         MATCHT(AND, &FOLLOW_AND_in_boolean_term146);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleboolean_termEx;
            	        }


            	        FOLLOWPUSH(FOLLOW_boolean_value_in_boolean_term150);
            	        b2=boolean_value(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleboolean_termEx;
            	        }


            	        {

            	            	   BinaryExpression* be = new BinaryExpression(FO_AND);
            	            	   be->push(val
            	            );
            	            	   be->push(b2
            	            );
            	            	   val= be;

            	            	 
            	        }


            	    }
            	    break;

            	default:
            	    goto loop2;	/* break out of the loop */
            	    break;
                }
            }
            loop2: ; /* Jump out to here if this rule does not match */


        }

    }

    // This is where rules clean up and exit
    //
    goto ruleboolean_termEx; /* Prevent compiler warnings */
    ruleboolean_termEx: ;



    return val;
}
Ejemplo n.º 9
0
/**
 * $ANTLR start boolean_expr
 * /home/cross/workspace/djondb/db/grammars/filter_expression.g:76:1: boolean_expr returns [BaseExpression* val] : b1= boolean_term ( OR b2= boolean_term )* ;
 */
static BaseExpression*
boolean_expr(pfilter_expressionParser ctx)
{
    BaseExpression* val;


    BaseExpression* b1;
    #undef	RETURN_TYPE_b1
    #define	RETURN_TYPE_b1 BaseExpression*

    BaseExpression* b2;
    #undef	RETURN_TYPE_b2
    #define	RETURN_TYPE_b2 BaseExpression*

    /* Initialize rule variables
     */

    {
        // /home/cross/workspace/djondb/db/grammars/filter_expression.g:77:2: (b1= boolean_term ( OR b2= boolean_term )* )
        // /home/cross/workspace/djondb/db/grammars/filter_expression.g:77:4: b1= boolean_term ( OR b2= boolean_term )*
        {
            FOLLOWPUSH(FOLLOW_boolean_term_in_boolean_expr107);
            b1=boolean_term(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto ruleboolean_exprEx;
            }


            {

                	   val= 
                b1
                ;

                	
            }


            // /home/cross/workspace/djondb/db/grammars/filter_expression.g:81:2: ( OR b2= boolean_term )*

            for (;;)
            {
                int alt1=2;
                switch ( LA(1) )
                {
                case OR:
                	{
                		alt1=1;
                	}
                    break;

                }

                switch (alt1)
                {
            	case 1:
            	    // /home/cross/workspace/djondb/db/grammars/filter_expression.g:81:3: OR b2= boolean_term
            	    {
            	         MATCHT(OR, &FOLLOW_OR_in_boolean_expr115);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleboolean_exprEx;
            	        }


            	        FOLLOWPUSH(FOLLOW_boolean_term_in_boolean_expr119);
            	        b2=boolean_term(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleboolean_exprEx;
            	        }


            	        {

            	            	   BinaryExpression* be = new BinaryExpression(FO_OR);
            	            	   be->push(val
            	            );
            	            	   be->push(b2
            	            );
            	            	   val= be;

            	            	
            	        }


            	    }
            	    break;

            	default:
            	    goto loop1;	/* break out of the loop */
            	    break;
                }
            }
            loop1: ; /* Jump out to here if this rule does not match */


        }

    }

    // This is where rules clean up and exit
    //
    goto ruleboolean_exprEx; /* Prevent compiler warnings */
    ruleboolean_exprEx: ;



    return val;
}
Ejemplo n.º 10
0
/**
 * $ANTLR start unary_expr
 * /home/cross/workspace/djondb/db/grammars/filter_expression.g:127:1: unary_expr returns [BaseExpression* val] : (c1= constant_expr |x1= xpath_expr ) ;
 */
static BaseExpression*
unary_expr(pfilter_expressionParser ctx)
{
    BaseExpression* val;


    BaseExpression* c1;
    #undef	RETURN_TYPE_c1
    #define	RETURN_TYPE_c1 BaseExpression*

    BaseExpression* x1;
    #undef	RETURN_TYPE_x1
    #define	RETURN_TYPE_x1 BaseExpression*

    /* Initialize rule variables
     */


    	     val = NULL;
    	
    {
        // /home/cross/workspace/djondb/db/grammars/filter_expression.g:131:2: ( (c1= constant_expr |x1= xpath_expr ) )
        // /home/cross/workspace/djondb/db/grammars/filter_expression.g:131:4: (c1= constant_expr |x1= xpath_expr )
        {
            // /home/cross/workspace/djondb/db/grammars/filter_expression.g:131:4: (c1= constant_expr |x1= xpath_expr )
            {
                int alt5=2;
                switch ( LA(1) )
                {
                case INT:
                case STRING:
                	{
                		alt5=1;
                	}
                    break;
                case XPATH:
                	{
                		alt5=2;
                	}
                    break;

                default:
                    CONSTRUCTEX();
                    EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                    EXCEPTION->message      = (void *)"";
                    EXCEPTION->decisionNum  = 5;
                    EXCEPTION->state        = 0;


                    goto ruleunary_exprEx;

                }

                switch (alt5)
                {
            	case 1:
            	    // /home/cross/workspace/djondb/db/grammars/filter_expression.g:131:5: c1= constant_expr
            	    {
            	        FOLLOWPUSH(FOLLOW_constant_expr_in_unary_expr255);
            	        c1=constant_expr(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleunary_exprEx;
            	        }


            	        {

            	            	        val= c1;

            	            	
            	        }


            	    }
            	    break;
            	case 2:
            	    // /home/cross/workspace/djondb/db/grammars/filter_expression.g:133:6: x1= xpath_expr
            	    {
            	        FOLLOWPUSH(FOLLOW_xpath_expr_in_unary_expr263);
            	        x1=xpath_expr(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleunary_exprEx;
            	        }


            	        {

            	            	        val= x1;

            	            	
            	        }


            	    }
            	    break;

                }
            }

        }

    }

    // This is where rules clean up and exit
    //
    goto ruleunary_exprEx; /* Prevent compiler warnings */
    ruleunary_exprEx: ;



    return val;
}
Ejemplo n.º 11
0
/**
 * $ANTLR start nonparentherized_boolean
 * /home/cross/workspace/djondb/db/grammars/filter_expression.g:114:1: nonparentherized_boolean returns [BaseExpression* val] : u1= unary_expr ( OPER u2= unary_expr )* ;
 */
static BaseExpression*
nonparentherized_boolean(pfilter_expressionParser ctx)
{
    BaseExpression* val;


    pANTLR3_COMMON_TOKEN    OPER6;
    BaseExpression* u1;
    #undef	RETURN_TYPE_u1
    #define	RETURN_TYPE_u1 BaseExpression*

    BaseExpression* u2;
    #undef	RETURN_TYPE_u2
    #define	RETURN_TYPE_u2 BaseExpression*

    /* Initialize rule variables
     */

    OPER6       = NULL;

    {
        // /home/cross/workspace/djondb/db/grammars/filter_expression.g:115:2: (u1= unary_expr ( OPER u2= unary_expr )* )
        // /home/cross/workspace/djondb/db/grammars/filter_expression.g:115:4: u1= unary_expr ( OPER u2= unary_expr )*
        {
            FOLLOWPUSH(FOLLOW_unary_expr_in_nonparentherized_boolean215);
            u1=unary_expr(ctx);

            FOLLOWPOP();
            if  (HASEXCEPTION())
            {
                goto rulenonparentherized_booleanEx;
            }


            {

                	   val= 
                u1
                ;

                	
            }


            // /home/cross/workspace/djondb/db/grammars/filter_expression.g:117:4: ( OPER u2= unary_expr )*

            for (;;)
            {
                int alt4=2;
                switch ( LA(1) )
                {
                case OPER:
                	{
                		alt4=1;
                	}
                    break;

                }

                switch (alt4)
                {
            	case 1:
            	    // /home/cross/workspace/djondb/db/grammars/filter_expression.g:117:6: OPER u2= unary_expr
            	    {
            	        OPER6 = (pANTLR3_COMMON_TOKEN) MATCHT(OPER, &FOLLOW_OPER_in_nonparentherized_boolean221);
            	        if  (HASEXCEPTION())
            	        {
            	            goto rulenonparentherized_booleanEx;
            	        }


            	        FOLLOWPUSH(FOLLOW_unary_expr_in_nonparentherized_boolean225);
            	        u2=unary_expr(ctx);

            	        FOLLOWPOP();
            	        if  (HASEXCEPTION())
            	        {
            	            goto rulenonparentherized_booleanEx;
            	        }


            	        {

            	            	   FILTER_OPERATORS oper = parseFilterOperator((char*)(OPER6->getText(OPER6))->chars);
            	            	   BinaryExpression* be = new BinaryExpression(oper);
            	            	   be->push(
            	            val
            	            );
            	            	   be->push(u2
            	            );
            	            	   val= be;

            	            	
            	        }


            	    }
            	    break;

            	default:
            	    goto loop4;	/* break out of the loop */
            	    break;
                }
            }
            loop4: ; /* Jump out to here if this rule does not match */


        }

    }

    // This is where rules clean up and exit
    //
    goto rulenonparentherized_booleanEx; /* Prevent compiler warnings */
    rulenonparentherized_booleanEx: ;



    return val;
}