-- "hoisted" (i.e., Is_Statically_Allocated and not Is_Library_Level)
-- entity must also be either Library_Level or hoisted. It turns out
-- that this would be incompatible with the current treatment of an
- -- object which is local to a subprogram, subject to an Export pragma,
+ -- object that is local to a subprogram, subject to an Export pragma,
-- not subject to an address clause, and whose declaration contains
-- references to other local (non-hoisted) objects (e.g., in the initial
-- value expression).
Build_Location_String (Buf, Loc);
-- If the exception is a renaming, use the exception that it
- -- renames (which might be a predefined exception, e.g.).
+ -- renames (which might be a predefined exception).
if Present (Renamed_Entity (Id)) then
Id := Renamed_Entity (Id);
Cc (N_Exception_Declaration, N_Declaration,
(Sy (Defining_Identifier, Node_Id),
Sy (Aspect_Specifications, List_Id, Default_No_List),
- Sm (Expression, Node_Id),
+ Sy (Expression, Node_Id, Default_Empty),
Sm (More_Ids, Flag),
Sm (Prev_Ids, Flag)));
Node_Field_Types_Used, Entity_Field_Types_Used : Type_Set;
Setter_Needs_Parent : Field_Set :=
- (Expression | Then_Actions | Else_Actions => True,
+ (Then_Actions | Else_Actions => True,
others => False);
-- Set of fields where the setter should set the Parent. True for
- -- syntactic fields of type Node_Id and List_Id, but with some
- -- exceptions. Expression is syntactic AND semantic, and the Parent
- -- is needed. Then_Actions and Else_Actions are not syntactic, but the
- -- Parent is needed.
+ -- syntactic fields of type Node_Id and List_Id. Then_Actions and
+ -- Else_Actions are not syntactic, but the Parent is needed.
--
-- Computed in Check_For_Syntactic_Field_Mismatch.
end if;
end loop;
- -- ???The following fields violate this rule. We might want
- -- to simplify by getting rid of these cases, but we allow
- -- them for now. At least, we don't want to add any new
- -- cases of syntactic/semantic mismatch.
- -- ???Just one case left.
-
- if F in Expression then
- pragma Assert (Syntactic_Seen and Semantic_Seen);
-
- else
- if Syntactic_Seen and Semantic_Seen then
- raise Illegal with
- "syntactic/semantic mismatch for " & Image (F);
- end if;
+ if Syntactic_Seen and Semantic_Seen then
+ raise Illegal with
+ "syntactic/semantic mismatch for " & Image (F);
+ end if;
- if Field_Table (F).Field_Type in Traversed_Field_Type
- and then Syntactic_Seen
- then
- Setter_Needs_Parent (F) := True;
- end if;
+ if Field_Table (F).Field_Type in Traversed_Field_Type
+ and then Syntactic_Seen
+ then
+ Setter_Needs_Parent (F) := True;
end if;
end;
end if;
-- If a field is syntactic, then the constructors in Nmake take a parameter to
-- initialize that field. In addition, the tree-traversal routines in Atree
-- (Traverse_Func and Traverse_Proc) traverse syntactic fields that are of
--- type Node_Id (or subtypes of Node_Id) or List_Id. Finally, (with some
--- exceptions documented in the body) the setter for a syntactic node or list
--- field "Set_F (N, Val)" will set the Parent of Val to N, unless Val is Empty
--- or Error[_List].
+-- type Node_Id (or subtypes of Node_Id) or List_Id. Finally, the setter for a
+-- syntactic node or list field "Set_F (N, Val)" will set the Parent of Val to
+-- N, unless Val is Empty or Error[_List].
--
--- Note that the same field can be syntactic in some node types but semantic
--- in other node types. This is an added complexity that we might want to
--- eliminate someday. We shouldn't add any new such cases.
+-- No syntactic/semantic mixing: the same field cannot be syntactic in some
+-- node types but semantic in other node types.
--
-- A "program" written in the Gen_IL.Gen language consists of calls to the
-- "Create_..." routines below, followed by a call to Compile, also below. In
-- N_Exception_Declaration
-- Sloc points to EXCEPTION
-- Defining_Identifier
- -- Expression
+ -- Expression (see below)
-- More_Ids (set to False if no more identifiers in list)
-- Prev_Ids (set to False if no previous identifiers in list)
+ -- Expression is not present in the syntax; it is set during expansion.
+ -- An exception_declaration is treated by the back end like an object of
+ -- type Standard.Exception_Type, and Expression is the initial value.
+ -- Expression is a syntactic field to match the Expression fields of
+ -- other node kinds.
+
------------------------------------------
-- 11.2 Handled Sequence Of Statements --
------------------------------------------