The FORWARD REFERENCE declaration enables the ALGOL compiler to handle situations in which two procedures, two interrupts, two switch labels, two connection blocks, or two structure blocks make references to each other. Normally, a procedure, interrupt, switch label, connection block, or structure block must be declared before it can be used in a program. However, if two such entities make reference to each other, regardless of which procedure, interrupt, switch label, connection block, or structure block is declared first, then the body of the procedure, interrupt, switch label, connection block, or structure block contains a reference to an undeclared entity.
The FORWARD REFERENCE declaration enables the compiler to recognize such entities before they have been declared in full. When a procedure is declared in full, the declaration must match the FORWARD REFERENCE declaration in its type. Also, if there are parameters, these must also match the FORWARD REFERENCE declaration in number and type.
<forward reference declaration>
──┬─<forward interrupt declaration>─────────────┬──────────────────────┤ ├─<forward procedure declaration>─────────────┤ ├─<forward switch label declaration>──────────┤ ├─<forward structure block type declaration>──┤ ├─<forward connection block type declaration>─┤ ├─<forward epilog procedure declaration>──────┤ ├─<forward exception procedure declaration>───┤ └─<forward prolog procedure declaration>──────┘
<forward interrupt declaration>
── INTERRUPT ──<interrupt identifier>── ; ── FORWARD ──────────────────┤
<forward procedure declaration>
──┬──────────────────┬─ PROCEDURE ──<procedure heading>── ; ───────────► └─<procedure type>─┘ ►─ FORWARD ────────────────────────────────────────────────────────────┤
<forward switch label declaration>
── SWITCH ──<switch label identifier>── FORWARD ───────────────────────┤
<forward structure block type declaration>
── TYPE STRUCTURE BLOCK ──<structure block type identifier>── ; ───────► ►─ FORWARD ────────────────────────────────────────────────────────────┤
<forward connection block type declaration>
── TYPE CONNECTION BLOCK ──<connection block type identifier>── ; ─────► ►─ FORWARD ────────────────────────────────────────────────────────────┤
<forward epilog procedure declaration>
── EPILOG PROCEDURE ──<epilog procedure identifier>── ; ── FORWARD ────┤
<forward exception procedure declaration>
── EXCEPTION PROCEDURE ──<exception procedure identifier>── ; ─────────► ►─ FORWARD ────────────────────────────────────────────────────────────┤
<forward prolog procedure declaration>
── PROLOG PROCEDURE ──<prolog procedure identifier>── ; ── FORWARD ────┤

