Oolite script compiler. Copyright (c) 2006 David Taylor. All rights reserved. This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. You are free: o to copy, distribute, display, and perform the work o to make derivative works Under the following conditions: o Attribution. You must give the original author credit. o Noncommercial. You may not use this work for commercial purposes. o Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one. For any reuse or distribution, you must make clear to others the license terms of this work. Any of these conditions can be waived if you get permission from the copyright holder. Your fair use and other rights are in no way affected by the above. Introduction ------------ This program reads an Oolite script written in a BASIC-like syntax and creates an XML PList version of it. The format of the BASIC-like file is: scriptname // comments must start with // and be the only thing on the line if xxx [and xxx ...] then // indentation is ignored actions [else actions] endif if xxx [and xxx ...] then actions [else actions] endif The scriptname must be a single word on the first line of the script file. Comments must be the only thing on a line, and start with //. Leading whitespace is ignored. Comments can appear anywhere after the script name. The script itself must only have "if" statements at the "top level". Multiple conditions can be given to an if statement by using "and". The conditions be put on more than one line. Newlines are ignored between "if" and "then" The end of the conditions is marked with the word "then", which must be followed by one or more "actions" which are written exactly as they are in the XML version of the script. You can only put one action on each line, and leading whitespace is ignored. You can use "else" followed by more actions to generate the else array of the XML script. The if/else block is finished with the word "endif" Installation ------------ You must have a working JRE to use this program. Create a directory for the program, such as C:\ooscript. Then create a set of directories under that called "dt\oolite\scriptcompiler". The ScriptCompiler.class file goes in the bottom directory. In the above example, the fully qualified filename for the class file will be: C:\ooscript\dt\oolite\scriptcompiler.class How to run it ------------- You can use the compile.bat file that is included as follows: compile