Can a lexer generate default error messages instead of aborting?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   primrose_mbanefo
Posted On:   Tuesday, September 7, 2004 09:54 AM

This must be somewhere in the manual or in the FAQ but I can't seem to find it... My problem is the following: The error handlers are turned on by default so that minimal error messages are generated but I have noticed that if a file to be scanned contains a character which is not expected by the lexer, the translator is abnormally terminated (I use c++ code generation, the error is "Abort"). Is there anyway of changing this behaviour? I have a general try/catch block in main but it doesn't seem to be able to catch the exception generated somewhere in the lexer. The parser on the other hand works perfectly in this respect and prints the error messages. Thanks    More>>

This must be somewhere in the manual or in the FAQ but I can't seem to find it...


My problem is the following: The error handlers are turned on by default so that minimal error messages are generated but I have noticed that if a file to be scanned contains a character which is not expected by the lexer, the translator is abnormally terminated (I use c++ code generation, the error is "Abort").


Is there anyway of changing this behaviour?


I have a general try/catch block in main but it doesn't seem to be able to catch the exception generated somewhere in the lexer.


The parser on the other hand works perfectly in this respect and prints the error messages.

Thanks for any help.

   <<Less
About | Sitemap | Contact