In describing Atlas Autocode we use square brackets round an entity to denote that it represents a class of entities and may be replaced by any member of the class. We call an entity in square brackets a PHRASE. For example we could define a decimal digit by
PHRASE[DIGIT] = 0,1,2,3,4,5,6,7,8,9
where the commas are interpreted as meaning 'or'. Thus there are ten different things which can be called [DIGIT], and when we refer to [DIGIT] elsewhere we mean that any of the ten will be legitimate.
We can then build up from this basis and describe, for example, a signed digit as
PHRASE[SIGNED DIGIT] = +[DIGIT], -[DIGIT]
There are also places where a phrase may or may not appear and to signify this a special phrase 'NIL' may be written as the last alternative in a phrase definition. For example the switch limits in a switch declaration can be proceeded by a + or - sign if desired. (Absence of a sign corresponds to +.) The relevant definition is
[NAME LIST]([±'][N]:[±'][N]) where PHRASE[±'] = +,-,NIL
Thus
-4:+4 -4: 4 1: 3
are examples of switch limits.
Alternatively we can use the special ? qualifier as follows.
PHRASE[±] = +, - PHRASE[±?] = [±],NIL
The last is implicit and we can use [±?] (e.g., in place of [±']) without explicity giving the latter definition.
In the interest of efficiency however, it is preferable to keep the depth of analysis as small as possible and for this reason we use the former scheme.
The phrase structure notation can be used recursively, i.e., phrase definitions may,directly or indirectly, use themselves. For example we may define a 'list of names separated by commas' by
PHRASE[NAME LIST] = [NAME][REST OF NAME LIST] PHRASE[REST OF NAME LIST] = [,][NAME][REST OF NAME LIST],NIL
[Since a ',' is used to separate the alternatives of a phrase definition it cannot stand for itself like the other basic symbols. Instead we must write [,]. Similarly [EOL] and [SP] are used to denote 'end of line' and 'space' in the source language.]
The qualifier * also indicates recursiveness and a [NAME LIST] could be defined as
PHRASE[NAME LIST] = [NAME][,NAME*?] PHRASE[,NAME] = [,][NAME]
the definitions
PHRASE[,NAME*?] = [,NAME*],NIL PHRASE[,NAME*] = [,NAME][,NAME*],[,NAME]
being implicit. Again, however, for reasons of efficiency we use the former definition.
Given the phrases of the language it is then possible to describe all the format allowed in a program. For example, if we introduce the phrase[TYPE] as
PHRASE[TYPE] = integer, real, complex
we can define the format for the scalar declarations as
FORMAT[SS] = [TYPE][NAME LIST][S]
The [SS] indicates that it is a source statement, which means it appears on its own in an Autocode program.
In Atlas Autocode there is a further type or CLASS of format, the unconditional instructions [UI], which have the special property that they may be preceded by the conditional operators if [COND] then and unless [COND] then.
A list of the phrases and formats of Atlas Autocode follows. Note that some phrases ([S],[CONST],[NAME] and [TEXT]) are not formally defined. These are defined by special built-in routines which we will not consider here, but those interested may refer to the references given below.
Finally we should point out that some of the definitions are not completely rigid. For example, the arithmetic assignment statement is defined as
FORMAT[UI] = [NAME][APP] = [EXPR]
In the routine which deals with this format, tests are made to ensure that the [NAME][APP] does in fact describe a variable, and is not, for example, a function.
[3]. Brooker,R.A., Morris,D. and Rohl,J.S. ''Trees and Routines'', Computer Journal, Vol. 5. No. 1.
[4]. Brooker,R.A., MacCallum,I.R., Morris,D. and Rohl,J.S. ''The Compiler Compiler'' 3rd Annual Review of Automatic Programming (ed. Goodman), Pergamon Press.
PHRASE [EXPR] = [±'][EXPR'] PHRASE [±] = +, - PHRASE [±'] = +, -, NIL PHRASE [EXPR'] = [OPERAND][OP][EXPR'],[OPERAND] PHRASE [OPERAND] = [NAME][APP],[CONST],([EXPR]),|[EXPR]", i, BUT NOT if PHRASE [APP] = ([EXPR-LIST]), NIL PHRASE [EXPR-LIST] = [EXPR][REST OF EXPR-LIST] PHRASE [REST OF EXPR-LIST]= [,][EXPR][REST OF EXPR-LIST], NIL PHRASE [OP] = +, -, *, /, ↑, ., NIL PHRASE [CR)[acc] = dsa, acc, ca, sac PHRASE [A0] = acc +, acc-, acc*, acc/, acc|, addr, -, NIL PHRASE [QUERY'] = ?, NIL PHRASE (CR)[program] = programme, program PHRASE [,'] = [,], NIL PHRASE [iu] = if, unless PHRASE [acc'] = acc, ca, sac PHRASE [TYPE] = integer, real, complex PHRASE [TYPE'] = integer, real, complex, NIL PHRASE [NAME LIST] = [NAME][REST OF NAME LIST] PHRASE [REST OF NAME LIST]=[,][NAME][REST OF NAME LIST], NIL PHRASE [ARRAY LIST] = [NAME LIST]([BOUND PAIR LIST])[REST OF ARRAY LIST] PHRASE [REST OF ARRAY LIST]=[,][NAME LIST]([BOUND PAIR LIST])[REST OF ARRAY LIST], NIL PHRASE [BOUND PAIR LIST] = [BOUND PAIR][REST OF BOUND PAIR LIST] PHRASE [REST OF BOUND PAIR LIST]=[,][BOUND PAIR][REST OF BOUND PAIR LIST], NIL PHRASE [BOUND PAIR] = [EXPR] : [EXPR] PHRASE [ARRAY FN LIST] = [NAME]([EXPR-LIST])[REST OF ARRAY FN LIST] PHRASE [REST OF ARRAY FN LIST]=[,][NAME]([EXPR-LIST])[REST OF ARRAY FN LIST], NIL PHRASE [SWITCH LIST] = [NAME LIST]([±'][N]:[±'][N])[REST OF SWITCH LIST] PHRASE [REST OF SWITCH LIST]=[,][NAME LIST]([±'][N]:[±'][N])[REST OF SWITCH LIST], NIL PHRASE [RT] = integer map, real map, complex map, integer fn, real fn, complex fn, routine PHRASE [FPP] = ([FP-LIST]), NIL PHRASE [FP-LIST] = [FP][REST OF FP-LIST] PHRASE [FP] = [FP-DELIMITER][NAME] PHRASE [REST OF FP-LIST] = [FP][REST OF FP-LIST], NIL PHRASE [FP-DELIMITER] = [,'][RT],[,'] integer array name, [,'] integer array, [,'] integer name, [,'] integer, [,'][real'] array name, [,'][real'] array, [,'] real name, [,'] real, [,'] complex array name, [,'] complex array, [,'] complex name, [,'] complex, [,'] addr, [,] PHRASE [COND] = [SC] and [AND-C],[SC] or [OR-C],[SC] PHRASE [AND-C] = [SC] and [AND-C], [SC] PHRASE [OR-C] = [SC] or [OR-C],[SC] PHRASE [SC] = [EXPR][COMP][EXPR][COMP][EXPR], [EXPR][COMP][EXPR],([COND]) PHRASE [COMP] = =, ≠, >, ≤, <, ≥ PHRASE [N-LIST] = [N][REST OF N-LIST] PHRASE [REST OF N-LIST] = [,][N][REST OF N-LIST], NIL PHRASE [ALPHA'] = α, NIL PHRASE [± CONST'] = [±][CONST], NIL PHRASE [real'] = real, NIL PHRASE [ADDRESS PART] = [±'][CONST] + [N]:,[N]:,[±'][CONST],[OW] PHRASE [check] = routine trace, jump trace, queries, array bound check PHRASE [FAULT LIST] = [N-LIST] -> [N][REST OF FAULT LIST] PHRASE [REST OF FAULT LIST]=[,][N-LIST] -> [N][REST OF FAULT LIST], NIL PHRASE [SIMPLE LABEL] = [N]:, BUT NOT [N]:[,] PHRASE [RT'] = [RT],NIL FORMAT CLASS[UI] FORMAT [UI] = [NAME][APP] = [EXPR][QUERY'] FORMAT [UI] = [NAME][APP] FORMAT [UI] = ->[N] FORMAT [UI] = ->[NAME]([EXPR]) FORMAT [UI] = caption [TEXT] FORMAT [UI] = result = [EXPR] FORMAT [UI] = return FORMAT [UI] = stop FORMAT [UI] = test [N-LIST] FORMAT [UI] = [check]on FORMAT [UI] = [check]off FORMAT [SS] = [UI][S] FORMAT [SS] = [UI][iu][COND][S] FORMAT [SS] = [iu][COND] then [UI][S] FORMAT [SS] = cycle [NAME][APP] = [EXPR][,][EXPR][,][EXPR][S] FORMAT [SS] = repeat [S] FORMAT [SS] = [SIMPLE LABEL] FORMAT [SS] = [N] case [COND]: FORMAT [SS] = [NAME]([±'][N]): FORMAT [SS] = [TYPE][NAME LIST][S] FORMAT [SS] = [TYPE'] array [ARRAY LIST][S] FORMAT [SS] = [TYPE'] array fn [ARRAY FN LIST][S] FORMAT [SS] = [RT'] spec [NAME][FPP][S] FORMAT [SS] = [RT][NAME][FPP][S] FORMAT [SS] = begin [S] FORMAT [SS] = comment [TEXT][S] FORMAT [SS] = end [S] FORMAT [SS] = end of [program][S] FORMAT [SS] = ignore queries [S] FORMAT [SS] = production run [S] FORMAT [SS] = page [TEXT][S] FORMAT [SS] = switch [SWITCH LIST][S] FORMAT [SS] = compile [check][S] FORMAT [SS] = stop [check][S] FORMAT [SS] = own [TYPE][NAME LIST][S] FORMAT [SS] = own [TYPE'] array [ARRAY LIST][S] FORMAT [SS] = fault [FAULT LIST][S] FORMAT [SS] = [FD][,][N][,][N][,][ADDRESS PART][S] FORMAT [SS] = [FD][,][N][,]-[,][ALPHA'][NAME][±CONST'][S] FORMAT [SS] = [±'][CONST][S] FORMAT [SS] = [ADDRESS PART][,][ADDRESS PART][S] FORMAT [SS] = [NAME] = st [S] FORMAT [SS] = st = [EXPR][S] FORMAT [SS] = st = st [±][EXPR'][S] FORMAT [SS] = prepare to read perm [S] FORMAT [SS] = define compiler FORMAT [SS] = define master compiler FORMAT [SS] = define special compiler FORMAT [SS] = advance β8 [S] FORMAT [SS] = pl [NAME]([N][,][N][,][N])[S] FORMAT [SS] = real exponentiation [s] FORMAT [SS] = |[TEXT][S] FORMAT [SS] = now compile from input [N][S] FORMAT [SS] = upper case delimiters [S] FORMAT [SS] = normal delimiters [S] FORMAT [SS] = [TEXT][S]