Implementing Universal Character Names in identifiers

Brian Sullivan bsulliv@legacyj.com
Fri Nov 1 13:44:00 GMT 2002


I was curious if anyone had looked into supporting Java header files
directly from C++ without generating includes as a separate step, for
maintainance and ease of use.
Something like:
extern "java" {
#include <java.lang.Object>
}
where the java indicates the lookup mechanism. (If someone were to do a
.net version or other reflection capable mechanisms later, additional
lookup mechanisms could be added.) There should be no requirement that
the only extern used ever be "C".
That way, whenever definitions of the Objects change, or the C++ to gcj
API changes, the change is automatically reflected in the C++ side's
compilation. And no separate .h generation would be required to compile
or required to maintain. (The effective input of this would be the same
currently as generated by the .h for the file.) I'm not picky on the
mechanism, I just think that it would be a cleaner interface than
separate generation.
As all the generation and usage would be internal to the compiler,
character set issues may become moot.
If I'm out of mind here, by all means let me know.
Regards,
Brian Sullivan
java-digest-help@gcc.gnu.org wrote:
>> The second issue is that of representing Java method and variable
> names in C++. We generate C++ header files from Java .class files,
> and the user can make Java method calls, etc, from C++. So if a Java
> method or field has a name containing a non-ascii character, we want
> to be able to represent that compatibly in a C++ header.
>> I assume this is solved by emitting \u escapes in the .h file. I
> haven't really looked into it. (We haven't ever seen a bug report for
> this, so it has had a very low priority.)
>> Tom



More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /