Hi,

I just ran into something a little odd. I'm using @init actions in some 
parser rules to stack some information and @after to pop it again. In 
the generated Java code, the @after action gets wrapped in an "if ( 
state.backtracking==0 ) {...}", so that it only gets executed when other 
actions are being executed, not during lookahead. This is what I 
expected. But I noticed that the @init actions are executed 
unconditionally, including during lookahead. I didn't expect this. The 
result was a lot of junk on the stack when it went into a dfa. The fix 
was easy enough, just checking state.backtracking myself. But I was 
wondering if this is an Antlr bug or if it's supposed to work this way.

Ron

-- 
Ron Hunter-Duvar | Software Developer V | 403-272-6580
Oracle Service Engineering
Gulf Canada Square 401 - 9th Avenue S.W., Calgary, AB, Canada T2P 3C5

All opinions expressed here are mine, and do not necessarily represent
those of my employer.


List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: 
http://www.antlr.org/mailman/options/antlr-interest/your-email-address

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to