Tuesday, February 5, 2008

Java Software is a Good Thing

I'm teaching a course on Compiler Design, and I'm going to have students use JFlex and CUP as the scanner and parser generators.

I always dread asking students to use any software besides Visual Studio or Java/Eclipse, since it means I have to worry about whether or not
  • they have it installed
  • they have it installed correctly
  • they have the right version
  • etc.
I also have to make the build scripts configurable so students can customize them to reflect where they have the tools installed, which of course is another place where things can go wrong. Plus, I have to ask our IT department to install the software in our lab, etc., etc.

It occurred to me today that JFlex and CUP are both written in Java, so I could simply include them in the assignment skeleton! This took me all of about 5 minutes. Now I have a compiler assignment skeleton that requires only Java and Eclipse. In fact, it has an Ant script, so you don't even have to use Eclipse. So far I've only verified that it works on Linux, but I'm pretty confident that it will work on Windows, too.

JFlex and CUP are both free software, so there are no license issues to worry about.

No comments: