Skip to content

goldfish-dave/ParadigmsAssignment4

Repository files navigation

ANTLR was not used because I didn't read the assignment sheet until it was too late, so the whole program is implemented in python.

sample.py contains various sample inputs we used.

Instead of run.sh and run.py calling everything, codeReader.py should be run.
codeReader.py runs off sample.py if no argument is provided, otherwise it passes the code, from the file (given by the argument), into task6.

Each task has samples of how to use the functions in the main.

common.py contains common functions used by all tasks, as well as utility functions i.e. converting from our processing format to plain code and visa versa

Task1 outputs a graph in DOT format, we used graph-easy to run it from the command line (see below for installation)

Task5 is not completely implemented. There some skeleton code that demonstrates some of the logic the task would require, but the code it output is equivalent to the code input.

Task6 has a optional debug argument which can be used to make each step of the optimisation print. It uses a simple hill climbing algorithm to know when to stop processing code.

Installing Graph-Easy:
=====================
goto 
	http://linuxgazette.net/139/okopnik.html

This page is about installing perl modules as non-root user. Only follow the
instructions down until the end of "Configuring the Environment". You can us
e a location other than myperl if you want (I used .perllibs).

Once you've done that install the Graph-Easy-0.70.tar.gz from
	http://search.cpan.org/~shlomif/Graph-Easy/bin/graph-easy

extract using
	$ tar -xzf Graph-Easy-x.xx.tar.gz

Instead of properly installing we'll just copy 
	Graph-Easy/bin/graph-easy
into
	~/bin/.
or somewhere else accessible from your PATH (alternatively you can add it to
the .gitignore file and leave it in this directory).

Also copy 
	Graph-Easy/lib/Graph
(and all of it's contents) into
	the location you added to PERL5Lib previously.

You should be able to test graph easy with this:
	$ echo "[ Bonn ] - car -> [ Berlin ]" | graph-easy

If it doesn't work, and the error message isn't obvious, try going through 
all the steps you can on the first linked page, and run
	$ perl Makefile.PL
in the Graph-Easy directory.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages