Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RE: Partially handwritten parsers

1 view
Skip to first unread message

Lowell Thomas

unread,
Jun 19, 2009, 11:19:09 AM6/19/09
to
John wrote:
>[How often is the parser a significant part of a program's runtime? The
>scanner is usually much slower. -John]

The tests that I have been doing use scannerless parsing but the larger
issue you are raising, that parsing is often not the bottleneck of the
application, is no doubt valid. But being relatively new to the business, my
motivation for building a better mousetrap is still a natural curiosity.

Quinn Tyler Jackson wrote:

>Before descending into a rule, first peek ahead one character to see if a
>match is even possible.
>OK, now my point: in a generated parser, these look aheads can be generated
>based on the grammar.

Thanks for your comments. Just googling up "Adapting to Babel" has given me
much to chew on. But just to comment on your look ahead idea, actually I
tried this in an earlier version, using compile-time-generated predictive
parsing tables. It did lead to improved parsing time factors of 2-4 (mostly
2). Nice, but not the kind of improvement I was hoping for.

If anyone is interested, you can take a look or try it yourself. It also has
some new features for AST construction and traversal and some improved
tracing/debugging features. Its free (GLP) and available as APG Version 6.0
from my website.

Thanks,
Lowell Thomas
www.coasttocoastresearch.com
low...@coasttocoastresearch.com

0 new messages