4848 equals symbol, declarer;
4949 mode symbol, defining indicant,
5050 equals symbol, void symbol;
51+ public symbol, mode symbol, defining indicant,
52+ equals symbol, declarer;
53+ public symbol, mode symbol, defining indicant,
54+ equals symbol, void symbol;
5155 mode declaration, comma symbol,
5256 defining indicant, equals symbol, declarer;
5357 mode declaration, comma symbol,
@@ -71,8 +75,16 @@ a68_lower_mode_declaration (NODE_T *p, LOW_CTX_T ctx)
7175 }
7276 else
7377 {
74- gcc_assert (IS (SUB (p), MODE_SYMBOL));
75- defining_indicant = NEXT (SUB (p));
78+ if (IS (SUB (p), PUBLIC_SYMBOL))
79+ {
80+ gcc_assert (IS (NEXT (SUB (p)), MODE_SYMBOL));
81+ defining_indicant = NEXT (NEXT (SUB (p)));
82+ }
83+ else
84+ {
85+ gcc_assert (IS (SUB (p), MODE_SYMBOL));
86+ defining_indicant = NEXT (SUB (p));
87+ }
7688 }
7789
7890 /* Create a TYPE_DECL declaration for the defined mode and chain it in the
@@ -100,6 +112,12 @@ a68_lower_mode_declaration (NODE_T *p, LOW_CTX_T ctx)
100112 qualifier, declarer, defining identifier;
101113 declarer, defining identifier, assign symbol, unit;
102114 declarer, defining identifier;
115+ public symbol, qualifier, declarer, defining identifier,
116+ assign symbol, unit;
117+ public symbol, qualifier, declarer, defining identiifer;
118+ qualifier, declarer, defining identifier;
119+ public symbol, declarer, defining identifier, assign symbol, unit;
120+ declarer, defining identifier;
103121 variable declaration, comma symbol,
104122 defining identifier, assign symbol, unit;
105123 variable declaration, comma symbol,
@@ -135,21 +153,29 @@ a68_lower_variable_declaration (NODE_T *p, LOW_CTX_T ctx)
135153 sub_expr = a68_lower_tree (SUB (p), new_ctx);
136154 defining_identifier = NEXT (NEXT (SUB (p)));
137155 }
138- else if (IS (SUB (p), QUALIFIER))
139- {
140- /* The qualifier determines what kind of generator is used in the
141- variable declaration. This is already annotated in the tax entry for
142- the definining identifier. */
143- declarer = NEXT (SUB (p));
144- defining_identifier = NEXT (NEXT (SUB (p)));
145- }
146- else if (IS (SUB (p), DECLARER))
156+ else
147157 {
148- declarer = SUB (p);
149- defining_identifier = NEXT (SUB (p));
158+ NODE_T *q = SUB (p);
159+
160+ if (IS (q, PUBLIC_SYMBOL))
161+ FORWARD (q);
162+
163+ if (IS (q, QUALIFIER))
164+ {
165+ /* The qualifier determines what kind of generator is used in the
166+ variable declaration. This is already annotated in the tax entry
167+ for the definining identifier. */
168+ declarer = NEXT (q);
169+ defining_identifier = NEXT (NEXT (q));
170+ }
171+ else if (IS (q, DECLARER))
172+ {
173+ declarer = q;
174+ defining_identifier = NEXT (q);
175+ }
176+ else
177+ gcc_unreachable ();
150178 }
151- else
152- gcc_unreachable ();
153179
154180 /* Communicate declarer upward. */
155181 if (ctx.declarer != NULL )
@@ -281,6 +307,8 @@ a68_lower_variable_declaration (NODE_T *p, LOW_CTX_T ctx)
281307
282308 identity declaration : declarer, defining identifier,
283309 equals symbol, unit;
310+ public symbol, declarer, defining identifier,
311+ equals symbol, unit;
284312 identity declaration, comma symbol,
285313 defining identifier, equals symbol, unit;
286314
@@ -310,6 +338,10 @@ a68_lower_identity_declaration (NODE_T *p, LOW_CTX_T ctx)
310338 sub_expr = a68_lower_tree (SUB (p), ctx);
311339 defining_identifier = NEXT (NEXT (SUB (p)));
312340 }
341+ else if (IS (SUB (p), PUBLIC_SYMBOL))
342+ {
343+ defining_identifier = NEXT (NEXT (SUB (p)));
344+ }
313345 else if (IS (SUB (p), DECLARER))
314346 {
315347 defining_identifier = NEXT (SUB (p));
@@ -443,6 +475,7 @@ a68_lower_declaration_list (NODE_T *p, LOW_CTX_T ctx)
443475/* Lower a procedure declaration.
444476
445477 procedure declaration : proc symbol, defining identifier, assign symbol, routine text;
478+ public symbol, proc symbol, defining identifier, assign symbol, routine text;
446479 procedure declaration, comma symbol,
447480 defining identifier, equals symbol, routine text.
448481
@@ -458,6 +491,10 @@ a68_lower_procedure_declaration (NODE_T *p, LOW_CTX_T ctx)
458491 sub_func_decl = a68_lower_tree (SUB (p), ctx);
459492 defining_identifier = NEXT (NEXT (SUB (p)));
460493 }
494+ else if (IS (SUB (p), PUBLIC_SYMBOL))
495+ {
496+ defining_identifier = NEXT (NEXT (SUB (p)));
497+ }
461498 else if (IS (SUB (p), PROC_SYMBOL))
462499 {
463500 defining_identifier = NEXT (SUB (p));
@@ -493,6 +530,8 @@ a68_lower_procedure_declaration (NODE_T *p, LOW_CTX_T ctx)
493530 procedure variable declaration
494531 : proc symbol, defining identifier, assign symbol, routine text;
495532 qualifier, proc symbol, defining identifier, assign symbol, routine text;
533+ public symbol, proc symbol, defining identifier, assign symbol, routine text;
534+ public symbol, qualifier, proc symbol, defining identifier, assign symbol, routine text;
496535 procedure variable declaration, comma symbol, defining identiier, assign symbol, routine text.
497536
498537 This lowers into the declaration of a VAR_DECL which is a pointer to the
@@ -508,15 +547,24 @@ a68_lower_procedure_variable_declaration (NODE_T *p, LOW_CTX_T ctx)
508547 sub_decl = a68_lower_tree (SUB (p), ctx);
509548 defining_identifier = NEXT (NEXT (SUB (p)));
510549 }
511- else if (IS (SUB (p), PROC_SYMBOL))
512- defining_identifier = NEXT (SUB (p));
513- else if (IS (SUB (p), QUALIFIER))
514- /* The qualifier determines what kind of generator is used in the variable
515- declaration. This is already annotated in the tax entry for the
516- definining identifier. */
517- defining_identifier = NEXT (NEXT (SUB (p)));
518550 else
519- gcc_unreachable ();
551+ {
552+ NODE_T *q = SUB (p);
553+
554+ if (IS (q, PUBLIC_SYMBOL))
555+ FORWARD (q);
556+
557+ if (IS (q, PROC_SYMBOL))
558+ defining_identifier = NEXT (q);
559+ else if (IS (q, QUALIFIER))
560+ /* The qualifier determines what kind of generator is used in the
561+ variable declaration. This is already annotated in the tax entry
562+ for the definining identifier. */
563+ defining_identifier = NEXT (NEXT (q));
564+ else
565+ gcc_unreachable ();
566+ }
567+
520568 NODE_T *routine_text = NEXT (NEXT (defining_identifier));
521569
522570 /* The routine text lowers into a pointer to function. */
@@ -590,6 +638,7 @@ a68_lower_priority_declaration (NODE_T *p ATTRIBUTE_UNUSED,
590638
591639 brief operator declaration
592640 : op symbol, defining operator, equals symbol, routine text;
641+ public symbol, op symbol, defining operator, equals symbol, routine text;
593642 brief operator declaration, comma symbol, defining operator, equals symbol, routine text.
594643
595644 The declarations low in a series of FUNCTION_DECLs, one per declared
@@ -607,7 +656,15 @@ a68_lower_brief_operator_declaration (NODE_T *p, LOW_CTX_T ctx)
607656 defining_operator = NEXT (NEXT (SUB (p)));
608657 }
609658 else
610- defining_operator = NEXT (SUB (p));
659+ {
660+ if (IS (SUB (p), PUBLIC_SYMBOL))
661+ {
662+ gcc_assert (IS (NEXT (SUB (p)), OP_SYMBOL));
663+ defining_operator = NEXT (NEXT (SUB (p)));
664+ }
665+ else
666+ defining_operator = NEXT (SUB (p));
667+ }
611668 NODE_T *routine_text = NEXT (NEXT (defining_operator));
612669
613670 /* Lower the routine text to get a function decl. */
@@ -634,6 +691,7 @@ a68_lower_brief_operator_declaration (NODE_T *p, LOW_CTX_T ctx)
634691/* Lower an operator declaration.
635692
636693 operator declaration : operator plan, defining operator, equals symbol, unit;
694+ public symbol, operator plan, defining operator, equals symbol, unit;
637695 operator declaration, comma symbol, defining operator, equals symbol, unit.
638696
639697 Each operator declaration lowers into a declaration. */
@@ -650,7 +708,12 @@ a68_lower_operator_declaration (NODE_T *p, LOW_CTX_T ctx)
650708 defining_operator = NEXT (NEXT (SUB (p)));
651709 }
652710 else
653- defining_operator = NEXT (SUB (p));
711+ {
712+ if (IS (SUB (p), PUBLIC_SYMBOL))
713+ defining_operator = NEXT (NEXT (SUB (p)));
714+ else
715+ defining_operator = NEXT (SUB (p));
716+ }
654717 NODE_T *unit = NEXT (NEXT (defining_operator));
655718
656719 tree op_decl = TAX_TREE_DECL (TAX (defining_operator));
0 commit comments