2 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 * See the copyright notice in the ACK home directory, in the file "Copyright".
5 * Author: Ceriel J.H. Jacobs
8 /* D E C L A R A T I O N S */
10 /* stripped down version of the one in the Modula-2 compiler */
12 /* $Id: declar.g,v 1.3 1994/06/24 12:44:47 ceriel Exp $ */
41 BEGIN StatementSequence
49 CONST [ ConstantDeclaration ';' ]*
51 TYPE [ TypeDeclaration ';' ]*
53 VAR [ VariableDeclaration ';' ]*
55 ProcedureHeading ';' block IDENT ';'
61 var IdentList ':' FormalType
95 /* The subrange type is given a base type by the
96 qualident (this is new modula-2).
118 This is not exactly the rule in the new report, but see
119 the rule for "SimpleType".
121 '[' ConstExpression UPTO ConstExpression ']'
133 RECORD FieldListSequence END
147 /* Also accept old fashioned Modula-2 syntax, but give a warning.
148 Sorry for the complicated code.
154 /* This is correct, in both kinds of Modula-2, if
155 the first qualident is a single identifier.
159 /* Old fashioned! the first qualident now represents
165 /* Aha, third edition. Well done! */
172 ELSE FieldListSequence
183 CaseLabelList ':' FieldListSequence
187 /* Changed rule in new modula-2 */
210 /* In a pointer type definition, the type pointed at does not
211 have to be declared yet, so be careful about identifying
259 ConstantDeclaration :
260 IDENT '=' ConstExpression
263 VariableDeclaration :
274 '[' ConstExpression ']'