Taurus Cycle Compiler v0.0.1

The following release notes are applicable to the above version of the Taurus Cycle Compiler. The copyright notice is applicable to any version of the Compiler unless stated otherwise.

Copyright notice
The Taurus Java Virtual Machine is © Copyright 2003, Taurus Software.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

The Taurus Cycle Compiler has been produced without any collaboration with Ultimate Real Robots Magazine, and is not associated with it in any way. Please do not contact Eaglemoss regarding any problems with Cycle - these should be addressed to support at tsac.co.uk .

Taurus Cycle and Taurus Cycle Compiler are trademarks of Taurus Software. Java is a trademark or a registered trademark of Sun Microsystems, Inc. All other trademarks are the property of their respective owners.

All references to Taurus Software directly refer to the non-profit freeware/shareware software development unit run from the UK by myself. Any conflict with names of companies inside or outside of the UK is unintentional and should be disregarded.

Purpose
Cycle (CYbot Control LanguagE) is a direct replacement for the graphical programming "language" that comes on CD2 of Real Robots. The Cycle compiler will take programs written in Cycle and convert the to .03p files which can be used with CD2.

Language Support
All the features of the graphical "language" as supplied with Programmer 03 on CD2 of Ultimate Real Robots are supported.

This means that as yet subroutines (which will be implemented through named procedures) are not yet implemented and the compiler will produce errors when they are encountered. It is intended that this feature be implemented as soon as the next Real Robots CD becomes available with this feature enabled.

There are one or two limitations due to the way that links can be made between blocks so that they do not form a single sequence. This is particularly evident where the inputs from two separate sensors blocks are linked to the same motor block. This cannot be expressed in Cycle as the sensor blocks are handled by switch statements and it is not possible to share code between switches. This could be implemented using a 'goto' statement, but this has deliberately been kept out of the language as usually leads to spagetti code. To achieve the same effect simply duplicate the code which you want to share - this has no real effect on the program, other than making it slightly larger.

Platform Support
The Taurus Cycle Compiler version 0.0.1 is provided in binary form on the following platforms:

For space reasons is provided without any of the required support libraries (DLLs and .so's). In order to run this software you must install these libraries yourself (they are likely to be already installed on most systems). Binaries for other platforms may follow at some later date.

Installation
The Cycle Compiler is shipped as a ZIP file. To install, simply unzip to a suitable location on your hard drive. e.g. C:\Cybot (or even C:\). This will create a directory called Cycle containing the compiler, cycbot.cyc (in the include folder) and some example files (in the examples folder.

You may wish to add C:\Cybot\Cycle (or path_to_cycle\Cycle) to your PATH environment varaible (this isn't necessary, but means you can run the compiler from anywhere).

Running
Running the Cycle Compiler is very easy, and it is designed to be run in a similar way to any other compiler.

If you do all your work in the Cycle folder, then you can run Cycle as .\cycle. If you run it from the examples folder you would run it as ..\cycle. To run it from anywhere else (if it isn't in your PATH), the you would type path_to_cycle\Cycle\cycle. In the examples below substitute ..\cycle with the appropriate path for your installation.

In the examples folder you will find a Cycle source file called flash4.cyc. To compile this file you would enter:

    ..\cycle -oflash4.03p flash4.cyc

This will produce a file called flash4.03p in the current folder containing a compiled version of the program which can be loaded into Programmer 03 or the Simulator. Note that there is no space between the -o and the output filename. If you do not specify an output filename, then the output is written to output.03p.

Windows users may optionally specify -i to install the compiled output in the Real Robots Robots Programs folder. Be careful, as like most compilers, this will overwrite any file of the same name without warning.

Also in the examples folder you will find a Makefile (for Cygwin users) and a batch file called build.bat (for Win32 users). These compile all the example programs in the examples folder. build.bat also installs the compiled output into Robots Programs, ready for use.

Troubleshooting
If you have problems loading the compiled code into Programmer 03, or you get unexpected results, then the compiler can be run in debug mode and will produce a listing of what it has parsed. To do this, the above example would become:

    ..\cycle -v -t flash4.cyc

The dumped code should match the input program exactly. If it does not, then please email the problem code (and if possible the output of the above command) to support at tsac.co.uk along with a brief explanation about what it is supposed to do.

Appendix A - Command Line Switches
The Cycle compiler currently supports the following switches and arguments:

Switch Meaning
-d n Causes the compiler to emit debugging information. This is primarily for debugging the parser and lexer and is not something you would want to run in normal use. n is a bit mask, whereby bit 0 (1) turns on parser debug and bit 1 (2) turns on lexer debug. To turn on both, you would set bits 0 and 1 (1 + 2 = 3).
-e Ignore syntax and semantic errors and try to produce output anyway. This is usually an very bad idea, but if you have having problems compiling what you believe to be valid code, then using this switch along with -t and -v you can safely produce a dump of the parse tree to aid debugging.
-h Help. Displays a brief usage message describing the valid switches to the compiler.
-i Install [Win32 only]. Cause the output to be written to Robot Programs folder in the Real Robots installation directory. This allows compiled Cycle programs to be loaded directly into the Real Robots Programmer and Simulator. Make sure that you use a different filename than any programs you want to keep, as like most compilers, Cycle does not warn if it is about to overwrite a file.
-n No Logo. Causes the compiler to remain quiet when comiling. It normally prints a copyright message each time it is run. This is useful from Makefiles as the only output should then be error messages.
-o filename Output. Causes the output to be written to the given filename. filename should be given a .03p file extension in order for the Real Robots software to recognise it - .03p is not added automatically. If no -o switch is specified, then the default filename is output.03p
-p Display Parse Tree. One -p will produce a dump of the parse tree immediately after syntax anaylsis. Two -p switches will produce a similar dump, but after the transformation of for loops and assignment statements. Three -v switches will produce both dumps.
-t Translate only. This switch causes the compiler to exit without producing any output. This is useful for testing that programs compile correctly without going to the code generation stage. It is also useful when used with the -v option in diagnosing compiler errors.
-v Verbose. Causes the compiler to produce verbose output about what it is doing.
-v Displays the version number of the compiler.

Last updated 5th July 2003
Comments support at tsac.co.uk

1