ALGOL W
外观
编程范型 | 多范型:过程式, 指令式, 结构化 |
---|---|
语言家族 | ALGOL |
设计者 | Niklaus Wirth, Tony Hoare |
发行时间 | 1966年 |
型态系统 | 静态, 强类型 |
作用域 | 词法 |
实作语言 | PL360 |
系统平台 | IBM System/360 |
启发语言 | |
ALGOL 60, ALGOL X | |
影响语言 | |
Pascal, Modula-2 |
ALGOL W,一种编程语言,为ALGOL家族的一分子。它基于尼克劳斯·维尔特与东尼·霍尔在IFIP Working Group 2.1针对ALGOL X所提出的草案而设计,希望能作为ALGOL 60的后继者[1]。经过小幅度的修改[2],在斯坦福大学,尼克劳斯·维尔特利用IBM System/360机器,以PL360实作出第一版的ALGOL W[3] 。
它的编译器是用尼克劳斯·维尔特所设计的PL360组语所写成[4]。
例子
[编辑]下面例子展示ALGOL W的记录类型设施:
RECORD PERSON (
STRING(20) NAME;
INTEGER AGE;
LOGICAL MALE;
REFERENCE(PERSON) FATHER, MOTHER, YOUNGESTOFFSPRING, ELDERSIBLING
);
REFERENCE(PERSON) PROCEDURE YOUNGESTUNCLE (REFERENCE(PERSON) R);
BEGIN
REFERENCE(PERSON) P, M;
P := YOUNGESTOFFSPRING(FATHER(FATHER(R)));
WHILE (P ¬= NULL) AND (¬ MALE(P)) OR (P = FATHER(R)) DO
P := ELDERSIBLING(P);
M := YOUNGESTOFFSPRING(MOTHER(MOTHER(R)));
WHILE (M ¬= NULL) AND (¬ MALE(M)) DO
M := ELDERSIBLING(M);
IF P = NULL THEN
M
ELSE IF M = NULL THEN
P
ELSE
IF AGE(P) < AGE(M) THEN P ELSE M
END
引用
[编辑]- ^ Niklaus Wirth & C. A. R Hoare (1966) A contribution to the development of ALGOL. Communications of the ACM, Vol.9, pp. 413–432
- ^ Niklaus Wirth (1966), Additional notes on "A Contribution to the Development of ALGOL", ALGOL Bulletin, Number 24 pp. 13 - 17.
- ^ Stanford Computer Science Department Technical Report CS-TR-68-89 (页面存档备份,存于互联网档案馆) (Various documents for Stanford University's 1972 implementation of ALGOL W; this report includes the ALGOL W Language Description.)
- ^ PL360(REVISED) A PROGRAMMING LANGUAGE FOR THE IBM 360. (PDF). [2020-05-16]. (原始内容存档 (PDF)于2016-03-04).
外部链接
[编辑]- aw2c – ALGOL W compiler for Linux
- awe(页面存档备份,存于互联网档案馆) – aw2c updated version
- ALGOL W @ Everything2 (页面存档备份,存于互联网档案馆) – informal but detailed description of the language by a former user, with sidebars extolling ALGOL W over Pascal as an educational programming language
- 1969 ALGOL W compiler listing(页面存档备份,存于互联网档案馆) at bitsavers.org
- The Michigan Terminal System Manuals, Volume 16: ALGOL W in MTS(页面存档备份,存于互联网档案馆)
- Algol W materials(页面存档备份,存于互联网档案馆) More than 200 Algol W programs and documentation