A Case Study in Grammar Engineering

  • Tiago L. Alves
  • Joost Visser
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5452)


This paper describes a case study about how well-established software engineering techniques can be applied to the development of a grammar. The employed development methodology can be described as iterative grammar engineering and includes the application of techniques such as grammar metrics, unit testing, and test coverage analysis. The result is a grammar of industrial strength, in the sense that it is well-tested, it can be used for fast parsing of high volumes of code, and it allows automatic generation of support for syntax tree representation, traversal, and interchange.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Klint, P., Lämmel, R., Verhoef, C.: Towards an engineering discipline for grammarware. Transaction on Software Engineering and Methodology, 331–380 (2005)Google Scholar
  2. 2.
    Malloy, B.A., Power, J.F., Waldron, J.T.: Applying software engineering techniques to parser design: the development of a c# parser. In: Proc. of the 2002 Conf. of the South African Institute of Computer Scientists and Information Technologists, pp. 75–82. In cooperation with ACM, Press, New York (2002)Google Scholar
  3. 3.
    Lämmel, R., Verhoef, C.: Semi-automatic Grammar Recovery. Software—Practice & Experience 31(15), 1395–1438 (2001)CrossRefMATHGoogle Scholar
  4. 4.
    van der Brand, M., Sellink, A., Verhoef, C.: Current parsing techniques in software renovation considered harmful. In: IWPC 1998: Proceedings of the 6th International Workshop on Program Comprehension, pp. 108–117. IEEE Computer Society, Los Alamitos (1998)Google Scholar
  5. 5.
    de Jonge, M., Visser, J.: Grammers as contracts. In: Butler, G., Jarzabek, S. (eds.) GCSE 2000. LNCS, vol. 2177, pp. 85–99. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  6. 6.
    Heering, J., Hendriks, P.R.H., Klint, P., Rekers, J.: The syntax definition formalism SDF — Reference manual. SIGPLAN Notices 24(11), 43–75 (1989)CrossRefGoogle Scholar
  7. 7.
    Visser, E.: Syntax Definition for Language Prototyping. PhD thesis, University of Amsterdam (1997)Google Scholar
  8. 8.
    den van Brand, M.G.J., van Deursen, A., Heering, J., de Jong, H.A., de Jonge, M., Kuipers, T., Klint, P., Moonen, L., Olivier, P.A., Scheerder, J., Vinju, J.J., Visser, E., Visser, J.: The ASF+SDF meta-environment: A component-based language development environment. In: Wilhelm, R. (ed.) CC 2001. LNCS, vol. 2027, p. 365. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  9. 9.
    Visser, E., Benaissa, Z.: A Core Language for Rewriting. In: Kirchner, C., Kirchner, H. (eds.) Proc. of the Int. Workshop on Rewriting Logic and its Applications (WRLA 1998), France. ENTCS, vol. 15. Elsevier Science, Amsterdam (1998)Google Scholar
  10. 10.
    Lämmel, R., Visser, J.: A Strafunski Application Letter. In: Dahl, V., Wadler, P. (eds.) PADL 2003. LNCS, vol. 2562, pp. 357–375. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  11. 11.
    Kuipers, T., Visser, J.: Object-oriented tree traversal with JJForester. In: Brand, M.v.d., Parigot, D. (eds.) Proceedings of the Workshop on Language Descriptions, Tools and Applications (LDTA). Electronic Notes in Theoretical Computer Science, vol. 44. Elsevier, Amsterdam (2001)Google Scholar
  12. 12.
    de Jonge, M.: A pretty-printer for every occasion. In: Ferguson, I., Gray, J., Scott, L. (eds.) Proceedings of the 2nd International Symposium on Constructing Software Engineering Tools (CoSET 2000), University of Wollongong, Australia (2000)Google Scholar
  13. 13.
    Fogel, K.: Open Source Development with CVS. Coriolis Group Books (1999)Google Scholar
  14. 14.
    Kort, J., Lämmel, R., Verhoef, C.: The grammar deployment kit. In: van den Brand, M., Lämmel, R. (eds.) ENTCS, vol. 65. Elsevier, Amsterdam (2002)Google Scholar
  15. 15.
    Power, J., Malloy, B.: A metrics suite for grammar-based software. Journal of Software Maintenance and Evolution 16, 405–426 (2004)CrossRefGoogle Scholar
  16. 16.
    Alves, T., Visser, J.: Metrication of SDF grammars. Technical Report DI-PURe-05.05.01, Universidade do Minho (May 2005)Google Scholar
  17. 17.
    Halstead, M.: Elements of Software Science. Operating, and Programming Systems Series, vol. 7. Elsevier, New York (1977)MATHGoogle Scholar
  18. 18.
    Fenton, N., Pfleeger, S.L.: Software metrics: a rigorous and practical approach, 2nd edn. PWS Publishing Co., Boston (revised printing, 1997)Google Scholar
  19. 19.
    Bravenboer, M.: Parse Unit home page, http://www.program-transformation.org/Tools/ParseUnit
  20. 20.
    Purdom, P.: Erratum: A Sentence Generator for Testing Parsers [BIT 12(3), 1972, p. 372]. BIT 12(4), 595–595 (1972)MathSciNetCrossRefGoogle Scholar
  21. 21.
    Lämmel, R.: Grammar testing. In: Hussmann, H. (ed.) FASE 2001. LNCS, vol. 2029, pp. 201–216. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  22. 22.
    Alves, T., Silva, P., Visser, J., Oliveira, J.: Strategic term rewriting and its application to a vdmsl to sql conversion. In: Fitzgerald, J.S., Hayes, I.J., Tarlecki, A. (eds.) FM 2005. LNCS, vol. 3582, pp. 399–414. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  23. 23.
    International Organisation for Standardization: Information technology—Programming languages, their environments and system software interfaces—Vienna Development Method—Specification Language—Part 1: Base language, ISO/IEC 13817-1 (December 1996)Google Scholar
  24. 24.
    den van Brand, M., Scheerder, J., Vinju, J., Visser, E.: Disambiguation filters for scannerless generalized LR parsers. In: Horspool, R.N. (ed.) CC 2002. LNCS, vol. 2304, p. 143. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  25. 25.
    Lämmel, R.: The Amsterdam toolkit for language archaeology (Extended Abstract). In: Proceedings of the 2nd International Workshop on Meta-Models, Schemas and Grammars for Reverse Engineering (ATEM 2004) (October 2004)Google Scholar
  26. 26.
    Erbach, G.: Tools for grammar engineering (March 15 (2000)Google Scholar
  27. 27.
    Volk, M.: The role of testing in grammar engineering. In: Proc. of the 3rd Conf. on Applied Natural Language Processing, Assoc. for Computational Linguistics, pp. 257–258 (1992)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2009

Authors and Affiliations

  • Tiago L. Alves
    • 1
  • Joost Visser
    • 2
  1. 1.University of Minho, Portugal, and Software Improvement GroupThe Netherlands
  2. 2.Software Improvement GroupThe Netherlands

Personalised recommendations