flex yy_fatal_error
exist just like that. But I want handler back to my application. How to avoid exist call? from yy_fatal_error. whether this problem addressed in any version? your suggestion is highly appreciated. help me on this issues.
标签:
flex-lexer
相关问题
- How do I generate different yyparse functions from
- Getting CMake to find flex on Windows
- Cyclic Dependency in reentrant flex / bison header
- Copying entire input line in (f)lex (for better er
- How to fix a missing ld library for -lfl while com
相关文章
- How to fix a missing ld library for -lfl while com
- Flex / Lex Encoding Strings with Escaped Character
- How to get string value of token in flex and bison
- unistd.h related difficulty when compiling bison &
- YAML parsing - lex or hand-rolled?
- Undefined reference to yyparse (flex & bison)
- Error in the output of my flex file
- Lex regex gets some extra characters
You can override the function, by
#define
ing your own. Note that in the generated code there isIf you
#define
the macroYY_FATAL_ERROR(msg)
to call your own function, the lexer will call that function rather than the one from the template.However, the lexer template is written to assume that this function does not return. You can make it do that by using
setjmp
andlongjmp
to prepare a predictable place to return in your application and jumping back (from your ownyy_fatal_error
function) to that when a "fatal" error is used.vi like emacs does this for instance, because it uses lexers for syntax highlighting. If a fatal error is generated by the lexer, you would not want the editor to stop.
Here are a few links discussing
setjmp
andlongjmp
: