Efficient Computation of LALR(1) Look-Ahead Sets

86Citations
Citations of this article
9Readers
Mendeley users who have this article in their library.
Get full text

Abstract

Two relations that capture the essential structure of the problem of computing LALR(1) look-ahead sets are defined, and an efficient algorithm is presented to compute the sets in time linear in the size of the relations. In particular, for a PASCAL grammar, the algorithm performs fewer than 15 percent of the set unions performed by the popular compiler-compiler YACC. When a grammar is not LALR(1), the relations, represented explicitly, provide for printing useroriented error messages that specifically indicate how the look-ahead problem arose. In addition, certain loops in the digraphs induced by these relations indicate that the grammar is not LR(k) for any k. Finally, an oft-discovered and used but incorrect look-ahead set algorithm is similarly based on two other relations defined for the fwst time here. The formal presentation of this algorithm should help prevent its rediscovery. © 1982, ACM. All rights reserved.

Cite

CITATION STYLE

APA

DeRemer, F., & Pennello, T. (1982). Efficient Computation of LALR(1) Look-Ahead Sets. ACM Transactions on Programming Languages and Systems (TOPLAS), 4(4), 615–649. https://doi.org/10.1145/69622.357187

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free