skip to main content
article

Teaching compiler construction and language design: making the case for unusual compiler projects with postscript as the target language

Published:07 March 2007Publication History
Skip Abstract Section

Abstract

This paper presents an unusual programming language, textttklx, illustrating the type of compiler construction projects the author uses successfully to accompany a mostly traditional lecture on compilers.The target processor of textttklx is the PostScript interpreter, and the paper argues that this is a very good choice. A PostScript interpreter simulates an elegant stack machine with built-in graphic capabilities. It is the perfect target for languages like textttklx, making them easy to implement and fun to use. The exact definition of the source language is an integral part of the student project.The use of non standard languages and a non standard target fosters student creativity in language design and implementation. It invites "out of the box" thinking, and prepares the knowledge transfer from the rich tradition of compiler construction to new and forthcoming areas of computer science.

References

  1. Adobe Systems Inc. PostScript language reference manual (2nd ed.). Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. A. V. Aho, R. Sethi, and J. D. Ullman. Compilers: principles, techniques, and tools. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. S. Debray. Making compiler design relevant for students who will (most likely) never design a compiler. In SIGCSE '02: Proceedings of the 33rd SIGCSE technical symposium on Computer science education, pages 341--345, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. W. Kandinsky. Punkt und Linie zu Fläche: Beitrag zur Analyse der malerischen Elemente. A. Langen, München, 1926.Google ScholarGoogle Scholar
  5. klx example code. http://www.cs.fhm.edu/~ruckert/compiler/klx/ex3/.Google ScholarGoogle Scholar
  6. klx project description. http://www.cs.fhm.edu/~ruckert/compiler/klx/.Google ScholarGoogle Scholar
  7. R. Lang. Ghostscript's home page. http://www.cs.wisc.edu/~ghost/, 2004.Google ScholarGoogle Scholar
  8. M. Lesk and E. Schmidt. Lex---a lexical analyzer. Technical Report 39, Bell Laboratories, Murray Hill, NJ 07974, 1975.Google ScholarGoogle Scholar
  9. M. Ruckert. Compiler construction lab on video (in german). Available on request from the author.Google ScholarGoogle Scholar
  10. SAX homepage. http://www.saxproject.org/.Google ScholarGoogle Scholar
  11. S. C. Johnson. Yacc: Yet another compiler compiler. Computing Science Technical Report 32, Bell Laboratories, Murray Hill, NJ 07974, 1975.Google ScholarGoogle Scholar
  12. R. W. Sebesta. Concepts of Programming Languages. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. M. Werner. A parser project in a programming languages course. J. Comput. Small Coll., 18(5):184--192, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. XML homepage. http://www.xml.org/.Google ScholarGoogle Scholar
  15. L. Xu and F. G. Martin. Chirp on crickets: Teaching compilers using an embedded robot controller. In SIGCSE '06: Proceedings of the 37th SIGCSE technical symposium on Computer science education, pages 82--86, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Teaching compiler construction and language design: making the case for unusual compiler projects with postscript as the target language

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGCSE Bulletin
      ACM SIGCSE Bulletin  Volume 39, Issue 1
      March 2007
      581 pages
      ISSN:0097-8418
      DOI:10.1145/1227504
      Issue’s Table of Contents
      • cover image ACM Conferences
        SIGCSE '07: Proceedings of the 38th SIGCSE technical symposium on Computer science education
        March 2007
        634 pages
        ISBN:1595933611
        DOI:10.1145/1227310

      Copyright © 2007 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 7 March 2007

      Check for updates

      Qualifiers

      • article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader