Introducing fixed-point iteration early in a compiler course

  • Authors:
  • Max Hailperin

  • Affiliations:
  • Gustavus Adolphus College, St. Peter, MN

  • Venue:
  • SIGCSE '97 Proceedings of the twenty-eighth SIGCSE technical symposium on Computer science education
  • Year:
  • 1997

Quantified Score

Hi-index 0.01

Visualization

Abstract

When teaching a course in compiler design, it is conventional to introduce the iterative calculation of least fixed points quite late in the course, in the guise of iterative data-flow analysis. In this paper I point out that the same mathematical and algorithmic ideas can be introduced much earlier, in the parsing portion of the course, as an explanation of the standard algorithm for computing the First sets of a context-free grammar. Doing so not only renders these techniques more familiar when they re-appear in data-flow analysis, it also provides a more sound foundation for the First algorithm than is typically offered. Moreover, these techniques deserve increased curricular prominence because they naturally lead to proofs of correctness for general non-deterministic algorithms that subsume multiple deterministic algorithms.