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.
Similar content being viewed by others
References
Aho, A.V., Ullman, J.D.: The theory of parsing, translation, and compiling, vols. I & II. Englewood Cliffs, N.J.: Prentice-Hall 1972
Aho, A.V., Ullman, J.D.: Principles of compiler design. Reading, Mass.: Addison-Wesley 1977
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)
Barth, G.: Fast recognition of context-sensitive structures. Computing 22, 243–256 (1979)
Buttelmann, H.W.: On the syntactic structures of unrestricted grammars, I & II. Inf. Control 29, 29–101 (1975)
DeRemer, F.L.: Practical translators for LR(k) languages. MIT, Cambridge, Mass., Project MAC Report TR-65, 1969
Early, J.: An efficient context-free parsing algorithm. Commun. ACM 13, 94–102 (1970)
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
Fisher, A.J.: Practical LL(1)-based parsing of van Wijngaarden grammars. Acta Inf. 21, 559–584 (1985)
Griffiths, T.V.: Some remarks on derivations in general rewriting systems. Inf. Control 12, 27–54 (1968)
Knuth, D.E.: On the translation of languages from left to right. Inf. Control 8, 607–639 (1965)
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
Loeckx, J.: The parsing for general phrase-structure grammars. Inf. Control 16, 443–464 (1970)
Mayer, O.: On deterministic canonical bottom-up-parsing. Inf. Control 43, 280–303 (1979)
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)
Revesz, G.E.: Introduction to formal languages. New York: McGraw-Hill 1983
Sebesta, R.W., Jones, N.D.: Parsers for indexed grammars. Int. J. Comput. Inf. Sci. 7, 345–359 (1978)
Turnbull, C.J.M., Lee, E.S.: Generalized deterministic left to right parsing. Acta Inf. 12, 187–207 (1979)
Vold'man, G.Sh.: A parsing algorithm for context-sensitive grammars. Program. Comput. Software 7, 302–307 (1981)
Walters, D.A.: Deterministic context-sensitive languages, I & II. Inf. Control 17, 14–61 (1970)
Wegner, L.M.: On parsing two-level grammars. Acta Inf. 14, 175–193 (1980)
Author information
Authors and Affiliations
Rights 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
Received:
Issue Date:
DOI: https://doi.org/10.1007/BF00264364