Data Types
----------

	"int"		(32 bit signed)
	"real"		(64 bit floating point)
	"string"	(arbitrary length of 8-bit characters)

	Arrays of these types are allowed, using the [] notation. The first
	element of any array is numbered 0. The array name without [..] 
	evaluates to the number of elements in the array. The length of
	arrays are fixed at declaration time.


Automatic Type conversion
-------------------------

	Before evaluating an expression, all variables are case to the
	same type as the lvalue as follows:

	Original Type		INT		REAL		STRING

	real			trunc(real)	real		"real"
	int			int		int.0		"int"
	string			len(string)	len(string)	"string"

Operators
---------
	Symbol	Description		Applies to		Priority

	+	Addition		int	real	string		5
	-	Subtraction or negation	int	real			5
	*	Multiplication		int	real			3
	/	Division		int	real			3
	%	Modulus			int				4
	~	binary complement	int				4
	|	bitwise OR		int				4
	^	bitwise XOR		int				4
	&	bitwise AND		int				4
	=	Assignment		int	real	string		7
	++	pre or post Increment	int	real			1
	--	pre or post Decrement	int	real			1
	==	Equality test		int	real	string		6
	+=	Add and store		int	real	string		2
	-=	Subtract and store	int	real			2
	*=	Multiply and store	int	real			2
	/=	Divide and store	int	real			2

	Priority can be altered by the use of parentheses "(" and ")".

Variables and Arrays
--------------------

	Variables are sequences of a-zA-Z0-9_ not starting with a digit.
	Variable names can be up to 32 characters long.
	
	Declarations take the form of "type variable" with optional "[n]" to
	indicate an array. The size of an array may be specified with a
	variable.

	All arrays are initialised to be empty. Runtime bounds checking is
	performed.

Expressions
-----------

	An expression is an alternating sequence of variables and operators
	using infix notation.
	Parentheses can be inserted to alter the priority of evaluation.

Statements
----------

	- Simple statements of the form "variable OP expression ;"
	- Compound statements:

		{
		simple statement
		simple statement
			...
		}

	- Conditional construct:

		IF (EXPRESSION)
			statement
		ELSE
			statement

	- Loop construct:

		for( INITIALISER ; EXPRESSION ; UPDATE)
			statement;

		INITIALISER: 	statement [, statement ... ]
		UPDATE: 	statement [, statement ... ]

		This is the only place in the language where it is legal
		to give a list of statements as per C.

Functions
---------

Functions are declared as follows:

	MODIFIER TYPE function-name(TYPE arg1,TYPE arg2,...)
		{

		return VAL;
		}

A function can return any of the three basic types or arrays. Automatic
type conversion is done as required to the returned value;

All functions must have a prototype which gives the types of parameters and
the return type for the function.

MODIFIER is either "local" or not present. A local function is callable only
from within the same file.
