1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
11 -- Copyright (C) 2001-2002 Free Software Foundation, Inc. --
13 -- GNAT is free software; you can redistribute it and/or modify it under --
14 -- terms of the GNU General Public License as published by the Free Soft- --
15 -- ware Foundation; either version 2, or (at your option) any later ver- --
16 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
17 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
18 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
19 -- for more details. You should have received a copy of the GNU General --
20 -- Public License distributed with GNAT; see file COPYING. If not, write --
21 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
22 -- MA 02111-1307, USA. --
24 -- GNAT was originally developed by the GNAT team at New York University. --
25 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
27 ------------------------------------------------------------------------------
29 with Errout; use Errout;
30 with Namet; use Namet;
31 with Prj.Attr; use Prj.Attr;
32 with Prj.Tree; use Prj.Tree;
33 with Scans; use Scans;
34 with Sinfo; use Sinfo;
35 with Stringt; use Stringt;
37 with Types; use Types;
39 package body Prj.Strt is
41 type Name_Location is record
42 Name : Name_Id := No_Name;
43 Location : Source_Ptr := No_Location;
45 -- Store the identifier and the location of a simple name
47 type Name_Range is range 0 .. 3;
48 subtype Name_Index is Name_Range range 1 .. Name_Range'Last;
49 -- A Name may contain up to 3 simple names
51 type Names is array (Name_Index) of Name_Location;
52 -- Used to store 1 to 3 simple_names. 2 simple names are for
53 -- <project>.<package>, <project>.<variable> or <package>.<variable>.
54 -- 3 simple names are for <project>.<package>.<variable>.
56 type Choice_String is record
57 The_String : String_Id;
58 Already_Used : Boolean := False;
60 -- The string of a case label, and an indication that it has already
61 -- been used (to avoid duplicate case labels).
63 Choices_Initial : constant := 10;
64 Choices_Increment : constant := 10;
66 Choice_Node_Low_Bound : constant := 0;
67 Choice_Node_High_Bound : constant := 099_999_999; -- In practice, infinite
69 type Choice_Node_Id is
70 range Choice_Node_Low_Bound .. Choice_Node_High_Bound;
72 First_Choice_Node_Id : constant Choice_Node_Id :=
73 Choice_Node_Low_Bound;
76 new Table.Table (Table_Component_Type => Choice_String,
77 Table_Index_Type => Choice_Node_Id,
78 Table_Low_Bound => First_Choice_Node_Id,
79 Table_Initial => Choices_Initial,
80 Table_Increment => Choices_Increment,
81 Table_Name => "Prj.Strt.Choices");
82 -- Used to store the case labels and check that there is no duplicate.
84 package Choice_Lasts is
85 new Table.Table (Table_Component_Type => Choice_Node_Id,
86 Table_Index_Type => Nat,
90 Table_Name => "Prj.Strt.Choice_Lasts");
91 -- Used to store the indices of the choices in table Choices,
92 -- to distinguish nested case constructions.
94 Choice_First : Choice_Node_Id := 0;
95 -- Index in table Choices of the first case label of the current
97 -- 0 means no current case construction.
99 procedure Add (This_String : String_Id);
100 -- Add a string to the case label list, indicating that it has not
103 procedure External_Reference (External_Value : out Project_Node_Id);
104 -- Parse an external reference. Current token is "external".
106 procedure Attribute_Reference
107 (Reference : out Project_Node_Id;
108 First_Attribute : Attribute_Node_Id;
109 Current_Project : Project_Node_Id;
110 Current_Package : Project_Node_Id);
111 -- Parse an attribute reference. Current token is an apostrophe.
114 (Term : out Project_Node_Id;
115 Expr_Kind : in out Variable_Kind;
116 Current_Project : Project_Node_Id;
117 Current_Package : Project_Node_Id);
118 -- Recursive procedure to parse one term or several terms concatenated
125 procedure Add (This_String : String_Id) is
127 Choices.Increment_Last;
128 Choices.Table (Choices.Last) :=
129 (The_String => This_String,
130 Already_Used => False);
133 -------------------------
134 -- Attribute_Reference --
135 -------------------------
137 procedure Attribute_Reference
138 (Reference : out Project_Node_Id;
139 First_Attribute : Attribute_Node_Id;
140 Current_Project : Project_Node_Id;
141 Current_Package : Project_Node_Id)
143 Current_Attribute : Attribute_Node_Id := First_Attribute;
146 Reference := Default_Project_Node (Of_Kind => N_Attribute_Reference);
147 Set_Location_Of (Reference, To => Token_Ptr);
148 Scan; -- past apostrophe
149 Expect (Tok_Identifier, "Identifier");
151 if Token = Tok_Identifier then
152 Set_Name_Of (Reference, To => Token_Name);
154 while Current_Attribute /= Empty_Attribute
156 Attributes.Table (Current_Attribute).Name /= Token_Name
158 Current_Attribute := Attributes.Table (Current_Attribute).Next;
161 if Current_Attribute = Empty_Attribute then
162 Error_Msg_Name_1 := Token_Name;
163 Error_Msg ("unknown attribute %", Token_Ptr);
164 Reference := Empty_Node;
167 Set_Project_Node_Of (Reference, To => Current_Project);
168 Set_Package_Node_Of (Reference, To => Current_Package);
169 Set_Expression_Kind_Of
170 (Reference, To => Attributes.Table (Current_Attribute).Kind_1);
172 (Reference, To => Attributes.Table (Current_Attribute).Kind_2 =
173 Case_Insensitive_Associative_Array);
176 if Attributes.Table (Current_Attribute).Kind_2 /= Single then
177 Expect (Tok_Left_Paren, "(");
179 if Token = Tok_Left_Paren then
181 Expect (Tok_String_Literal, "literal string");
183 if Token = Tok_String_Literal then
184 Set_Associative_Array_Index_Of
185 (Reference, To => Strval (Token_Node));
187 Expect (Tok_Right_Paren, ")");
189 if Token = Tok_Right_Paren then
197 end Attribute_Reference;
199 ---------------------------
200 -- End_Case_Construction --
201 ---------------------------
203 procedure End_Case_Construction is
205 if Choice_Lasts.Last = 1 then
206 Choice_Lasts.Set_Last (0);
207 Choices.Set_Last (First_Choice_Node_Id);
210 elsif Choice_Lasts.Last = 2 then
211 Choice_Lasts.Set_Last (1);
212 Choices.Set_Last (Choice_Lasts.Table (1));
216 Choice_Lasts.Decrement_Last;
217 Choices.Set_Last (Choice_Lasts.Table (Choice_Lasts.Last));
218 Choice_First := Choice_Lasts.Table (Choice_Lasts.Last - 1) + 1;
220 end End_Case_Construction;
222 ------------------------
223 -- External_Reference --
224 ------------------------
226 procedure External_Reference (External_Value : out Project_Node_Id) is
227 Field_Id : Project_Node_Id := Empty_Node;
231 Default_Project_Node (Of_Kind => N_External_Value,
232 And_Expr_Kind => Single);
233 Set_Location_Of (External_Value, To => Token_Ptr);
235 -- The current token is External
237 -- Get the left parenthesis
240 Expect (Tok_Left_Paren, "(");
242 -- Scan past the left parenthesis
244 if Token = Tok_Left_Paren then
248 -- Get the name of the external reference
250 Expect (Tok_String_Literal, "literal string");
252 if Token = Tok_String_Literal then
254 Default_Project_Node (Of_Kind => N_Literal_String,
255 And_Expr_Kind => Single);
256 Set_String_Value_Of (Field_Id, To => Strval (Token_Node));
257 Set_External_Reference_Of (External_Value, To => Field_Id);
259 -- Scan past the first argument
265 when Tok_Right_Paren =>
267 -- Scan past the right parenthesis
272 -- Scan past the comma
276 Expect (Tok_String_Literal, "literal string");
280 if Token = Tok_String_Literal then
282 Default_Project_Node (Of_Kind => N_Literal_String,
283 And_Expr_Kind => Single);
284 Set_String_Value_Of (Field_Id, To => Strval (Token_Node));
285 Set_External_Default_Of (External_Value, To => Field_Id);
287 Expect (Tok_Right_Paren, ")");
290 -- Scan past the right parenthesis
291 if Token = Tok_Right_Paren then
296 Error_Msg ("',' or ')' expected", Token_Ptr);
299 end External_Reference;
301 -----------------------
302 -- Parse_Choice_List --
303 -----------------------
305 procedure Parse_Choice_List (First_Choice : out Project_Node_Id) is
306 Current_Choice : Project_Node_Id := Empty_Node;
307 Next_Choice : Project_Node_Id := Empty_Node;
308 Choice_String : String_Id := No_String;
309 Found : Boolean := False;
313 Default_Project_Node (Of_Kind => N_Literal_String,
314 And_Expr_Kind => Single);
315 Current_Choice := First_Choice;
318 Expect (Tok_String_Literal, "literal string");
319 exit when Token /= Tok_String_Literal;
320 Set_Location_Of (Current_Choice, To => Token_Ptr);
321 Choice_String := Strval (Token_Node);
322 Set_String_Value_Of (Current_Choice, To => Choice_String);
325 for Choice in Choice_First .. Choices.Last loop
326 if String_Equal (Choices.Table (Choice).The_String,
331 if Choices.Table (Choice).Already_Used then
332 String_To_Name_Buffer (Choice_String);
333 Error_Msg_Name_1 := Name_Find;
334 Error_Msg ("duplicate case label {", Token_Ptr);
336 Choices.Table (Choice).Already_Used := True;
344 String_To_Name_Buffer (Choice_String);
345 Error_Msg_Name_1 := Name_Find;
346 Error_Msg ("illegal case label {", Token_Ptr);
351 if Token = Tok_Vertical_Bar then
353 Default_Project_Node (Of_Kind => N_Literal_String,
354 And_Expr_Kind => Single);
355 Set_Next_Literal_String (Current_Choice, To => Next_Choice);
356 Current_Choice := Next_Choice;
362 end Parse_Choice_List;
364 ----------------------
365 -- Parse_Expression --
366 ----------------------
368 procedure Parse_Expression
369 (Expression : out Project_Node_Id;
370 Current_Project : Project_Node_Id;
371 Current_Package : Project_Node_Id)
373 First_Term : Project_Node_Id := Empty_Node;
374 Expression_Kind : Variable_Kind := Undefined;
377 Expression := Default_Project_Node (Of_Kind => N_Expression);
378 Set_Location_Of (Expression, To => Token_Ptr);
379 Terms (Term => First_Term,
380 Expr_Kind => Expression_Kind,
381 Current_Project => Current_Project,
382 Current_Package => Current_Package);
383 Set_First_Term (Expression, To => First_Term);
384 Set_Expression_Kind_Of (Expression, To => Expression_Kind);
385 end Parse_Expression;
387 ----------------------------
388 -- Parse_String_Type_List --
389 ----------------------------
391 procedure Parse_String_Type_List (First_String : out Project_Node_Id) is
392 Last_String : Project_Node_Id := Empty_Node;
393 Next_String : Project_Node_Id := Empty_Node;
394 String_Value : String_Id := No_String;
398 Default_Project_Node (Of_Kind => N_Literal_String,
399 And_Expr_Kind => Single);
400 Last_String := First_String;
403 Expect (Tok_String_Literal, "literal string");
404 exit when Token /= Tok_String_Literal;
405 String_Value := Strval (Token_Node);
406 Set_String_Value_Of (Last_String, To => String_Value);
407 Set_Location_Of (Last_String, To => Token_Ptr);
410 Current : Project_Node_Id := First_String;
413 while Current /= Last_String loop
414 if String_Equal (String_Value_Of (Current), String_Value) then
415 String_To_Name_Buffer (String_Value);
416 Error_Msg_Name_1 := Name_Find;
417 Error_Msg ("duplicate value { in type", Token_Ptr);
421 Current := Next_Literal_String (Current);
427 if Token /= Tok_Comma then
432 Default_Project_Node (Of_Kind => N_Literal_String,
433 And_Expr_Kind => Single);
434 Set_Next_Literal_String (Last_String, To => Next_String);
435 Last_String := Next_String;
439 end Parse_String_Type_List;
441 ------------------------------
442 -- Parse_Variable_Reference --
443 ------------------------------
445 procedure Parse_Variable_Reference
446 (Variable : out Project_Node_Id;
447 Current_Project : Project_Node_Id;
448 Current_Package : Project_Node_Id)
451 Last_Name : Name_Range := 0;
452 Current_Variable : Project_Node_Id := Empty_Node;
454 The_Package : Project_Node_Id := Current_Package;
455 The_Project : Project_Node_Id := Current_Project;
457 Specified_Project : Project_Node_Id := Empty_Node;
458 Specified_Package : Project_Node_Id := Empty_Node;
459 Look_For_Variable : Boolean := True;
460 First_Attribute : Attribute_Node_Id := Empty_Attribute;
461 Variable_Name : Name_Id;
464 for Index in The_Names'Range loop
465 Expect (Tok_Identifier, "identifier");
467 if Token /= Tok_Identifier then
468 Look_For_Variable := False;
472 Last_Name := Last_Name + 1;
473 The_Names (Last_Name) :=
475 Location => Token_Ptr);
477 exit when Token /= Tok_Dot;
481 if Look_For_Variable then
482 if Token = Tok_Apostrophe then
484 -- Attribute reference
494 for Index in Package_First .. Package_Attributes.Last loop
495 if Package_Attributes.Table (Index).Name =
499 Package_Attributes.Table (Index).First_Attribute;
504 if First_Attribute /= Empty_Attribute then
505 The_Package := First_Package_Of (Current_Project);
506 while The_Package /= Empty_Node
507 and then Name_Of (The_Package) /= The_Names (1).Name
509 The_Package := Next_Package_In_Project (The_Package);
512 if The_Package = Empty_Node then
513 Error_Msg_Name_1 := The_Names (1).Name;
514 Error_Msg ("package % not yet defined",
515 The_Names (1).Location);
519 First_Attribute := Attribute_First;
520 The_Package := Empty_Node;
523 The_Project_Name_And_Node :
524 constant Tree_Private_Part.Project_Name_And_Node :=
525 Tree_Private_Part.Projects_Htable.Get
526 (The_Names (1).Name);
528 use Tree_Private_Part;
531 if The_Project_Name_And_Node =
532 Tree_Private_Part.No_Project_Name_And_Node
534 Error_Msg_Name_1 := The_Names (1).Name;
535 Error_Msg ("unknown project %",
536 The_Names (1).Location);
538 The_Project := The_Project_Name_And_Node.Node;
545 With_Clause : Project_Node_Id :=
546 First_With_Clause_Of (Current_Project);
549 while With_Clause /= Empty_Node loop
550 The_Project := Project_Node_Of (With_Clause);
551 exit when Name_Of (The_Project) = The_Names (1).Name;
552 With_Clause := Next_With_Clause_Of (With_Clause);
555 if With_Clause = Empty_Node then
556 Error_Msg_Name_1 := The_Names (1).Name;
557 Error_Msg ("unknown project %",
558 The_Names (1).Location);
559 The_Project := Empty_Node;
560 The_Package := Empty_Node;
561 First_Attribute := Attribute_First;
564 The_Package := First_Package_Of (The_Project);
565 while The_Package /= Empty_Node
566 and then Name_Of (The_Package) /= The_Names (2).Name
569 Next_Package_In_Project (The_Package);
572 if The_Package = Empty_Node then
573 Error_Msg_Name_1 := The_Names (2).Name;
574 Error_Msg_Name_2 := The_Names (1).Name;
575 Error_Msg ("package % not declared in project %",
576 The_Names (2).Location);
577 First_Attribute := Attribute_First;
581 Package_Attributes.Table
582 (Package_Id_Of (The_Package)).First_Attribute;
589 ("too many single names for an attribute reference",
590 The_Names (1).Location);
592 Variable := Empty_Node;
598 Current_Project => The_Project,
599 Current_Package => The_Package,
600 First_Attribute => First_Attribute);
606 Default_Project_Node (Of_Kind => N_Variable_Reference);
608 if Look_For_Variable then
617 Set_Name_Of (Variable, To => The_Names (1).Name);
619 -- Header comment needed ???
622 Set_Name_Of (Variable, To => The_Names (2).Name);
623 The_Package := First_Package_Of (Current_Project);
625 while The_Package /= Empty_Node
626 and then Name_Of (The_Package) /= The_Names (1).Name
628 The_Package := Next_Package_In_Project (The_Package);
631 if The_Package /= Empty_Node then
632 Specified_Package := The_Package;
633 The_Project := Empty_Node;
637 With_Clause : Project_Node_Id :=
638 First_With_Clause_Of (Current_Project);
641 while With_Clause /= Empty_Node loop
642 The_Project := Project_Node_Of (With_Clause);
643 exit when Name_Of (The_Project) = The_Names (1).Name;
644 With_Clause := Next_With_Clause_Of (With_Clause);
647 if With_Clause = Empty_Node then
650 (Project_Declaration_Of (Current_Project));
652 if The_Project /= Empty_Node
654 Name_Of (The_Project) /= The_Names (1).Name
656 The_Project := Empty_Node;
660 if The_Project = Empty_Node then
661 Error_Msg_Name_1 := The_Names (1).Name;
662 Error_Msg ("unknown package or project %",
663 The_Names (1).Location);
664 Look_For_Variable := False;
666 Specified_Project := The_Project;
671 -- Header comment needed ???
674 Set_Name_Of (Variable, To => The_Names (3).Name);
677 With_Clause : Project_Node_Id :=
678 First_With_Clause_Of (Current_Project);
681 while With_Clause /= Empty_Node loop
682 The_Project := Project_Node_Of (With_Clause);
683 exit when Name_Of (The_Project) = The_Names (1).Name;
684 With_Clause := Next_With_Clause_Of (With_Clause);
687 if With_Clause = Empty_Node then
690 (Project_Declaration_Of (Current_Project));
692 if The_Project /= Empty_Node
693 and then Name_Of (The_Project) /= The_Names (1).Name
695 The_Project := Empty_Node;
699 if The_Project = Empty_Node then
700 Error_Msg_Name_1 := The_Names (1).Name;
701 Error_Msg ("unknown package or project %",
702 The_Names (1).Location);
703 Look_For_Variable := False;
706 Specified_Project := The_Project;
707 The_Package := First_Package_Of (The_Project);
709 while The_Package /= Empty_Node
710 and then Name_Of (The_Package) /= The_Names (2).Name
712 The_Package := Next_Package_In_Project (The_Package);
715 if The_Package = Empty_Node then
716 Error_Msg_Name_1 := The_Names (2).Name;
717 Error_Msg ("unknown package %",
718 The_Names (2).Location);
719 Look_For_Variable := False;
722 Specified_Package := The_Package;
723 The_Project := Empty_Node;
731 if Look_For_Variable then
732 Variable_Name := Name_Of (Variable);
733 Set_Project_Node_Of (Variable, To => Specified_Project);
734 Set_Package_Node_Of (Variable, To => Specified_Package);
736 if The_Package /= Empty_Node then
737 Current_Variable := First_Variable_Of (The_Package);
739 while Current_Variable /= Empty_Node
741 Name_Of (Current_Variable) /= Variable_Name
743 Current_Variable := Next_Variable (Current_Variable);
747 if Current_Variable = Empty_Node
748 and then The_Project /= Empty_Node
750 Current_Variable := First_Variable_Of (The_Project);
751 while Current_Variable /= Empty_Node
752 and then Name_Of (Current_Variable) /= Variable_Name
754 Current_Variable := Next_Variable (Current_Variable);
758 if Current_Variable = Empty_Node then
759 Error_Msg_Name_1 := Variable_Name;
760 Error_Msg ("unknown variable %", The_Names (Last_Name).Location);
764 if Current_Variable /= Empty_Node then
765 Set_Expression_Kind_Of
766 (Variable, To => Expression_Kind_Of (Current_Variable));
768 if Kind_Of (Current_Variable) = N_Typed_Variable_Declaration then
770 (Variable, To => String_Type_Of (Current_Variable));
774 if Token = Tok_Left_Paren then
775 Error_Msg ("\variables cannot be associative arrays", Token_Ptr);
777 Expect (Tok_String_Literal, "literal string");
779 if Token = Tok_String_Literal then
781 Expect (Tok_Right_Paren, ")");
783 if Token = Tok_Right_Paren then
788 end Parse_Variable_Reference;
790 ---------------------------------
791 -- Start_New_Case_Construction --
792 ---------------------------------
794 procedure Start_New_Case_Construction (String_Type : Project_Node_Id) is
795 Current_String : Project_Node_Id;
798 if Choice_First = 0 then
800 Choices.Set_Last (First_Choice_Node_Id);
802 Choice_First := Choices.Last + 1;
805 if String_Type /= Empty_Node then
806 Current_String := First_Literal_String (String_Type);
808 while Current_String /= Empty_Node loop
809 Add (This_String => String_Value_Of (Current_String));
810 Current_String := Next_Literal_String (Current_String);
814 Choice_Lasts.Increment_Last;
815 Choice_Lasts.Table (Choice_Lasts.Last) := Choices.Last;
817 end Start_New_Case_Construction;
823 procedure Terms (Term : out Project_Node_Id;
824 Expr_Kind : in out Variable_Kind;
825 Current_Project : Project_Node_Id;
826 Current_Package : Project_Node_Id)
828 Next_Term : Project_Node_Id := Empty_Node;
829 Term_Id : Project_Node_Id := Empty_Node;
830 Current_Expression : Project_Node_Id := Empty_Node;
831 Next_Expression : Project_Node_Id := Empty_Node;
832 Current_Location : Source_Ptr := No_Location;
833 Reference : Project_Node_Id := Empty_Node;
836 Term := Default_Project_Node (Of_Kind => N_Term);
837 Set_Location_Of (Term, To => Token_Ptr);
841 when Tok_Left_Paren =>
850 ("literal string list cannot appear in a string",
854 Term_Id := Default_Project_Node
855 (Of_Kind => N_Literal_String_List,
856 And_Expr_Kind => List);
857 Set_Current_Term (Term, To => Term_Id);
858 Set_Location_Of (Term, To => Token_Ptr);
861 if Token = Tok_Right_Paren then
866 Current_Location := Token_Ptr;
867 Parse_Expression (Expression => Next_Expression,
868 Current_Project => Current_Project,
869 Current_Package => Current_Package);
871 if Expression_Kind_Of (Next_Expression) = List then
872 Error_Msg ("single expression expected",
876 if Current_Expression = Empty_Node then
877 Set_First_Expression_In_List
878 (Term_Id, To => Next_Expression);
880 Set_Next_Expression_In_List
881 (Current_Expression, To => Next_Expression);
884 Current_Expression := Next_Expression;
885 exit when Token /= Tok_Comma;
886 Scan; -- past the comma
889 Expect (Tok_Right_Paren, "(");
891 if Token = Tok_Right_Paren then
896 when Tok_String_Literal =>
897 if Expr_Kind = Undefined then
901 Term_Id := Default_Project_Node (Of_Kind => N_Literal_String);
902 Set_Current_Term (Term, To => Term_Id);
903 Set_String_Value_Of (Term_Id, To => Strval (Token_Node));
907 when Tok_Identifier =>
908 Current_Location := Token_Ptr;
909 Parse_Variable_Reference
910 (Variable => Reference,
911 Current_Project => Current_Project,
912 Current_Package => Current_Package);
913 Set_Current_Term (Term, To => Reference);
915 if Reference /= Empty_Node then
916 if Expr_Kind = Undefined then
917 Expr_Kind := Expression_Kind_Of (Reference);
919 elsif Expr_Kind = Single
920 and then Expression_Kind_Of (Reference) = List
924 ("list variable cannot appear in single string expression",
930 Current_Location := Token_Ptr;
932 Expect (Tok_Apostrophe, "'");
934 if Token = Tok_Apostrophe then
936 (Reference => Reference,
937 First_Attribute => Prj.Attr.Attribute_First,
938 Current_Project => Current_Project,
939 Current_Package => Empty_Node);
940 Set_Current_Term (Term, To => Reference);
943 if Reference /= Empty_Node then
944 if Expr_Kind = Undefined then
945 Expr_Kind := Expression_Kind_Of (Reference);
947 elsif Expr_Kind = Single
948 and then Expression_Kind_Of (Reference) = List
951 ("lists cannot appear in single string expression",
957 if Expr_Kind = Undefined then
961 External_Reference (External_Value => Reference);
962 Set_Current_Term (Term, To => Reference);
965 Error_Msg ("cannot be part of an expression", Token_Ptr);
970 if Token = Tok_Ampersand then
973 Terms (Term => Next_Term,
974 Expr_Kind => Expr_Kind,
975 Current_Project => Current_Project,
976 Current_Package => Current_Package);
977 Set_Next_Term (Term, To => Next_Term);