I've just read the book. I do understand what backtracking means now (and memoize), and that it means that it automatically inserts predicates before every rule production that it can't disambiguate. It just so happens that at least one of them has an argument.
Chuck > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Doucette, Charles > Sent: Tuesday, September 16, 2008 10:22 AM > To: Antlr > Subject: Re: [antlr-interest] automatically generated > syntatic predicates become semantic predicates (fragments) > plus arguments generate parser which doesn't compile > > Sorry - that was sent prematurely: > > Here are my grammar options. > I don't completely understand what they mean. > I inherited them when I started with a Java grammar. > > options { > k=2; > backtrack=true; > memoize=true; > // output=AST; > } > > When I tried to remove them and use the default options - I > did get many errors and warnings. > I guess I have to follow your suggested tutorial to remove > backtracking? > > I didn't explicitly use arguments and predicates. ANTLR > automatically generated the predicates for me; probably based > on my grammar options above. > > > > > > It's a user bug. Arguments and predicates don't mix. Use scopes > > > instead like this. > > > > > > rule a > > > scope { > > > int i; > > > } > > > : (pred)=> y {$a::i = 3;} > > > ; > > Thanks, > Chuck > > List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest > Unsubscribe: > http://www.antlr.org:8080/mailman/options/antlr-interest/your- > email-address > > List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org:8080/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 -~----------~----~----~----~------~----~------~--~---
