Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

demangle.h

Go to the documentation of this file.
00001 /* Defs for interface to demanglers.
00002    Copyright 1992, 1995, 1996 Free Software Foundation, Inc.
00003    
00004    This program is free software; you can redistribute it and/or modify
00005    it under the terms of the GNU General Public License as published by
00006    the Free Software Foundation; either version 2, or (at your option)
00007    any later version.
00008 
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012    GNU General Public License for more details.
00013 
00014    You should have received a copy of the GNU General Public License
00015    along with this program; if not, write to the Free Software
00016    Foundation, Inc., 59 Temple Place - Suite 330,
00017    Boston, MA 02111-1307, USA.  */
00018 
00019 
00020 #if !defined (DEMANGLE_H)
00021 #define DEMANGLE_H
00022 
00023 /* Options passed to cplus_demangle (in 2nd parameter). */
00024 
00025 #define DMGL_NO_OPTS    0               /* For readability... */
00026 #define DMGL_PARAMS     (1 << 0)        /* Include function args */
00027 #define DMGL_ANSI       (1 << 1)        /* Include const, volatile, etc */
00028 #define DMGL_JAVA       (1 << 2)        /* Demangle as Java rather than C++. */
00029 
00030 #define DMGL_AUTO       (1 << 8)
00031 #define DMGL_GNU        (1 << 9)
00032 #define DMGL_LUCID      (1 << 10)
00033 #define DMGL_ARM        (1 << 11)
00034 #define DMGL_HP         (1 << 12)       /* For the HP aCC compiler; same as ARM
00035                                                                    except for template arguments, etc. */
00036 #define DMGL_EDG        (1 << 13)
00037 
00038 /* If none of these are set, use 'current_demangling_style' as the default. */
00039 #define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM|DMGL_HP|DMGL_EDG)
00040 
00041 /* Enumeration of possible demangling styles.
00042 
00043    Lucid and ARM styles are still kept logically distinct, even though
00044    they now both behave identically.  The resulting style is actual the
00045    union of both.  I.E. either style recognizes both "__pt__" and "__rf__"
00046    for operator "->", even though the first is lucid style and the second
00047    is ARM style. (FIXME?) */
00048 
00049 extern enum demangling_styles
00050 {
00051   unknown_demangling = 0,
00052   auto_demangling = DMGL_AUTO,
00053   gnu_demangling = DMGL_GNU,
00054   lucid_demangling = DMGL_LUCID,
00055   arm_demangling = DMGL_ARM,
00056   hp_demangling = DMGL_HP,
00057   edg_demangling = DMGL_EDG
00058 } current_demangling_style;
00059 
00060 /* Define string names for the various demangling styles. */
00061 
00062 #define AUTO_DEMANGLING_STYLE_STRING    "auto"
00063 #define GNU_DEMANGLING_STYLE_STRING     "gnu"
00064 #define LUCID_DEMANGLING_STYLE_STRING   "lucid"
00065 #define ARM_DEMANGLING_STYLE_STRING     "arm"
00066 #define HP_DEMANGLING_STYLE_STRING      "hp"
00067 #define EDG_DEMANGLING_STYLE_STRING     "edg"
00068 
00069 /* Some macros to test what demangling style is active. */
00070 
00071 #define CURRENT_DEMANGLING_STYLE current_demangling_style
00072 #define AUTO_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_AUTO)
00073 #define GNU_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU)
00074 #define LUCID_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_LUCID)
00075 #define ARM_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_ARM)
00076 #define HP_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_HP)
00077 #define EDG_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_EDG)
00078 
00079 extern char *
00080 cplus_demangle (const char *mangled, int options);
00081 
00082 extern int
00083 cplus_demangle_opname (const char *opname, char *result, int options);
00084 
00085 extern const char *
00086 cplus_mangle_opname (const char *opname, int options);
00087 
00088 /* Note: This sets global state.  FIXME if you care about multi-threading. */
00089 
00090 extern void
00091 set_cplus_marker_for_demangling (int ch);
00092 
00093 #endif  /* DEMANGLE_H */

Generated on Fri May 7 21:15:30 2004 by doxygen 1.3.5