[antlr-interest] Submitting bug report?
Terence Parr
parrt at cs.usfca.edu
Fri Apr 20 12:02:48 PDT 2007
On Apr 20, 2007, at 11:47 AM, Terence Parr wrote:
> Hi. I have confirmed that this is a bug:
>
> http://www.antlr.org:8888/browse/ANTLR-113
>
> I know the issue. will fix soon.
Ok, fixed. Tweak Java.stg. Change this template:
/** A DFA state that is actually the loopback decision of a closure
* loop. If end-of-token (EOT) predicts any of the targets then it
* should act like a default clause (i.e., no error can be generated).
* This is used only in the lexer so that for ('a')* on the end of a
rule
* anything other than 'a' predicts exiting.
*/
dfaLoopbackState
(k,edges,eotPredictsAlt,description,stateNumber,semPredState) ::= <<
int LA<decisionNumber>_<stateNumber> = input.LA(<k>);<\n>
<edges; separator="\nelse "><\n>
<if(eotPredictsAlt)>
<if(!edges)>
alt<decisionNumber>=<eotPredictsAlt>; <! if no edges, don't need else !>
<else>
else {
alt<decisionNumber>=<eotPredictsAlt>;
}<\n>
<endif>
<endif>
>>
It now avoids an ELSE if no edges.
Ter
More information about the antlr-interest
mailing list