Homework 1 Notes and Tools

Suggestions:

The following are tools for use with homework 1.

Parser Code:
parser-example.c contains code for parsing the data used by the input operator for your SBV. It also contains an example program of its use (which uses list.data). Be sure to read the comments in this file for important tips on using it.

Shell Scripts:
run-tests is a shell-script to run your tests for part 4. Read the file for comments on its use. You will have to edit it to perform all your tests. When you copy it to your unix directory, perform the command: chmod 700 run-tests. This will make the script executable.

Also, be sure to run this script in a BASH shell. Most of you are likely already running a bash shell, but if you are not sure, type "bash" and hit enter before running the script.

Awk:
awk-example is a shell-script that runs awk on the lines in data. You will need to edit this script to manipulate the data from run-tests to be acceptable by gnuplot. Gnuplot requires data to be in the form of a pair of x and y coordinates, separated by whitespace, one pair per line.

  Example:

  1  3
  2  5
  3  8
  7  24
Read the script file for comments on using it. You will have to edit it some to finish the assignment. When you copy it to your unix directory, perform the command: chmod 700 awk-example. This will make the script executable.

Gnuplot:
gnuplot.p is a driver file you will need for creating graphs with gnuplot. Read the file to see what you may have to edit.

To use in gnuplot, first type gnuplot from the unix prompt. At the gnuplot prompt, type load "gnuplot.p". Your graph should then be displayed.

To print your graph, use the saveplot.p driver file. After loading gnuplot.p, from the gnuplot prompt, type set out "FILENAME.ps", where FILENAME is the name of the file you want to save the graph as (note that it must be a postscript file). Then, type load "saveplot.p". Your graph will now be saved in your directory. Use ghostview to view it.

CSE 326 Winter 2002 Home