Esempio 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;
}
Esempio n. 2
0
/** \brief Lexer rule generated by ANTLR3
 *
 * $ANTLR start NEWLINE
 *
 * Looks to match the characters the constitute the token NEWLINE
 * from the attached input stream.
 *
 *
 * \remark
 *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
 */
static ANTLR3_INLINE
void mNEWLINE(pExprCppTreeLexer ctx)
{
	ANTLR3_UINT32	_type;

    _type	    = NEWLINE;
       
    
    // D:\\message\\ExprCppTree.g:44:8: ( ( '\\r' )? '\\n' )
    // D:\\message\\ExprCppTree.g:44:10: ( '\\r' )? '\\n'
    {

        // D:\\message\\ExprCppTree.g:44:10: ( '\\r' )?
        {
            int alt4=2;
            switch ( LA(1) ) 
            {
                case '\r':
                	{
                		alt4=1;
                	}
                    break;
            }

            switch (alt4) 
            {
        	case 1:
        	    // D:\\message\\ExprCppTree.g:44:10: '\\r'
        	    {
        	        MATCHC('\r'); 
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleNEWLINEEx;
        	        }


        	    }
        	    break;

            }
        }
        MATCHC('\n'); 
        if  (HASEXCEPTION())
        {
            goto ruleNEWLINEEx;
        }


    }

	LEXSTATE->type = _type;

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

}
Esempio n. 3
0
/** \brief Lexer rule generated by ANTLR3
 *
 * $ANTLR start T__9
 *
 * Looks to match the characters the constitute the token T__9
 * from the attached input stream.
 *
 *
 * \remark
 *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
 */
static ANTLR3_INLINE
void mT__9(pMudLexer ctx)
{
	ANTLR3_UINT32	_type;

    _type	    = T__9;


    // c_src/Mud.g:10:6: ( 'join as' )
    // c_src/Mud.g:10:8: 'join as'
    {
        MATCHS(lit_4);
        if  (HASEXCEPTION())
        {
            goto ruleT__9Ex;
        }




    }

	LEXSTATE->type = _type;
    // This is where rules clean up and exit
    //
    goto ruleT__9Ex; /* Prevent compiler warnings */
    ruleT__9Ex: ;

}
Esempio n. 4
0
/** \brief Lexer rule generated by ANTLR3
 *
 * $ANTLR start T__8
 *
 * Looks to match the characters the constitute the token T__8
 * from the attached input stream.
 *
 *
 * \remark
 *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
 */
static ANTLR3_INLINE
void mT__8(pMudLexer ctx)
{
	ANTLR3_UINT32	_type;

    _type	    = T__8;


    // c_src/Mud.g:9:6: ( 'create user' )
    // c_src/Mud.g:9:8: 'create user'
    {
        MATCHS(lit_3);
        if  (HASEXCEPTION())
        {
            goto ruleT__8Ex;
        }




    }

	LEXSTATE->type = _type;
    // This is where rules clean up and exit
    //
    goto ruleT__8Ex; /* Prevent compiler warnings */
    ruleT__8Ex: ;

}
Esempio n. 5
0
/** \brief Lexer rule generated by ANTLR3
 *
 * $ANTLR start PLUS
 *
 * Looks to match the characters the constitute the token PLUS
 * from the attached input stream.
 *
 *
 * \remark
 *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
 */
static ANTLR3_INLINE
void mPLUS(pExprCppTreeLexer ctx)
{
	ANTLR3_UINT32	_type;

    _type	    = PLUS;
       
    
    // D:\\message\\ExprCppTree.g:13:5: ( '+' )
    // D:\\message\\ExprCppTree.g:13:7: '+'
    {
        MATCHC('+'); 
        if  (HASEXCEPTION())
        {
            goto rulePLUSEx;
        }


    }

	LEXSTATE->type = _type;

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

}
Esempio n. 6
0
/** \brief Lexer rule generated by ANTLR3
 *
 * $ANTLR start TIMES
 *
 * Looks to match the characters the constitute the token TIMES
 * from the attached input stream.
 *
 *
 * \remark
 *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
 */
static ANTLR3_INLINE
void mTIMES(pExprCppTreeLexer ctx)
{
	ANTLR3_UINT32	_type;

    _type	    = TIMES;
       
    
    // D:\\message\\ExprCppTree.g:20:6: ( '*' )
    // D:\\message\\ExprCppTree.g:20:8: '*'
    {
        MATCHC('*'); 
        if  (HASEXCEPTION())
        {
            goto ruleTIMESEx;
        }


    }

	LEXSTATE->type = _type;

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

}
Esempio n. 7
0
/** \brief Lexer rule generated by ANTLR3
 *
 * $ANTLR start ASSIGN
 *
 * Looks to match the characters the constitute the token ASSIGN
 * from the attached input stream.
 *
 *
 * \remark
 *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
 */
static ANTLR3_INLINE
void mASSIGN(pExprCppTreeLexer ctx)
{
	ANTLR3_UINT32	_type;

    _type	    = ASSIGN;
       
    
    // D:\\message\\ExprCppTree.g:32:7: ( '=' )
    // D:\\message\\ExprCppTree.g:32:9: '='
    {
        MATCHC('='); 
        if  (HASEXCEPTION())
        {
            goto ruleASSIGNEx;
        }


    }

	LEXSTATE->type = _type;

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

}
/** \brief Lexer rule generated by ANTLR3
 *
 * $ANTLR start ZERO
 *
 * Looks to match the characters the constitute the token ZERO
 * from the attached input stream.
 *
 *
 * \remark
 *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
 */
static ANTLR3_INLINE
void mZERO(pbelle_sdpLexer ctx)
{
	ANTLR3_UINT32	_type;

        
    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:316:14: ( '0' )
    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:316:16: '0'
    {
        MATCHC('0'); 
        if  (HASEXCEPTION())
        {
            goto ruleZEROEx;
        }


    }



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

}
/** \brief Lexer rule generated by ANTLR3
 *
 * $ANTLR start POS_DIGIT
 *
 * Looks to match the characters the constitute the token POS_DIGIT
 * from the attached input stream.
 *
 *
 * \remark
 *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
 */
