CSCI 431 Homework 5

time due submission file
9:00 AM Wednesday 18 October, 2006 csci/431/HW5/tingle.atg

The assignment

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.

 & ~ ( | )

Running Coco

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 and running the command:


Take a look at all the files generated by this command. Now run the command which will invoke the Coco system. This will create and compile a few Java files in your directory.


You may run your Java code with the following command:

java -jar tingle.jar