help-flex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Enhancements in flex for error handling


From: kbinu
Subject: Enhancements in flex for error handling
Date: Mon, 21 May 2001 14:55:56 +0530


Hi
     We have been using flex generated scanners for a project. In our
application, we need to ensure that the application does not exit on system
errors including memory allocation failures. For errors that might occur
while the scanner allocates memory, we thought we would re-define
YY_FATAL_ERROR to something like
#define YY_FATAL_ERROR(x) return (error_indication=x, 0)
where error_indication is a global that I would check after the lexer
returns. This however is not feasible since YY_FATAL_ERROR is used in
functions called within yylex. Some of these do not return values. Also
yylex doesn't check if the called function encountered errors.
Is there any plan to enhance flex to return cleanly from yylex instead of
using exit() ? If not, any references on how to go about modifying the
skeleton scanner for this feature ?

-Binu





reply via email to

[Prev in Thread] Current Thread [Next in Thread]