A new top-down parsing algorithm to accommodate ambiguity and left recursion in polynomial time

RA Frost, R Hafiz - ACM SIGPLAN Notices, 2006 - dl.acm.org
RA Frost, R Hafiz
ACM SIGPLAN Notices, 2006dl.acm.org
Top-down backtracking language processors are highly modular, can handle ambiguity, and
are easy to implement with clear and maintainable code. However, a widely-held, and
incorrect, view is that top-down processors are inherently exponential for ambiguous
grammars and cannot accommodate left-recursive productions. It has been known for many
years that exponential complexity can be avoided by memoization, and that left-recursive
productions can be accommodated through a variety of techniques. However, until now …
Top-down backtracking language processors are highly modular, can handle ambiguity, and are easy to implement with clear and maintainable code. However, a widely-held, and incorrect, view is that top-down processors are inherently exponential for ambiguous grammars and cannot accommodate left-recursive productions. It has been known for many years that exponential complexity can be avoided by memoization, and that left-recursive productions can be accommodated through a variety of techniques. However, until now, memoization and techniques for handling left recursion have either been presented independently, or else attempts at their integration have compromised modularity and clarity of the code.
ACM Digital Library