Table of Contents

Data types

The following data types are supported by the scripting language:

Single token data types

Lists

A list is a dynamic array of the specified single token data type. The array index is 1-based, meaning that the first item in the list is accessed as: list_name[1].

Reading from a non-existing item in a list always returns nul. Writing into a non-existing item in a list is ignored.

Database objects

Template declaration:

BEGIN            <class>       <template_name> 
  [OBJECT        Parent      = <parent_template_name>]
  [OBJECT        Scripta     = <inheritance_list>] 
  [<TYPE>        <name>      = [<value>]]  
  [<TYPES>       <name>      = [ [{] [<value> [,] [<value> ...]] [}] ]] 
                           [ = <value> [,] [<value> ...] [}] ]
END

Unless specific functionality provided by the underlying engine is required, object <class> identifier is object.

When an object is instantiated from a template, the following occurs:

When an object instance is freed, the following occurs:

To split a list across several lines, ‘=’ operator may be used.

Example template

file: “my_class.gee”

BEGIN            object        MY_CLASS  
  OBJECT         Parent      = MY_BASE_CLASS 
  OBJECT         Scripta     = @ my_class //default is @
  ATOM           Name        = ‘MY_CLASS’ 
  ATOM           Type        = MY_TYPE //'' may be omitted 
  INTEGER        Prop1       = 10    
  FLOATS         Prop2       = { 5.5 , 10 , 14.6 }       
  INTEGERS       Prop3       = 5 17 20 //{} and , may be omitted 
  ATOMS          Prop4       = { ‘haha’ hehe0 hihi_1_x }  
  VECTOR         Color       = | 1.0 29 0 0 | 
  REFERENCES     Game        = GAME GAME GAME GAME 
  CLONES         Members     = MY_BASE_CLASS MY_BASE_CLASS 
  ATOMS          LongList    = atom1 atom2 atom3
                             = atom4 atom1 atom2
                             = atom5 atom3
  VECTORS        Vectors     = |1 , 1 , 2| , |1.5 0|  13.5 , 0.0 
                             = |0.0|
END

Global maps

Using global maps, it is possible to define global identifiers.

BEGIN            global        CONST 
  <TYPE>         const_name  = [...]
END

CONST global identifiers are compiled into the code, and may not be altered in runtime. A REFERENCE or REFERENCES variable may not be constant, therefore, it is automatically considered an alias even when listed in CONST global maps.

BEGIN            global        ALIAS 
  <TYPE>         const_name  = [...]
END

ALIAS global identifiers are variables with a global scope. They may be altered in runtime. All database objects referred to by REFERENCE and REFERENCES global variables are created as first (following the ATOM to REFERENCE conversion rules).

Engine objects

Engine objects cannot be saved into a permanent file.

Access to engine objects is provided through INSTANCE handles. Thus:

REFERENCE databaseObject  = new ‘MY_CLASS’ 
ATOM result               = databaseObject.branchName('atom', 0, 0.5)
 
INSTANCE engineObject     = newTexture(128, 128) 
or: ITEXTURE engineObject = ... 
 
ATOM result               = engineObject.engineObjectFunction('atom', 0, 0.5)

Calling a nul instance is always safe. The return value of a nul call is always nul.

Variable scopes

Local variables

Included are branch and eval parameters.

Scope: current branch / eval

Examples:

branch foo(parameter_1, ATOM parameter_2)
  INTEGER local_var 
  REFERENCE global_object
  ..

The following local variables are implicitely present:

Examples:

local_var = parameter_1      //equivalent to:
local_var = &[1]
local_var = parameter_2      //not necessarily equivalent to:
local_var = &[2]             
parameter_1 = local_var      //calling parameter is changed
parameter_2 = global_object  //calling parameter is NOT changed
global_object.property = ...
$.property = ...
*.property = ...
$.foo()

Object properties

Scope: global database

Examples:

REFERENCE x   = *
ATOM      x.a = ...

When a property being assigned to does not exist on an object, it is automatically created.