X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=blobdiff_plain;f=libcpp%2Finclude%2Fcpplib.h;h=c84f62433766eb7301ecf2e2d4b6c1cbd4214449;hp=13213882aa812eaa9c3492324fe125eaaee3aeeb;hb=865c4e44475a4e78fef3deb41aef6152793ce596;hpb=68bf2ad934202d583d12eff842fdeb4114f9c783 diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h index 13213882aa8..c84f6243376 100644 --- a/libcpp/include/cpplib.h +++ b/libcpp/include/cpplib.h @@ -1,5 +1,6 @@ /* Definitions for CPP library. - Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, + 2004, 2005 Free Software Foundation, Inc. Written by Per Bothner, 1994-95. @@ -15,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. In other words, you are welcome to use, share and improve this program. You are forbidden to forbid anyone else to use, share and improve @@ -152,7 +153,7 @@ enum cpp_ttype #undef OP #undef TK -/* C language kind, used when calling cpp_reader_init. */ +/* C language kind, used when calling cpp_create_reader. */ enum c_lang {CLK_GNUC89 = 0, CLK_GNUC99, CLK_STDC89, CLK_STDC94, CLK_STDC99, CLK_GNUCXX, CLK_CXX98, CLK_ASM}; @@ -235,6 +236,19 @@ typedef CPPCHAR_SIGNED_T cppchar_signed_t; /* Style of header dependencies to generate. */ enum cpp_deps_style { DEPS_NONE = 0, DEPS_USER, DEPS_SYSTEM }; +/* The possible normalization levels, from most restrictive to least. */ +enum cpp_normalize_level { + /* In NFKC. */ + normalized_KC = 0, + /* In NFC. */ + normalized_C, + /* In NFC, except for subsequences where being in NFC would make + the identifier invalid. */ + normalized_identifier_C, + /* Not normalized at all. */ + normalized_none +}; + /* This structure is nested inside struct cpp_reader, and carries all the options visible to the command line. */ struct cpp_options @@ -331,6 +345,9 @@ struct cpp_options /* Zero means dollar signs are punctuation. */ unsigned char dollars_in_ident; + /* Nonzero means UCNs are accepted in identifiers. */ + unsigned char extended_identifiers; + /* True if we should warn about dollars in identifiers or numbers for this translation unit. */ unsigned char warn_dollars; @@ -372,6 +389,10 @@ struct cpp_options /* Holds the name of the input character set. */ const char *input_charset; + /* The minimum permitted level of normalization before a warning + is generated. */ + enum cpp_normalize_level warn_normalize; + /* True to warn about precompiled header files we couldn't use. */ bool warn_invalid_pch; @@ -551,6 +572,19 @@ enum { /* The common part of an identifier node shared amongst all 3 C front ends. Also used to store CPP identifiers, which are a superset of identifiers in the grammatical sense. */ + +union _cpp_hashnode_value GTY(()) +{ + /* If a macro. */ + cpp_macro * GTY((tag ("NTV_MACRO"))) macro; + /* Answers to an assertion. */ + struct answer * GTY ((tag ("NTV_ANSWER"))) answers; + /* Code for a builtin macro. */ + enum builtin_type GTY ((tag ("NTV_BUILTIN"))) builtin; + /* Macro argument index. */ + unsigned short GTY ((tag ("NTV_ARGUMENT"))) arg_index; +}; + struct cpp_hashnode GTY(()) { struct ht_identifier ident; @@ -562,17 +596,7 @@ struct cpp_hashnode GTY(()) ENUM_BITFIELD(node_type) type : 8; /* CPP node type. */ unsigned char flags; /* CPP flags. */ - union _cpp_hashnode_value - { - /* If a macro. */ - cpp_macro * GTY((tag ("NTV_MACRO"))) macro; - /* Answers to an assertion. */ - struct answer * GTY ((tag ("NTV_ANSWER"))) answers; - /* Code for a builtin macro. */ - enum builtin_type GTY ((tag ("NTV_BUILTIN"))) builtin; - /* Macro argument index. */ - unsigned short GTY ((tag ("NTV_ARGUMENT"))) arg_index; - } GTY ((desc ("CPP_HASHNODE_VALUE_IDX (%1)"))) value; + union _cpp_hashnode_value GTY ((desc ("CPP_HASHNODE_VALUE_IDX (%1)"))) value; }; /* Call this first to get a handle to pass to other functions. @@ -636,7 +660,7 @@ extern unsigned int cpp_errors (cpp_reader *); extern unsigned int cpp_token_len (const cpp_token *); extern unsigned char *cpp_token_as_text (cpp_reader *, const cpp_token *); extern unsigned char *cpp_spell_token (cpp_reader *, const cpp_token *, - unsigned char *); + unsigned char *, bool); extern void cpp_register_pragma (cpp_reader *, const char *, const char *, void (*) (cpp_reader *), bool); extern void cpp_handle_deferred_pragma (cpp_reader *, const cpp_string *); @@ -658,6 +682,9 @@ extern bool cpp_interpret_string_notranslate (cpp_reader *, const cpp_string *, size_t, cpp_string *, bool); +/* Convert a host character constant to the execution character set. */ +extern cppchar_t cpp_host_to_exec_charset (cpp_reader *, cppchar_t); + /* Used to register macros and assertions, perhaps from the command line. The text is the same as the command line argument. */ extern void cpp_define (cpp_reader *, const char *); @@ -742,12 +769,6 @@ cpp_num cpp_num_sign_extend (cpp_num, size_t); #define CPP_DL_WARNING_P(l) (CPP_DL_EXTRACT (l) >= CPP_DL_WARNING \ && CPP_DL_EXTRACT (l) <= CPP_DL_PEDWARN) -/* N.B. The error-message-printer prototypes have not been nicely - formatted because exgettext needs to see 'msgid' on the same line - as the name of the function in order to work properly. Only the - string argument gets a name in an effort to keep the lines from - getting ridiculously oversized. */ - /* Output a diagnostic of some kind. */ extern void cpp_error (cpp_reader *, int, const char *msgid, ...) ATTRIBUTE_PRINTF_3;