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