Language Reference
by Helmut Emmelmann, PhD
and Keith Oustalet
|
Expressions can occur as parameters for heitml and user defined tags.
They are evaluated before execution of a specific tag.
heitml knows the following data types:
- Integer, 32-Bits
- Boolean, true or false
- Float, 64-Bits
- String, up to 32767 characters
- Tuple
- Unknown
|
Integer and boolean are different types (and not the same as in C).
The special value null is the only value which has the type
unknown.
A tuple is (as a struct in C) a sequence of fields with an associated value. However the number of fields, their names and types can change dynamically.
Each value processed by heitml has one of the 6 above-described datatypes associated with it. Note that there is a difference between 6 as an integer value and "6" as a string. Also, true as boolean value and "true" as a string are different.
Each heitml variable has an identifier, which must be declared when a value is first assigned to it. heitml is a Dynamically Typed Language, which means that variable types are assigned according to the type of data
associated with it. Later, the variable type can change simply by assigning it a new type of data.
Variables are local to the current heitml-page or to the current invocation of a procedure.
There are two global tuple variables called gl and ff. Global
means that all procedures can access these variables.
Assignments occur when explicitely written down with the = operator and
implicitely during parameter passing.
Assignments of all types except tuple have the usual value semantics, the
whole value is copied. For tuples pointer semantics applies. This means a
tuple is an object on the heap and a tuple variable always contains a
reference to a tuple on the heap. Assignment assigns this reference. Unused
tuples are automatically cleand up (currently reference counting is used).
heitml knows the operators + (add), - (subtract), * (multiply), / (divide),
% (modulo) which work as usual on integer and
real variables. The plus symbol "+" can also be used to concatenate strings.
Binary boolean expressions use the operators ==, !=, <, <=, >=, ||, &&
with ascending precedence. Unary boolean expressions consist of the not operator "!" followed by a boolean expression.
The assignment operator "=" assigns the right operand to the left operand.
Therefore, the left operand must denote a variable or a field of a tuple.
The operator "," evaluates both operands and returns the result of the
second.
The operator "." selects a field of a tuple. The right operand of "." must
be an identifier and the left operand a tuple. The result is the field of the
tuple designated by the identifier. The "." operator can be used on the left
hand side or the right hand side of an assignment statement. If used on the
right hand side, the named field must be existent. If used on the left hand
side a new field is added to the tuple, if neccessary.
The operator "[]" can be used to index a tuple or a string.
If t is a tuple and i an integer t[i] denotes the i-th
field of the tuple, counting starts with 0.
If s is a string and i an integer s[i] denotes the i-th
character of the string, counting starts with 0.
If t is a tuple and s is a string t[s] denotes the field of t with name s.
This page was dynamically generated by
heitml
© 1996-1997 H.E.I. All Rights Reserved
|