Re: Empty token sequence
- From: AC <user@xxxxxxxxxxxxxx>
- Date: Thu, 30 Aug 2007 08:52:16 -0400
Cesare Zecca wrote:
Warning: Line 153, Column 9: This choice can expand to the empty
token sequence and will therefore always be taken in favor of the
choices appearing later.
javacc complains that within Factro() non terminal the Id() might be
choosen to the detriment of the following choice (GroupId())
In this case the problem is in Factor: all the calls are erroneously
inside java code sections, so to JavaCC it looks like Factor calls no
productions or tokens.
----------
String
Factor() :
{
Token lToken;
String lResult;
}
{
{
lResult = Id(); // bug: inside {javacode}
return lResult;
}
| {
lResult = GroupId(); // bug: inside {javacode}
return lResult;
}
} // end Gpl.Factor()
----------
String
Factor() :
{
Token lToken;
String lResult;
}
{
lResult = Id() // fix: outside {javacode}
{ return lResult; }
|
lResult = GroupId() // fix: outside {javacode}
{ return lResult; }
} // end Gpl.Factor()
----------
Hope this helps!
.
- Follow-Ups:
- Re: Empty token sequence
- From: Cesare Zecca
- Re: Empty token sequence
- References:
- Emtpy token sequence
- From: Cesare Zecca
- Emtpy token sequence
- Prev by Date: Emtpy token sequence
- Next by Date: Re: Empty token sequence
- Previous by thread: Emtpy token sequence
- Next by thread: Re: Empty token sequence
- Index(es):
Relevant Pages
|
|