In ocamllex, I can use _
as a lexer rule to match any string that does not match previously defined rules, and raise errors. How can achieve this in lex/flex?
Typically, you would define a rule like this, which would go at the very end:
.|\n { /* process default here */ }
This rule will match any character that wasn't matched by any other rule.
Hope this helps!
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