static ANTLR3_INLINE
void mPOS_DIGIT(pbelle_sdpLexer ctx)
{
	ANTLR3_UINT32	_type;

        
    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:317:20: ( '1' .. '9' )
    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:317:32: '1' .. '9'
    {
        MATCHRANGE('1', '9'); 
        if  (HASEXCEPTION())
        {
            goto rulePOS_DIGITEx;
        }


    }



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

}
Esempio n. 10
0
/**
 * $ANTLR start operand_expr
 * /home/cross/workspace/djondb/db/grammars/filter_expression.g:160:1: operand_expr returns [BaseExpression* val] : OPER ;
 */
static BaseExpression*
operand_expr(pfilter_expressionParser ctx)
{
    BaseExpression* val;


    /* Initialize rule variables
     */

    {
        // /home/cross/workspace/djondb/db/grammars/filter_expression.g:161:2: ( OPER )
        // /home/cross/workspace/djondb/db/grammars/filter_expression.g:161:4: OPER
        {
             MATCHT(OPER, &FOLLOW_OPER_in_operand_expr318);
            if  (HASEXCEPTION())
            {
                goto ruleoperand_exprEx;
            }


        }

    }

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



    return val;
}
/** \brief Lexer rule generated by ANTLR3
 *
 * $ANTLR start SPACE
 *
 * Looks to match the characters the constitute the token SPACE
 * from the attached input stream.
 *
 *
 * \remark
 *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
 */
static ANTLR3_INLINE
void mSPACE(pbelle_sdpLexer ctx)
{
	ANTLR3_UINT32	_type;

    _type	    = SPACE;
       
    
    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:323:6: ( ' ' )
    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:323:8: ' '
    {
        MATCHC(' '); 
        if  (HASEXCEPTION())
        {
            goto ruleSPACEEx;
        }


    }

	LEXSTATE->type = _type;

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

}
Esempio n. 12
0
/** \brief Lexer rule generated by ANTLR3
 *
 * $ANTLR start T__13
 *
 * Looks to match the characters the constitute the token T__13
 * from the attached input stream.
 *
 *
 * \remark
 *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
 */
static ANTLR3_INLINE
void mT__13(pMudLexer ctx)
{
	ANTLR3_UINT32	_type;

    _type	    = T__13;


    // c_src/Mud.g:14:7: ( 'my name is' )
    // c_src/Mud.g:14:9: 'my name is'
    {
        MATCHS(lit_8);
        if  (HASEXCEPTION())
        {
            goto ruleT__13Ex;
        }




    }

	LEXSTATE->type = _type;
    // This is where rules clean up and exit
    //
    goto ruleT__13Ex; /* Prevent compiler warnings */
    ruleT__13Ex: ;

}
Esempio n. 13
0
/** \brief Lexer rule generated by ANTLR3
 *
 * $ANTLR start T__14
 *
 * Looks to match the characters the constitute the token T__14
 * from the attached input stream.
 *
 *
 * \remark
 *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
 */
static ANTLR3_INLINE
void mT__14(pMudLexer ctx)
{
	ANTLR3_UINT32	_type;

    _type	    = T__14;


    // c_src/Mud.g:15:7: ( 'new character' )
    // c_src/Mud.g:15:9: 'new character'
    {
        MATCHS(lit_9);
        if  (HASEXCEPTION())
        {
            goto ruleT__14Ex;
        }




    }

	LEXSTATE->type = _type;
    // This is where rules clean up and exit
    //
    goto ruleT__14Ex; /* Prevent compiler warnings */
    ruleT__14Ex: ;

}
Esempio n. 14
0
/**
 * $ANTLR start program
 * TestGrammar.g:7:1: program : HELLO WORLD ;
 */
static void
program(pTestGrammarParser ctx)
{
    /* Initialize rule variables
     */

    {
        // TestGrammar.g:7:9: ( HELLO WORLD )
        // TestGrammar.g:7:11: HELLO WORLD
        {
             MATCHT(HELLO, &FOLLOW_HELLO_in_program24);
            if  (HASEXCEPTION())
            {
                goto ruleprogramEx;
            }


             MATCHT(WORLD, &FOLLOW_WORLD_in_program26);
            if  (HASEXCEPTION())
            {
                goto ruleprogramEx;
            }


        }

    }

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

            if (HASEXCEPTION())
            {
                PREPORTERROR();
                PRECOVER();
            }
    return ;
}
Esempio n. 15
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;
}
Esempio n. 16
0
/**
 * $ANTLR start xpath_expr
 * /home/cross/workspace/djondb/db/grammars/filter_expression.g:137:1: xpath_expr returns [BaseExpression* val] : XPATH ;
 */
static BaseExpression*
xpath_expr(pfilter_expressionParser ctx)
{
    BaseExpression* val;


    pANTLR3_COMMON_TOKEN    XPATH7;

    /* Initialize rule variables
     */

    XPATH7       = NULL;

    {
        // /home/cross/workspace/djondb/db/grammars/filter_expression.g:138:2: ( XPATH )
        // /home/cross/workspace/djondb/db/grammars/filter_expression.g:138:4: XPATH
        {
            XPATH7 = (pANTLR3_COMMON_TOKEN) MATCHT(XPATH, &FOLLOW_XPATH_in_xpath_expr280);
            if  (HASEXCEPTION())
            {
                goto rulexpath_exprEx;
            }


            {

                	     char* text = (char*)(XPATH7->getText(XPATH7))->chars;
                	     SimpleExpression* result = new SimpleExpression(text);
                	     addToken(text);
                	     
                val= result;

                	
            }


        }

    }

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



    return val;
}
/** 
 * $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;
}
/** 
 * $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;
}
/** 
 * $ANTLR start value
 * corpconf.g:98:1: value returns [std::string v] : (s= STR | p= PATH | 'AT' a= PATH );
 */
