[antlr-interest] crash on parsing filter condition

monaabs monaabs at yahoo.com
Mon Jun 16 12:49:03 PDT 2003


Greetings !!!

I am using 2.7.2 .. on parsing join and filter conditions i get 
abnormal program termination .

Its a very strange situation cause this crash occurs only on 
syntatically wrong conditions 

for eg if i type column1 = column2 .. no crash
if i type column1 = column2sum  (junk at end) application crashes.

The crash call stack is 
ETL_PARSERS! _CxxThrowException at 8 + 52 bytes
SQL_Parser::r_BoolPrimary() line 7121


Similarly i encounter the same crash on parsing transforms .

The stack in this case is 
ETL_PARSERS! _CxxThrowException at 8 + 52 bytes
COMPUTE_Parser::r_RHS() line 260

Any reason why this should happen . I have intialised the ASTFsctory 
and it works great for parseColumn() but for parseJoinCondition() and 
parseWhereCondition() it fails

My function looks like this

long ETL_PARSERS_API ETL_ParseSQL::parseWhereConditions( const char 
*inBuf, bool bIgnoreSubSelects )
{
  ANTLR_USING_NAMESPACE(std)
  ANTLR_USING_NAMESPACE(antlr)
   etl_parser_buffer parserBuf;
   parserBuf.init( inBuf );
   
   initGlobalPtr();
   getMetaInfoPtr()->setIgnoreSubSelects( bIgnoreSubSelects );
   saveInPtr( parserBuf.get_istream() );

   ASTFactory my_factory;
   SQL_Lexer  lexer( *(parserBuf.get_istream()) );
   SQL_Parser parser(lexer);
   parser.initializeASTFactory(my_factory);
   parser.setASTFactory(&my_factory);

   try
   {
     parser.r_ETL_Where();
   }
   catch(exception& e)
   {
     if ( isBlank( inBuf ) )
       return( 0 );
     setErrMsg( e.what() );
     return( -1 );
   }
   return( 0 );
}

Any input greatly appreciated .

Best Regards
Mona


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list