Set Calculator

I wrote this little number in about a day and a half for my CS193 class (yes, it was due at day 1.5). Basically, the program is a command line utility, where you type in set operations, and it will calculate them for you and produce the output. Here are a few examples (lines beginning with > are what you(I) type, the rest is the result):

> a:{1,2,"hello"}
{1, 2, hello}

> b:{2,3,"hello"}
{2, 3, hello}

> a + b
{1, 2, hello, 3}

> a ^ b      (intersection)
{2, hello}

> a - {"hello"}
{1, 2}

It uses a hand-rolled recursive descent parser. What a refreshingly artisinal approach, in a world where lex and yacc are so much better!

You can download the sourcecode here: setcalc.tar.gz. Installation instructions are here. You can browse the source here.