[COMMITTED] algol68: add syntax for denotations, tokens and pragments to ga68.vw

Jose E. Marchesi jemarch@gnu.org
Mon Apr 21 11:26:57 GMT 2025


---
 gcc/algol68/ga68.vw | 228 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 228 insertions(+)

diff --git a/gcc/algol68/ga68.vw b/gcc/algol68/ga68.vw
index 9f421b90c21..ef3f4d9df6b 100644
--- a/gcc/algol68/ga68.vw
+++ b/gcc/algol68/ga68.vw
@@ -62,6 +62,9 @@
   descriptions of other languages that typically use some variant of
   the BNF notation.
 
+  Sample code in examples and pragmatics is expressed using the UPPER
+  stropping regime.
+
   This file is better browsed using the Emacs vw-mode, which provides
   automatic indentation, font-lock, and other facilities like the
   hiding of annotations an the following of cross-references.  See the
@@ -1423,6 +1426,231 @@ b) voided to{61A} void COMORF :
     b) PROC VOID (pp) (in PROC PROC VOID pp = PROC VOID : (print (1);
             VOID : print (2)); PROC VOID (pp);) }
 
+8 Denotations
+
+8.1 Plain denotations
+
+8.1.0.1 Syntax
+
+A) SIZE:: long ; short.
+B) *NUMERAL :: fixed point numeral ; variable point numeral ;
+               floating point numeral.
+
+a) SIZE INTREAL denotation{a,80a} :
+     SIZE symbol{94d}, INTREAL, denotation{a,811a,812a}.
+
+b) *plain denotation :
+     PLAIN denotation{a,811a,812a,813a,814a} ; void denotation{815a}.
+
+{ Example:
+    a) LONG 0 }
+
+8.1.1 Integral denotations
+
+8.1.1.1 Syntax
+
+a) integral denotation{80a,810a} : fixed point numeral{b}.
+b) fixed point numeral{a,812c,d,f,i,A341h} : digit cypher{c} sequence.
+c) digit cypher{b} : DIGIT symbol{94b}.
+
+{ Examples:
+    a) 4096
+    b) 4096
+    c) 4 }
+
+8.1.2 Real denotations
+
+8.1.2.1 Syntax
+
+a) real denotation{80a,810a} :
+     variable point numeral{b} ; floating point numeral{e}.
+b) variable point numeral{a,f} :
+     integral part{c} option, fractional part{d}.
+c) integral part{b} : fixed point numeral{811b}.
+d) fractional part{b} : point symbol{94b}, fixed point numeral{811b}.
+e) floating point numeral{a} : stagnant part{f}, exponent part{g}.
+f) stagnant part{e} :
+     fixed point numeral{811b} : variable point numeral{b}.
+g) exponent part{e} :
+     times ten to the power choice{h}, power of then{i}.
+h) times ten to the power choice{g} :
+     times ten to the power symbol{94b} ; letter e symbol{94a}.
+i) power of ten{g}: plusminus{j} option, fixed point numeral{811b}.
+j) plusminus{i} : plus symbol{94c} ; mius symbol{94c}.
+
+{ Examples:
+    a) 0.00123
+       1.23e-3
+    b) 0.00123
+    c) 0
+    d) .00123
+    e) 1.23e-3
+    f) 123
+       1.23
+    g) E-3
+    h) E
+    i) -3
+    j) +
+       - }
+
+8.1.3 Boolean denotations
+
+8.1.3.1 Syntax
+
+a) boolean denotation{80a} : true{94b} symbol ; false{94b} smbol.
+
+{ Examples:
+    a) TRUE
+       FALSE }
+
+8.1.4 Character denotations
+
+8.1.4.1 Syntax
+
+a) character denotation{80a} :
+     quote{94b} symbol, string item{b}, quote sybol{94b}.
+b) string item{a,83b} :
+     character glyph{c} ; quote image symbol{94f} ; other string item{d}.
+c) character glyph{b,92c} :
+     LETTER symbol{94a} ; DIGIT symbol{94b} ;
+     point sybol{94b} ; open symbol{94f} ; close symbol{94f} ;
+     comma symbol{94b} ; space symbol{94b} ;
+     plus symbol{94c} ; minus symbol{94c}.
+
+{ Examples:
+    a) "a"
+    b) a
+       ""
+       ?
+    c) a 1 . ( ) , . space + - }
+
+{ A production rule may be added fo rthe notion 'other string item'
+  each of whose alternatives is a symbol 1.1.3.1.f which is different
+  from any terminal production of 'character glyph' and which is not
+  'quote symbol' }
+
+8.1.5 Void denotation
+
+5.1.5.1 Syntax
+
+a) void denotation{80a} : empty{94b} symbol.
+
+{ Example:
+    a) EMPTY }
+
+8.2 Bits denotations
+
+8.2.1 Syntax
+
+A) RADIX :: radix two ; radix four ; radix eight ; radix sixteen.
+
+a) structured with row of boolean field
+              LENGTH LENGTHETY letter aleph mode denotation{a,80a} :
+     long{94d} symbol, structured with row of boolean field
+                                  LENGTHETY letter aleph mode denotation{a,c}.
+b) structured with row of boolean field
+              SHORT SHORTHTETY letter aleph mode denotation{b,80a} :
+     short{94d} symbol,
+       structured with row of boolean field SHORTHETY letter aleph mode denotation{b,c}.
+c) structured wih row of boolean field
+              letter aleph mode denotation{a,b,80a} :
+     RADIX{d,e,f,g}, letter r symbol{94a}, RADIX digit{h,i,j,k} sequence.
+d) radix two{c,A347b} : digit two{94b} symbol.
+e) radix four{c,A347b} : digit four{94b} symbol.
+f) radix eight{c,A347b} : digit eight{94b} symbol.
+g) radix sixteen{c,A347b} : digit one symbol{94b}, digit six symbol{94b}.
+h) radix two digit{c,i} : digit zero symbol{94b} ; digit one symbol{94b}.
+i) radix four digit{c,j} :
+     radix two digit{h} ; digit two symbol{94b} ;
+     digit three symbol{94b}.
+j) raidx eight digit{c,k} :
+     radix four digit{i} ; digit four symbol{94b} ;
+     digit five symbol{94b} ; digit six symbol{94b} ;
+     digit seven symbol{94b}.
+k) radix sixteen digit{c} :
+     radix eight digit{j} ; digit eight symbol{94b} ;
+     digit nine symbol{94b} ; letter a symbol{94a} ;
+     letter b symbol{94a} ; letter e symbol{94a} ; letter d symbol{94a} ;
+     letter e symbol{94a} ; letter f symbol{94a}.
+
+l) *bits denotation : BITS denotation{a,b,c}.
+m) *radix digit : RADIX digit{h,i,j,k}.
+
+{ Examples:
+    a) LONG 2r101
+    b) SHORT 16rffff
+    c) 8r231 }
+
+8.3 String denotations
+
+8.3.1 Syntax
+
+a) row of character denotation{80a} :
+     quote{94b} symbol, string{b} option, quote symbol{94b}.
+b) string{a} : string item{814b}, string item{814b} sequence.
+
+c) *string denotation : row of charater denotation{a}.
+
+{ Examples:
+    a) "abc"
+    b) abc }
+
+9 Tokens and symbols
+
+9.1 Tokens
+
+{ Tokens are symbols possibly preceded by pragments.  }
+
+9.1.1 Syntax
+
+a) CHOICE STYLE start{34a} :
+     where (CHOICE) is (choice using boolean),
+       STYLE if{94f,-} token ;
+     where (CHOICE) is (CASE), STYLE case{94f,-} token.
+b) CHOICE STYLE in{34e} :
+     where (CHOICE) is (choice using boolean),
+       STYLE then{94f,-} token ;
+     where (CHOICE) is (CASE), STYLE in{94f,-} token.
+c) CHOICE STYLE again{34l} :
+     where (CHOICE) is (choice using boolean),
+       STYLE else if{94f,-} token ;
+     where (CHOICE) is (CASE), STYLE ouse{94f,-} token.
+d) CHOICE STYLE out{34l} :
+     where (CHOICE) is (choice using boolean),
+       STYLE else{94f,-} token ;
+     where (CHOICE) is (CASE), STYLE out{94f,-} token.
+e) CHOICE STYLE finish{34a} :
+     whre (CHOICE) is (choice using boolean),
+       STYLE fi{94f,-} token ;
+     where (CHOICE) is (CASE), STYLE esac{94f,-} token.
+f) NOTION token :
+     pragment{92a} sequence option,
+       NOTION symbol{94a,b,c,d,e,f,g,h}.
+
+g) *token : NOTION token{f}.
+h) *symbol : NOTION symbol{94a,b,c,d,e,f,g,h}.
+
+9.2 Comments and pragmats
+
+9.2.1 Syntax
+
+A) PRAGMENT :: pragmant ; comment.
+
+a) pragment{80a,91f,A341b,h,A348a,b,c,A349a,A34Ab} : PRAGMENT{b}.
+b) PRAGMENT{a} :
+     STYLE PRAGMENT symbol{94h,-},
+       STYLEPRAGMENT item{c} sequence option,
+       STYLE PARGMENT symbol{94h,-}.
+c) STYLE PRAGMENT item{b} :
+     character glyph{814c} ; STYLE other PRAGMENT item{d}.
+
+{ A production rule may be added for each notion designated by 'STYLE
+  other PRAGMENT item each of whose alternatives is a symbol different
+  from any terminal production of 'character glyph', and such that no
+  terminal production of any 'STYLE other PRAGMENT item' is the
+  corresponding STYLE PRAGMENT symbol'.  This allows to nest different
+  comment or pragmat for example.  }
+
 9.4 The reference language
 
 9.4.1 Representations of symbols
-- 
2.30.2



More information about the Algol68 mailing list