This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Unicode and g++


This is a patch to support universal character names in g++, for use
in identifiers and strings (the preprocessor has not been changed).

struct B\u00F6se{
  static int \u30DE;
  virtual void dummy();
};

int B\u00F6se::\u30DE;

void se\u00F1or(B\u00F6se &b)
{}

void B\u00F6se::dummy()
{}

wchar_t x[]=L"\u1234 \u5678";

Depending on the assembler properties, this will mangle names either
according to gxxint.texi, or produce assembler output that contains
UTF-8.

This is the first release of the patch, some work still needs to be
done. In particular, the function that determines whether a character
is a letter (according to Annex E of ISO C++) is generated, but the
generation mechanism has not yet been ported to C (it is a Python
script). Unfortunately, it seems that the C++ definition of letters is
different from the Java one.

Please let me know what you think.

Thanks,
Martin

Mon Nov  2 21:55:09 1998  Martin von Löwis  <loewis@informatik.hu-berlin.de>

	* acconfig.h (HAVE_GAS_UTF8): Undefine.
	* configure.in: Test UTF-8 support in assembler.
	* tree.h (TREE_UNIVERSAL_CHAR): New macro.
	* tree.c (get_identifier): Set if identifier contains \u.

1998-11-02  Martin von Löwis  <loewis@informatik.hu-berlin.de>

	* universal.c: New file.
	* Make-lang.in (CXX_SRCS): Add it.
	* Makefile.in (CXX_OBJS): Likewise.
	* lex.c (universal_getch, put_universal): New functions.
	(skip_white_space): Handle universal characters.
	(readescape): Likewise.
	(real_yylex): Likewise. For identifiers, merge similar if cases.
	* method.c (unival): New function.
	(put_universal): New function.
	(OB_PUTID): Call it.
	(put_id): New function.
	(build_template_parm_names): Call it instead of OB_PUTID.
	(build_overload_identifier): Likewise.
	(build_static_name): Emit 'U' for universal names.
	(build_decl_overload_real): Lose name, call OB_PUTID instead.
	Suffix methods with 'U'.


diff.gz


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]