static corpconfParser_value_return
value(pcorpconfParser ctx)
{   
    corpconfParser_value_return retval;

    pANTLR3_BASE_TREE root_0;

    pANTLR3_COMMON_TOKEN    s;
    pANTLR3_COMMON_TOKEN    p;
    pANTLR3_COMMON_TOKEN    a;
    pANTLR3_COMMON_TOKEN    string_literal13;

    pANTLR3_BASE_TREE s_tree;
    pANTLR3_BASE_TREE p_tree;
    pANTLR3_BASE_TREE a_tree;
    pANTLR3_BASE_TREE string_literal13_tree;

    /* Initialize rule variables
     */


    root_0 = NULL;

    s       = NULL;
    p       = NULL;
    a       = NULL;
    string_literal13       = NULL;
    retval.start = LT(1); retval.stop = retval.start;

    s_tree   = NULL;
    p_tree   = NULL;
    a_tree   = NULL;
    string_literal13_tree   = NULL;


    retval.tree  = NULL;
    {
        {
            //  corpconf.g:99:2: (s= STR | p= PATH | 'AT' a= PATH )
            
            ANTLR3_UINT32 alt5;

            alt5=3;

            switch ( LA(1) ) 
            {
            case STR:
            	{
            		alt5=1;
            	}
                break;
            case PATH:
            	{
            		alt5=2;
            	}
                break;
            case 14:
            	{
            		alt5=3;
            	}
                break;

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


                goto rulevalueEx;
            }

            switch (alt5) 
            {
        	case 1:
        	    // corpconf.g:99:4: s= STR
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));

        	        s = (pANTLR3_COMMON_TOKEN) MATCHT(STR, &FOLLOW_STR_in_value422); 
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulevalueEx;
        	        }

        	        s_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, s));
        	        ADAPTOR->addChild(ADAPTOR, root_0, s_tree);

        	        {
        	            retval.v= std::string((const char *) (s->getText(s))->chars);
        	        }

        	    }
        	    break;
        	case 2:
        	    // corpconf.g:100:4: p= PATH
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));

        	        p = (pANTLR3_COMMON_TOKEN) MATCHT(PATH, &FOLLOW_PATH_in_value442); 
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulevalueEx;
        	        }

        	        p_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, p));
        	        ADAPTOR->addChild(ADAPTOR, root_0, p_tree);

        	        {
        	            retval.v= std::string((const char *) (p->getText(p))->chars);
        	        }

        	    }
        	    break;
        	case 3:
        	    // corpconf.g:101:4: 'AT' a= PATH
        	    {
        	        root_0 = (pANTLR3_BASE_TREE)(ADAPTOR->nilNode(ADAPTOR));

        	        string_literal13 = (pANTLR3_COMMON_TOKEN) MATCHT(14, &FOLLOW_14_in_value459); 
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulevalueEx;
        	        }

        	        string_literal13_tree = (pANTLR3_BASE_TREE)(ADAPTOR->create(ADAPTOR, string_literal13));
        	        ADAPTOR->addChild(ADAPTOR, root_0, string_literal13_tree);

        	        a = (pANTLR3_COMMON_TOKEN) MATCHT(PATH, &FOLLOW_PATH_in_value463); 
        	        if  (HASEXCEPTION())
        	        {
        	            goto rulevalueEx;
        	        }

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

        	        {
        	            retval.v= std::string("@") + std::string((const char *) (a->getText(a))->chars);
        	        }

        	    }
        	    break;

            }
        }
    }
    

    // This is where rules clean up and exit
    //
    goto rulevalueEx; /* Prevent compiler warnings */
    rulevalueEx: ;
    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;
}
Esempio n. 20
0
/**
 * $ANTLR start constant_expr
 * /home/cross/workspace/djondb/db/grammars/filter_expression.g:145:1: constant_expr returns [BaseExpression* val] : ( INT | STRING ) ;
 */
static BaseExpression*
constant_expr(pfilter_expressionParser ctx)
{
    BaseExpression* val;


    pANTLR3_COMMON_TOKEN    INT8;
    pANTLR3_COMMON_TOKEN    STRING9;

    /* Initialize rule variables
     */

    INT8       = NULL;
    STRING9       = NULL;

    {
        // /home/cross/workspace/djondb/db/grammars/filter_expression.g:146:2: ( ( INT | STRING ) )
        // /home/cross/workspace/djondb/db/grammars/filter_expression.g:146:4: ( INT | STRING )
        {
            // /home/cross/workspace/djondb/db/grammars/filter_expression.g:146:4: ( INT | STRING )
            {
                int alt6=2;
                switch ( LA(1) )
                {
                case INT:
                	{
                		alt6=1;
                	}
                    break;
                case STRING:
                	{
                		alt6=2;
                	}
                    break;

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


                    goto ruleconstant_exprEx;

                }

                switch (alt6)
                {
            	case 1:
            	    // /home/cross/workspace/djondb/db/grammars/filter_expression.g:146:5: INT
            	    {
            	        INT8 = (pANTLR3_COMMON_TOKEN) MATCHT(INT, &FOLLOW_INT_in_constant_expr296);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleconstant_exprEx;
            	        }


            	        {

            	            	    int i = atoi((char*)(INT8->getText(INT8))->chars);
            	            	    
            	            val= new ConstantExpression(i);

            	            	
            	        }


            	    }
            	    break;
            	case 2:
            	    // /home/cross/workspace/djondb/db/grammars/filter_expression.g:150:6: STRING
            	    {
            	        STRING9 = (pANTLR3_COMMON_TOKEN) MATCHT(STRING, &FOLLOW_STRING_in_constant_expr303);
            	        if  (HASEXCEPTION())
            	        {
            	            goto ruleconstant_exprEx;
            	        }


            	        {

            	            	    char* ptext = (char*)(STRING9->getText(STRING9))->chars;
            	            	    char* text = (char*)malloc(strlen(ptext) - 1);
            	            	    memset(text, 0, strlen(ptext) - 1);
            	            	    memcpy(text, ptext + 1, strlen(ptext) - 2);
            	            	    
            	            	    
            	            val= new ConstantExpression(text);

            	            	    free (text);
            	            	
            	        }


            	    }
            	    break;

                }
            }

        }

    }

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



    return val;
}
Esempio n. 21
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;
}
/** This is the entry point in to the lexer from an object that
 *  wants to generate the next token, such as a pCOMMON_TOKEN_STREAM
 */
