Hi Pascal,
I haven’t really gotten to the bottom of it yet, but it is some interaction between the presence of a negated character class and the negation operator.
If you need a work-around, changing the spec to the equivalent
EXP = [\u{0}-`b-\u{10FFFF}] [^]* [\u{0}-`b-\u{10FFFF}]
should make it work as expected (you can tell when jflex warns that the second action can never be matched).
Cheers,
Gerwin
> On 22 Oct 2019, at 02:50, Pascal HENNEQUIN <pas...@te...> wrote:
>
> hello,
> I found an issue with the negation operator "!"
> With the following specification, string "baba" is not matched
> by either EXP ou !EXP .
>
> Pascal Hennequin
>
>
> -------------------------------
> %%
> %standalone
> %{
> void ECHO(String cat) { System.out.print("["+cat+":"+yytext()+"]"); }
> %}
>
> EXP = ( [^a] [^]* [^a] )
> ALL = {EXP} | ! {EXP}
>
> %%
> {ALL} { ECHO("1"); }
> baba { ECHO("2"); }
> ---------------------------------
>
>
> --
> jflex-users mailing list
> https://lists.sourceforge.net/lists/listinfo/jflex-users
|