
The Cabbage Compiler
====================

From the website:

  Dr. Andrew Davison
  Dept. of Computer Engineering
  Prince of Songkla University
  Hat Yai, Songkhla 90112, Thailand
  E-mail: ad@fivedots.coe.psu.ac.th
  http://fivedots.coe.psu.ac.th/~ad/cabbage


If you use this code, please mention my name, and include a link
to the website.

Thanks,
  Andrew

==========================================================

This directory contains the Cabbage and AES JAR files and 
examples. The source code is in the subdirectories
"Cabbage Code" and "SimpAES Code".

JAR files:
  * cabbage.jar    // the Cabbage compiler
  * aes.jar        // the Analaytical Engine emulator

Cabbage examples:
  * bern.cb     
  * div.cb      
  * equs.cb     
  * fact.cb     
  * fact6.cb    
  * fib.cb
  * log.cb      
  * pi.cb       
  * quotrem.cb  
  * sieve.cb    
  * sine.cb     
  * sort.cb
  * sum.cb      
  * tqk.cb

AE examples:
  * arith.ae       
  * bernouilli.ae  
  * call.ae        
  * fact1.ae
  * fact2.ae       
  * indirect.ae    
  * newton.ae      
  * puts.ae


------
Batch files for running:
  * run.bat
     - make sure you have cabbage.jar and aes.jar 
       in this directory

  * cleanup.bat
     - deletes all the AE files generated by the
       Cabbage compiler (by looking for corresponding
       CB files, which are left alone)

  * runAES.bat
     - make sure you have aes.jar in this directory

If you do not have them, then go to the "Cabbage Code" 
and "SimpAES Code" directories and use their compile.bat 
batch files to generate the JARs here.


----------------------------
Compiling and Running the Cabbage examples:

> run <CB file>
e.g.
> run bern.cb
    - 1) compiles the cabbage file, generating a
      corresponding AE file (e.g. bern.ae);

    - 2) runs the AE file inside the emulator


----------------------------
Running the AES examples:

> runAES <AE file>
e.g.
> runAES div.ae
    - runs the AE file inside the emulator


Note that this emulator is a cut-down version of the full-powered
emulator by John Walker at: 
   https://www.fourmilab.ch/babbage/contents.html

**plus** with the addition of 10 new instructions needed to support
the "boiled" version of Cabbage. Details on the changes can
be found in the Java file comments in "SimpAES Code", especially 
at the start of AES.java

-----------------------------
Last updated: 16th March 2018
