Programming guide to Unibase

16 : Developers: Meta language

Define priority between operations

<operations>  An extra operation with left or right side and the level.
{[type] operation type: level} 
</operations> 
 
This tag is used to define operations with their level. The level is used to calculate the order of their handeling the multiply (*) operator is of a higher order that the add (+) operator. So the multiplication will be done before the adding.

Reserved keywords

<reserved_keywords>  A new reserved keyword. Not usable as routine or variable name.
 {keyword} 
</reserved_keywords> 
 
Not every word can be freely used as names for variables, tables and indexes. Some of them would conflict with the use of the language and thus are reserved.

Reserved field names

<reserved_fields>  A new reserved fieldname.
 {fieldname} 
</reserved_fields> 
 
Also there are some reserved field names.

Basic operations in the internal language

<actions>  A new action in the internal language.
{"identifier" See the table below for possible identifiers.
 "code" Code to place in the C program at this point. See second table for parameter options.
 ["afterblockcode"] Code for the end of a block, this is used by statements that contain blocks of code.
 [#parameters] Number of values that are read from the stack.
 [resulttype]. | The type of the value that is left on the stack.
 <type name="type" A new type defined for the language.
 [define="code"]>} Code that is put in the beginnen of the program to describe the contents of this type.
</actions> 
 
There is an internal language to the database. It is need for flexibility in the language. It is used to create ANSI-C code and can be used to find errors in the language more easy. But it can also be used for an interpreter to the language.

List of possible types of actions

parm type The code to define this 'type' as a parameter to a routine.
null type The null value of this 'type'.
define type The code to define a variable of this 'type'.
free type The code to free claimed memory of this 'type'. When this code is omitted then the language assumes there is no claimed memory outside the stack.
variable type The code to use to provide the data of a type in an expression.
type -> type A conversion from one type to another.
type operation type A binary operation on two types. When there is a conversion to other types the language creates automatically new operations with the converted types. When two different operations can both make the same operation by translating the operants the first given operation is used by the language.
operation type A unary operation.
constant The value of a constant in the language.

Variables to the internal code

#1 Left parameter to an operation
#2 Rigth parameter to an operation
#p Parameter, mostly used to fill in a variable name
#d Added data for various different usages