skip to main content
10.1145/512927.512929acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
Article
Free Access

Strict deterministic versus LR(0) parsing

Published:01 October 1973Publication History

ABSTRACT

Recently strict deterministic grammars and languages have been introduced [9,10,11]. This family of languages is quite fundamental in the study of the mathematical properties of deterministic languages and in dealing with some classical families of grammars such as LR(k) and bounded right context grammars [7,8,14]. These grammars are closely related to LR(0) grammars [1,12,13,14], in fact each strict deterministic grammar is also LR(0). In the present paper, we consider the question of how to parse strict deterministic grammars. We introduce part of a more general theory called "characteristic LR(k) parsing". This actually produces parsers which are tuned to the characteristics of a particular family of grammars. We apply the theory to the family of strict deterministic grammars and we get parsers which are as fast as canonical LR(k) parsers but are substantially smaller. They are not necessarily minimal but we postpone any discussion of minimality to the sequel.The techniques used in the present discussion are quite general [5]. For instance, the study in [3] is similar in spirit to our technique. The optimization techniques for LR(k) parsers in [2] do not work in the case k = 0 without modification. After modifying those methods for k = 0, it can be shown that our parsers cannot be produced by those techniques. This fact has its positive aspect in that our parsers may be smaller and its negative aspect in that error detection may be delayed.The present paper is divided into the present introduction and three sections. In the remainder of this introduction, some basic definitions of strict deterministic and LR(k) parsing are given. We have tried to follow [1] as much as possible in order to minimize the amount of new material to be absorbed. The order of the results is the order needed to prove that the characteristic parser works. In Section III, we apply the theory of Section II to strict deterministic parsing. A simple example shows that the new parsers can be unboundedly smaller than the canonical LR(0) parser.The present paper is meant to be an extended abstract and no proofs are included.The rest of the introduction is concerned with notational conventions for the technical concepts needed.

References

  1. Aho, A. V. and Ullman, J. D. , The Theory of of Parsing, Translating, and Compiling, Vols. I and II, Prentice Hall, Englewood Cliffs, New Jersey, 1972, and 1973. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Aho, A. V. and Ullman, J. D. , "Optimization of LR(k) Parsers", Journal of Computer and System Sciences, Vol. 6, pp 573-602, 1972.Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. El Djabri, N., "Extending the LR Parsing Technique to Some Non-LR Grammars", Technical Report TR-121, Computer Science Laboratory, Princeton University, 1973.Google ScholarGoogle Scholar
  4. Floyd, R. W., "Nondeterministic Algorithms", Journal of the Association for Computing Machinery, Vol. 14, pp 636-644, 1967. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Geller, M. M., "Characteristic LR(k) Parsing", Ph.D. Thesis (in preparation), Computer Science Department, University of California, Berkeley, 1973.Google ScholarGoogle Scholar
  6. Geller, M. M. and Harrison, M. A., "Characterizations of LR(0) Languages", Fourteenth Annual Symposium on Switching and Automata Theory, 1973.Google ScholarGoogle Scholar
  7. Graham, S. L., "Extended Precedence, Bounded Right Context Languages and Deterministic Languages", Proceedings of Symposium on Switching and Automata Theory, pp 175-180, 1970.Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Graham, S. L., "Precedence Languages and Bounded Right Context Languages ", Ph.D. Thesis and Technical Report CS-71 -- 233, Department of Computer Science, Stanford University, 1970. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Harrison, M. A., and Havel, I. M., "Strict Deterministic Grammars", Journal of Computer and Systems Science, Vol. 7 pp 237-277, 1973.Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Harrison, M. A., and Havel, I. M., "On the Parsing of Deterministic Languages", submitted for publication.Google ScholarGoogle Scholar
  11. Harrison, M. A., and Havel, I. M., "Real-time Strict Deterministic Languages", SIAM Journal of Computing, Vol. 1, pp 333-Google ScholarGoogle ScholarCross RefCross Ref
  12. Kemp, R., "LR(k) Analysatoren", Technical Report A73/02, Mathematisches Institut und Institut für Angemandte Mathematik, Universitat des Saarlandes, Saarbrucken, Germany, 1973.Google ScholarGoogle Scholar
  13. Kemp, R., "An Estimation of the Set of States of the Minimal LR(0)-Acceptor", in Automata, Languages and Programming, (M.Nivat, editor) North Holland Publishing Co., Amsterdam, pp 563-574, 1973.Google ScholarGoogle Scholar
  14. Knuth, D. E., "On the Translation of Languages from Left to Right", Information and Control, Vol. 8, pp 607-639, 1965.Google ScholarGoogle ScholarCross RefCross Ref
  1. Strict deterministic versus LR(0) parsing

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      POPL '73: Proceedings of the 1st annual ACM SIGACT-SIGPLAN symposium on Principles of programming languages
      October 1973
      242 pages
      ISBN:9781450373494
      DOI:10.1145/512927

      Copyright © 1973 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 1 October 1973

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • Article

      Acceptance Rates

      POPL '73 Paper Acceptance Rate22of100submissions,22%Overall Acceptance Rate824of4,130submissions,20%

      Upcoming Conference

      POPL '25

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader