[COMMITTED] algol68: fix some typos and add coupleof examples to ga68.vw
Jose E. Marchesi
jemarch@gnu.org
Wed Apr 2 09:57:14 GMT 2025
---
gcc/algol68/ga68.vw | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/gcc/algol68/ga68.vw b/gcc/algol68/ga68.vw
index 6b78cf9f260..f875fec8f01 100644
--- a/gcc/algol68/ga68.vw
+++ b/gcc/algol68/ga68.vw
@@ -261,6 +261,9 @@ B) PACK :: STYLE pack.
a) SOID NEST closed clause{22a,5D,551a,A341h,A349a} :
SOID NEST serial clause defining LAYER{32a} PACK.
+{ Examples:
+ a) BEGIN x := 1; y := 2 END }
+
3.2 Serial clauses
3.2.1 Syntax
@@ -285,7 +288,7 @@ b) SOID NEST series with PROPSETY{a,b,35c} :
SOID2 NEST series with LABSETY{b} ;
where (PROPSETY) is (EMPTY),
SOID NEST unit{d}.
-c) NEST label efinition of label TAG{b} :
+c) NEST label definition of label TAG{b} :
label NEST defining identifier with TAG{48a}, label{94f} token.
d) SOME unit{b,33b,g,34i,35d,46m,n,521c,532e,541a,b,543c,A34Ab,c,d} :
SOME UNIT{5A,-}.
@@ -311,6 +314,23 @@ i) *establishing clause :
{ The paranotion establishing-clause encompasses both module-texts and
revelations. }
+{ Examples:
+ b) read (x1); REAL s:= 0;
+ sum: FOR i TO n DO (x1[i] > 0 | s :+= x1[i] | nonpos) OD EXIT
+ nonpos: print (s)
+
+ REAL s := 0;
+ sum: FOR i TO n DO (x1[i] > 0 | s :+= x1[i] | nonpos) OD EXIT
+ nonpos: print (s)
+
+ sum: FOR i TO n DO (x1[i] > 0 | s :+= x1[i] | nonpos) OD EXIT
+ nonpos: print (s)
+
+ FOR i TO n DO (x1[i] > 0 | s :+= x1[i] | nonpos) OD EXIT
+ nonpos: print (s)
+ c) sum:
+ d) print (s) }
+
3.3 Collateral and parallel clauses
3.3.1 Syntax
@@ -374,7 +394,7 @@ g) SOID NEST2 in part of choice using integral{e} :
SOID NEST2 joined portrait{33b}.
h) SOID NEST2 in part of choice using UNITED{e,h} :
SOID NEST2 case part of choice using UNITED{i} ;
- where SOID balances SOID1 and sOID2{32e},
+ where SOID balances SOID1 and SOID2{32e},
SOID1 NEST2 case part of choice using UNITED{i},
and also{94f} token,
SOID2 NEST2 in part of choice using UNITED{h}.
@@ -910,6 +930,10 @@ g) *module text :
f) POSTLUDE close (f) }
+{ Note that the EMPTY (for PROPSETY) in rule f enforces that a module
+ postlude cannot contain declarations, labels or module accesses.
+ Only units are allowed. }
+
{ Rule b ensures that a unique 'TAU' is associated with each
module-text accessible from any given point in the program. This is
used to ensure that an invoke ATU' can be identified in the nest of
--
2.30.2
More information about the Algol68
mailing list