Advertisement

Abstract

A graph language can be described by a graph grammar in a manner similar to a string grammar known from the theory of formal languages. Unfortunately, graph parsing is known to be computationally expensive in general. There are quite simple graph languages that crush most general-purpose graph parsers.

In this paper we present graph parser combinators, a new approach to graph parsing inspired by the well-known string parser combinators. The basic idea is to define primitive graph parsers for elementary graph components and a set of combinators for the construction of more advanced graph parsers. Using graph parser combinators special-purpose graph parsers can be composed conveniently. Thereby, language-specific performance optimizations can be incorporated in a flexible manner.

Keywords

functional programming graph parsing parser combinators visual languages 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Minas, M.: Concepts and realization of a diagram editor generator based on hypergraph transformation. Science of Computer Programming 44(2), 157–180 (2002)zbMATHCrossRefGoogle Scholar
  2. 2.
    Kasami, T.: An efficient recognition and syntax analysis algorithm for context free languages. Scientific Report AF CRL-65-758, Air Force Cambridge Research Laboratory, Bedford, Massachussetts (1965)Google Scholar
  3. 3.
    Drewes, F., Habel, A., Kreowski, H.J.: Hyperedge replacement graph grammars. In: Rozenberg, G. (ed.) Handbook of Graph Grammars and Computing by Graph Transformation. Foundations, vol. I, pp. 95–162. World Scientific, Singapore (1997)Google Scholar
  4. 4.
    Hutton, G., Meijer, E.: Monadic parser combinators. Technical Report NOTTCS-TR-96-4, Department of Computer Science, University of Nottingham (1996)Google Scholar
  5. 5.
    Johnson, S.C.: Yacc: Yet another compiler compiler. Technical Report 32, Bell Laboratories, Murray Hill, New Jersey (1975)Google Scholar
  6. 6.
    Wallace, M.: PolyParse (2007), http://www.cs.york.ac.uk/fp/polyparse/
  7. 7.
    Peyton Jones, S.: Haskell 98 Language and Libraries. The Revised Report. Cambridge University Press (2003)Google Scholar
  8. 8.
    Citrin, W., Hall, R., Zorn, B.: Programming with visual expressions. In: Haarslev, V. (ed.) Proc. 11th IEEE Symp. Vis. Lang, pp. 294–301. IEEE Computer Soc. Press, Los Alamitos (1995)Google Scholar
  9. 9.
    Minas, M.: Hypergraphs as a uniform diagram representation model. In: Ehrig, H., Engels, G., Kreowski, H.-J., Rozenberg, G. (eds.) TAGT 1998. LNCS, vol. 1764, pp. 281–295. Springer, Heidelberg (2000)Google Scholar
  10. 10.
    Erwig, M.: Inductive graphs and functional graph algorithms. J. Funct. Program. 11(5), 467–492 (2001)zbMATHCrossRefMathSciNetGoogle Scholar
  11. 11.
    Leijen, D., Meijer, E.: Parsec: Direct style monadic parser combinators for the real world. Technical Report UU-CS-2001-27, Dept. of Comp. Science, Universiteit Utrecht (2001)Google Scholar
  12. 12.
    Gill, A., Marlow, S.: Happy - the parser generator for Haskell, http://www.haskell.org/happy
  13. 13.
    King, D.: Functional Programming and Graph Algorithms. PhD thesis, University of Glasgow (1996)Google Scholar
  14. 14.
    Erwig, M.: FGL - A Functional Graph Library, http://web.engr.oregonstate.edu/~erwig/fgl/haskell/
  15. 15.
    Erwig, M.: A functional homage to graph reduction. Technical Report 239, FernUniversität Hagen (1998)Google Scholar
  16. 16.
    Schneider, H.J.: Graph transformations - an introduction to the categorical approach (2007), http://www2.cs.fau.de/~schneide/gtbook/
  17. 17.
    Kahl, W., Schmidt, G.: Exploring (finite) Relation Algebras using Tools written in Haskell. Technical Report 2000-02, Fakultät für Informatik, Universität der Bundeswehr, München (2000)Google Scholar
  18. 18.
    Swierstra, S.D., Azero Alcocer, P.R.: Fast, error correcting parser combinators: a short tutorial. In: Pavelka, J., Tel, G., Bartosek, M. (eds.) SOFSEM 1999. LNCS, vol. 1725, pp. 111–129. Springer, Heidelberg (1999)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Steffen Mazanek
    • 1
  • Mark Minas
    • 1
  1. 1.Universität der BundeswehrMünchenGermany

Personalised recommendations