10.07.2015 Views

Algol 68 - ACM Digital Library

Algol 68 - ACM Digital Library

Algol 68 - ACM Digital Library

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>68</strong> van Wijngaarden, et al.Defining-mode-indications-with-SIZETY-STANDARD may be declaredonly in the standard-prelude, where the nest is of the form 'new LAYER'(10.1.l.b) .}4.2.2. SemanticsThe elaboration of a mode-declaration {involves no action, yields novalue and} is completed.4.3. Priority declarations{Priority-declarations are used to specify the priority of operators.Priorities from 1 to 9 are available.Since monadic-operators have effectively only one priority-level, whichis higher than that of all dyadic-operators, monadic-operators do notrequire priority-declarations.}4.3.1. Syntaxa) NEST priority declaration of DECS{41a} :priority{94d} token, NEST priority joined definition of DECS{41b,c}.b) NEST priority definition of priority PRIO TAD{41c} :priority PRIO NEST defining operator with TAD{48a},is defined as{94d} token, DIGIT{94b} token,where DIGIT counts PRIO{c,d}.{DIGIT :: digit zero ; digit one ; digit two ; digit three ; digit four ;digit five ; digit six ; digit seven ; digit eight ; digit nine.}c) WHETHER DIGITI counts PRIO i{b,c} :WHETHER DIGIT2 counts PRIO{c,d},where (digit one digit two digit three digit fourdigit five digit six digit seven digit eight digit nine)~eontains (DIGIT2 DIGITI).d) WHETHER digit one counts i{b,c} : WHETHER true.{Examples:a) prior=2, ^=3 b) v=2}4.3.2. SemanticsThe elaboration of a priority-declaration {involves no action, yields novalue and} is completed.4.4. Identifier declarations{Identifier-declarations provide MODE-defining-identifiers, by means ofeither identity-definitions or variable-definitions.Examples:real pi = 3.1416 •real scan := 0.05.ALGOL <strong>68</strong> Revised Report 69fThe latter example, which is a variable-declaration, may be considered asan equivalent form of the identity-declarationrot real scan = Ioc real := 0.05.The elaboration of identifier-declarations causes values to be ascribedto their identifiers; in the examples given above, 3.1416 is ascribed to piand a new local name which refers to 0.05 is ascribed to scan.}4.4.1. SyntaxA) MODINE :: MODE ; routine.B) LEAP :: local ; heap ; primal.a) NEST MODINE identity declaration of DECS{41a} :formal MODINE NEST declarer{b,46b},NEST MODINE identity joined definition of DECS{41b,c}.b) VICTAL routine NEST declarer{a,523b} : procedure{94d} token.c) NEST MODINE identity definition of MODE TAG{41c} :MODE NEST defining identifier with TAG{48a},is defined as{94d} token, MODE NEST source for MODINE{d}.d) MODE NEST source for MODINE{c,f,45c} :where (MODINE) is (MODE), MODE NEST source{521c} ;where (MODINE) is (routine), MODE NEST routine text{541a,b,-}.e) NEST reference to MODINE variable declaration of DECS{41a} :reference to MODINE NEST LEAP sample generator{523b},NEST reference to MODINE variable joineddefinition of DECS{41b,c}.f) NEST reference to MODINE variable definitionof reference to MODE TAG{41c} :reference to MODE NEST defining identifier with TAG[48a},becomes{94c} token, MODE NEST source for MODINE{d} ;where (MODINE) is (MODE),reference to MODE NEST defining identifier with TAG{48a}.g) *identifier declaration :NEST MODINE identity declaration of DECS{a} ;NEST reference to MODINE variable declaration of DECS{e}.{Examples:a) int m = 4096 • proc rlO= real : random x 10b) proc c) m = 4096d) 4096 • real : random x 10e) real x, y • proc pp := real : random x 10f) pp := real: random x I0 • x }4.4.2. Semanticsa) An identity-declaration D is elaborated as follows:• the constituent sourees-for-MODINE of D are elaborated collaterally;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!