home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Gadgets 1
/
ADE-1.bin
/
ade-dist
/
gnat-2.06-src.tgz
/
tar.out
/
fsf
/
gnat
/
ada
/
csets.ads
< prev
next >
Wrap
Text File
|
1996-09-28
|
5KB
|
88 lines
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- C S E T S --
-- --
-- S p e c --
-- --
-- $Revision: 1.13 $ --
-- --
-- Copyright (c) 1992,1993,1994,1995 NYU, All Rights Reserved --
-- --
-- The GNAT library is free software; you can redistribute it and/or modify --
-- it under terms of the GNU Library General Public License as published by --
-- the Free Software Foundation; either version 2, or (at your option) any --
-- later version. The GNAT library is distributed in the hope that it will --
-- be useful, but WITHOUT ANY WARRANTY; without even the implied warranty --
-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- Library General Public License for more details. You should have --
-- received a copy of the GNU Library General Public License along with --
-- the GNAT library; see the file COPYING.LIB. If not, write to the Free --
-- Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
-- --
------------------------------------------------------------------------------
package Csets is
-- This package contains character tables for the various character
-- sets that are supported for source representation. Character and
-- string literals are not affected, only identifiers. For each set,
-- the table in this package gives the mapping of letters to their
-- upper case equivalent. Each table thus provides the information
-- for building the table used to fold lower case to upper case, and
-- also the table of flags showing which characters are allowed in
-- identifiers.
type Translate_Table is array (Character) of Character;
-- Type used to describe translate tables
type Char_Array_Flags is array (Character) of Boolean;
-- Type used for character attribute arrays. Note that we deliberately
-- do NOT pack this table, since we don't want the extra overhead of
-- accessing a packed bit string.
-----------------------------------------------
-- Character Tables For Current Compilation --
-----------------------------------------------
procedure Initialize;
-- Routine to initialize following character tables, whose content depends
-- on the character code being used to represent the source program. In
-- particular, the use of the upper half of the 8-bit code set varies.
-- The character set in use is specified by the value stored in
-- Opt.Identifier_Character_Set, which has the following settings:
-- '1' Latin-1
-- '2' Latin-2
-- '3' Latin-3
-- '4' Latin-4
-- 'p' IBM PC (code page 437)
-- '8' IBM PC (code page 850)
-- 'f' Full upper set (all distinct)
-- 'n' No upper characters (Ada/83 rules)
-- 'w' Latin-1 plus wide characters also allowed
function Is_Upper_Case_Letter (C : Character) return Boolean;
pragma Inline (Is_Upper_Case_Letter);
-- Determine if character is upper case letter
function Is_Lower_Case_Letter (C : Character) return Boolean;
pragma Inline (Is_Lower_Case_Letter);
-- Determine if character is lower case letter
Fold_Upper : Translate_Table;
-- Table to fold lower case identifier letters to upper case
Fold_Lower : Translate_Table;
-- Table to fold upper case identifier letters to lower case
Identifier_Char : Char_Array_Flags;
-- This table has True entries for all characters that can legally appear
-- in identifiers, including digits, the underline character, all letters
-- including upper and lower case and extended letters (as controlled by
-- the setting of Opt.Identifier_Character_Set, and also ESC if wide
-- characters are permitted in identifiers.
end Csets;