A new method of generating LL(1) lookahead sets

  • Authors:
  • K. John Gough

  • Affiliations:
  • Queensland Institute of Technology, Brisbane, Australia

  • Venue:
  • ACM SIGPLAN Notices
  • Year:
  • 1985

Quantified Score

Hi-index 0.00

Visualization

Abstract

The purpose of this note is to draw attention to the existence of a new, efficient algorithm for generating the LL(1) lookaheads for the productions of a context-free grammar. The algorithm is related to a classical method, but forms the sets First() and Follow() directly, rather than first forming the inverses.The success of the method depends on the application of an algorithm which forms a set-union on the transitive closure of a relation. This algorithm is the same one used in the DeRemer and Pennello algorithm for generating the LALR lookaheads for bottom-up parsers.A fuller account of the algorithm and its implementation is available in a technical report, Gough [1984].