ACM Home Page
Please provide us with feedback. Feedback
Efficient construction of LR(k) states and tables
Full text PdfPdf (1.57 MB)
Source ACM Transactions on Programming Languages and Systems (TOPLAS) archive
Volume 13 ,  Issue 1  (January 1991) table of contents
Pages: 150 - 178  
Year of Publication: 1991
ISSN:0164-0925
Authors
M. Anicona  Univ. di Genova, Genoa, Italy
G. Dodero  Univ. di Genova, Genoa, Italy
V. Gianuzzi  Univ. di Genova, Genoa, Italy
M. Morgavi  Univ. di Genova, Genoa, Italy
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 2,   Downloads (12 Months): 48,   Citation Count: 2
Additional Information:

abstract   references   cited by   index terms   review   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/114005.102809
What is a DOI?

ABSTRACT

A new method for building LR(k) states and parsing tables is presented. The method aims at giving a feasible construction of a collection of LR(k) parsing tables, especially when k > 1. for nontrivial grammars. To this purpose, the algorithm first attempts to build a set of normal states for the given grammar, each one associated to a single parsing action in {accept, reduce, shift}. When such an action cannot be uniquely determined, that is, when up to k input symbols have to be examined (inadequacy), further states, belonging to a new type, called look-ahead states, are computed. The action associated with inadequate states is a new parsing action, look. States are built without actual computation of the FIRSTk and EFFk functions; that is, nonterminals are kept in the context string of items composing each state, and their expansion to terminals is deferred until indispensable to solve inadequacy. The aforementioned method is illustrated; then the canonical collection of states and the canonical tables are compared with those obtained from the proposed method. A sufficient condition is stated, by which the size of parsing tables, obtained by applying this new method, is smaller than that of canonical tables. Experimental results show that such a condition is verified by the grammars of several programming languagues and that significant speed is gained by avoiding the computation of the FIRSTk function.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
1
 
2
3
 
4
ANCONA, M., FASSINO, C., AND GIANUZZI, V. Optimization of LR(k) reduced tables. Tech. Rep. 39/88, IMA-CNR, Genoa, Italy, 1988.
 
5
ANCONA, M., AND GIANUZZI V. Implementation of reduced LR(k) tables when k > 1. Tech. Rep. 47, IMA-CNR, Genoa, Italy, 1980.
 
6
ANCONA, M., AND GIANUZZI, V. A new method for implementing LR(k) tables. Inf. Process. Lett. 13, 4 and 5 (1981), 171-176.
7
 
8
CULIK, C., AND COHEN, R. LR-regular grammars-An extension of LR(k) grammars. J. Comput. Syst. Sci. 7 (1973), 66-96.
9
 
10
 
11
JOHNSON, S.C. YACC--Yet another compiler compiler. Computing Science Tech. Rep. 32, AT&T Bell Laborafories. Murray Hill. N.J.. 1975.
 
12
KNUTtt, D.E. On the translation of languages from left to right. Inf. Control 8 (1965), 607-639.
 
13
MCKEEMAN, W. M., HORNING, J. J., AND WORTMAN, D.B. A Compiler Generator. Prentice- Hall, Englewood Cliffs, N.J., 1974.
 
14
MORGAVI, M. An algorithm to build sets of states and parsing tables for LR(k) grammars lin
 
15
SEITE, B. A YACC extension for LRR grammar parsing. Ph.D. dissertation. INRIA, France, 1986.
16
 
17



REVIEW

"Marian Gheorghe : Reviewer"

The authors present a new method for building LR(k) parsing tables, called reduced tables, and the associated reduced parser (a shift-reduce parsing algorithm) driven by these tables. The reduced tables are o  more...

Collaborative Colleagues:
M. Anicona: colleagues
G. Dodero: colleagues
V. Gianuzzi: colleagues
M. Morgavi: colleagues