Skip to main content
Log in

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

  • Published:
Acta Informatica Aims and scope Submit manuscript

Summary

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 via an institution to check access.

Access this article

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  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

    Google Scholar 

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

    CAS  PubMed  Google Scholar 

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

    Google Scholar 

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

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

    Google Scholar 

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

    Google Scholar 

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

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

    Google Scholar 

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

    Google Scholar 

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

    Google Scholar 

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

    Google Scholar 

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

    Google Scholar 

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

    Google Scholar 

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

    Google Scholar 

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

    Google Scholar 

  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

    Google Scholar 

  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. 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

    Google Scholar 

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

    Google Scholar 

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

    Google Scholar 

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

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

    Google Scholar 

  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)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

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

  • Received:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF00264538

Keywords