I would like like to stop the execution of the program when facing some error. How to do that when using lex? I can just call normal C exit like:
exit( status );
or is there a more neat way to do it with Lex?
I would like like to stop the execution of the program when facing some error. How to do that when using lex? I can just call normal C exit like:
exit( status );
or is there a more neat way to do it with Lex?
You can do just that - but:
If your lexer serves as the parser, then exiting from the lexer would make sense.
Further reading: