time due | submission file |
---|---|
9:00 AM Wednesday 18 October, 2006 | csci/431/HW5/tingle.atg |
Several years ago some UNCA professor wrote a paper describing a system for monitoring networks. The system had a very odd control language with statements similar to the following which means: If busbee has been "up" for 30 seconds and it is not the case that bulldog has been "down" for 20 seconds and candler has been "up" for 15 seconds.
+busbee[> 30] & ~ ( -bulldog[< 20] | +candler [ > 15] )
Well, I guess you see why this never became a very popular system.
Your assignment is to use Coco/R to define a parser for this language. For now, just make your Java code print out the logical operators and parenthesis that it encounters. For example, for the above example it would merely print out the following line.
& ~ ( | )
The commands for running Coco are difficult. First, you need to create a shell script that will compile your atg. Do this by logging into candler.cs.unca.edu and running the command:
/usr/local/csci/431/bin/CocoInit
Take a look at all the files generated by this command. Now run the command build.sh which will invoke the Coco system. This will create and compile a few Java files in your directory.
./build.sh
You may run your Java code with the following command:
java -jar tingle.jar