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

  • Authors:
  • Richard A. Frost;Rahmatullah Hafiz

  • Affiliations:
  • University of Windsor, Windsor, Ontario Canada ON;University of Windsor, Windsor, Ontario Canada ON

  • Venue:
  • ACM SIGPLAN Notices
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

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.