1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-1998 Free Software Foundation, Inc. --
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, 59 Temple Place - Suite 330, Boston, --
20 -- MA 02111-1307, USA. --
22 -- As a special exception, if other files instantiate generics from this --
23 -- unit, or you link this unit with other files to produce an executable, --
24 -- this unit does not by itself cause the resulting executable to be --
25 -- covered by the GNU General Public License. This exception does not --
26 -- however invalidate any other reasons why the executable file might be --
27 -- covered by the GNU Public License. --
29 -- GNAT was originally developed by the GNAT team at New York University. --
30 -- Extensive contributions were provided by Ada Core Technologies Inc. --
32 ------------------------------------------------------------------------------
34 -- Subprograms for manipulation of wide character sequences
36 with Types
; use Types
;
40 function Length_Wide
return Nat
;
41 -- Returns the maximum length in characters for the escape sequence that
42 -- is used to encode wide character literals outside the ASCII range. Used
43 -- only in the implementation of the attribute Width for Wide_Character.
46 (S
: Source_Buffer_Ptr
;
47 P
: in out Source_Ptr
;
50 -- On entry S (P) points to the first character in the source text for
51 -- a wide character (i.e. to an ESC character, a left bracket, or an
52 -- upper half character, depending on the representation method). A
53 -- single wide character is scanned. If no error is found, the value
54 -- stored in C is the code for this wide character, P is updated past
55 -- the sequence and Err is set to False. If an error is found, then
56 -- P points to the improper character, C is undefined, and Err is
63 -- The escape sequence (including any leading ESC character) for the
64 -- given character code is stored starting at S (P + 1), and on return
65 -- P points to the last stored character (i.e. P is the count of stored
66 -- characters on entry and exit, and the escape sequence is appended to
67 -- the end of the stored string). The character code C represents a code
68 -- originally constructed by Scan_Wide, so it is known to be in a range
69 -- that is appropriate for the encoding method in use.
71 procedure Skip_Wide
(S
: String; P
: in out Natural);
72 -- On entry, S (P) points to an ESC character for a wide character escape
73 -- sequence or to an upper half character if the encoding method uses the
74 -- upper bit, or to a left bracket if the brackets encoding method is in
75 -- use. On exit, P is bumped past the wide character sequence. No error
76 -- checking is done, since this is only used on escape sequences generated
77 -- by Set_Wide, which are known to be correct.
79 function Is_Start_Of_Wide_Char
80 (S
: Source_Buffer_Ptr
;
83 -- Determines if S (P) is the start of a wide character sequence