[DGD] Working with parse_string()

Felix A. Croes felix at dworkin.nl
Tue Jul 21 14:29:12 CEST 2009


Shentino <shentino at gmail.com> wrote:

>[...]
> > Adding rules to handle common errors is what you should do.  Though it
> > may work for some grammars, in general you can't depend on diagnostic
> > information gathered in LPC functions called by parse_string(), since
> > several functions may be called for the same tokens as the parser tries
> > to fit them to different rules, and there is no guarantee that the last
> > function called is the most informative one.
>
>
> Are there any guarantees about which order they will be called in?

Tell you what -- why don't you come up with an order in which functions
should be called that takes into account the order of rules in the
grammar, recursion and ambiguity, and then I'll let you know if it is
the one that parse_string() uses.

Regards,
Felix Croes



More information about the DGD mailing list