static void 
mTokens(pbelle_sdpLexer ctx)
{
    {
        //  /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:1:8: ( T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | DIGIT | COMMON_CHAR | HEX_CHAR | SPACE | LQUOTE | RQUOTE | CR | LF | DOT | EQUAL | COLON | SLASH | DASH | ANY_EXCEPT_CR_LF )
        
        ANTLR3_UINT32 alt1;

        alt1=22;


        {
            int LA1_0 = LA(1);
            if ( (LA1_0 == '!') ) 
            {
                alt1=1;
            }
            else if ( (LA1_0 == '#') ) 
            {
                alt1=2;
            }
            else if ( (LA1_0 == '$') ) 
            {
                alt1=3;
            }
            else if ( (LA1_0 == '&') ) 
            {
                alt1=4;
            }
            else if ( (LA1_0 == '%') ) 
            {
                alt1=5;
            }
            else if ( (LA1_0 == '\'') ) 
            {
                alt1=6;
            }
            else if ( (LA1_0 == '*') ) 
            {
                alt1=7;
            }
            else if ( (LA1_0 == '+') ) 
            {
                alt1=8;
            }
            else if ( (((LA1_0 >= '0') && (LA1_0 <= '9'))) ) 
            {
                alt1=9;
            }
            else if ( (((LA1_0 >= 'G') && (LA1_0 <= 'Z')) || ((LA1_0 >= 'g') && (LA1_0 <= 'z'))) ) 
            {
                alt1=10;
            }
            else if ( (((LA1_0 >= 'A') && (LA1_0 <= 'F')) || ((LA1_0 >= 'a') && (LA1_0 <= 'f'))) ) 
            {
                alt1=11;
            }
            else if ( (LA1_0 == ' ') ) 
            {
                alt1=12;
            }
            else if ( (LA1_0 == '<') ) 
            {
                alt1=13;
            }
            else if ( (LA1_0 == '>') ) 
            {
                alt1=14;
            }
            else if ( (LA1_0 == '\r') ) 
            {
                alt1=15;
            }
            else if ( (LA1_0 == '\n') ) 
            {
                alt1=16;
            }
            else if ( (LA1_0 == '.') ) 
            {
                alt1=17;
            }
            else if ( (LA1_0 == '=') ) 
            {
                alt1=18;
            }
            else if ( (LA1_0 == ':') ) 
            {
                alt1=19;
            }
            else if ( (LA1_0 == '/') ) 
            {
                alt1=20;
            }
            else if ( (LA1_0 == '-') ) 
            {
                alt1=21;
            }
            else if ( (((LA1_0 >= 0x0000) && (LA1_0 <= '\t')) || ((LA1_0 >= 0x000B) && (LA1_0 <= '\f')) || ((LA1_0 >= 0x000E) && (LA1_0 <= 0x001F)) || LA1_0 == '"' || ((LA1_0 >= '(') && (LA1_0 <= ')')) || LA1_0 == ',' || LA1_0 == ';' || ((LA1_0 >= '?') && (LA1_0 <= '@')) || ((LA1_0 >= '[') && (LA1_0 <= '`')) || ((LA1_0 >= '{') && (LA1_0 <= 0xFFFF))) ) 
            {
                alt1=22;
            }
            else 
            {
            
                CONSTRUCTEX();
                EXCEPTION->type         = ANTLR3_NO_VIABLE_ALT_EXCEPTION;
                EXCEPTION->message      = (void *)"";
                EXCEPTION->decisionNum  = 1;
                EXCEPTION->state        = 0;


                goto ruleTokensEx;
            }
        }
        switch (alt1) 
        {
    	case 1:
    	    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:1:10: T__20
    	    {
    	        /* 1:10: T__20 */
    	        mT__20(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 2:
    	    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:1:16: T__21
    	    {
    	        /* 1:16: T__21 */
    	        mT__21(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 3:
    	    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:1:22: T__22
    	    {
    	        /* 1:22: T__22 */
    	        mT__22(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 4:
    	    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:1:28: T__23
    	    {
    	        /* 1:28: T__23 */
    	        mT__23(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 5:
    	    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:1:34: T__24
    	    {
    	        /* 1:34: T__24 */
    	        mT__24(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 6:
    	    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:1:40: T__25
    	    {
    	        /* 1:40: T__25 */
    	        mT__25(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 7:
    	    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:1:46: T__26
    	    {
    	        /* 1:46: T__26 */
    	        mT__26(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 8:
    	    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:1:52: T__27
    	    {
    	        /* 1:52: T__27 */
    	        mT__27(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 9:
    	    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:1:58: DIGIT
    	    {
    	        /* 1:58: DIGIT */
    	        mDIGIT(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 10:
    	    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:1:64: COMMON_CHAR
    	    {
    	        /* 1:64: COMMON_CHAR */
    	        mCOMMON_CHAR(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 11:
    	    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:1:76: HEX_CHAR
    	    {
    	        /* 1:76: HEX_CHAR */
    	        mHEX_CHAR(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 12:
    	    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:1:85: SPACE
    	    {
    	        /* 1:85: SPACE */
    	        mSPACE(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 13:
    	    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:1:91: LQUOTE
    	    {
    	        /* 1:91: LQUOTE */
    	        mLQUOTE(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 14:
    	    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:1:98: RQUOTE
    	    {
    	        /* 1:98: RQUOTE */
    	        mRQUOTE(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 15:
    	    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:1:105: CR
    	    {
    	        /* 1:105: CR */
    	        mCR(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 16:
    	    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:1:108: LF
    	    {
    	        /* 1:108: LF */
    	        mLF(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 17:
    	    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:1:111: DOT
    	    {
    	        /* 1:111: DOT */
    	        mDOT(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 18:
    	    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:1:115: EQUAL
    	    {
    	        /* 1:115: EQUAL */
    	        mEQUAL(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 19:
    	    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:1:121: COLON
    	    {
    	        /* 1:121: COLON */
    	        mCOLON(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 20:
    	    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:1:127: SLASH
    	    {
    	        /* 1:127: SLASH */
    	        mSLASH(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 21:
    	    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:1:133: DASH
    	    {
    	        /* 1:133: DASH */
    	        mDASH(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 22:
    	    // /Users/huyheo/Documents/Linphone/linphone-iphone/submodules/build/..//belle-sip/src/belle_sdp.g:1:138: ANY_EXCEPT_CR_LF
    	    {
    	        /* 1:138: ANY_EXCEPT_CR_LF */
    	        mANY_EXCEPT_CR_LF(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;

        }
    }

    
    goto ruleTokensEx; /* Prevent compiler warnings */
ruleTokensEx: ;
}
Esempio n. 23
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;
}
Esempio n. 24
0
/** \brief Lexer rule generated by ANTLR3
 *
 * $ANTLR start INT
 *
 * Looks to match the characters the constitute the token INT
 * from the attached input stream.
 *
 *
 * \remark
 *  - lexer->error == ANTLR3_TRUE if an exception was thrown.
 */
static ANTLR3_INLINE
void mINT(pExprCppTreeLexer ctx)
{
	ANTLR3_UINT32	_type;

    _type	    = INT;
       
    
    // D:\\message\\ExprCppTree.g:43:4: ( ( '~' )? ( '0' .. '9' )+ )
    // D:\\message\\ExprCppTree.g:43:6: ( '~' )? ( '0' .. '9' )+
    {

        // D:\\message\\ExprCppTree.g:43:6: ( '~' )?
        {
            int alt2=2;
            switch ( LA(1) ) 
            {
                case '~':
                	{
                		alt2=1;
                	}
                    break;
            }

            switch (alt2) 
            {
        	case 1:
        	    // D:\\message\\ExprCppTree.g:43:6: '~'
        	    {
        	        MATCHC('~'); 
        	        if  (HASEXCEPTION())
        	        {
        	            goto ruleINTEx;
        	        }


        	    }
        	    break;

            }
        }
        // D:\\message\\ExprCppTree.g:43:11: ( '0' .. '9' )+
        {
            int cnt3=0;

            for (;;)
            {
                int alt3=2;
        	switch ( LA(1) ) 
        	{
        	case '0':
        	case '1':
        	case '2':
        	case '3':
        	case '4':
        	case '5':
        	case '6':
        	case '7':
        	case '8':
        	case '9':
        		{
        			alt3=1;
        		}
        	    break;

        	}

        	switch (alt3) 
        	{
        	    case 1:
        	        // D:\\message\\ExprCppTree.g:43:11: '0' .. '9'
        	        {
        	            MATCHRANGE('0', '9'); 
        	            if  (HASEXCEPTION())
        	            {
        	                goto ruleINTEx;
        	            }


        	        }
        	        break;

        	    default:
        	    
        		if ( cnt3 >= 1 )
        		{
        		    goto loop3;
        		}
        		/* mismatchedSetEx()
        		 */
        		CONSTRUCTEX();
        		EXCEPTION->type = ANTLR3_EARLY_EXIT_EXCEPTION;
        		EXCEPTION->name = (void *)ANTLR3_EARLY_EXIT_NAME;


        		goto ruleINTEx;
        	}
        	cnt3++;
            }
            loop3: ;	/* Jump to here if this rule does not match */
        }

    }

	LEXSTATE->type = _type;

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

}
Esempio n. 25
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;
}
Esempio n. 26
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;
}
Esempio n. 27
0
/** This is the entry point in to the lexer from an object that
 *  wants to generate the next token, such as a pCOMMON_TOKEN_STREAM
 */
static void
mTokens(pMudLexer ctx)
{
    {
        //  c_src/Mud.g:1:8: ( T__6 | T__7 | T__8 | T__9 | T__10 | T__11 | T__12 | T__13 | T__14 | WS | TEXT )

        ANTLR3_UINT32 alt3;

        alt3=11;

        switch ( LA(1) )
        {
        case 'a':
        	{
        		switch ( LA(2) )
        		{
        		case 'r':
        			{
        				switch ( LA(3) )
        				{
        				case 'o':
        					{
        						switch ( LA(4) )
        						{
        						case 'u':
        							{
        								switch ( LA(5) )
        								{
        								case 'n':
        									{
        										switch ( LA(6) )
        										{
        										case 'd':
        											{
        												switch ( LA(7) )
        												{
        												case '!':
        												case '#':
        												case '$':
        												case '%':
        												case '&':
        												case '(':
        												case ')':
        												case '*':
        												case '@':
        												case 'A':
        												case 'B':
        												case 'C':
        												case 'D':
        												case 'E':
        												case 'F':
        												case 'G':
        												case 'H':
        												case 'I':
        												case 'J':
        												case 'K':
        												case 'L':
        												case 'M':
        												case 'N':
        												case 'O':
        												case 'P':
        												case 'Q':
        												case 'R':
        												case 'S':
        												case 'T':
        												case 'U':
        												case 'V':
        												case 'W':
        												case 'X':
        												case 'Y':
        												case 'Z':
        												case '^':
        												case 'a':
        												case 'b':
        												case 'c':
        												case 'd':
        												case 'e':
        												case 'f':
        												case 'g':
        												case 'h':
        												case 'i':
        												case 'j':
        												case 'k':
        												case 'l':
        												case 'm':
        												case 'n':
        												case 'o':
        												case 'p':
        												case 'q':
        												case 'r':
        												case 's':
        												case 't':
        												case 'u':
        												case 'v':
        												case 'w':
        												case 'x':
        												case 'y':
        												case 'z':
        													{
        														alt3=11;
        													}
        												    break;

        												default:
        												    alt3=1;
        												}

        											}
        										    break;

        										default:
        										    alt3=11;
        										}

        									}
        								    break;

        								default:
        								    alt3=11;
        								}

        							}
        						    break;

        						default:
        						    alt3=11;
        						}

        					}
        				    break;

        				default:
        				    alt3=11;
        				}

        			}
        		    break;
        		case 't':
        			{
        				switch ( LA(3) )
        				{
        				case '!':
        				case '#':
        				case '$':
        				case '%':
        				case '&':
        				case '(':
        				case ')':
        				case '*':
        				case '@':
        				case 'A':
        				case 'B':
        				case 'C':
        				case 'D':
        				case 'E':
        				case 'F':
        				case 'G':
        				case 'H':
        				case 'I':
        				case 'J':
        				case 'K':
        				case 'L':
        				case 'M':
        				case 'N':
        				case 'O':
        				case 'P':
        				case 'Q':
        				case 'R':
        				case 'S':
        				case 'T':
        				case 'U':
        				case 'V':
        				case 'W':
        				case 'X':
        				case 'Y':
        				case 'Z':
        				case '^':
        				case 'a':
        				case 'b':
        				case 'c':
        				case 'd':
        				case 'e':
        				case 'f':
        				case 'g':
        				case 'h':
        				case 'i':
        				case 'j':
        				case 'k':
        				case 'l':
        				case 'm':
        				case 'n':
        				case 'o':
        				case 'p':
        				case 'q':
        				case 'r':
        				case 's':
        				case 't':
        				case 'u':
        				case 'v':
        				case 'w':
        				case 'x':
        				case 'y':
        				case 'z':
        					{
        						alt3=11;
        					}
        				    break;

        				default:
        				    alt3=2;
        				}

        			}
        		    break;

        		default:
        		    alt3=11;
        		}

        	}
            break;
        case 'c':
        	{
        		switch ( LA(2) )
        		{
        		case 'r':
        			{
        				switch ( LA(3) )
        				{
        				case 'e':
        					{
        						switch ( LA(4) )
        						{
        						case 'a':
        							{
        								switch ( LA(5) )
        								{
        								case 't':
        									{
        										switch ( LA(6) )
        										{
        										case 'e':
        											{
        												switch ( LA(7) )
        												{
        												case ' ':
        													{
        														alt3=3;
        													}
        												    break;

        												default:
        												    alt3=11;
        												}

        											}
        										    break;

        										default:
        										    alt3=11;
        										}

        									}
        								    break;

        								default:
        								    alt3=11;
        								}

        							}
        						    break;

        						default:
        						    alt3=11;
        						}

        					}
        				    break;

        				default:
        				    alt3=11;
        				}

        			}
        		    break;

        		default:
        		    alt3=11;
        		}

        	}
            break;
        case 'j':
        	{
        		switch ( LA(2) )
        		{
        		case 'o':
        			{
        				switch ( LA(3) )
        				{
        				case 'i':
        					{
        						switch ( LA(4) )
        						{
        						case 'n':
        							{
        								switch ( LA(5) )
        								{
        								case ' ':
        									{
        										alt3=4;
        									}
        								    break;

        								default:
        								    alt3=11;
        								}

        							}
        						    break;

        						default:
        						    alt3=11;
        						}

        					}
        				    break;

        				default:
        				    alt3=11;
        				}

        			}
        		    break;

        		default:
        		    alt3=11;
        		}

        	}
            break;
        case 'l':
        	{
        		switch ( LA(2) )
        		{
        		case 'o':
        			{
        				switch ( LA(3) )
        				{
        				case 'g':
        					{
        						switch ( LA(4) )
        						{
        						case 'i':
        							{
        								switch ( LA(5) )
        								{
        								case 'n':
        									{
        										switch ( LA(6) )
        										{
        										case '!':
        										case '#':
        										case '$':
        										case '%':
        										case '&':
        										case '(':
        										case ')':
        										case '*':
        										case '@':
        										case 'A':
        										case 'B':
        										case 'C':
        										case 'D':
        										case 'E':
        										case 'F':
        										case 'G':
        										case 'H':
        										case 'I':
        										case 'J':
        										case 'K':
        										case 'L':
        										case 'M':
        										case 'N':
        										case 'O':
        										case 'P':
        										case 'Q':
        										case 'R':
        										case 'S':
        										case 'T':
        										case 'U':
        										case 'V':
        										case 'W':
        										case 'X':
        										case 'Y':
        										case 'Z':
        										case '^':
        										case 'a':
        										case 'b':
        										case 'c':
        										case 'd':
        										case 'e':
        										case 'f':
        										case 'g':
        										case 'h':
        										case 'i':
        										case 'j':
        										case 'k':
        										case 'l':
        										case 'm':
        										case 'n':
        										case 'o':
        										case 'p':
        										case 'q':
        										case 'r':
        										case 's':
        										case 't':
        										case 'u':
        										case 'v':
        										case 'w':
        										case 'x':
        										case 'y':
        										case 'z':
        											{
        												alt3=11;
        											}
        										    break;

        										default:
        										    alt3=5;
        										}

        									}
        								    break;

        								default:
        								    alt3=11;
        								}

        							}
        						    break;

        						default:
        						    alt3=11;
        						}

        					}
        				    break;
        				case 'o':
        					{
        						switch ( LA(4) )
        						{
        						case 'k':
        							{
        								switch ( LA(5) )
        								{
        								case '!':
        								case '#':
        								case '$':
        								case '%':
        								case '&':
        								case '(':
        								case ')':
        								case '*':
        								case '@':
        								case 'A':
        								case 'B':
        								case 'C':
        								case 'D':
        								case 'E':
        								case 'F':
        								case 'G':
        								case 'H':
        								case 'I':
        								case 'J':
        								case 'K':
        								case 'L':
        								case 'M':
        								case 'N':
        								case 'O':
        								case 'P':
        								case 'Q':
        								case 'R':
        								case 'S':
        								case 'T':
        								case 'U':
        								case 'V':
        								case 'W':
        								case 'X':
        								case 'Y':
        								case 'Z':
        								case '^':
        								case 'a':
        								case 'b':
        								case 'c':
        								case 'd':
        								case 'e':
        								case 'f':
        								case 'g':
        								case 'h':
        								case 'i':
        								case 'j':
        								case 'k':
        								case 'l':
        								case 'm':
        								case 'n':
        								case 'o':
        								case 'p':
        								case 'q':
        								case 'r':
        								case 's':
        								case 't':
        								case 'u':
        								case 'v':
        								case 'w':
        								case 'x':
        								case 'y':
        								case 'z':
        									{
        										alt3=11;
        									}
        								    break;

        								default:
        								    alt3=6;
        								}

        							}
        						    break;

        						default:
        						    alt3=11;
        						}

        					}
        				    break;

        				default:
        				    alt3=11;
        				}

        			}
        		    break;

        		default:
        		    alt3=11;
        		}

        	}
            break;
        case 'm':
        	{
        		switch ( LA(2) )
        		{
        		case 'o':
        			{
        				switch ( LA(3) )
        				{
        				case 'v':
        					{
        						switch ( LA(4) )
        						{
        						case 'e':
        							{
        								switch ( LA(5) )
        								{
        								case '!':
        								case '#':
        								case '$':
        								case '%':
        								case '&':
        								case '(':
        								case ')':
        								case '*':
        								case '@':
        								case 'A':
        								case 'B':
        								case 'C':
        								case 'D':
        								case 'E':
        								case 'F':
        								case 'G':
        								case 'H':
        								case 'I':
        								case 'J':
        								case 'K':
        								case 'L':
        								case 'M':
        								case 'N':
        								case 'O':
        								case 'P':
        								case 'Q':
        								case 'R':
        								case 'S':
        								case 'T':
        								case 'U':
        								case 'V':
        								case 'W':
        								case 'X':
        								case 'Y':
        								case 'Z':
        								case '^':
        								case 'a':
        								case 'b':
        								case 'c':
        								case 'd':
        								case 'e':
        								case 'f':
        								case 'g':
        								case 'h':
        								case 'i':
        								case 'j':
        								case 'k':
        								case 'l':
        								case 'm':
        								case 'n':
        								case 'o':
        								case 'p':
        								case 'q':
        								case 'r':
        								case 's':
        								case 't':
        								case 'u':
        								case 'v':
        								case 'w':
        								case 'x':
        								case 'y':
        								case 'z':
        									{
        										alt3=11;
        									}
        								    break;

        								default:
        								    alt3=7;
        								}

        							}
        						    break;

        						default:
        						    alt3=11;
        						}

        					}
        				    break;

        				default:
        				    alt3=11;
        				}

        			}
        		    break;
        		case 'y':
        			{
        				switch ( LA(3) )
        				{
        				case ' ':
        					{
        						alt3=8;
        					}
        				    break;

        				default:
        				    alt3=11;
        				}

        			}
        		    break;

        		default:
        		    alt3=11;
        		}

        	}
            break;
        case 'n':
        	{
        		switch ( LA(2) )
        		{
        		case 'e':
        			{
        				switch ( LA(3) )
        				{
        				case 'w':
        					{
        						switch ( LA(4) )
        						{
        						case ' ':
        							{
        								alt3=9;
        							}
        						    break;

        						default:
        						    alt3=11;
        						}

        					}
        				    break;

        				default:
        				    alt3=11;
        				}

        			}
        		    break;

        		default:
        		    alt3=11;
        		}

        	}
            break;
        case '\t':
        case ' ':
        	{
        		alt3=10;
        	}
            break;
        case '!':
        case '#':
        case '$':
        case '%':
        case '&':
        case '(':
        case ')':
        case '*':
        case '@':
        case 'A':
        case 'B':
        case 'C':
        case 'D':
        case 'E':
        case 'F':
        case 'G':
        case 'H':
        case 'I':
        case 'J':
        case 'K':
        case 'L':
        case 'M':
        case 'N':
        case 'O':
        case 'P':
        case 'Q':
        case 'R':
        case 'S':
        case 'T':
        case 'U':
        case 'V':
        case 'W':
        case 'X':
        case 'Y':
        case 'Z':
        case '^':
        case 'b':
        case 'd':
        case 'e':
        case 'f':
        case 'g':
        case 'h':
        case 'i':
        case 'k':
        case 'o':
        case 'p':
        case 'q':
        case 'r':
        case 's':
        case 't':
        case 'u':
        case 'v':
        case 'w':
        case 'x':
        case 'y':
        case 'z':
        	{
        		alt3=11;
        	}
            break;

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


            goto ruleTokensEx;

        }

        switch (alt3)
        {
    	case 1:
    	    // c_src/Mud.g:1:10: T__6
    	    {
    	        /* 1:10: T__6 */
    	        mT__6(ctx );
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }



    	    }
    	    break;
    	case 2:
    	    // c_src/Mud.g:1:15: T__7
    	    {
    	        /* 1:15: T__7 */
    	        mT__7(ctx );
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }



    	    }
    	    break;
    	case 3:
    	    // c_src/Mud.g:1:20: T__8
    	    {
    	        /* 1:20: T__8 */
    	        mT__8(ctx );
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }



    	    }
    	    break;
    	case 4:
    	    // c_src/Mud.g:1:25: T__9
    	    {
    	        /* 1:25: T__9 */
    	        mT__9(ctx );
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }



    	    }
    	    break;
    	case 5:
    	    // c_src/Mud.g:1:30: T__10
    	    {
    	        /* 1:30: T__10 */
    	        mT__10(ctx );
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }



    	    }
    	    break;
    	case 6:
    	    // c_src/Mud.g:1:36: T__11
    	    {
    	        /* 1:36: T__11 */
    	        mT__11(ctx );
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }



    	    }
    	    break;
    	case 7:
    	    // c_src/Mud.g:1:42: T__12
    	    {
    	        /* 1:42: T__12 */
    	        mT__12(ctx );
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }



    	    }
    	    break;
    	case 8:
    	    // c_src/Mud.g:1:48: T__13
    	    {
    	        /* 1:48: T__13 */
    	        mT__13(ctx );
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }



    	    }
    	    break;
    	case 9:
    	    // c_src/Mud.g:1:54: T__14
    	    {
    	        /* 1:54: T__14 */
    	        mT__14(ctx );
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }



    	    }
    	    break;
    	case 10:
    	    // c_src/Mud.g:1:60: WS
    	    {
    	        /* 1:60: WS */
    	        mWS(ctx );
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }



    	    }
    	    break;
    	case 11:
    	    // c_src/Mud.g:1:63: TEXT
    	    {
    	        /* 1:63: TEXT */
    	        mTEXT(ctx );
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }



    	    }
    	    break;

        }
    }


    goto ruleTokensEx; /* Prevent compiler warnings */
ruleTokensEx: ;
}
/** 
 * $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;
}
Esempio n. 29
0
/** This is the entry point in to the lexer from an object that
 *  wants to generate the next token, such as a pCOMMON_TOKEN_STREAM
 */
static void 
mTokens(pExprCppTreeLexer ctx)
{
    {
        //  D:\\message\\ExprCppTree.g:1:8: ( T__12 | T__13 | PLUS | MINUS | TIMES | ASSIGN | ID | INT | NEWLINE | WS )
        
        ANTLR3_UINT32 alt6;

        alt6=10;

        switch ( LA(1) ) 
        {
        case '(':
        	{
        		alt6=1;
        	}
            break;
        case ')':
        	{
        		alt6=2;
        	}
            break;
        case '+':
        	{
        		alt6=3;
        	}
            break;
        case '-':
        	{
        		alt6=4;
        	}
            break;
        case '*':
        	{
        		alt6=5;
        	}
            break;
        case '=':
        	{
        		alt6=6;
        	}
            break;
        case 'A':
        case 'B':
        case 'C':
        case 'D':
        case 'E':
        case 'F':
        case 'G':
        case 'H':
        case 'I':
        case 'J':
        case 'K':
        case 'L':
        case 'M':
        case 'N':
        case 'O':
        case 'P':
        case 'Q':
        case 'R':
        case 'S':
        case 'T':
        case 'U':
        case 'V':
        case 'W':
        case 'X':
        case 'Y':
        case 'Z':
        case 'a':
        case 'b':
        case 'c':
        case 'd':
        case 'e':
        case 'f':
        case 'g':
        case 'h':
        case 'i':
        case 'j':
        case 'k':
        case 'l':
        case 'm':
        case 'n':
        case 'o':
        case 'p':
        case 'q':
        case 'r':
        case 's':
        case 't':
        case 'u':
        case 'v':
        case 'w':
        case 'x':
        case 'y':
        case 'z':
        	{
        		alt6=7;
        	}
            break;
        case '0':
        case '1':
        case '2':
        case '3':
        case '4':
        case '5':
        case '6':
        case '7':
        case '8':
        case '9':
        case '~':
        	{
        		alt6=8;
        	}
            break;
        case '\n':
        case '\r':
        	{
        		alt6=9;
        	}
            break;
        case '\t':
        case ' ':
        	{
        		alt6=10;
        	}
            break;

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


            goto ruleTokensEx;
        }

        switch (alt6) 
        {
    	case 1:
    	    // D:\\message\\ExprCppTree.g:1:10: T__12
    	    {
    	        /* 1:10: T__12 */
    	        mT__12(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 2:
    	    // D:\\message\\ExprCppTree.g:1:16: T__13
    	    {
    	        /* 1:16: T__13 */
    	        mT__13(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 3:
    	    // D:\\message\\ExprCppTree.g:1:22: PLUS
    	    {
    	        /* 1:22: PLUS */
    	        mPLUS(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 4:
    	    // D:\\message\\ExprCppTree.g:1:27: MINUS
    	    {
    	        /* 1:27: MINUS */
    	        mMINUS(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 5:
    	    // D:\\message\\ExprCppTree.g:1:33: TIMES
    	    {
    	        /* 1:33: TIMES */
    	        mTIMES(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 6:
    	    // D:\\message\\ExprCppTree.g:1:39: ASSIGN
    	    {
    	        /* 1:39: ASSIGN */
    	        mASSIGN(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 7:
    	    // D:\\message\\ExprCppTree.g:1:46: ID
    	    {
    	        /* 1:46: ID */
    	        mID(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 8:
    	    // D:\\message\\ExprCppTree.g:1:49: INT
    	    {
    	        /* 1:49: INT */
    	        mINT(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 9:
    	    // D:\\message\\ExprCppTree.g:1:53: NEWLINE
    	    {
    	        /* 1:53: NEWLINE */
    	        mNEWLINE(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;
    	case 10:
    	    // D:\\message\\ExprCppTree.g:1:61: WS
    	    {
    	        /* 1:61: WS */
    	        mWS(ctx ); 
    	        if  (HASEXCEPTION())
    	        {
    	            goto ruleTokensEx;
    	        }


    	    }
    	    break;

        }
    }

    
    goto ruleTokensEx; /* Prevent compiler warnings */
ruleTokensEx: ;
}
Esempio n. 30
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;
}