The following abbreviations are used throughout this guide:
A bit within a byte, 0 <= bit <= 7
Comments begin with either "--" or ";" and continue through the end of the line.
A numeric constant.
An expression is a sequence of values and operations. Expressions are subdivided into:
An expression that can be fully evaluated at compile time. For example 1 + 2.
An expression is anything that evaluates to a value, for example: b + c, x + 1, etc.
A logical expression. This differs from an expression in that the result is 0 if the expression is zero, and 1 if the expression is anything other than 0.
Identifies a variable, constant procedure, function, label, etc. Must begin with a letter or '_' followed by any number of of letters (a-z), digits (0-9), or '_'. Note that identifiers beginning with '_' are reserved for the compiler.
A program is simply a sequence of statements. Unlike other languages, in JAL, if the execution runs out of statements, the processor will be put to sleep.
Scope is the `visibility' of an identifier. Each statement_block creates a new scope. Anything declared within this scope will not be visible once the scope ends.
A variable can be redefined in a block as follows:
VAR BYTE x, z ... IF (x) THEN VAR WORD x, y ; all references to x will refer ; to this definition ... END IF ... VAR WORD x ; this is illegal because x already exists
A single assignment, definition, control (BLOCK, CASE, IF) or looping (FOR, FOREVER, REPEAT, WHILE).
A sequence of statements. Variables, constants, procedures, and functions defined in a statement_block will not be visible outside of the statement_block.
The JAL compiler sees only a stream of tokens. An entire program can be written without any line breaks or extra spaces, except of course for comments which are terminated by and end of line.