On 10/12/11 9:04 PM, "Ruslan Zasukhin" <ruslan_zasuk...@valentina-db.com> wrote:
> Hi All, Terrence, Jim, > > I have review FAQs, other docs and list ... > But sop far cannot find isolated advices/tips of kind > > > * Tend develop grammar as k=1 > AVOID to use k=*, because this is slower ... > > OR reverse > > * No problems to use k=* > Always prefer to use k=* and do not worry ... Speed will be fine.. > > OR > > * always tend to (not)? Use backtrack option. > and if you use it then use memoize also ... > > > In the ANTLR3/Examples/C I see options as > > > ==================== > grammar C; > > options > { > backtrack = true; > memoize = true; > k = 2; > language = C; > } > ==================== > > > But what is official point of view at current state ? In that C grammar also present comment /** Either a function definition or any other kind of C decl/def. * The LL(*) analysis algorithm fails to deal with this due to * recursion in the declarator rules. I'm putting in a * manual predicate here so that we don't backtrack over * the entire function. Further, you get a better error * as errors within the function itself don't make it fail * to predict that it's a function. Weird errors previously. * Remember: the goal is to avoid backtrack like the plague * because it makes debugging, actions, and errors harder. * * Note that k=1 results in a much smaller predictor for the * fixed lookahead; k=2 made a few extra thousand lines. ;) * I'll have to optimize that in the future. */ I wonder, if this already was optimized? Or still in the future? Should we also try to specify k=1 for most rules ? -- Best regards, Ruslan Zasukhin VP Engineering and New Technology Paradigma Software, Inc Valentina - Joining Worlds of Information http://www.paradigmasoft.com [I feel the need: the need for speed] 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 il-antlr-inter...@googlegroups.com. To unsubscribe from this group, send email to il-antlr-interest+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en.