* rtl.h (struct rtx_def): Update comments.
[official-gcc.git] / gcc / ada / scn.ads
blob71c121f851c747616e35474775b915cf466829a0
1 ------------------------------------------------------------------------------
2 -- --
3 -- GNAT COMPILER COMPONENTS --
4 -- --
5 -- S C N --
6 -- --
7 -- S p e c --
8 -- --
9 -- --
10 -- Copyright (C) 1992-2000 Free Software Foundation, Inc. --
11 -- --
12 -- GNAT is free software; you can redistribute it and/or modify it under --
13 -- terms of the GNU General Public License as published by the Free Soft- --
14 -- ware Foundation; either version 2, or (at your option) any later ver- --
15 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
16 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
17 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
18 -- for more details. You should have received a copy of the GNU General --
19 -- Public License distributed with GNAT; see file COPYING. If not, write --
20 -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
21 -- MA 02111-1307, USA. --
22 -- --
23 -- GNAT was originally developed by the GNAT team at New York University. --
24 -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
25 -- --
26 ------------------------------------------------------------------------------
28 -- This package contains the lexical analyzer routines. This is used both
29 -- for scanning Ada source files and also for scanning Ada project files.
31 with Casing; use Casing;
32 with Types; use Types;
34 package Scn is
36 procedure Initialize_Scanner
37 (Unit : Unit_Number_Type;
38 Index : Source_File_Index);
39 -- Initialize lexical scanner for scanning a new file. The caller has
40 -- completed the construction of the Units.Table entry for the specified
41 -- Unit and Index references the corresponding source file. A special
42 -- case is when Unit = No_Unit_Number, and Index corresponds to the
43 -- source index for reading the configuration pragma file.
45 procedure Scan;
46 -- Scan scans out the next token, and advances the scan state accordingly
47 -- (see package Scan_State for details). If the scan encounters an illegal
48 -- token, then an error message is issued pointing to the bad character,
49 -- and Scan returns a reasonable substitute token of some kind.
51 function Scan_First_Char return Source_Ptr;
52 -- This routine returns the position in Source of the first non-blank
53 -- character on the current line, used for certain error recovery actions.
55 procedure Scan_Reserved_Identifier (Force_Msg : Boolean);
56 -- This procedure is called to convert the current token, which the caller
57 -- has checked is for a reserved word, to an equivalent identifier. This is
58 -- of course only used in error situations where the parser can detect that
59 -- a reserved word is being used as an identifier. An appropriate error
60 -- message, pointing to the token, is also issued if either this is the
61 -- first occurrence of misuse of this identifier, or if Force_Msg is True.
63 function Determine_Token_Casing return Casing_Type;
64 pragma Inline (Determine_Token_Casing);
65 -- Determines the casing style of the current token, which is
66 -- either a keyword or an identifier. See also package Casing.
68 end Scn;