diff options
Diffstat (limited to 'gcc/ada/scn.ads')
-rw-r--r-- | gcc/ada/scn.ads | 48 |
1 files changed, 33 insertions, 15 deletions
diff --git a/gcc/ada/scn.ads b/gcc/ada/scn.ads index ead6441fbb1..23741e85441 100644 --- a/gcc/ada/scn.ads +++ b/gcc/ada/scn.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 1992-2000 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2002 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -24,10 +24,13 @@ -- -- ------------------------------------------------------------------------------ --- This package contains the lexical analyzer routines. This is used both --- for scanning Ada source files and also for scanning Ada project files. +-- This package contains the lexical analyzer routines. This is used by the +-- compiler for scanning Ada source files. with Casing; use Casing; +with Errout; use Errout; +with Scng; +with Style; use Style; with Types; use Types; package Scn is @@ -41,15 +44,14 @@ package Scn is -- case is when Unit = No_Unit_Number, and Index corresponds to the -- source index for reading the configuration pragma file. - procedure Scan; - -- Scan scans out the next token, and advances the scan state accordingly - -- (see package Scan_State for details). If the scan encounters an illegal - -- token, then an error message is issued pointing to the bad character, - -- and Scan returns a reasonable substitute token of some kind. + function Determine_Token_Casing return Casing_Type; + -- Determines the casing style of the current token, which is + -- either a keyword or an identifier. See also package Casing. - function Scan_First_Char return Source_Ptr; - -- This routine returns the position in Source of the first non-blank - -- character on the current line, used for certain error recovery actions. + procedure Post_Scan; + pragma Inline (Post_Scan); + -- Create nodes for tokens: Char_Literal, Identifier, Real_Literal, + -- Integer_Literal, String_Literal and Operator_Symbol. procedure Scan_Reserved_Identifier (Force_Msg : Boolean); -- This procedure is called to convert the current token, which the caller @@ -59,9 +61,25 @@ package Scn is -- message, pointing to the token, is also issued if either this is the -- first occurrence of misuse of this identifier, or if Force_Msg is True. - function Determine_Token_Casing return Casing_Type; - pragma Inline (Determine_Token_Casing); - -- Determines the casing style of the current token, which is - -- either a keyword or an identifier. See also package Casing. + ------------- + -- Scanner -- + ------------- + + -- The scanner used by the compiler is an instantiation of the + -- generic package Scng with routines appropriate to the compiler + + package Scanner is new Scng + (Post_Scan => Post_Scan, + Error_Msg => Error_Msg, + Error_Msg_S => Error_Msg_S, + Error_Msg_SC => Error_Msg_SC, + Error_Msg_SP => Error_Msg_SP, + Style => Style.Style_Inst); + + procedure Scan renames Scanner.Scan; + -- Scan scans out the next token, and advances the scan state accordingly + -- (see package Scans for details). If the scan encounters an illegal + -- token, then an error message is issued pointing to the bad character, + -- and Scan returns a reasonable substitute token of some kind. end Scn; |