[DGD] Reasonable Tick Counts?
Felix A. Croes
felix at dworkin.nl
Sat Jul 14 03:48:19 CEST 2007
Shentino <shentino at gmail.com> wrote:
> Actually, having 1 real token, plus a nomatch, might be MORE efficient
> than two explicit tokens. With nomatch, all the parser needs to try
> is the first one, and if it doesn't work, it can default to nomatch by
> process of elimination...whereas with TWO token rules, it has to try
> them both, and if it doesn't match either it bombs out with a runtime
> error.
Trying them both isn't any slower than trying the longest of the two,
whereas a nomatch token will attempt the longest possible match, and
then fail. The reason nomatch is less efficient is that it involves
reprocessing input that otherwise would be processed only once.
Regards,
Dworkin
More information about the DGD
mailing list