OSDN Git Service

* gcc.dg/attr-weakref-1.c: Add exit (0) to avoid spurious
[pf3gnuchains/gcc-fork.git] / gcc / ada / prepcomp.adb
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                         GNAT COMPILER COMPONENTS                         --
4 --                                                                          --
5 --                             P R E P C O M P                              --
6 --                                                                          --
7 --                                 B o d y                                  --
8 --                                                                          --
9 --          Copyright (C) 2003, Free Software Foundation, Inc.              --
10 --                                                                          --
11 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
12 -- terms of the  GNU General Public License as published  by the Free Soft- --
13 -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
14 -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
17 -- for  more details.  You should have  received  a copy of the GNU General --
18 -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
19 -- to  the  Free Software Foundation,  51  Franklin  Street,  Fifth  Floor, --
20 -- Boston, MA 02110-1301, USA.                                              --
21 --                                                                          --
22 -- GNAT was originally developed  by the GNAT team at  New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc.      --
24 --                                                                          --
25 ------------------------------------------------------------------------------
26
27 with Ada.Unchecked_Deallocation;
28
29 with Errout;   use Errout;
30 with Namet;    use Namet;
31 with Lib.Writ; use Lib.Writ;
32 with Opt;      use Opt;
33 with Osint;    use Osint;
34 with Prep;     use Prep;
35 with Scans;    use Scans;
36 with Scn;      use Scn;
37 with Sinput.L; use Sinput.L;
38 with Stringt;  use Stringt;
39 with Table;
40
41 package body Prepcomp is
42
43    No_Preprocessing : Boolean := True;
44    --  Set to True if there is at least one source that needs to be
45    --  preprocessed.
46
47    Source_Index_Of_Preproc_Data_File : Source_File_Index := No_Source_File;
48
49    --  The following variable should be a constant, but this is not
50    --  possible. Warnings are Off because it is never assigned a value.
51
52    pragma Warnings (Off);
53    No_Mapping : Prep.Symbol_Table.Instance;
54    pragma Warnings (On);
55
56    type String_Ptr is access String;
57    type String_Array is array (Positive range <>) of String_Ptr;
58    type String_Array_Ptr is access String_Array;
59
60    procedure Free is
61       new Ada.Unchecked_Deallocation (String_Array, String_Array_Ptr);
62
63    Symbol_Definitions : String_Array_Ptr := new String_Array (1 .. 4);
64    --  An extensible array to temporarily stores symbol definitions specified
65    --  on the command line with -gnateD switches.
66
67    Last_Definition : Natural := 0;
68    --  Index of last symbol definition in array Symbol_Definitions
69
70    type Preproc_Data is record
71       Mapping      : Symbol_Table.Instance;
72       File_Name    : Name_Id   := No_Name;
73       Deffile      : String_Id := No_String;
74       Undef_False  : Boolean   := False;
75       Always_Blank : Boolean   := False;
76       Comments     : Boolean   := False;
77       List_Symbols : Boolean   := False;
78       Processed    : Boolean   := False;
79    end record;
80    --  Structure to keep the preprocessing data for a file name or for the
81    --  default (when Name_Id = No_Name).
82
83    No_Preproc_Data : constant Preproc_Data :=
84      (Mapping      => No_Mapping,
85       File_Name    => No_Name,
86       Deffile      => No_String,
87       Undef_False  => False,
88       Always_Blank => False,
89       Comments     => False,
90       List_Symbols => False,
91       Processed    => False);
92
93    Default_Data : Preproc_Data := No_Preproc_Data;
94    --  The preprocessing data to be used when no specific preprocessing data
95    --  is specified for a source.
96
97    Default_Data_Defined : Boolean := False;
98    --  True if source for which no specific preprocessing is specified need to
99    --  be preprocess with the Default_Data.
100
101    Current_Data : Preproc_Data := No_Preproc_Data;
102
103    package Preproc_Data_Table is new Table.Table
104      (Table_Component_Type => Preproc_Data,
105       Table_Index_Type     => Int,
106       Table_Low_Bound      => 1,
107       Table_Initial        => 5,
108       Table_Increment      => 5,
109       Table_Name           => "Prepcomp.Preproc_Data_Table");
110    --  Table to store the specific preprocessing data
111
112    Command_Line_Symbols : Symbol_Table.Instance;
113    --  A table to store symbol definitions specified on the command line with
114    --  -gnateD switches.
115
116    package Dependencies is new Table.Table
117      (Table_Component_Type => Source_File_Index,
118       Table_Index_Type     => Int,
119       Table_Low_Bound      => 1,
120       Table_Initial        => 5,
121       Table_Increment      => 5,
122       Table_Name           => "Prepcomp.Dependencies");
123    --  Table to store the dependencies on preprocessing files
124
125    procedure Add_Command_Line_Symbols;
126    --  Add the command line symbol definitions, if any, to the
127    --  Prep.Mapping table.
128
129    procedure Skip_To_End_Of_Line;
130    --  Ignore errors and scan up to the next end of line or the end of file
131
132    ------------------------------
133    -- Add_Command_Line_Symbols --
134    ------------------------------
135
136    procedure Add_Command_Line_Symbols is
137       Symbol_Id : Prep.Symbol_Id;
138    begin
139       for J in 1 .. Symbol_Table.Last (Command_Line_Symbols) loop
140          Symbol_Id := Prep.Index_Of (Command_Line_Symbols.Table (J).Symbol);
141
142          if Symbol_Id = No_Symbol then
143             Symbol_Table.Increment_Last (Prep.Mapping);
144             Symbol_Id := Symbol_Table.Last (Prep.Mapping);
145          end if;
146
147          Prep.Mapping.Table (Symbol_Id) := Command_Line_Symbols.Table (J);
148       end loop;
149    end Add_Command_Line_Symbols;
150
151    ----------------------
152    -- Add_Dependencies --
153    ----------------------
154
155    procedure Add_Dependencies is
156    begin
157       for Index in 1 .. Dependencies.Last loop
158          Add_Preprocessing_Dependency (Dependencies.Table (Index));
159       end loop;
160    end Add_Dependencies;
161
162    ---------------------------
163    -- Add_Symbol_Definition --
164    ---------------------------
165
166    procedure Add_Symbol_Definition (Def : String) is
167    begin
168       --  If Symbol_Definitions is not large enough, double it
169
170       if Last_Definition = Symbol_Definitions'Last then
171          declare
172             New_Symbol_Definitions : constant String_Array_Ptr :=
173               new String_Array (1 .. 2 * Last_Definition);
174
175          begin
176             New_Symbol_Definitions (Symbol_Definitions'Range) :=
177               Symbol_Definitions.all;
178             Free (Symbol_Definitions);
179             Symbol_Definitions := New_Symbol_Definitions;
180          end;
181       end if;
182
183       Last_Definition := Last_Definition + 1;
184       Symbol_Definitions (Last_Definition) := new String'(Def);
185    end Add_Symbol_Definition;
186
187    -------------------
188    -- Check_Symbols --
189    -------------------
190
191    procedure Check_Symbols is
192    begin
193       --  If there is at least one switch -gnateD specified
194
195       if Symbol_Table.Last (Command_Line_Symbols) >= 1 then
196          Current_Data := No_Preproc_Data;
197          No_Preprocessing := False;
198          Current_Data.Processed := True;
199
200          --  Start with an empty, initialized mapping table; use Prep.Mapping,
201          --  because Prep.Index_Of uses Prep.Mapping.
202
203          Prep.Mapping := No_Mapping;
204          Symbol_Table.Init (Prep.Mapping);
205
206          --  Add the command line symbols
207
208          Add_Command_Line_Symbols;
209
210          --  Put the resulting Prep.Mapping in Current_Data, and immediately
211          --  set Prep.Mapping to nil.
212
213          Current_Data.Mapping := Prep.Mapping;
214          Prep.Mapping := No_Mapping;
215
216          --  Set the default data
217
218          Default_Data := Current_Data;
219          Default_Data_Defined := True;
220       end if;
221    end Check_Symbols;
222
223    ------------------------------
224    -- Parse_Preprocessing_Data --
225    ------------------------------
226
227    procedure Parse_Preprocessing_Data_File (N : File_Name_Type) is
228       OK : Boolean := False;
229       Dash_Location : Source_Ptr;
230       Symbol_Data : Prep.Symbol_Data;
231       Symbol_Id   : Prep.Symbol_Id;
232       T : constant Nat := Total_Errors_Detected;
233
234    begin
235       --  Load the preprocessing data file
236
237       Source_Index_Of_Preproc_Data_File := Load_Preprocessing_Data_File (N);
238
239       --  Fail if preprocessing data file cannot be found
240
241       if Source_Index_Of_Preproc_Data_File = No_Source_File then
242          Get_Name_String (N);
243          Fail ("preprocessing data file """,
244                Name_Buffer (1 .. Name_Len),
245                """ not found");
246       end if;
247
248       --  Initialize the sanner and set its behavior for a processing data file
249       Scn.Scanner.Initialize_Scanner
250         (No_Unit, Source_Index_Of_Preproc_Data_File);
251       Scn.Scanner.Set_End_Of_Line_As_Token (True);
252       Scn.Scanner.Reset_Special_Characters;
253
254       For_Each_Line :
255       loop
256          <<Scan_Line>>
257          Scan;
258
259          exit For_Each_Line when Token = Tok_EOF;
260
261          if Token = Tok_End_Of_Line then
262             goto Scan_Line;
263          end if;
264
265          --  Line is not empty
266
267          OK := False;
268          No_Preprocessing := False;
269          Current_Data := No_Preproc_Data;
270
271          case Token is
272             when Tok_Asterisk =>
273
274                --  Default data
275
276                if Default_Data_Defined then
277                   Error_Msg
278                     ("multiple default preprocessing data", Token_Ptr);
279
280                else
281                   OK := True;
282                   Default_Data_Defined := True;
283                end if;
284
285             when Tok_String_Literal =>
286
287                --  Specific data
288
289                String_To_Name_Buffer (String_Literal_Id);
290                Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len));
291                Current_Data.File_Name := Name_Find;
292                OK := True;
293
294                for Index in 1 .. Preproc_Data_Table.Last loop
295                   if Current_Data.File_Name =
296                        Preproc_Data_Table.Table (Index).File_Name
297                   then
298                      Error_Msg_Name_1 := Current_Data.File_Name;
299                      Error_Msg
300                        ("multiple preprocessing data for{", Token_Ptr);
301                      OK := False;
302                      exit;
303                   end if;
304                end loop;
305
306             when others =>
307                Error_Msg ("`'*` or literal string expected", Token_Ptr);
308          end case;
309
310          --  If there is a problem, skip the line
311
312          if not OK then
313             Skip_To_End_Of_Line;
314             goto Scan_Line;
315          end if;
316
317          --  Scan past the * or the literal string
318
319          Scan;
320
321          --  A literal string in second position is a definition file
322
323          if Token = Tok_String_Literal then
324             Current_Data.Deffile := String_Literal_Id;
325             Current_Data.Processed := False;
326             Scan;
327
328          else
329             --  If there is no definition file, set Processed to True now
330
331             Current_Data.Processed := True;
332          end if;
333
334          --  Start with an empty, initialized mapping table; use Prep.Mapping,
335          --  because Prep.Index_Of uses Prep.Mapping.
336
337          Prep.Mapping := No_Mapping;
338          Symbol_Table.Init (Prep.Mapping);
339
340          --  Check the switches that may follow
341
342          while Token /= Tok_End_Of_Line and then Token /= Tok_EOF loop
343
344             if Token /= Tok_Minus then
345                Error_Msg ("`'-` expected", Token_Ptr);
346                Skip_To_End_Of_Line;
347                goto Scan_Line;
348             end if;
349
350             --  Keep the location of the '-' for possible error reporting
351
352             Dash_Location := Token_Ptr;
353
354             --  Scan past the '-'
355
356             Scan;
357             OK := False;
358             Change_Reserved_Keyword_To_Symbol;
359
360             --  An identifier (or a reserved word converted to an
361             --  identifier) is expected and there must be no blank space
362             --  between the '-' and the identifier.
363
364             if Token = Tok_Identifier
365               and then Token_Ptr = Dash_Location + 1
366             then
367                Get_Name_String (Token_Name);
368
369                --  Check the character in the source, because the case is
370                --  significant.
371
372                case Sinput.Source (Token_Ptr) is
373                   when 'u' =>
374
375                      --  Undefined symbol are False
376
377                      if Name_Len = 1 then
378                         Current_Data.Undef_False := True;
379                         OK := True;
380                      end if;
381
382                   when 'b' =>
383
384                      --  Blank lines
385
386                      if Name_Len = 1 then
387                         Current_Data.Always_Blank := True;
388                         OK := True;
389                      end if;
390
391                   when 'c' =>
392
393                      --  Comment removed lines
394
395                      if Name_Len = 1 then
396                         Current_Data.Comments := True;
397                         OK := True;
398                      end if;
399
400                   when 's' =>
401
402                      --  List symbols
403
404                      if Name_Len = 1 then
405                         Current_Data.List_Symbols := True;
406                         OK := True;
407                      end if;
408
409                   when 'D' =>
410
411                      --  Symbol definition
412
413                      OK := Name_Len > 1;
414
415                      if OK then
416
417                         --  A symbol must be an Ada identifier; it cannot start
418                         --  with an underline or a digit.
419
420                         if Name_Buffer (2) = '_'
421                           or Name_Buffer (2) in '0' .. '9'
422                         then
423                            Error_Msg ("symbol expected", Token_Ptr + 1);
424                            Skip_To_End_Of_Line;
425                            goto Scan_Line;
426                         end if;
427
428                         --  Get the name id of the symbol
429
430                         Symbol_Data.On_The_Command_Line := True;
431                         Name_Buffer (1 .. Name_Len - 1) :=
432                           Name_Buffer (2 .. Name_Len);
433                         Name_Len := Name_Len - 1;
434                         Symbol_Data.Symbol := Name_Find;
435
436                         if Name_Buffer (1 .. Name_Len) = "if"
437                           or else Name_Buffer (1 .. Name_Len) = "else"
438                           or else Name_Buffer (1 .. Name_Len) = "elsif"
439                           or else Name_Buffer (1 .. Name_Len) = "end"
440                           or else Name_Buffer (1 .. Name_Len) = "not"
441                           or else Name_Buffer (1 .. Name_Len) = "and"
442                           or else Name_Buffer (1 .. Name_Len) = "then"
443                         then
444                            Error_Msg ("symbol expected", Token_Ptr + 1);
445                            Skip_To_End_Of_Line;
446                            goto Scan_Line;
447                         end if;
448
449                         --  Get the name id of the original symbol, with
450                         --  possibly capital letters.
451
452                         Name_Len := Integer (Scan_Ptr - Token_Ptr - 1);
453
454                         for J in 1 .. Name_Len loop
455                            Name_Buffer (J) :=
456                              Sinput.Source (Token_Ptr + Text_Ptr (J));
457                         end loop;
458
459                         Symbol_Data.Original := Name_Find;
460
461                         --  Scan past D<symbol>
462
463                         Scan;
464
465                         if Token /= Tok_Equal then
466                            Error_Msg ("`=` expected", Token_Ptr);
467                            Skip_To_End_Of_Line;
468                            goto Scan_Line;
469                         end if;
470
471                         --  Scan past '='
472
473                         Scan;
474
475                         --  Here any reserved word is OK
476
477                         Change_Reserved_Keyword_To_Symbol
478                           (All_Keywords => True);
479
480                         --  Value can be an identifier (or a reserved word)
481                         --  or a literal string.
482
483                         case Token is
484                            when Tok_String_Literal =>
485                               Symbol_Data.Is_A_String := True;
486                               Symbol_Data.Value := String_Literal_Id;
487
488                            when Tok_Identifier =>
489                               Symbol_Data.Is_A_String := False;
490                               Start_String;
491
492                               for J in Token_Ptr .. Scan_Ptr - 1 loop
493                                  Store_String_Char (Sinput.Source (J));
494                               end loop;
495
496                               Symbol_Data.Value := End_String;
497
498                            when others =>
499                               Error_Msg
500                                 ("literal string or identifier expected",
501                                  Token_Ptr);
502                               Skip_To_End_Of_Line;
503                               goto Scan_Line;
504                         end case;
505
506                         --  If symbol already exists, replace old definition
507                         --  by new one.
508
509                         Symbol_Id := Prep.Index_Of (Symbol_Data.Symbol);
510
511                         --  Otherwise, add a new entry in the table.
512
513                         if Symbol_Id = No_Symbol then
514                            Symbol_Table.Increment_Last (Prep.Mapping);
515                            Symbol_Id := Symbol_Table.Last (Mapping);
516                         end if;
517
518                         Prep.Mapping.Table (Symbol_Id) := Symbol_Data;
519                      end if;
520
521                   when others =>
522                      null;
523                end case;
524
525                Scan;
526             end if;
527
528             if not OK then
529                Error_Msg ("invalid switch", Dash_Location);
530                Skip_To_End_Of_Line;
531                goto Scan_Line;
532             end if;
533          end loop;
534
535          --  Add the command line symbols, if any, possibly replacing symbols
536          --  just defined.
537
538          Add_Command_Line_Symbols;
539
540          --  Put the resulting Prep.Mapping in Current_Data, and immediately
541          --  set Prep.Mapping to nil.
542
543          Current_Data.Mapping := Prep.Mapping;
544          Prep.Mapping := No_Mapping;
545
546          --  Record Current_Data
547
548          if Current_Data.File_Name = No_Name then
549             Default_Data := Current_Data;
550
551          else
552             Preproc_Data_Table.Increment_Last;
553             Preproc_Data_Table.Table (Preproc_Data_Table.Last) := Current_Data;
554          end if;
555
556          Current_Data := No_Preproc_Data;
557       end loop For_Each_Line;
558
559       Scn.Scanner.Set_End_Of_Line_As_Token (False);
560
561       --  Fail if there were errors in the preprocessing data file
562
563       if Total_Errors_Detected > T then
564          Errout.Finalize;
565          Fail ("errors found in preprocessing data file """,
566                Get_Name_String (N),
567                """");
568       end if;
569
570       --  Record the dependency on the preprocessor data file
571
572       Dependencies.Increment_Last;
573       Dependencies.Table (Dependencies.Last) :=
574         Source_Index_Of_Preproc_Data_File;
575    end Parse_Preprocessing_Data_File;
576
577    ---------------------------
578    -- Prepare_To_Preprocess --
579    ---------------------------
580
581    procedure Prepare_To_Preprocess
582      (Source               : File_Name_Type;
583       Preprocessing_Needed : out Boolean)
584    is
585       Default : Boolean := False;
586       Index   : Int := 0;
587
588    begin
589       --  By default, preprocessing is not needed
590
591       Preprocessing_Needed := False;
592
593       if No_Preprocessing then
594          return;
595       end if;
596
597       --  First, look for preprocessing data specific to the current source
598
599       for J in 1 .. Preproc_Data_Table.Last loop
600          if Preproc_Data_Table.Table (J).File_Name = Source then
601             Index := J;
602             Current_Data := Preproc_Data_Table.Table (J);
603             exit;
604          end if;
605       end loop;
606
607       --  If no specific preprocessing data, then take the default
608
609       if Index = 0 then
610          if Default_Data_Defined then
611             Current_Data := Default_Data;
612             Default := True;
613
614          else
615             --  If no default, then nothing to do
616
617             return;
618          end if;
619       end if;
620
621       --  Set the preprocessing flags according to the preprocessing data
622
623       if Current_Data.Comments and then not Current_Data.Always_Blank then
624          Comment_Deleted_Lines := True;
625          Blank_Deleted_Lines   := False;
626
627       else
628          Comment_Deleted_Lines := False;
629          Blank_Deleted_Lines   := True;
630       end if;
631
632       Undefined_Symbols_Are_False := Current_Data.Undef_False;
633       List_Preprocessing_Symbols  := Current_Data.List_Symbols;
634
635       --  If not already done it, process the definition file
636
637       if Current_Data.Processed then
638          --  Set Prep.Mapping
639
640          Prep.Mapping := Current_Data.Mapping;
641
642       else
643          --  First put the mapping in Prep.Mapping, because Prep.Parse_Def_File
644          --  works on Prep.Mapping.
645
646          Prep.Mapping := Current_Data.Mapping;
647
648          String_To_Name_Buffer (Current_Data.Deffile);
649
650          declare
651             N : constant Name_Id := Name_Find;
652             Deffile : constant Source_File_Index :=  Load_Definition_File (N);
653             Add_Deffile : Boolean := True;
654             T : constant Nat := Total_Errors_Detected;
655
656          begin
657             if Deffile = No_Source_File then
658                Fail ("definition file """,
659                      Get_Name_String (N),
660                      """ cannot be found");
661             end if;
662
663             --  Initialize the preprocessor and set the characteristics of the
664             --  scanner for a definition file.
665
666             Prep.Initialize
667               (Error_Msg         => Errout.Error_Msg'Access,
668                Scan              => Scn.Scanner.Scan'Access,
669                Set_Ignore_Errors => Errout.Set_Ignore_Errors'Access,
670                Put_Char          => null,
671                New_EOL           => null);
672
673             Scn.Scanner.Set_End_Of_Line_As_Token (True);
674             Scn.Scanner.Reset_Special_Characters;
675
676             --  Initialize the scanner and process the definition file
677
678             Scn.Scanner.Initialize_Scanner (No_Unit, Deffile);
679             Prep.Parse_Def_File;
680
681             --  Reset the behaviour of the scanner to the default
682
683             Scn.Scanner.Set_End_Of_Line_As_Token (False);
684
685             --  Fail if errors were found while processing the definition file
686
687             if T /= Total_Errors_Detected then
688                Errout.Finalize;
689                Fail ("errors found in definition file """,
690                      Get_Name_String (N),
691                      """");
692             end if;
693
694             for Index in 1 .. Dependencies.Last loop
695                if Dependencies.Table (Index) = Deffile then
696                   Add_Deffile := False;
697                   exit;
698                end if;
699             end loop;
700
701             if Add_Deffile then
702                Dependencies.Increment_Last;
703                Dependencies.Table (Dependencies.Last) := Deffile;
704             end if;
705          end;
706
707          --  Get back the mapping, indicate that the definition file is
708          --  processed and store back the preprocessing data.
709
710          Current_Data.Mapping := Prep.Mapping;
711          Current_Data.Processed := True;
712
713          if Default then
714             Default_Data := Current_Data;
715
716          else
717             Preproc_Data_Table.Table (Index) := Current_Data;
718          end if;
719       end if;
720
721       Preprocessing_Needed := True;
722    end Prepare_To_Preprocess;
723
724    ---------------------------------------------
725    -- Process_Command_Line_Symbol_Definitions --
726    ---------------------------------------------
727
728    procedure Process_Command_Line_Symbol_Definitions is
729       Symbol_Data : Prep.Symbol_Data;
730       Found : Boolean := False;
731
732    begin
733       Symbol_Table.Init (Command_Line_Symbols);
734
735       --  The command line definitions have been stored temporarily in
736       --  array Symbol_Definitions.
737
738       for Index in 1 .. Last_Definition loop
739          --  Check each symbol definition, fail immediately if syntax is not
740          --  correct.
741
742          Check_Command_Line_Symbol_Definition
743            (Definition => Symbol_Definitions (Index).all,
744             Data => Symbol_Data);
745          Found := False;
746
747          --  If there is already a definition for this symbol, replace the old
748          --  definition by this one.
749
750          for J in 1 .. Symbol_Table.Last (Command_Line_Symbols) loop
751             if Command_Line_Symbols.Table (J).Symbol = Symbol_Data.Symbol then
752                Command_Line_Symbols.Table (J) := Symbol_Data;
753                Found := True;
754                exit;
755             end if;
756          end loop;
757
758          --  Otherwise, create a new entry in the table
759
760          if not Found then
761             Symbol_Table.Increment_Last (Command_Line_Symbols);
762             Command_Line_Symbols.Table
763               (Symbol_Table.Last (Command_Line_Symbols)) := Symbol_Data;
764          end if;
765       end loop;
766    end Process_Command_Line_Symbol_Definitions;
767
768    -------------------------
769    -- Skip_To_End_Of_Line --
770    -------------------------
771
772    procedure Skip_To_End_Of_Line is
773    begin
774       Set_Ignore_Errors (To => True);
775
776       while Token /= Tok_End_Of_Line and then Token /= Tok_EOF loop
777          Scan;
778       end loop;
779
780       Set_Ignore_Errors (To => False);
781    end Skip_To_End_Of_Line;
782
783 end Prepcomp;