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
In the following small grammar, we have a compile warning for which I see no reason.
It looks to me it is a bug (well, I found this while building a very big set of test cases for JavaCC)..
Any idea? TIA. Marc
TOKEN :
{
< a : "a" >
| < bB : "b" ("B")* >
}
int one_line() : {}
{
p1() p2() p3() ";" { return 0; }
| ";" { return 1; }
}
void p1() : {}
{ < ID1 : < bB > < a > > { System.out.println("got ID1"); } }
// here we have a JJ compile warning: ... Regular Expression choice : bB can never be matched as : ID2
// Why? We don't have it in p4() with the direct formulation nor in p3() when not single in the choice
void p2() : {}
{ < ID2 : < bB > | "c" > { System.out.println("got ID2"); } }
void p3() : {}
{ < ID3 : < bB > "!" | "c" > { System.out.println("got ID3"); } }
void p4() : {}
{ < ID4 : "b" ("B")* | "c" > { System.out.println("got ID4"); } }
Following is the remaining of the grammar, if someone wants to test.
Running the test cases shows that the parser does not accept the input corresponding to the warning.
In the following small grammar, we have a compile warning for which I see no reason.
It looks to me it is a bug (well, I found this while building a very big set of test cases for JavaCC)..
Any idea? TIA. Marc
Following is the remaining of the grammar, if someone wants to test.
Running the test cases shows that the parser does not accept the input corresponding to the warning.
The text was updated successfully, but these errors were encountered: