README FOR THE OGEL PROGRAMMING LANGUAGE COMPILER
=======
cwo4@columbia.edu -- Last updated: 05/2004
A more complete specification can be found at:
   http://www.mit.edu/~cwo/projects/ogel_design.pdf
===================================================

OGEL is a language for the LEGO Mindstorm product robots.
OGEL source will compiles down to NQC source code. 
OGEL's goals are to make it simple to create robot
functionality which involves multiple physical RCX
boxes, as well as simplify some of the NQC annoyances.

The OGEL compiler has three stages
   1) an OGEL preprocessor
   2) a UNI-OGEL compiler 
   3) a product-NQC mapper

It is our intent that the output of (2) is generalized
LEGO Mindstorm NQC code which can then be mapped to
a specific LEGO Mindstorm compatible product
(be it RCX 1.0, RCX 2.0, CyberMaster, etc)

Usage
=====

To compile an OGEL program one can use the simple
"ogelc" bash script, which will generate a .nqc file
for every rcx block defined by the program.

For this to work, it is necessary to have java and perl
installed, as well as the ANTLR parser generator. The
ANTLR classes must be in the CLASSPATH as well as this
directory containing the ogelgen classes. ANTLR can
be found at http://www.antlr.org/

Alternatively each of the three steps above can be
used as standalone commands
   1) libpacker.pl      -- preprocessor and library checking routine
                           outputs infile.master
   2) java ogelgen      -- main compiler
                           outputs infile.uniogel
   3) rcx10trans_opt.pl -- RCX 1.0 translator (minorly optimizing)
                           other translators exist including a
                           non-optimizing version 'rcx10trans.pl'

This has been tested with ANTLR 2.7.3, Sun Java 1.4.2,
and Perl 5.8.4 on a Debian GNU/Linux system with kernel 2.6.5

Examples
========

The subdirectory /examples/ holds a few sample OGEL programs
which are known to compile correctly using the 'ogelc' compiler


