[an error occurred while processing this directive]
An ADM program is specified by a set of entity descriptions, each of which consists of a header and a body. The entity descriptions describe the sets of variables and actions which can be instantiated.
entity name (parameter_list)
{ body }
The name of the entity is an alphanumeric
identifier, and must start with a letter. The parameter list is a
possibly empty list of comma-separated parameter names, where each
parameter name starts with an underscore ("_"), e.g. (_bank,
_number). A set of entity descriptions gives a program
specification. Any occurrence of "//" is the start of a comment, which
is terminated by a newline.definition variable_list action action_listwhere variable_list is a list of variables, each of which can be optionally initialised with a definition (e.g.
a = b * c * d). The action_list is
a comma-separated list of actions.guard procedural_action -> commandwhere a guard is an arithmetic or boolean expression involving constants and other variables. It is false or zero, and true otherwise. A procedural_action is of the form
print (message)where message is a comma-separated list of quoted strings (e.g. "Number: "), parameters and parametric variables. The value of supplied paramteres or variables is printed. A command is a semicolon-separated list of dynamic actions and definitions, or the keyword
stop, which halts
execution.name (parameter_list)where name is the name of the entity to be instantiated, and parameter_list is the comma-separated list of parameters. Each parameter can be an arithmetic or boolean expression involving either parameters of the entity or constants, but not variables. An entity deletion is of the same form, but prefixed with the keyword delete. Parameters are used in a call-by-value manner, so a parameter cannot be redefined.
variable = expressionwhere expression is a boolean or integer arithmetic expression. The boolean operators available are
<, <=, ==, >=,
>, !=, &&
and ||, and the arithmetic operators available are the four standard
operators (+, -, *, /), unary minus (-), the rand() function
where rand(n) returns a value between 1 and n, and the
arithmetic if...then...else... construct. Expressions can
also contain constants (true, false, @ and
integers), the evaluation operator (e.g. |date|), and other
variables.valid, book[_number] and cheque[_date,_signed].