Chapter 1. Definitions and Conventions

1.1. Definitions

The following abbreviations are used throughout this guide:

bit

A bit within a byte, 0 <= bit <= 7

comment

Comments begin with either "--" or ";" and continue through the end of the line.

constant

A numeric constant.

expression

An expression is a sequence of values and operations. Expressions are subdivided into:

cexpr -- constant expression

An expression that can be fully evaluated at compile time. For example 1 + 2.

expr -- any expression.

An expression is anything that evaluates to a value, for example: b + c, x + 1, etc.

lexpr -- logical expression

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.

identifier

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.

program

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

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
              

statement

A single assignment, definition, control (BLOCK, CASE, IF) or looping (FOR, FOREVER, REPEAT, WHILE).

statement_block

A sequence of statements. Variables, constants, procedures, and functions defined in a statement_block will not be visible outside of the statement_block.

token

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.

var -- variable