You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When no regular expression matches a character, lex and flex copy that character to the standard output.
Recently I learned that JFlex yylex() throws an exception when no regular expression matches a character.
This might be a feature and not a bug, but since it caused program termination with a cryptic error message
on a specification that flex would process to completion, maybe it is a bug. Is there a command line option
to get jflex to behave like flex, or better yet, can the default behavior be like flex and the exception be available
as a command line option?
Cheers
Clint Jeffery
The text was updated successfully, but these errors were encountered:
The behaviour is intentional. JFlex is not trying to be fully compatible with lex and flex, its heritage is more through JLex, which it does have a compatibility mode for.
It usually doesn't make sense in Java for a scanner to interact with System.out without that being explicitly requested, but you can use %standalone in the options part of the scanner spec for getting this particular lex/flex behaviour. This option also declares a main method so that scanner can be run from the command line.
Hi,
When no regular expression matches a character, lex and flex copy that character to the standard output.
Recently I learned that JFlex yylex() throws an exception when no regular expression matches a character.
This might be a feature and not a bug, but since it caused program termination with a cryptic error message
on a specification that flex would process to completion, maybe it is a bug. Is there a command line option
to get jflex to behave like flex, or better yet, can the default behavior be like flex and the exception be available
as a command line option?
Cheers
Clint Jeffery
The text was updated successfully, but these errors were encountered: