Predictive Shift-Reduce Parsing for Hyperedge Replacement Grammars

  • Frank Drewes
  • Berthold Hoffmann
  • Mark MinasEmail author
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10373)


Graph languages defined by hyperedge replacement grammars can be NP-complete. We study predictive shift-reduce (PSR) parsing for a subclass of these grammars, which generalizes the concepts of SLR(1) string parsing to graphs. PSR parsers run in linear space and time. In comparison to the predictive top-down (PTD) parsers recently developed by the authors, PSR parsing is more efficient and more general, while the required grammar analysis is easier than for PTD parsing.


Hyperedge replacement grammar Graph parsing Grammar analysis 


  1. 1.
    Aalbersberg, I., Ehrenfeucht, A., Rozenberg, G.: On the membership problem for regular DNLC grammars. Discrete Appl. Math. 13, 79–85 (1986)MathSciNetCrossRefzbMATHGoogle Scholar
  2. 2.
    Chiang, D., Andreas, J., Bauer, D., Hermann, K.M., Jones, B., Knight, K.: Parsing graphs with hyperedge replacement grammars. In: Proceedings of the 51st Annual Meeting of the Association for Computational Linguistic. Long Papers, vol. 1, pp. 924–932 (2013)Google Scholar
  3. 3.
    Costagliola, G., De Lucia, A., Orefice, S., Tortora, G.: A parsing methodology for the implementation of visual systems. IEEE Trans. Softw. Eng. 23, 777–799 (1997)CrossRefGoogle Scholar
  4. 4.
    DeRemer, F.L.: Simple LR(k) grammars. Commun. ACM 14(7), 453–460 (1971)MathSciNetCrossRefzbMATHGoogle Scholar
  5. 5.
    Drewes, F.: Recognising \(k\)-connected hypergraphs in cubic time. Theor. Comput. Sci. 109, 83–122 (1993)MathSciNetCrossRefzbMATHGoogle Scholar
  6. 6.
    Drewes, F., Hoffmann, B.: Contextual hyperedge replacement. Acta Informatica 52, 497–524 (2015)MathSciNetCrossRefzbMATHGoogle Scholar
  7. 7.
    Drewes, F., Hoffmann, B., Minas, M.: Contextual hyperedge replacement. In: Schürr, A., Varró, D., Varró, G. (eds.) AGTIVE 2011. LNCS, vol. 7233, pp. 182–197. Springer, Heidelberg (2012). doi: 10.1007/978-3-642-34176-2_16 CrossRefGoogle Scholar
  8. 8.
    Drewes, F., Hoffmann, B., Minas, M.: Predictive top-down parsing for hyperedge replacement grammars. In: Parisi-Presicce, F., Westfechtel, B. (eds.) ICGT 2015. LNCS, vol. 9151, pp. 19–34. Springer, Cham (2015). doi: 10.1007/978-3-319-21145-9_2 CrossRefGoogle Scholar
  9. 9.
    Drewes, F., Hoffmann, B., Minas, M.: Approximating Parikh images for generating deterministic graph parsers. In: Milazzo, P., Varró, D., Wimmer, M. (eds.) STAF 2016. LNCS, vol. 9946, pp. 112–128. Springer, Cham (2016). doi: 10.1007/978-3-319-50230-4_9 CrossRefGoogle Scholar
  10. 10.
    Franck, R.: A class of linearly parsable graph grammars. Acta Informatica 10(2), 175–201 (1978)MathSciNetCrossRefzbMATHGoogle Scholar
  11. 11.
    Habel, A.: Hyperedge Replacement: Grammars and Languages. LNCS, vol. 643. Springer, Heidelberg (1992). doi: 10.1007/BFb0013875
  12. 12.
    Hoffmann, B.: Cleaned SLL(1) grammars are SLR(1). Technical Report 17–1, Studiengang Informatik, Universität Bremen (2017).
  13. 13.
    Johnson, S.C.: Yacc: Yet another compiler-compiler. Computer Science Technical Report 32, AT&T Bell Laboratories (1975)Google Scholar
  14. 14.
    Kaul, M.: Practical applications of precedence graph grammars. In: Ehrig, H., Nagl, M., Rozenberg, G., Rosenfeld, A. (eds.) Graph Grammars 1986. LNCS, vol. 291, pp. 326–342. Springer, Heidelberg (1987). doi: 10.1007/3-540-18771-5_62 CrossRefGoogle Scholar
  15. 15.
    Knuth, D.E.: On the translation of languages from left to right. Inf. Control 8(6), 607–639 (1965)MathSciNetCrossRefzbMATHGoogle Scholar
  16. 16.
    Lautemann, C.: The complexity of graph languages generated by hyperedge replacement. Acta Informatica 27, 399–421 (1990)MathSciNetCrossRefzbMATHGoogle Scholar
  17. 17.
    Lewis II, P.M., Stearns, R.E.: Syntax-directed transduction. J. ACM 15(3), 465–488 (1968)CrossRefzbMATHGoogle Scholar
  18. 18.
    Ludwigs, H.J.: A LR-like analyzer algorithm for graphs. In: Wilhelm, R. (ed.) GI - 10. Jahrestagung, Proceedings of the Saarbrücken, 30 September - 2 Oktober 1980. Informatik-Fachberichte, vol. 33, pp. 321–335 (1980)Google Scholar
  19. 19.
    Minas, M.: Diagram editing with hypergraph parser support. In: Proceedings of the 1997 IEEE Symposium on Visual Languages (VL 1997), Capri, Italy, pp. 226–233 (1997)Google Scholar
  20. 20.
    Sippu, S., Soisalon-Soininen, E.: Parsing Theroy I: Languages and Parsing, EATCS Monographs in Theoretical Computer Science, vol. 15 (1988)Google Scholar
  21. 21.
    Vogler, W.: Recognizing edge replacement graph languages in cubic time. In: Ehrig, H., Kreowski, H.-J., Rozenberg, G. (eds.) Graph Grammars 1990. LNCS, vol. 532, pp. 676–687. Springer, Heidelberg (1991). doi: 10.1007/BFb0017421 CrossRefGoogle Scholar

Copyright information

© Springer International Publishing AG 2017

Authors and Affiliations

  1. 1.Umeå universitetUmeåSweden
  2. 2.Universität BremenBremenGermany
  3. 3.Universität der Bundeswehr MünchenNeubibergGermany

Personalised recommendations