Springer Nature is making SARS-CoV-2 and COVID-19 research free View research | View latest news | Sign up for updates

Eliminating unit reductions from LR(k) parsers using minimum contexts

  • 19 Accesses

  • 1 Citations


This paper presents a new approach to the design and the proof of bypassed LR(k) parsers; a bypassed LR(k) parser is an LR(k) parser which does not perform any reductions caused by insignificant unit productions. We show that bypassed LR(k) parsers having minimum set of reduction contexts always exist for Knuth LR(k) parsers, but do not necessarily exist for SLR(k) and LALR(k) parsers. As byproducts of our approach, we naturally derive Anderson, Eve and Homing's algorithm [5] and a sufficient condition for the existence of bypassed SLR(1) parsers.

This is a preview of subscription content, log in to check access.


  1. 1.

    Aho, A.V., Ullman, J.D.: The theory of parsing, translation, and compiling, Vol. 1–2. Englewood Cliffs N.J.: Prentice-Hall 1972, 1973

  2. 2.

    Aho, A.V., Ullman, J.D.: A technique for speeding up LR(k) parsers. SIAM J. Comput. 2, 106–127 (1973)

  3. 3.

    Aho, A.V., Ullman, J.D.: Principle of compiler design. Reading Mass.: Prentice-Hall 1977

  4. 4.

    Anderson, T.: Syntactic analysis of LR(k) languages. Ph. D. Thesis, Univ. of Newcastle upon Tyne, Computing Lab. 1972

  5. 5.

    Anderson, T., Eve, J., Horning, J.J.: Efficient LR(1) parsers. Acta Informat. 2, 12–39 (1973)

  6. 6.

    Backhouse, R.C.: An alternative approach to the improvement of LR(k) parsers. Acta Informat. 6, 277–296 (1976)

  7. 7.

    Demers, A.J.: Skeletal LR parsing. Proc. 15th IEEE Symposium on Switching and Automata Theory, 185–198 (1974)

  8. 8.

    Demers, A.J.: Elimination of single productions and merging nonterminal symbols of LR(1) grammars. Comput. Lang. 1, 105–119 (1975)

  9. 9.

    DeRemer, F.L.: Practical translators for LR(k) languages. Mass. Inst. of Tech., Cambridge (Mass.), Project MAC, Tech. Report MAC TR-65, 1969

  10. 10.

    DeRemer, F.L.: Simple LR(k) grammars. Comm. ACM 14, 453–460 (1971)

  11. 11.

    DeRemer, F.L., Pennello, J.J.: Efficient computation of LALR(1) look-ahead sets. Proc. ACM Symposium on Compiler Construction, 176–87 (1979)

  12. 12.

    Joliat, M.L.: A simple technique for partial elimination of unit productions from LR(k) parsers. IEEE Trans. Computers C-25, 763–764 1976)

  13. 13.

    Knuth, D.E.: On the translation of languages from left to right. Information and Control 8, 607–639 (1965)

  14. 14.

    Korenjak, A.J.: A practical method for constructing LR(k) processors. Comm. ACM 12, 613–623 (1969)

  15. 15.

    Koskimies, K., Soisalon-Soininen, E.: On a method for optimizing LR parsers. Internat. J. Comput. Math. 7, 287–295 (1979)

  16. 16.

    LaLonde, W.R.: An efficient LALR parser generator. Computer Systems Research Group, University of Toronto, Toronto, Tech. Report CSRG-2, 1971

  17. 17.

    LaLonde, W.R., Lee, E.S., Horning, J.J.: An LALR(k) parser generator, Proc. IFIP Congress 1971, Ljubljana, pp. 151–153, Amsterdam: North Holland, 1971

  18. 18.

    LaLonde, W.R.: On directly constructing LR(k) parsers without chain reductions. Proc. 3rd ACM Symposium on Principles of programming languages, pp. 127–133 (1976)

  19. 19.

    Pager, D.: On eliminating unit productions from LR(k) parsers. In: Loeckx, J. (ed.), Automata, languages and programming, 2nd Colloquium. Lecture Notes in Computer Science Vol. 14. Berlin-Heidelberg-New York: Springer 1974

  20. 20.

    Pager, D.: A practical general method for constructing LR(k) parsers. Acta Informat. 7, 249–268 (1977)

  21. 21.

    Pager, D.: Eliminating unit productions from LR parsers. Acta Informat. 9, 31–59 (1977)

  22. 22.

    Rushby, J.M.: LR(k) sparse-parsers and their optimization. Ph. D. Thesis, Univ. of Newcastle upon Tyne, Computing Lab. 1977

  23. 23.

    Soisalon-Soininen, E.: Elimination of single productions from LR parsers in conjunction with the use of default reductions. Proc. 4th ACM Symposium on Principles of Programming Languages, pp. 183–193 (1977)

  24. 24.

    Soisalon-Soininen, E.: On the space optimizing effect of eliminating single productions from LR parsers. Acta Informat. 14, 157–174 (1980)

  25. 25.

    Tokuda, T.: Eliminating unit reductions from LR(k) parsers using minimum contexts. Tokyo Inst. of Tech., Tokyo, Res. Report C-16, (1978) (Revised version C-29, 1980)

Download references

Author information

Rights and permissions

Reprints and Permissions

About this article

Cite this article

Tokuda, T. Eliminating unit reductions from LR(k) parsers using minimum contexts. Acta Informatica 15, 447–470 (1981). https://doi.org/10.1007/BF00264538

Download citation


  • Information System
  • Operating System
  • Data Structure
  • Communication Network
  • Information Theory