ALGOL 68RS: Difference between revisions
→Example: lang -> syntaxhighlight
m (short ALGOL 68RS description.) |
(→Example: lang -> syntaxhighlight) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1:
{{wikipedia}}{{implementation|ALGOL 68}}
<br>
ALGOL 68RS from [http://en.wikipedia.org/wiki/Royal_Signals_and_Radar_Establishment RSRE] was a portable compiler system written in ALGOL 68RS (bootstrapped from [[ALGOL 68R]]), and implemented on a variety of systems including the [http://en.wikipedia.org/wiki_ICL_2900_Series ICL 2900]/[http://en.wikipedia.org/wiki/ICL_Series_39 Series 39], [[Multics]] and [http://en.wikipedia.org/wikiVAX|DEC VAX/VMS].▼
<br>
▲ALGOL 68RS from [
The language was based on the Revised Report, but with similar subset restrictions to [[ALGOL 68R]].
This compiler survives
== Modules ==
Line 9 ⟶ 11:
Syntax:
<lang algol68>PROGRAM [ (holelist ) ] progtitle▼
▲PROGRAM [ (holelist ) ] progtitle
[ CONTEXT holename IN progtitle ]
[ USE uselist ]
enclosed clause
FINISH</lang>
<lang algol68>DECS dectitle▼
▲DECS dectitle
CONTEXT holename IN progtitle
[ USE uselist ]
decsbody
KEEP keeplist
FINISH</lang>
=== Example ===
<syntaxhighlight lang=algol68>PROGRAM (thinking, displaying) chess▼
▲PROGRAM (thinking, displaying) chess
BEGIN
MODE PIECE = STRUCT(...);
Line 36 ⟶ 32:
HERE displaying(PIECE, pieces, BOARD, game);
...
END</lang>
<lang algol68>PROGRAM thinkmodule▼
▲PROGRAM thinkmodule
CONTEXT thinking IN chess
...
FINISH</syntaxhighlight>
An entire program can thus be '''composed''' of pieces of other modules, particularly if a ''hole'' contains a sub-''hole'' (eg displaypiece), then this
Example:
<lang algol68>PROGRAM abc▼
▲PROGRAM abc
COMPOSE game(thinking=thinkmodule, displaying=displayingmodule(piece=displaypiece))
FINISH</lang>
|