parsing string
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ameesh_Baxi
Posted On:   Wednesday, October 30, 2002 03:09 AM

Hi there, I am using antlr for parsing the string. I use c++ version. my code is... strstream to_parse(char_pointer, strlen(char_pointer)+1); try { MyLexer lexer(to_parse); TokenBuffer buffer(lexer); MyParser parser(buffer); parser.parse(); }catch (exception&e ) { cout < < } The problem is it parses the string properly when string is correct. When some wrong data is given, it goes in to the consume() method and looks for EOF_TYPE and ultimately ends up in the infinite while loop. I don't know how to specify EOF_TYPE in a string.    More>>

Hi there,

I am using antlr for parsing the string. I use c++ version.

my code is...


strstream to_parse(char_pointer, strlen(char_pointer)+1);



try {


MyLexer lexer(to_parse);

TokenBuffer buffer(lexer);

MyParser parser(buffer);

parser.parse();


}catch (exception&e ) {

cout < <

}



The problem is it parses the string properly when string is correct. When some wrong data is given, it goes in to the consume() method and looks for EOF_TYPE and ultimately ends up in the infinite while loop.

I don't know how to specify EOF_TYPE in a string.


Any suggestions??



Cheers

   <<Less
About | Sitemap | Contact