OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [ada/] [stringt.h] - Diff between revs 281 and 338

Only display areas with differences | Details | Blame | View Log

Rev 281 Rev 338
/****************************************************************************
/****************************************************************************
 *                                                                          *
 *                                                                          *
 *                         GNAT COMPILER COMPONENTS                         *
 *                         GNAT COMPILER COMPONENTS                         *
 *                                                                          *
 *                                                                          *
 *                              S T R I N G T                               *
 *                              S T R I N G T                               *
 *                                                                          *
 *                                                                          *
 *                              C Header File                               *
 *                              C Header File                               *
 *                                                                          *
 *                                                                          *
 *            Copyright (C) 1992-2007, Free Software Foundation, Inc.       *
 *            Copyright (C) 1992-2007, Free Software Foundation, Inc.       *
 *                                                                          *
 *                                                                          *
 * GNAT is free software;  you can  redistribute it  and/or modify it under *
 * 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- *
 * terms of the  GNU General Public License as published  by the Free Soft- *
 * ware  Foundation;  either version 3,  or (at your option) any later ver- *
 * ware  Foundation;  either version 3,  or (at your option) any later ver- *
 * sion.  GNAT is distributed in the hope that it will be useful, but WITH- *
 * sion.  GNAT is distributed in the hope that it will be useful, but WITH- *
 * OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY *
 * OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY *
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License *
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License *
 * for  more details.  You should have  received  a copy of the GNU General *
 * for  more details.  You should have  received  a copy of the GNU General *
 * Public License  distributed with GNAT; see file COPYING3.  If not, go to *
 * Public License  distributed with GNAT; see file COPYING3.  If not, go to *
 * http://www.gnu.org/licenses for a complete copy of the license.          *
 * http://www.gnu.org/licenses for a complete copy of the license.          *
 *                                                                          *
 *                                                                          *
 * GNAT was originally developed  by the GNAT team at  New York University. *
 * GNAT was originally developed  by the GNAT team at  New York University. *
 * Extensive contributions were provided by Ada Core Technologies Inc.      *
 * Extensive contributions were provided by Ada Core Technologies Inc.      *
 *                                                                          *
 *                                                                          *
 ****************************************************************************/
 ****************************************************************************/
 
 
/* This file is the C file that corresponds to the Ada package spec
/* This file is the C file that corresponds to the Ada package spec
   Stringt. It was created manually from stringt.ads and stringt.adb
   Stringt. It was created manually from stringt.ads and stringt.adb
 
 
   Note: only the access functions are provided, since the tree transformer
   Note: only the access functions are provided, since the tree transformer
   is not allowed to modify the tree or its auxiliary structures.
   is not allowed to modify the tree or its auxiliary structures.
 
 
   This package contains routines for handling the strings table which is
   This package contains routines for handling the strings table which is
   used to store string constants encountered in the source, and also those
   used to store string constants encountered in the source, and also those
   additional string constants generated by compile time concatenation and
   additional string constants generated by compile time concatenation and
   other similar processing.
   other similar processing.
 
 
   A string constant in this table consists of a series of Char_Code values,
   A string constant in this table consists of a series of Char_Code values,
   so that 16-bit character codes can be properly handled if this feature is
   so that 16-bit character codes can be properly handled if this feature is
   implemented in the scanner.
   implemented in the scanner.
 
 
   There is no guarantee that hashing is used in the implementation. This
   There is no guarantee that hashing is used in the implementation. This
   means that the caller cannot count on having the same Id value for two
   means that the caller cannot count on having the same Id value for two
   identical strings stored separately.
   identical strings stored separately.
 
 
   The String_Id values reference entries in the Strings table, which
   The String_Id values reference entries in the Strings table, which
   contains String_Entry records that record the length of each stored string
   contains String_Entry records that record the length of each stored string
   and its starting location in the String_Chars table.  */
   and its starting location in the String_Chars table.  */
 
 
struct String_Entry
struct String_Entry
{
{
  Int String_Index;
  Int String_Index;
  Int Length;
  Int Length;
};
};
 
 
/* Pointer to string entry vector. This pointer is passed to the tree
/* Pointer to string entry vector. This pointer is passed to the tree
   transformer and stored in a global location.  */
   transformer and stored in a global location.  */
extern struct String_Entry *Strings_Ptr;
extern struct String_Entry *Strings_Ptr;
 
 
/* Pointer to name characters table. This pointer is passed to the tree
/* Pointer to name characters table. This pointer is passed to the tree
   transformer and stored in a global location for access from here. The
   transformer and stored in a global location for access from here. The
   String_Index values are subscripts into this array.  */
   String_Index values are subscripts into this array.  */
extern Char_Code *String_Chars_Ptr;
extern Char_Code *String_Chars_Ptr;
 
 
 
 
/* String_Length returns the length of the specified string.  */
/* String_Length returns the length of the specified string.  */
INLINE Int String_Length (String_Id);
INLINE Int String_Length (String_Id);
 
 
INLINE Int
INLINE Int
String_Length (String_Id Id)
String_Length (String_Id Id)
{
{
  return Strings_Ptr[Id - First_String_Id].Length;
  return Strings_Ptr[Id - First_String_Id].Length;
}
}
 
 
 
 
/* Get_String_Char obtains the specified character from a stored string.  The
/* Get_String_Char obtains the specified character from a stored string.  The
   lower bound of stored strings is always 1, so the range of values is 1 to
   lower bound of stored strings is always 1, so the range of values is 1 to
   String_Length (Id).  */
   String_Length (Id).  */
INLINE Char_Code Get_String_Char (String_Id, Int);
INLINE Char_Code Get_String_Char (String_Id, Int);
 
 
INLINE Char_Code
INLINE Char_Code
Get_String_Char (String_Id Id, Int Index)
Get_String_Char (String_Id Id, Int Index)
{
{
  return
  return
    String_Chars_Ptr
    String_Chars_Ptr
      [Strings_Ptr[Id - First_String_Id].String_Index + Index - 1];
      [Strings_Ptr[Id - First_String_Id].String_Index + Index - 1];
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.