I need to disable flex output for unmatched characters. I can't disable this by default ECHO(), can't disable yyout. Any variants?
The creators of lex have provided a much simpler, more maintainable method. Add the following matching rules at the end of all your other rules:
[ \t\n]+ /* do nothing */
.+ /* do nothing */
I've found the solution. When you compile with gcc/g++, you have to add the option '-DECHO'. So the 'ECHO' macro will be defined and the program will not print anything.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With