1 |
12 |
jlechner |
------------------------------------------------------------------------------
|
2 |
|
|
-- --
|
3 |
|
|
-- GNAT COMPILER COMPONENTS --
|
4 |
|
|
-- --
|
5 |
|
|
-- P R E P C O M P --
|
6 |
|
|
-- --
|
7 |
|
|
-- S p e c --
|
8 |
|
|
-- --
|
9 |
|
|
-- Copyright (C) 2002-2005, 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 |
|
|
-- This package stores all preprocessing data for the compiler
|
28 |
|
|
|
29 |
|
|
with Types; use Types;
|
30 |
|
|
|
31 |
|
|
package Prepcomp is
|
32 |
|
|
|
33 |
|
|
procedure Add_Dependencies;
|
34 |
|
|
-- Add dependencies on the preprocessing data file and the
|
35 |
|
|
-- preprocessing definition files, if any.
|
36 |
|
|
|
37 |
|
|
procedure Add_Symbol_Definition (Def : String);
|
38 |
|
|
-- Add a symbol definition from the command line.
|
39 |
|
|
-- Fail if definition is illegal.
|
40 |
|
|
|
41 |
|
|
procedure Check_Symbols;
|
42 |
|
|
-- Check if there are preprocessing symbols on the command line and
|
43 |
|
|
-- set preprocessing if there are some: all files are preprocessed with
|
44 |
|
|
-- these symbols. This procedure should not be called if there is a
|
45 |
|
|
-- preprocessing data file specified on the command line. Procedure
|
46 |
|
|
-- Parse_Preprocessing_Data_File should be called instead.
|
47 |
|
|
|
48 |
|
|
procedure Parse_Preprocessing_Data_File (N : File_Name_Type);
|
49 |
|
|
-- Parse a preprocessing data file, specified with a -gnatep= switch
|
50 |
|
|
|
51 |
|
|
procedure Prepare_To_Preprocess
|
52 |
|
|
(Source : File_Name_Type;
|
53 |
|
|
Preprocessing_Needed : out Boolean);
|
54 |
|
|
-- Prepare, if necessary, the preprocessor for a source file.
|
55 |
|
|
-- If the source file needs to be preprocessed, Preprocessing_Needed
|
56 |
|
|
-- is set to True. Otherwise, Preprocessing_Needed is set to False
|
57 |
|
|
-- and no preprocessing needs to be done.
|
58 |
|
|
|
59 |
|
|
procedure Process_Command_Line_Symbol_Definitions;
|
60 |
|
|
-- Check symbol definitions that have been added by calls to procedure
|
61 |
|
|
-- Add_Symbol_Definition and stored as pointers to string, and put them in
|
62 |
|
|
-- a table. The reason the definitions were stored as pointer to strings is
|
63 |
|
|
-- that the name table is not yest initialized when we process the command
|
64 |
|
|
-- line switches. These symbol definitions will be later used in
|
65 |
|
|
-- the call to Prepare_To_Preprocess.
|
66 |
|
|
|
67 |
|
|
end Prepcomp;
|