OSDN Git Service

* config/pa/fptr.c: Update license header.
[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-2007, 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 Lib.Writ; use Lib.Writ;
31 with Opt;      use Opt;
32 with Osint;    use Osint;
33 with Prep;     use Prep;
34 with Scans;    use Scans;
35 with Scn;      use Scn;
36 with Sinput.L; use Sinput.L;
37 with Stringt;  use Stringt;
38 with Table;
39 with Types;    use Types;
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    : File_Name_Type := No_File;
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_File,
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      => 100,
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        => 10,
121       Table_Increment      => 100,
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
139    begin
140       for J in 1 .. Symbol_Table.Last (Command_Line_Symbols) loop
141          Symbol_Id := Prep.Index_Of (Command_Line_Symbols.Table (J).Symbol);
142
143          if Symbol_Id = No_Symbol then
144             Symbol_Table.Increment_Last (Prep.Mapping);
145             Symbol_Id := Symbol_Table.Last (Prep.Mapping);
146          end if;
147
148          Prep.Mapping.Table (Symbol_Id) := Command_Line_Symbols.Table (J);
149       end loop;
150    end Add_Command_Line_Symbols;
151
152    ----------------------
153    -- Add_Dependencies --
154    ----------------------
155
156    procedure Add_Dependencies is
157    begin
158       for Index in 1 .. Dependencies.Last loop
159          Add_Preprocessing_Dependency (Dependencies.Table (Index));
160       end loop;
161    end Add_Dependencies;
162
163    ---------------------------
164    -- Add_Symbol_Definition --
165    ---------------------------
166
167    procedure Add_Symbol_Definition (Def : String) is
168    begin
169       --  If Symbol_Definitions is not large enough, double it
170
171       if Last_Definition = Symbol_Definitions'Last then
172          declare
173             New_Symbol_Definitions : constant String_Array_Ptr :=
174               new String_Array (1 .. 2 * Last_Definition);
175
176          begin
177             New_Symbol_Definitions (Symbol_Definitions'Range) :=
178               Symbol_Definitions.all;
179             Free (Symbol_Definitions);
180             Symbol_Definitions := New_Symbol_Definitions;
181          end;
182       end if;
183
184       Last_Definition := Last_Definition + 1;
185       Symbol_Definitions (Last_Definition) := new String'(Def);
186    end Add_Symbol_Definition;
187
188    -------------------
189    -- Check_Symbols --
190    -------------------
191
192    procedure Check_Symbols is
193    begin
194       --  If there is at least one switch -gnateD specified
195
196       if Symbol_Table.Last (Command_Line_Symbols) >= 1 then
197          Current_Data := No_Preproc_Data;
198          No_Preprocessing := False;
199          Current_Data.Processed := True;
200
201          --  Start with an empty, initialized mapping table; use Prep.Mapping,
202          --  because Prep.Index_Of uses Prep.Mapping.
203
204          Prep.Mapping := No_Mapping;
205          Symbol_Table.Init (Prep.Mapping);
206
207          --  Add the command line symbols
208
209          Add_Command_Line_Symbols;
210
211          --  Put the resulting Prep.Mapping in Current_Data, and immediately
212          --  set Prep.Mapping to nil.
213
214          Current_Data.Mapping := Prep.Mapping;
215          Prep.Mapping := No_Mapping;
216
217          --  Set the default data
218
219          Default_Data := Current_Data;
220          Default_Data_Defined := True;
221       end if;
222    end Check_Symbols;
223
224    ------------------------------
225    -- Parse_Preprocessing_Data --
226    ------------------------------
227
228    procedure Parse_Preprocessing_Data_File (N : File_Name_Type) is
229       OK            : Boolean := False;
230       Dash_Location : Source_Ptr;
231       Symbol_Data   : Prep.Symbol_Data;
232       Symbol_Id     : Prep.Symbol_Id;
233       T             : constant Nat := Total_Errors_Detected;
234
235    begin
236       --  Load the preprocessing data file
237
238       Source_Index_Of_Preproc_Data_File := Load_Preprocessing_Data_File (N);
239
240       --  Fail if preprocessing data file cannot be found
241
242       if Source_Index_Of_Preproc_Data_File = No_Source_File then
243          Get_Name_String (N);
244          Fail ("preprocessing data file """,
245                Name_Buffer (1 .. Name_Len),
246                """ not found");
247       end if;
248
249       --  Initialize the sanner and set its behavior for a processing data file
250
251       Scn.Scanner.Initialize_Scanner (Source_Index_Of_Preproc_Data_File);
252       Scn.Scanner.Set_End_Of_Line_As_Token (True);
253       Scn.Scanner.Reset_Special_Characters;
254
255       For_Each_Line : 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_File_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             if Token /= Tok_Minus then
344                Error_Msg ("`'-` expected", Token_Ptr);
345                Skip_To_End_Of_Line;
346                goto Scan_Line;
347             end if;
348
349             --  Keep the location of the '-' for possible error reporting
350
351             Dash_Location := Token_Ptr;
352
353             --  Scan past the '-'
354
355             Scan;
356             OK := False;
357             Change_Reserved_Keyword_To_Symbol;
358
359             --  An identifier (or a reserved word converted to an
360             --  identifier) is expected and there must be no blank space
361             --  between the '-' and the identifier.
362
363             if Token = Tok_Identifier
364               and then Token_Ptr = Dash_Location + 1
365             then
366                Get_Name_String (Token_Name);
367
368                --  Check the character in the source, because the case is
369                --  significant.
370
371                case Sinput.Source (Token_Ptr) is
372                   when 'u' =>
373
374                      --  Undefined symbol are False
375
376                      if Name_Len = 1 then
377                         Current_Data.Undef_False := True;
378                         OK := True;
379                      end if;
380
381                   when 'b' =>
382
383                      --  Blank lines
384
385                      if Name_Len = 1 then
386                         Current_Data.Always_Blank := True;
387                         OK := True;
388                      end if;
389
390                   when 'c' =>
391
392                      --  Comment removed lines
393
394                      if Name_Len = 1 then
395                         Current_Data.Comments := True;
396                         OK := True;
397                      end if;
398
399                   when 's' =>
400
401                      --  List symbols
402
403                      if Name_Len = 1 then
404                         Current_Data.List_Symbols := True;
405                         OK := True;
406                      end if;
407
408                   when 'D' =>
409
410                      --  Symbol definition
411
412                      OK := Name_Len > 1;
413
414                      if OK then
415
416                         --  A symbol must be an Ada identifier; it cannot start
417                         --  with an underline or a digit.
418
419                         if Name_Buffer (2) = '_'
420                           or Name_Buffer (2) in '0' .. '9'
421                         then
422                            Error_Msg ("symbol expected", Token_Ptr + 1);
423                            Skip_To_End_Of_Line;
424                            goto Scan_Line;
425                         end if;
426
427                         --  Get the name id of the symbol
428
429                         Symbol_Data.On_The_Command_Line := True;
430                         Name_Buffer (1 .. Name_Len - 1) :=
431                           Name_Buffer (2 .. Name_Len);
432                         Name_Len := Name_Len - 1;
433                         Symbol_Data.Symbol := Name_Find;
434
435                         if Name_Buffer (1 .. Name_Len) = "if"
436                           or else Name_Buffer (1 .. Name_Len) = "else"
437                           or else Name_Buffer (1 .. Name_Len) = "elsif"
438                           or else Name_Buffer (1 .. Name_Len) = "end"
439                           or else Name_Buffer (1 .. Name_Len) = "not"
440                           or else Name_Buffer (1 .. Name_Len) = "and"
441                           or else Name_Buffer (1 .. Name_Len) = "then"
442                         then
443                            Error_Msg ("symbol expected", Token_Ptr + 1);
444                            Skip_To_End_Of_Line;
445                            goto Scan_Line;
446                         end if;
447
448                         --  Get the name id of the original symbol, with
449                         --  possibly capital letters.
450
451                         Name_Len := Integer (Scan_Ptr - Token_Ptr - 1);
452
453                         for J in 1 .. Name_Len loop
454                            Name_Buffer (J) :=
455                              Sinput.Source (Token_Ptr + Text_Ptr (J));
456                         end loop;
457
458                         Symbol_Data.Original := Name_Find;
459
460                         --  Scan past D<symbol>
461
462                         Scan;
463
464                         if Token /= Tok_Equal then
465                            Error_Msg ("`=` expected", Token_Ptr);
466                            Skip_To_End_Of_Line;
467                            goto Scan_Line;
468                         end if;
469
470                         --  Scan past '='
471
472                         Scan;
473
474                         --  Here any reserved word is OK
475
476                         Change_Reserved_Keyword_To_Symbol
477                           (All_Keywords => True);
478
479                         --  Value can be an identifier (or a reserved word)
480                         --  or a literal string.
481
482                         case Token is
483                            when Tok_String_Literal =>
484                               Symbol_Data.Is_A_String := True;
485                               Symbol_Data.Value := String_Literal_Id;
486
487                            when Tok_Identifier =>
488                               Symbol_Data.Is_A_String := False;
489                               Start_String;
490
491                               for J in Token_Ptr .. Scan_Ptr - 1 loop
492                                  Store_String_Char (Sinput.Source (J));
493                               end loop;
494
495                               Symbol_Data.Value := End_String;
496
497                            when others =>
498                               Error_Msg
499                                 ("literal string or identifier expected",
500                                  Token_Ptr);
501                               Skip_To_End_Of_Line;
502                               goto Scan_Line;
503                         end case;
504
505                         --  If symbol already exists, replace old definition
506                         --  by new one.
507
508                         Symbol_Id := Prep.Index_Of (Symbol_Data.Symbol);
509
510                         --  Otherwise, add a new entry in the table
511
512                         if Symbol_Id = No_Symbol then
513                            Symbol_Table.Increment_Last (Prep.Mapping);
514                            Symbol_Id := Symbol_Table.Last (Mapping);
515                         end if;
516
517                         Prep.Mapping.Table (Symbol_Id) := Symbol_Data;
518                      end if;
519
520                   when others =>
521                      null;
522                end case;
523
524                Scan;
525             end if;
526
527             if not OK then
528                Error_Msg ("invalid switch", Dash_Location);
529                Skip_To_End_Of_Line;
530                goto Scan_Line;
531             end if;
532          end loop;
533
534          --  Add the command line symbols, if any, possibly replacing symbols
535          --  just defined.
536
537          Add_Command_Line_Symbols;
538
539          --  Put the resulting Prep.Mapping in Current_Data, and immediately
540          --  set Prep.Mapping to nil.
541
542          Current_Data.Mapping := Prep.Mapping;
543          Prep.Mapping := No_Mapping;
544
545          --  Record Current_Data
546
547          if Current_Data.File_Name = No_File then
548             Default_Data := Current_Data;
549
550          else
551             Preproc_Data_Table.Increment_Last;
552             Preproc_Data_Table.Table (Preproc_Data_Table.Last) := Current_Data;
553          end if;
554
555          Current_Data := No_Preproc_Data;
556       end loop For_Each_Line;
557
558       Scn.Scanner.Set_End_Of_Line_As_Token (False);
559
560       --  Fail if there were errors in the preprocessing data file
561
562       if Total_Errors_Detected > T then
563          Errout.Finalize;
564          Errout.Output_Messages;
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
639          --  Set Prep.Mapping
640
641          Prep.Mapping := Current_Data.Mapping;
642
643       else
644          --  First put the mapping in Prep.Mapping, because Prep.Parse_Def_File
645          --  works on Prep.Mapping.
646
647          Prep.Mapping := Current_Data.Mapping;
648
649          String_To_Name_Buffer (Current_Data.Deffile);
650
651          declare
652             N           : constant File_Name_Type    := Name_Find;
653             Deffile     : constant Source_File_Index :=
654                             Load_Definition_File (N);
655             Add_Deffile : Boolean                    := True;
656             T           : constant Nat               := Total_Errors_Detected;
657
658          begin
659             if Deffile = No_Source_File then
660                Fail ("definition file """,
661                      Get_Name_String (N),
662                      """ cannot be found");
663             end if;
664
665             --  Initialize the preprocessor and set the characteristics of the
666             --  scanner for a definition file.
667
668             Prep.Initialize
669               (Error_Msg         => Errout.Error_Msg'Access,
670                Scan              => Scn.Scanner.Scan'Access,
671                Set_Ignore_Errors => Errout.Set_Ignore_Errors'Access,
672                Put_Char          => null,
673                New_EOL           => null);
674
675             Scn.Scanner.Set_End_Of_Line_As_Token (True);
676             Scn.Scanner.Reset_Special_Characters;
677
678             --  Initialize the scanner and process the definition file
679
680             Scn.Scanner.Initialize_Scanner (Deffile);
681             Prep.Parse_Def_File;
682
683             --  Reset the behaviour of the scanner to the default
684
685             Scn.Scanner.Set_End_Of_Line_As_Token (False);
686
687             --  Fail if errors were found while processing the definition file
688
689             if T /= Total_Errors_Detected then
690                Errout.Finalize;
691                Errout.Output_Messages;
692                Fail ("errors found in definition file """,
693                      Get_Name_String (N),
694                      """");
695             end if;
696
697             for Index in 1 .. Dependencies.Last loop
698                if Dependencies.Table (Index) = Deffile then
699                   Add_Deffile := False;
700                   exit;
701                end if;
702             end loop;
703
704             if Add_Deffile then
705                Dependencies.Increment_Last;
706                Dependencies.Table (Dependencies.Last) := Deffile;
707             end if;
708          end;
709
710          --  Get back the mapping, indicate that the definition file is
711          --  processed and store back the preprocessing data.
712
713          Current_Data.Mapping := Prep.Mapping;
714          Current_Data.Processed := True;
715
716          if Default then
717             Default_Data := Current_Data;
718
719          else
720             Preproc_Data_Table.Table (Index) := Current_Data;
721          end if;
722       end if;
723
724       Preprocessing_Needed := True;
725    end Prepare_To_Preprocess;
726
727    ---------------------------------------------
728    -- Process_Command_Line_Symbol_Definitions --
729    ---------------------------------------------
730
731    procedure Process_Command_Line_Symbol_Definitions is
732       Symbol_Data : Prep.Symbol_Data;
733       Found : Boolean := False;
734
735    begin
736       Symbol_Table.Init (Command_Line_Symbols);
737
738       --  The command line definitions have been stored temporarily in
739       --  array Symbol_Definitions.
740
741       for Index in 1 .. Last_Definition loop
742          --  Check each symbol definition, fail immediately if syntax is not
743          --  correct.
744
745          Check_Command_Line_Symbol_Definition
746            (Definition => Symbol_Definitions (Index).all,
747             Data => Symbol_Data);
748          Found := False;
749
750          --  If there is already a definition for this symbol, replace the old
751          --  definition by this one.
752
753          for J in 1 .. Symbol_Table.Last (Command_Line_Symbols) loop
754             if Command_Line_Symbols.Table (J).Symbol = Symbol_Data.Symbol then
755                Command_Line_Symbols.Table (J) := Symbol_Data;
756                Found := True;
757                exit;
758             end if;
759          end loop;
760
761          --  Otherwise, create a new entry in the table
762
763          if not Found then
764             Symbol_Table.Increment_Last (Command_Line_Symbols);
765             Command_Line_Symbols.Table
766               (Symbol_Table.Last (Command_Line_Symbols)) := Symbol_Data;
767          end if;
768       end loop;
769    end Process_Command_Line_Symbol_Definitions;
770
771    -------------------------
772    -- Skip_To_End_Of_Line --
773    -------------------------
774
775    procedure Skip_To_End_Of_Line is
776    begin
777       Set_Ignore_Errors (To => True);
778
779       while Token /= Tok_End_Of_Line and then Token /= Tok_EOF loop
780          Scan;
781       end loop;
782
783       Set_Ignore_Errors (To => False);
784    end Skip_To_End_Of_Line;
785
786 end Prepcomp;