Skip to main content
Log in

SLR(1) and LALR(1) parsing for unrestricted grammars

  • Published:
Acta Informatica Aims and scope Submit manuscript

Summary

Simple LR(1) and lookahead LR(1) phrase structure grammars are defined and corresponding deterministic two-pushdown automata which parse all sentences are given. These grammars include a wide variety of grammars for non context-free languages. A given phrase structure grammar is one of these types if the parse table for the associated automaton has no multiple entries. A technique for construction of this parse table is given which in the lookahead case involves elimination of inverses in a grammar for lookahead strings for LR(0) items and computation of first sets for strings of symbols in the given grammar.

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

Access this article

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, vols. I & II. Englewood Cliffs, N.J.: Prentice-Hall 1972

    Google Scholar 

  2. Aho, A.V., Ullman, J.D.: Principles of compiler design. Reading, Mass.: Addison-Wesley 1977

    Google Scholar 

  3. Ancona, M., Dodero, G., Gianuzzi, V.: Building collections of LR(k) items with partial expansion of lookahead strings. ACM SIGPLAN Notices 17, (4), 25–28 (1982)

    Google Scholar 

  4. Barth, G.: Fast recognition of context-sensitive structures. Computing 22, 243–256 (1979)

    Google Scholar 

  5. Buttelmann, H.W.: On the syntactic structures of unrestricted grammars, I & II. Inf. Control 29, 29–101 (1975)

    Google Scholar 

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

    Google Scholar 

  7. Early, J.: An efficient context-free parsing algorithm. Commun. ACM 13, 94–102 (1970)

    Google Scholar 

  8. Eickel, J., Paul, M.: The parsing and ambiguity problem for Chomsky-languages. Proceedings of the IFIP Working Conference on Formal Language Description Languages, Steel, T.B. (ed.), pp. 52–75. Amsterdam: North-Holland 1966

    Google Scholar 

  9. Fisher, A.J.: Practical LL(1)-based parsing of van Wijngaarden grammars. Acta Inf. 21, 559–584 (1985)

    Google Scholar 

  10. Griffiths, T.V.: Some remarks on derivations in general rewriting systems. Inf. Control 12, 27–54 (1968)

    Google Scholar 

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

    Google Scholar 

  12. Kunze, M.: Grammars for efficient non-context-free parsing. Conference on Information Sciences and Systems, University of Patras, Greece, 1979, Lainiotis, D.G., Tzannes, N.S., (eds.), Applications of information and control systems, pp. 217–225. Dordrecht-Boston-London: D. Reidel 1980

    Google Scholar 

  13. Loeckx, J.: The parsing for general phrase-structure grammars. Inf. Control 16, 443–464 (1970)

    Google Scholar 

  14. Mayer, O.: On deterministic canonical bottom-up-parsing. Inf. Control 43, 280–303 (1979)

    Google Scholar 

  15. Mickunas, M.D., Lancaster, R.L., Schneider, V.B.: Transforming LR(k) grammars to LR(1), SLR(1), and (1,1) bounded right-context grammars. J. ACM 23, 511–553 (1976)

    Google Scholar 

  16. Revesz, G.E.: Introduction to formal languages. New York: McGraw-Hill 1983

    Google Scholar 

  17. Sebesta, R.W., Jones, N.D.: Parsers for indexed grammars. Int. J. Comput. Inf. Sci. 7, 345–359 (1978)

    Google Scholar 

  18. Turnbull, C.J.M., Lee, E.S.: Generalized deterministic left to right parsing. Acta Inf. 12, 187–207 (1979)

    Google Scholar 

  19. Vold'man, G.Sh.: A parsing algorithm for context-sensitive grammars. Program. Comput. Software 7, 302–307 (1981)

    Google Scholar 

  20. Walters, D.A.: Deterministic context-sensitive languages, I & II. Inf. Control 17, 14–61 (1970)

    Google Scholar 

  21. Wegner, L.M.: On parsing two-level grammars. Acta Inf. 14, 175–193 (1980)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Harris, L.A. SLR(1) and LALR(1) parsing for unrestricted grammars. Acta Informatica 24, 191–209 (1987). https://doi.org/10.1007/BF00264364

Download citation

  • Received:

  • Issue Date:

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

Keywords

Navigation