Knuth'sLR(1) parsing algorithm is sufficiently general to handle the parsing of most programming languages with the additional benefit of earlier detection of syntax errors than in other formal methods used in compilers. The major obstacle impeding the use of this algorithm is the large space requirement for parsing tables. In addition, certain optimisations described here, which increase parsing speed, exacerbate the space problem.
Using parsers related to theLR(1) parser which parse a large subset of theLR(1) grammars, but which have much smaller parsing tables.
Devising compact encodings and performing space optimisations on these tables.
Time and space efficiency is evaluated using the Stanford University Algol W compiler as a base for comparison since the parsing routine in this compiler is among the more efficient presently used.
KeywordsEarly Detection Computational Mathematic Computer System System Organization Programming Language
Unable to display preview. Download preview PDF.
- Anderson, T.: Syntactic analysis ofLR(k) languages. Ph. D. Thesis (1972), University of Newcastle upon Tyne.Google Scholar
- DeRemer, F. L.: Practical translators forLR(k) languages. Ph.D.Thesis 1969, Department of Electrical Engineering, M.I.T.Google Scholar
- DeRemer, F. L.: SimpleLR(k) grammars. CACM14, 453–460 (1971).Google Scholar
- Earley, J.: An efficient context free parsing algorithm. CACM13, 94–102 (1970).Google Scholar
- Feldman, J. R., Gries, D.: Translator writing systems. CACM11, 77–113 (1968).Google Scholar
- Knuth, D. E.: On the translation of languages from left to right. Information and Control8, 607–639 (1965).Google Scholar
- Korenjak, A.: A practical method for constructingLR(k) processors. CACM12, 613–623 (1969).Google Scholar
- Lalonde, W.R.: An efficient LALR parser generator. Tech. Rep. CSRG-2 (1971), University of Toronto.Google Scholar
- Lewis, P.M., Stearns, R.E.: Syntax directed transduction. JACM15, 465–488 (1968).Google Scholar
- McKeeman, W.M., Horning, J.J., Wortman, D.B.: A compiler generator. Prentice Hall 1970.Google Scholar
- Pager, D.: A solution to an open problem by Knuth. Information and Control14, 462–473 (1970).Google Scholar
- Wirth, N.: PL 360, a programming language for the 360 computers. JACM15, 37–74 (1968).Google Scholar
- Wirth, N., Hoare, C.A.R.: A contribution to the development ofAlgol. CACM9, 413–432 (1966).Google Scholar
- Wirth, N., Weber, H.:Euler: A generalisation ofAlgol, and its formal definition: Part I. CACM9, 13–23 (1966).Google Scholar