< Language grammars Index Adventure language >

Compiler

The compiler is used to translate data files according to a grammar into binary data. The compiler may be called from the command line or from its GUI. The data files are interpreted according to the grammar and some special compiler directives.

The Compiler GUI

If you start the compiler without any argument, its GUI is displayed. There, you may specify files for the input, for the grammar, and for the output. Only the input file is mandatory. If no grammar file is specified, the grammar selection between adventure game and look and the grammar version number is used instead. In addition, the compiler may be directed to store item names and to check for double items and for item types. Compilation is started with the Compile button. During compilation, a log window may log the ongoing processes on file or item level. The Info button shows information about the compiler and the language versions. The GUI is closed using the Exit button.

Compiling from the Command Line

If started from the command line, at least the name of the data file must be given as a parameter. In this case, the most current adventure game grammar is used. Other parameters start with a slash and have to stand before the data file.

Compiler directives

The compiler recognizes the following directives that have to be in a single line.

Note: Defintions are overwritten without warning. The last definition read is used for the total file.

Note: An included file is inserted at the position of the include directive. The file may have a relative or absolute path. If the path is relative, the file is searched in the current directory, in the directory of the compiled file, and then in the directory of the compiler itself.

Macros

A macro defines a pattern to create similar items or groups of items. The macro declaration consists of three parts:

  1. #macro macro_name(parameter1, ... , parametern): Each macro is identified by a unique name. It has a list of parameters which are also names.
  2. macro pattern: The pattern consists of one or several item definitions. They may contain the parameter names instead of item names and values.
  3. #orcam: A single line with #orcam ends the macro declaration.

To create items from a macro, the macro is instantiated by assigning values to the declared parameters. The syntax is:
macro_name {value1 | ... | valuen}
In the macro pattern, the parameter names are replaced then by the values to create new items.