Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 1.25 KB

File metadata and controls

34 lines (24 loc) · 1.25 KB

turtle - A Logo Parser in C

This C project contains a parser, an interpreter, and a GTK+ GUI that would interpret the LOGO language on the fly.

Compiling

This has been tested on Ubuntu 10.10 with gtk-2.0. Make sure gtk-2.0 is installed correctly, and then simply do

make extension
./extension

will fire up the GUI.

Logo Language

The BNF of the language is:

<MAIN>        ::= "{" <INSTRCTLST>
<INSTRCTLST>  ::= <INSTRUCTION><INSTRCTLST> | "}"
<INSTRUCTION> ::= <FD> | <LT> | <RT> | <DO> | <SET>
<FD>          ::= "FD" <VARNUM>
<LT>          ::= "LT" <VARNUM>
<RT>          ::= "RT" <VARNUM>
<DO>          ::= "DO" <VAR> "FROM" <VARNUM> "TO"
                  <VARNUM> "{" <INSTRCTLST>
<VAR>         ::= [A-Z]
<VARNUM>      ::= number | <VAR>
<SET>         ::= "SET" <VAR> ":=" <POLISH>
<POLISH>      ::= <OP> <POLISH> | <VARNUM> <POLISH> | ";"
<OP>          ::= "+" | "-" | "*" | "/"

About

This project was written for an assignment for the University of Bristol. It includes substantial testing using MinUnit. There are the project submission documentation that discusses the technicalities of the implementation.