Re: JavaCC in teaching (Des Watson)
22 Dec 2004 01:06:17 -0500

          From comp.compilers

Related articles
JavaCC in teaching (Johannes Waldmann) (2004-12-16)
Re: JavaCC in teaching (Etienne Gagnon) (2004-12-17)
Re: JavaCC in teaching (Alexey Demakov) (2004-12-17)
Re: JavaCC in teaching (Mayan Moudgill) (2004-12-19)
Re: JavaCC in teaching (2004-12-22)
| List of all articles for this month |

From: (Des Watson)
Newsgroups: comp.compilers
Date: 22 Dec 2004 01:06:17 -0500
Organization: Janet Usenet Reading Service.
References: 04-12-065
Keywords: Java, courses
Posted-Date: 22 Dec 2004 01:06:17 EST

Johannes Waldmann ( wrote:
: What is your opinion on using JavaCC in teaching?

I've been using JavaCC in a final year compiler design course at the
University of Sussex for some years. Its use forms a part of an
exercise to build a compiler for a small C-like language targeted to a
simple register-based machine (although some students develop code
generators for "real" architectures). The source language changes
from year to year.

: I consider using JavaCC as an example in my compiler construction
: course, effectively replacing flex/bison.

Yes - I used to use flex/bison for this exercise.

: While the "classical" tools are well covered in standard textbooks,
: is there similar coverage for JavaCC somewhere? .

The documentation on the web together with the examples in the
distribution seems to be more than adequate - I talk about the general
principles in the lectures and the students are happy to research all
the details themselves.

: Any pointers and comments appreciated (especially from teachers).

These students have already been exposed to traditional hand-written
top-down predictive parsers. This JavaCC exercise aims to give them
some (limited) experience of one of the many compiler construction
tools, to show that with these tools it may be possible to parse large
grammars without too much pain and to give them a better insight into
top-down parsing (they all tend to have to think carefully about
lookahead!). I find that with the larger compiler construction
exercises that require code to be written from scratch, students often
get overwhelmed by the detail in the limited time they have available
- using an appropriate parser generator helps them to produce
something that they are more likely to be proud of.

Best wishes

Des Watson

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.