OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [ada/] [gnatprep.ads] - Blame information for rev 27

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
------------------------------------------------------------------------------
2
--                                                                          --
3
--                         GNAT COMPILER COMPONENTS                         --
4
--                                                                          --
5
--                             G N A T P R E P                              --
6
--                                                                          --
7
--                                 S p e c                                  --
8
--                                                                          --
9
--          Copyright (C) 1992-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 program provides a simple preprocessing capability for Ada programs.
28
--  It is designed for use with GNAT, but is not dependent on any special
29
--  features of GNAT.
30
 
31
--    To call gnatprep use
32
 
33
--      gnatprep infile outfile [deffile] [-v] [-c] [-b] [-r] [-s] [-u]
34
--            [-Dsymbol=value]
35
 
36
--    where
37
 
38
--      infile is the full name of the input file, which is an Ada source
39
--      file containing preprocessor directives.
40
 
41
--      outfile is the full name of the output file, which is an Ada source
42
--      in standard Ada form. When used with GNAT, this file name will
43
--      normally have an ads or adb suffix.
44
 
45
--      deffile is the full name of a text file containing definitions of
46
--      symbols to be referenced by the preprocessor. This argument is
47
--      optional.
48
 
49
--      The -c switch, causes both preprocessor lines and the lines deleted
50
--      by preprocessing to be retained in the output source as comments marked
51
--      with the special string "--! ". This option will result in line numbers
52
--      being preserved in the output file.
53
 
54
--      The -b switch causes both preprocessor lines and the lines deleted by
55
--      preprocessing to be replaced by blank lines in the output source file,
56
--      thus preserving line numbers in the output file.
57
 
58
--      The -r switch causes a Source_Reference pragma to be generated that
59
--      references the original input file, so that error messages will use
60
--      the file name of this original file.
61
 
62
--      The -u switch causes gnatprep to treat any undefined symbol that it
63
--      encounters as having the value False. Otherwise an undefined symbol
64
--      is a fatal error.
65
 
66
--      The -s switch causes a sorted list of symbol names and values to be
67
--      listed on the standard output file.
68
 
69
--      The -v switch causes a Copyright notice to be displayed, and
70
--      lines containing errors in the input file or the definition file
71
--      to be displayed before the errors.
72
 
73
--      The -D switch causes symbol 'symbol' to be associated with 'value'.
74
--      This symbols can then be referenced by the preprocessor. Several
75
--      -D switches may be specified.
76
 
77
--      Note: if neither -b nor -c is present, then preprocessor lines and
78
--      deleted lines are completely removed from the output, unless -r is
79
--      specified, in which case -b is assumed.
80
 
81
--   The definitions file contains lines of the form
82
 
83
--      symbol := value
84
 
85
--   where symbol is an identifier, following normal Ada (case-insensitive)
86
--   rules for its syntax, and value is one of the following:
87
 
88
--      Empty, corresponding to a null substitution
89
 
90
--      A string literal using normal Ada syntax
91
 
92
--      Any sequence of characters from the set
93
--        (letters, digits, period, underline)
94
 
95
--   Comment lines may also appear in the definitions file, starting with
96
--   the usual --, and comments may be added to the definitions lines.
97
 
98
--   The input text may contain preprocessor conditional inclusion lines,
99
--   and also general symbol substitution sequences.
100
 
101
--   The preprocessor conditional inclusion commands have the form
102
 
103
--      #if <expression> [then]
104
--         lines
105
--      #elsif <expression> [then]
106
--         lines
107
--      #elsif <expression> [then]
108
--         lines
109
--      ...
110
--      #else
111
--         lines
112
--      #end if;
113
--
114
--     Where expression is defined by the following grammar :
115
--        expression ::=  <symbol>
116
--        expression ::=  <symbol> = "<value>"
117
--        expression ::=  <symbol> = <symbol>
118
--        expression ::=  <symbol> 'Defined
119
--        expression ::=  not <expression>
120
--        expression ::=  <expression> and <expression>
121
--        expression ::=  <expression> or <expression>
122
--        expression ::=  <expression> and then <expression>
123
--        expression ::=  <expression> or else <expression>
124
--        expression ::=  ( <expression> )
125
 
126
--        "or" and "and" may not be used in the same expression without
127
--        using parentheses.
128
 
129
--     For these Boolean tests, the symbol must have either the value True or
130
--     False. If the value is True, then the corresponding lines are included,
131
--     and if the value is False, they are excluded. It is an error to
132
--     reference a symbol not defined in the symbol definitions file, or
133
--     to reference a symbol that has a value other than True or False.
134
 
135
--     The use of the not operator inverts the sense of this logical test, so
136
--     that the lines are included only if the symbol is not defined.
137
 
138
--     The THEN keyword is optional as shown
139
 
140
--     Spaces or tabs may appear between the # and the keyword. The keywords
141
--     and the symbols are case insensitive as in normal Ada code. Comments
142
--     may be used on a preprocessor line, but other than that, no other
143
--     tokens may appear on a preprocessor line.
144
 
145
--     Any number of #elsif clauses can be present, including none at all
146
 
147
--     The #else is optional, as in Ada
148
 
149
--     The # marking the start of a preprocessor line must be the first
150
--     non-blank character on the line, i.e. it must be preceded only by
151
--     spaces or horizontal tabs.
152
 
153
--   Symbol substitution is obtained by using the sequence
154
 
155
--     $symbol
156
 
157
--   anywhere within a source line, except in a comment. The identifier
158
--   following the $ must match one of the symbols defined in the symbol
159
--   definition file, and the result is to substitute the value of the
160
--   symbol in place of $symbol in the output file.
161
 
162
procedure GNATprep;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.