diff options
author | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-03-10 21:46:48 +0000 |
---|---|---|
committer | mark <mark@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-03-10 21:46:48 +0000 |
commit | ce57ab760f69de6db452def7ffbf5b114a2d8694 (patch) | |
tree | ea38c56431c5d4528fb54254c3f8e50f517bede3 /libjava/classpath/scripts | |
parent | 50996fe55769882de3f410896032c887f0ff0d04 (diff) | |
download | gcc-ce57ab760f69de6db452def7ffbf5b114a2d8694.tar.gz |
Imported GNU Classpath 0.90
* scripts/makemake.tcl: Set gnu/java/awt/peer/swing to ignore.
* gnu/classpath/jdwp/VMFrame.java (SIZE): New constant.
* java/lang/VMCompiler.java: Use gnu.java.security.hash.MD5.
* java/lang/Math.java: New override file.
* java/lang/Character.java: Merged from Classpath.
(start, end): Now 'int's.
(canonicalName): New field.
(CANONICAL_NAME, NO_SPACES_NAME, CONSTANT_NAME): New constants.
(UnicodeBlock): Added argument.
(of): New overload.
(forName): New method.
Updated unicode blocks.
(sets): Updated.
* sources.am: Regenerated.
* Makefile.in: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111942 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/scripts')
-rw-r--r-- | libjava/classpath/scripts/Makefile.in | 7 | ||||
-rw-r--r-- | libjava/classpath/scripts/eclipse-gnu.xml | 90 | ||||
-rw-r--r-- | libjava/classpath/scripts/math_symbols | 4 | ||||
-rwxr-xr-x | libjava/classpath/scripts/unicode-blocks.pl | 240 | ||||
-rwxr-xr-x | libjava/classpath/scripts/unicode-muncher.pl | 637 |
5 files changed, 721 insertions, 257 deletions
diff --git a/libjava/classpath/scripts/Makefile.in b/libjava/classpath/scripts/Makefile.in index 40df5421d2d..df9b898078d 100644 --- a/libjava/classpath/scripts/Makefile.in +++ b/libjava/classpath/scripts/Makefile.in @@ -72,6 +72,7 @@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CLASSPATH_INCLUDES = @CLASSPATH_INCLUDES@ CLASSPATH_MODULE = @CLASSPATH_MODULE@ +COLLECTIONS_PREFIX = @COLLECTIONS_PREFIX@ CP = @CP@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -79,6 +80,8 @@ CREATE_ALSA_LIBRARIES_FALSE = @CREATE_ALSA_LIBRARIES_FALSE@ CREATE_ALSA_LIBRARIES_TRUE = @CREATE_ALSA_LIBRARIES_TRUE@ CREATE_API_DOCS_FALSE = @CREATE_API_DOCS_FALSE@ CREATE_API_DOCS_TRUE = @CREATE_API_DOCS_TRUE@ +CREATE_COLLECTIONS_FALSE = @CREATE_COLLECTIONS_FALSE@ +CREATE_COLLECTIONS_TRUE = @CREATE_COLLECTIONS_TRUE@ CREATE_CORE_JNI_LIBRARIES_FALSE = @CREATE_CORE_JNI_LIBRARIES_FALSE@ CREATE_CORE_JNI_LIBRARIES_TRUE = @CREATE_CORE_JNI_LIBRARIES_TRUE@ CREATE_DSSI_LIBRARIES_FALSE = @CREATE_DSSI_LIBRARIES_FALSE@ @@ -109,6 +112,7 @@ EGREP = @EGREP@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXAMPLESDIR = @EXAMPLESDIR@ EXEEXT = @EXEEXT@ +FASTJAR = @FASTJAR@ FIND = @FIND@ FOUND_ECJ_FALSE = @FOUND_ECJ_FALSE@ FOUND_ECJ_TRUE = @FOUND_ECJ_TRUE@ @@ -120,6 +124,8 @@ FOUND_JIKES_FALSE = @FOUND_JIKES_FALSE@ FOUND_JIKES_TRUE = @FOUND_JIKES_TRUE@ FOUND_KJC_FALSE = @FOUND_KJC_FALSE@ FOUND_KJC_TRUE = @FOUND_KJC_TRUE@ +FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ +FREETYPE2_LIBS = @FREETYPE2_LIBS@ GCJ = @GCJ@ GCJX = @GCJX@ GJDOC = @GJDOC@ @@ -170,6 +176,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PANGOFT2_CFLAGS = @PANGOFT2_CFLAGS@ PANGOFT2_LIBS = @PANGOFT2_LIBS@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ diff --git a/libjava/classpath/scripts/eclipse-gnu.xml b/libjava/classpath/scripts/eclipse-gnu.xml index 8d04e08e15f..60a1082ca1e 100644 --- a/libjava/classpath/scripts/eclipse-gnu.xml +++ b/libjava/classpath/scripts/eclipse-gnu.xml @@ -1,31 +1,24 @@ <?xml version="1.0" encoding="UTF-8"?> -<profiles version="6"> -<profile name="GNU" version="6"> -<setting id="comment_clear_blank_lines" value="true"/> -<setting id="comment_format_comments" value="true"/> -<setting id="comment_format_header" value="false"/> -<setting id="comment_format_html" value="true"/> -<setting id="comment_format_source_code" value="true"/> -<setting id="comment_indent_parameter_description" value="true"/> -<setting id="comment_indent_root_tags" value="true"/> -<setting id="comment_line_length" value="80"/> -<setting id="comment_new_line_for_parameter" value="true"/> -<setting id="comment_separate_root_tags" value="true"/> +<profiles version="8"> +<profile name="GNU" version="8"> <setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="18"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="18"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="18"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="18"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="18"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="82"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="18"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="18"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="18"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="0"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/> -<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="17"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/> +<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="17"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/> <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/> <setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/> @@ -38,25 +31,43 @@ <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/> <setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="2"/> <setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="next_line"/> <setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="next_line"/> <setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/> <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line_shifted"/> <setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="next_line"/> <setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="next_line"/> +<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line"/> <setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="next_line"/> <setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line_shifted"/> <setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line"/> +<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_comments" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/> <setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/> <setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/> <setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/> <setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/> +<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/> <setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/> <setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/> <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/> <setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/> <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/> <setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/> +<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="insert"/> @@ -64,20 +75,31 @@ <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/> @@ -86,13 +108,22 @@ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/> @@ -104,16 +135,24 @@ <setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/> -<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/> @@ -126,11 +165,15 @@ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/> @@ -139,19 +182,32 @@ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/> @@ -163,13 +219,16 @@ <setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/> +<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/> <setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/> @@ -182,5 +241,6 @@ <setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/> <setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/> <setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="2"/> +<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/> </profile> </profiles> diff --git a/libjava/classpath/scripts/math_symbols b/libjava/classpath/scripts/math_symbols index 9bc8c26a22d..e676a5197dc 100644 --- a/libjava/classpath/scripts/math_symbols +++ b/libjava/classpath/scripts/math_symbols @@ -7,10 +7,14 @@ sin tan cosh sinh +tanh exp frexp ldexp +expm1 log +log10 +log1p modf pow sqrt diff --git a/libjava/classpath/scripts/unicode-blocks.pl b/libjava/classpath/scripts/unicode-blocks.pl index 9b84c831ddb..f022220acfe 100755 --- a/libjava/classpath/scripts/unicode-blocks.pl +++ b/libjava/classpath/scripts/unicode-blocks.pl @@ -76,6 +76,47 @@ my %additions = ("SYRIAC" => "1.4", "CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A" => "1.4", "YI_SYLLABLES" => "1.4", "YI_RADICALS" => "1.4", + "CYRILLIC_SUPPLEMENTARY" => "1.5", + "TAGALOG" => "1.5", + "HANUNOO" => "1.5", + "BUHID" => "1.5", + "TAGBANWA" => "1.5", + "LIMBU" => "1.5", + "TAI_LE" => "1.5", + "KHMER_SYMBOLS" => "1.5", + "PHONETIC_EXTENSIONS" => "1.5", + "MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A" => "1.5", + "SUPPLEMENTAL_ARROWS_A" => "1.5", + "SUPPLEMENTAL_ARROWS_B" => "1.5", + "MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B" => "1.5", + "SUPPLEMENTAL_MATHEMATICAL_OPERATORS" => "1.5", + "MISCELLANEOUS_SYMBOLS_AND_ARROWS" => "1.5", + "KATAKANA_PHONETIC_EXTENSIONS" => "1.5", + "YIJING_HEXAGRAM_SYMBOLS" => "1.5", + "VARIATION_SELECTORS" => "1.5", + "LINEAR_B_SYLLABARY" => "1.5", + "LINEAR_B_IDEOGRAMS" => "1.5", + "AEGEAN_NUMBERS" => "1.5", + "OLD_ITALIC" => "1.5", + "GOTHIC" => "1.5", + "UGARITIC" => "1.5", + "DESERET" => "1.5", + "SHAVIAN" => "1.5", + "OSMANYA" => "1.5", + "CYPRIOT_SYLLABARY" => "1.5", + "BYZANTINE_MUSICAL_SYMBOLS" => "1.5", + "MUSICAL_SYMBOLS" => "1.5", + "TAI_XUAN_JING_SYMBOLS" => "1.5", + "MATHEMATICAL_ALPHANUMERIC_SYMBOLS" => "1.5", + "CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B" => "1.5", + "CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT" => "1.5", + "TAGS" => "1.5", + "VARIATION_SELECTORS_SUPPLEMENT" => "1.5", + "SUPPLEMENTARY_PRIVATE_USE_AREA_A" => "1.5", + "SUPPLEMENTARY_PRIVATE_USE_AREA_B" => "1.5", + "HIGH_SURROGATES" => "1.5", + "HIGH_PRIVATE_USE_SURROGATES" => "1.5", + "LOW_SURROGATES" => "1.5" ); print <<'EOF'; @@ -87,7 +128,7 @@ print <<'EOF'; * <code>$ARGV[0]</code>, by some perl scripts. * This Unicode definition file can be found on the * <a href="http://www.unicode.org">http://www.unicode.org</a> website. - * JDK 1.4 uses Unicode version 3.0.0. + * JDK 1.5 uses Unicode version 4.0.0. * * @author scripts/unicode-blocks.pl (written by Eric Blake) * @since 1.2 @@ -95,10 +136,18 @@ print <<'EOF'; public static final class UnicodeBlock extends Subset { /** The start of the subset. */ - private final char start; + private final int start; /** The end of the subset. */ - private final char end; + private final int end; + + /** The canonical name of the block according to the Unicode standard. */ + private final String canonicalName; + + /** Constants for the <code>forName()</code> method */ + private static final int CANONICAL_NAME = 0; + private static final int NO_SPACES_NAME = 1; + private static final int CONSTANT_NAME = 2; /** * Constructor for strictly defined blocks. @@ -106,25 +155,46 @@ print <<'EOF'; * @param start the start character of the range * @param end the end character of the range * @param name the block name + * @param canonicalName the name of the block as defined in the Unicode + * standard. */ - private UnicodeBlock(char start, char end, String name) + private UnicodeBlock(int start, int end, String name, + String canonicalName) { super(name); this.start = start; this.end = end; + this.canonicalName = canonicalName; } /** * Returns the Unicode character block which a character belongs to. + * <strong>Note</strong>: This method does not support the use of + * supplementary characters. For such support, <code>of(int)</code> + * should be used instead. * * @param ch the character to look up * @return the set it belongs to, or null if it is not in one */ public static UnicodeBlock of(char ch) { - // Special case, since SPECIALS contains two ranges. - if (ch == '\uFEFF') - return SPECIALS; + return of((int) ch); + } + + /** + * Returns the Unicode character block which a code point belongs to. + * + * @param codePoint the character to look up + * @return the set it belongs to, or null if it is not in one. + * @throws IllegalArgumentException if the specified code point is + * invalid. + * @since 1.5 + */ + public static UnicodeBlock of(int codePoint) + { + if (codePoint > MAX_CODE_POINT) + throw new IllegalArgumentException("The supplied integer value is " + + "too large to be a codepoint."); // Simple binary search for the correct block. int low = 0; int hi = sets.length - 1; @@ -132,69 +202,163 @@ print <<'EOF'; { int mid = (low + hi) >> 1; UnicodeBlock b = sets[mid]; - if (ch < b.start) + if (codePoint < b.start) hi = mid - 1; - else if (ch > b.end) + else if (codePoint > b.end) low = mid + 1; else return b; } return null; } + + /** + * <p> + * Returns the <code>UnicodeBlock</code> with the given name, as defined + * by the Unicode standard. The version of Unicode in use is defined by + * the <code>Character</code> class, and the names are given in the + * <code>Blocks-<version>.txt</code> file corresponding to that version. + * The name may be specified in one of three ways: + * </p> + * <ol> + * <li>The canonical, human-readable name used by the Unicode standard. + * This is the name with all spaces and hyphens retained. For example, + * `Basic Latin' retrieves the block, UnicodeBlock.BASIC_LATIN.</li> + * <li>The canonical name with all spaces removed e.g. `BasicLatin'.</li> + * <li>The name used for the constants specified by this class, which + * is the canonical name with all spaces and hyphens replaced with + * underscores e.g. `BASIC_LATIN'</li> + * </ol> + * <p> + * The names are compared case-insensitively using the case comparison + * associated with the U.S. English locale. The method recognises the + * previous names used for blocks as well as the current ones. At + * present, this simply means that the deprecated `SURROGATES_AREA' + * will be recognised by this method (the <code>of()</code> methods + * only return one of the three new surrogate blocks). + * </p> + * + * @param blockName the name of the block to look up. + * @return the specified block. + * @throws NullPointerException if the <code>blockName</code> is + * <code>null</code>. + * @throws IllegalArgumentException if the name does not match any Unicode + * block. + * @since 1.5 + */ + public static final UnicodeBlock forName(String blockName) + { + int type; + if (blockName.indexOf(' ') != -1) + type = CANONICAL_NAME; + else if (blockName.indexOf('_') != -1) + type = CONSTANT_NAME; + else + type = NO_SPACES_NAME; + Collator usCollator = Collator.getInstance(Locale.US); + usCollator.setStrength(Collator.PRIMARY); + /* Special case for deprecated blocks not in sets */ + switch (type) + { + case CANONICAL_NAME: + if (usCollator.compare(blockName, "Surrogates Area") == 0) + return SURROGATES_AREA; + break; + case NO_SPACES_NAME: + if (usCollator.compare(blockName, "SurrogatesArea") == 0) + return SURROGATES_AREA; + break; + case CONSTANT_NAME: + if (usCollator.compare(blockName, "SURROGATES_AREA") == 0) + return SURROGATES_AREA; + break; + } + /* Other cases */ + int setLength = sets.length; + switch (type) + { + case CANONICAL_NAME: + for (int i = 0; i < setLength; i++) + { + UnicodeBlock block = sets[i]; + if (usCollator.compare(blockName, block.canonicalName) == 0) + return block; + } + break; + case NO_SPACES_NAME: + for (int i = 0; i < setLength; i++) + { + UnicodeBlock block = sets[i]; + String nsName = block.canonicalName.replaceAll(" ",""); + if (usCollator.compare(blockName, nsName) == 0) + return block; + } + break; + case CONSTANT_NAME: + for (int i = 0; i < setLength; i++) + { + UnicodeBlock block = sets[i]; + if (usCollator.compare(blockName, block.toString()) == 0) + return block; + } + break; + } + throw new IllegalArgumentException("No Unicode block found for " + + blockName + "."); + } EOF -my $seenSpecials = 0; -my $seenSurrogates = 0; -my $surrogateStart = 0; my @names = (); while (<BLOCKS>) { next if /^\#/; - my ($start, $end, $block) = split(/; /); + my ($range, $block) = split(/; /); + my ($start, $end) = split /\.\./, $range; next unless defined $block; chomp $block; $block =~ s/ *$//; - if (! $seenSpecials and $block =~ /Specials/) { - # Special case SPECIALS, since it is two disjoint ranges - $seenSpecials = 1; - next; - } - if ($block =~ /Surrogates/) { - # Special case SURROGATES_AREA, since it one range, not three - # consecutive, in Java - $seenSurrogates++; - if ($seenSurrogates == 1) { - $surrogateStart = $start; - next; - } elsif ($seenSurrogates == 2) { - next; - } else { - $start = $surrogateStart; - $block = "Surrogates Area"; - } - } - # Special case the name of PRIVATE_USE_AREA. - $block =~ s/(Private Use)/$1 Area/; + # Translate new Unicode names which have the old name in Java + $block = "Greek" if $block =~ /Greek and Coptic/; + $block = "Combining Marks for Symbols" + if $block =~ /Combining Diacritical Marks for Symbols/; + (my $name = $block) =~ tr/a-z -/A-Z__/; push @names, $name; my $since = (defined $additions{$name} ? "\n * \@since $additions{$name}" : ""); - my $extra = ($block =~ /Specials/ ? "'\\uFEFF', " : ""); print <<EOF; /** * $block. - * $extra'\\u$start' - '\\u$end'.$since + * 0x$start - 0x$end.$since */ public static final UnicodeBlock $name - = new UnicodeBlock('\\u$start', '\\u$end', - "$name"); + = new UnicodeBlock(0x$start, 0x$end, + "$name", + "$block"); EOF } print <<EOF; /** + * Surrogates Area. + * '\uD800' - '\uDFFF'. + * \@deprecated As of 1.5, the three areas, + * <a href="#HIGH_SURROGATES">HIGH_SURROGATES</a>, + * <a href="#HIGH_PRIVATE_USE_SURROGATES">HIGH_PRIVATE_USE_SURROGATES</a> + * and <a href="#LOW_SURROGATES">LOW_SURROGATES</a>, as defined + * by the Unicode standard, should be used in preference to + * this. These are also returned from calls to <code>of(int)</code> + * and <code>of(char)</code>. + */ + \@Deprecated + public static final UnicodeBlock SURROGATES_AREA + = new UnicodeBlock(0xD800, 0xDFFF, + "SURROGATES_AREA", + "Surrogates Area"); + + /** * The defined subsets. */ private static final UnicodeBlock sets[] = { diff --git a/libjava/classpath/scripts/unicode-muncher.pl b/libjava/classpath/scripts/unicode-muncher.pl index b275f36f07b..db2b89a728c 100755 --- a/libjava/classpath/scripts/unicode-muncher.pl +++ b/libjava/classpath/scripts/unicode-muncher.pl @@ -42,20 +42,21 @@ # # Inspired by code from Jochen Hoenicke. # author Eric Blake <ebb9@email.byu.edu> +# updated to Unicode 4.0.0 by Anthony Balkissoon <abalkiss@redhat.com> # # Usage: ./unicode-muncher <UnicodeData> <SpecialCasing> <CharData.java> # where <UnicodeData> and <SpecialCasing> are .txt files obtained from -# www.unicode.org (named UnicodeData-3.0.0.txt and SpecialCasing-2.txt for -# Unicode version 3.0.0), and <CharData.java> is the final location for the +# www.unicode.org (named UnicodeData-4.0.0.txt and SpecialCasing-4.0.0.txt for +# Unicode version 4.0.0), and <CharData.java> is the final location for the # Java interface gnu.java.lang.CharData. -# As of JDK 1.4, use Unicode version 3.0.0 for best results. +# As of JDK 1.5, use Unicode version 4.0.0 for best results. ## ## Convert a 16-bit integer to a Java source code String literal character ## sub javaChar($) { my ($char) = @_; - die "Out of range: $char\n" if $char < -0x8000 or $char > 0xffff; + die "Out of range: $char\n" if $char < -0x8000 or $char > 0x10ffff; $char += 0x10000 if $char < 0; # Special case characters that must be escaped, or are shorter as ASCII return sprintf("\\%03o", $char) if $char < 0x20; @@ -77,18 +78,44 @@ my $NOBREAK_FLAG = 32; my $MIRRORED_FLAG = 64; my %special = (); -my @info = (); + +# infoArray is an array where each element is a list of character information +# for characters in a plane. The index of each list is equal to the plane +# that it corresponds to even though most of these lists will currently be +# empty. This is done so that that this script can be easily modified to +# accomodate future versions of Unicode. +my @infoArray = \((), (), (), (), (), (), (), (), + (), (), (), (), (), (), (), (), ()); + +# info is a reference to one of the lists in infoArray, depending on which +# plane we're currently parsing. +my $info; + +# titlecase is a string of ordered pairs of characters to store the titlecase +# conversions of characters that have them my $titlecase = ""; + +# count is simply used to print "." to the screen every so often my $count = 0; + +# range is used when the UnicodeData file blocks out ranges of code points my $range = 0; +# largeNums is an array of numerical values that are too large to fit +# into the 16 bit char where most numerical values are stored. +# What is stored in the char then is a number N such that (-N - 3) is +# the index into largeNums where the numerical value can be found. +my @largeNums = (); + die "Usage: $0 <UnicodeData.txt> <SpecialCasing.txt> <CharData.java>" unless @ARGV == 3; $| = 1; print "GNU Classpath Unicode Attribute Database Generator 2.1\n"; print "Copyright (C) 1998, 2002 Free Software Foundation, Inc.\n"; -# Stage 0: Parse the special casing file +################################################################################ +################################################################################ +## Stage 0: Parse the special casing file print "Parsing special casing file\n"; open (SPECIAL, "< $ARGV[1]") || die "Can't open special casing file: $!\n"; while (<SPECIAL>) { @@ -105,10 +132,11 @@ while (<SPECIAL>) { next unless defined $upper and $upper =~ / /; $special{hex $ch} = [map {hex} split ' ', $upper]; } - close SPECIAL; -# Stage 1: Parse the attribute file +################################################################################ +################################################################################ +## Stage 1: Parse the attribute file print "Parsing attributes file"; open (UNICODE, "< $ARGV[0]") || die "Can't open Unicode attribute file: $!\n"; while (<UNICODE>) { @@ -118,10 +146,17 @@ while (<UNICODE>) { my ($ch, $name, $category, undef, $bidir, $decomp, undef, undef, $numeric, $mirrored, undef, undef, $upcase, $lowcase, $title) = split ';'; $ch = hex($ch); - next if $ch > 0xffff; # Ignore surrogate pairs, since Java does + + # plane tells us which Unicode code plane we're currently in and is an + # index into infoArray. + my $plane = int($ch / 0x10000); + my $planeBase = $plane * 0x10000; + $info = \@{$infoArray[$plane]}; my ($type, $numValue, $upperchar, $lowerchar, $direction); + # Set the value of the $type variable, checking to make sure that it's valid + # and setting the mirrored and nobreak bits if necessary. $type = 0; while ($category !~ /^$TYPECODES[$type]$/) { if (++$type == @TYPECODES) { @@ -131,9 +166,18 @@ while (<UNICODE>) { $type |= $NOBREAK_FLAG if ($decomp =~ /noBreak/); $type |= $MIRRORED_FLAG if ($mirrored =~ /Y/); + # Set the value of the $numeric variable checking the special cases of + # large numbers or 'a' - 'z' values. if ($numeric =~ /^[0-9]+$/) { $numValue = $numeric; - die "numValue too big: $ch, $numValue\n" if $numValue >= 0x7fff; + # If numeric takes more than 16 bits to store we want to store that + # number in a separate array and store a number N in numValue such + # that (-N - 3) is the offset into the separate array containing the + # large numerical value. + if ($numValue >= 0x7fff) { + $numValue = -3 - @largeNums; + push @largeNums, $numeric; + } } elsif ($numeric eq "") { # Special case sequences of 'a'-'z' if ($ch >= 0x0041 && $ch <= 0x005a) { @@ -151,13 +195,20 @@ while (<UNICODE>) { $numValue = -2; } + # Set the uppercase and lowercase expansions for the character. $upperchar = $upcase ? hex($upcase) - $ch : 0; $lowerchar = $lowcase ? hex($lowcase) - $ch : 0; + + # If this character has a special titlecase expansion then append it to + # the titlecase String. if ($title ne $upcase) { my $titlechar = $title ? hex($title) : $ch; $titlecase .= pack("n2", $ch, $titlechar); } + # Set the direction variable, use the lower 2 bits as a count of how many + # characters will be added to the String if this character undergoes an + # uppercase expansion. $direction = 0; while ($bidir !~ /^$DIRCODES[$direction]$/) { if (++$direction == @DIRCODES) { @@ -168,159 +219,218 @@ while (<UNICODE>) { $direction <<= 2; $direction += $#{$special{$ch}} if defined $special{$ch}; + # If the UnicodeData file blocks off ranges of code points give them all + # the same character information. if ($range) { die "Expecting end of range at $ch\n" unless $name =~ /Last>$/; for ($range + 1 .. $ch - 1) { - $info[$_] = pack("n5", $type, $numValue, $upperchar, + $info->[$_ - $planeBase] = pack("n5", $type, $numValue, $upperchar, $lowerchar, $direction); } $range = 0; } elsif ($name =~ /First>$/) { $range = $ch; } - $info[$ch] = pack("n5", $type, $numValue, $upperchar, $lowerchar, + + # Store all this parsed information into the element in infoArray that info + # points to. + $info->[$ch - $planeBase] = pack("n5", $type, $numValue, $upperchar, $lowerchar, $direction); } close UNICODE; -# Stage 2: Compress the data structures +################################################################################ +################################################################################ +## Stage 2: Compress the data structures printf "\nCompressing data structures"; $count = 0; -my $info = (); -my %charhash = (); -my @charinfo = (); - -for my $ch (0 .. 0xffff) { - print "." unless $count++ % 0x1000; - $info[$ch] = pack("n5", 0, -1, 0, 0, -4) unless defined $info[$ch]; - - my ($type, $numVal, $upper, $lower, $direction) = unpack("n5", $info[$ch]); - if (! exists $charhash{$info[$ch]}) { - push @charinfo, [ $numVal, $upper, $lower, $direction ]; - $charhash{$info[$ch]} = $#charinfo; + +# data is a String that will be used to create the DATA String containing +# character information and offsets into the attribute tables. +my @data = (); + +# charhashArray is an array of hashtables used so that we can reuse character +# attributes when characters share the same attributes ... this makes our +# attribute tables smaller. charhash is a pointer into this array. +my @charhashArray = ({}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}); +my $charhash = (); + +# charinfoArray is an array of arrays, one per plane, for storing character +# information. charinfo is a pointer into this array. +my @charinfoArray = \((), (), (), (), (), (), (), (), + (), (), (), (), (), (), (), (), ()); +my $charinfo; + +# charlen is an array, one element per plane, that tells us how many unique +# character attributes there are for that plane. +my @charlen = (); + +for my $plane (0 .. 0x10) { + $info = \@{$infoArray[$plane]}; + my $planeBase = $plane * 0x10000; + $charhash = \%{$charhashArray[$plane]}; + $charinfo = \@{$charinfoArray[$plane]}; + + for my $ch ($planeBase .. $planeBase + 0xffff) { + my $index = $ch - $planeBase; + print "." unless $count++ % 0x1000; + $info->[$index] = pack("n5", 0, -1, 0, 0, -4) unless defined $info->[$index]; + + my ($type, $numVal, $upper, $lower, $direction) = unpack("n5", $info->[$index]); + if (! exists $charhash->{$info->[$index]}) { + # If we entered this loop that means the character we're looking at + # now has attributes that are unique from those that we've looked + # at so far for this plane. So we push its attributes into charinfo + # and store in charhash the offset into charinfo where these + # attributes can later be found. + push @{$charinfo}, [ $numVal, $upper, $lower, $direction ]; + $charhash->{$info->[$index]} = @{$charinfo} - 1; + # When the file is generaged, the number we just stored in charhas + # will be the upper 9 bits in the DATA String that are an offset + # into the attribute tables. + } + $data[$plane] .= pack("n", ($charhash->{$info->[$index]} << 7) | $type); } - $info .= pack("n", ($charhash{$info[$ch]} << 7) | $type); + $charlen[$plane] = scalar(@{$charinfoArray[$plane]}); } -my $charlen = @charinfo; -my $bestshift; +# the shift that results in the best compression of the table. This is an array +# because different shifts are better for the different tables for each plane. +my @bestshift; + +# an initial guess. my $bestest = 1000000; -my $bestblkstr; -die "Too many unique character entries: $charlen\n" if $charlen > 512; -print "\nUnique character entries: $charlen\n"; - -for my $i (3 .. 8) { - my $blksize = 1 << $i; - my %blocks = (); - my @blkarray = (); - my ($j, $k); - print "shift: $i"; - - for ($j = 0; $j < 0x10000; $j += $blksize) { - my $blkkey = substr $info, 2 * $j, 2 * $blksize; - if (! exists $blocks{$blkkey}) { - push @blkarray, $blkkey; - $blocks{$blkkey} = $#blkarray; - } - } - my $blknum = @blkarray; - my $blocklen = $blknum * $blksize; - printf " before %5d", $blocklen; - - # Now we try to pack the blkarray as tight as possible by finding matching - # heads and tails. - for ($j = $blksize - 1; $j > 0; $j--) { - my %tails = (); - for $k (0 .. $#blkarray) { - next unless defined $blkarray[$k]; - my $len = length $blkarray[$k]; - my $tail = substr $blkarray[$k], $len - $j * 2; - if (exists $tails{$tail}) { - push @{$tails{$tail}}, $k; - } else { - $tails{$tail} = [ $k ]; +my @bestblkstr; +my @blksize = (); + +for my $plane (0 .. 0x10) { + print "\n\nplane: $plane\n"; + print "Unique character entries: $charlen[$plane]\n"; + $bestest = 1000000; + for my $i (3 .. 8) { + my $blksize = 1 << $i; + my %blocks = (); + my @blkarray = (); + my ($j, $k); + print "shift: $i"; + + for ($j = 0; $j < 0x10000; $j += $blksize) { + my $blkkey = substr $data[$plane], 2 * $j, 2 * $blksize; + if (! exists $blocks{$blkkey}) { + push @blkarray, $blkkey; + $blocks{$blkkey} = $#blkarray; } } - # tails are calculated, now calculate the heads and merge. - BLOCK: - for $k (0 .. $#blkarray) { - next unless defined $blkarray[$k]; - my $tomerge = $k; - while (1) { - my $head = substr($blkarray[$tomerge], 0, $j * 2); - my $entry = $tails{$head}; - next BLOCK unless defined $entry; - - my $other = shift @{$entry}; - if ($other == $tomerge) { - if (@{$entry}) { - push @{$entry}, $other; - $other = shift @{$entry}; - } else { - push @{$entry}, $other; - next BLOCK; - } - } - if (@{$entry} == 0) { - delete $tails{$head}; + my $blknum = @blkarray; + my $blocklen = $blknum * $blksize; + printf " before %5d", $blocklen; + + # Now we try to pack the blkarray as tight as possible by finding matching + # heads and tails. + for ($j = $blksize - 1; $j > 0; $j--) { + my %tails = (); + for $k (0 .. $#blkarray) { + next unless defined $blkarray[$k]; + my $len = length $blkarray[$k]; + my $tail = substr $blkarray[$k], $len - $j * 2; + if (exists $tails{$tail}) { + push @{$tails{$tail}}, $k; + } else { + $tails{$tail} = [ $k ]; } + } + + # tails are calculated, now calculate the heads and merge. + BLOCK: + for $k (0 .. $#blkarray) { + next unless defined $blkarray[$k]; + my $tomerge = $k; + while (1) { + my $head = substr($blkarray[$tomerge], 0, $j * 2); + my $entry = $tails{$head}; + next BLOCK unless defined $entry; + + my $other = shift @{$entry}; + if ($other == $tomerge) { + if (@{$entry}) { + push @{$entry}, $other; + $other = shift @{$entry}; + } else { + push @{$entry}, $other; + next BLOCK; + } + } + if (@{$entry} == 0) { + delete $tails{$head}; + } - # a match was found - my $merge = $blkarray[$other] - . substr($blkarray[$tomerge], $j * 2); - $blocklen -= $j; - $blknum--; - - if ($other < $tomerge) { - $blkarray[$tomerge] = undef; - $blkarray[$other] = $merge; - my $len = length $merge; - my $tail = substr $merge, $len - $j * 2; - $tails{$tail} = [ map { $_ == $tomerge ? $other : $_ } - @{$tails{$tail}} ]; - next BLOCK; + # a match was found + my $merge = $blkarray[$other] + . substr($blkarray[$tomerge], $j * 2); + $blocklen -= $j; + $blknum--; + + if ($other < $tomerge) { + $blkarray[$tomerge] = undef; + $blkarray[$other] = $merge; + my $len = length $merge; + my $tail = substr $merge, $len - $j * 2; + $tails{$tail} = [ map { $_ == $tomerge ? $other : $_ } + @{$tails{$tail}} ]; + next BLOCK; + } + $blkarray[$tomerge] = $merge; + $blkarray[$other] = undef; } - $blkarray[$tomerge] = $merge; - $blkarray[$other] = undef; } } - } - my $blockstr; - for $k (0 .. $#blkarray) { - $blockstr .= $blkarray[$k] if defined $blkarray[$k]; - } - - die "Unexpected $blocklen" if length($blockstr) != 2 * $blocklen; - my $estimate = 2 * $blocklen + (0x20000 >> $i); + my $blockstr; + for $k (0 .. $#blkarray) { + $blockstr .= $blkarray[$k] if defined $blkarray[$k]; + } - printf " after merge %5d: %6d bytes\n", $blocklen, $estimate; - if ($estimate < $bestest) { - $bestest = $estimate; - $bestshift = $i; - $bestblkstr = $blockstr; + die "Unexpected $blocklen" if length($blockstr) != 2 * $blocklen; + my $estimate = 2 * $blocklen + (0x20000 >> $i); + + printf " after merge %5d: %6d bytes\n", $blocklen, $estimate; + if ($estimate < $bestest) { + $bestest = $estimate; + $bestshift[$plane] = $i; + $bestblkstr[$plane] = $blockstr; + } } + $blksize[$plane] = 1 << $bestshift[$plane]; + print "best shift: ", $bestshift[$plane]; + print " blksize: ", $blksize[$plane]; } - -my @blocks; -my $blksize = 1 << $bestshift; -for (my $j = 0; $j < 0x10000; $j += $blksize) { - my $blkkey = substr $info, 2 * $j, 2 * $blksize; - my $index = index $bestblkstr, $blkkey; - while ($index & 1) { - die "not found: $j" if $index == -1; - $index = index $bestblkstr, $blkkey, $index + 1; +my @blocksArray = \((), (), (), (), (), (), (), (), + (), (), (), (), (), (), (), (), ()); + +for my $plane (0 .. 0x10) { + for (my $j = 0; $j < 0x10000; $j += $blksize[$plane]) { + my $blkkey = substr $data[$plane], 2 * $j, 2 * $blksize[$plane]; + my $index = index $bestblkstr[$plane], $blkkey; + while ($index & 1) { + die "not found: $j" if $index == -1; + $index = index $bestblkstr[$plane], $blkkey, $index + 1; + } + push @{$blocksArray[$plane]}, ($index / 2 - $j) & 0xffff; } - push @blocks, ($index / 2 - $j) & 0xffff; } -# Phase 3: Generate the file -die "UTF-8 limit of blocks may be exceeded: " . scalar(@blocks) . "\n" - if @blocks > 0xffff / 3; -die "UTF-8 limit of data may be exceeded: " . length($bestblkstr) . "\n" - if length($bestblkstr) > 0xffff / 3; +################################################################################ +################################################################################ +## Stage 3: Generate the file +for my $plane (0 .. 0x10) { + die "UTF-8 limit of blocks may be exceeded for plane $plane: " . scalar(@{$blocksArray[$plane]}) . "\n" + if @{$blocksArray[$plane]} > 0xffff / 3; + die "UTF-8 limit of data may be exceeded for plane $plane: " . length($bestblkstr[$plane]) . "\n" + if length($bestblkstr[$plane]) > 0xffff / 3; +} + { - print "Generating $ARGV[2] with shift of $bestshift"; + print "\nGenerating $ARGV[2]."; my ($i, $j); open OUTPUT, "> $ARGV[2]" or die "Failed creating output file: $!\n"; @@ -372,18 +482,22 @@ package gnu.java.lang; * <code>$ARGV[1]</code>, by some * perl scripts. These Unicode definition files can be found on the * <a href="http://www.unicode.org">http://www.unicode.org</a> website. - * JDK 1.4 uses Unicode version 3.0.0. + * JDK 1.5 uses Unicode version 4.0.0. * * The data is stored as string constants, but Character will convert these - * Strings to their respective <code>char[]</code> components. The field + * Strings to their respective <code>char[]</code> components. The fields + * are stored in arrays of 17 elements each, one element per Unicode plane. * <code>BLOCKS</code> stores the offset of a block of 2<sup>SHIFT</sup> * characters within <code>DATA</code>. The DATA field, in turn, stores * information about each character in the low order bits, and an offset * into the attribute tables <code>UPPER</code>, <code>LOWER</code>, * <code>NUM_VALUE</code>, and <code>DIRECTION</code>. Notice that the * attribute tables are much smaller than 0xffff entries; as many characters - * in Unicode share common attributes. The DIRECTION table also contains - * a field for detecting characters with multi-character uppercase expansions. + * in Unicode share common attributes. Numbers that are too large to fit + * into NUM_VALUE as 16 bit chars are stored in LARGENUMS and a number N is + * stored in NUM_VALUE such that (-N - 3) is the offset into LARGENUMS for + * the particular character. The DIRECTION table also contains a field for + * detecting characters with multi-character uppercase expansions. * Next, there is a listing for <code>TITLE</code> exceptions (most characters * just have the same title case as upper case). Finally, there are two * tables for multi-character capitalization, <code>UPPER_SPECIAL</code> @@ -404,54 +518,117 @@ public interface CharData /** * The character shift amount to look up the block offset. In other words, - * <code>(char) (BLOCKS.value[ch >> SHIFT] + ch)</code> is the index where - * <code>ch</code> is described in <code>DATA</code>. + * <code>(char) (BLOCKS.value[ch >> SHIFT[p]] + ch)</code> is the index + * where <code>ch</code> is described in <code>DATA</code> if <code>ch</code> + * is in Unicode plane <code>p</code>. Note that <code>p</code> is simply + * the integer division of ch and 0x10000. */ - int SHIFT = $bestshift; + int[] SHIFT +EOF + for ($i = 0; $i < @bestshift - 1; $i++) { + if ($i == 0){ + print OUTPUT " = new int[] {"; + } + print OUTPUT $bestshift[$i], ", "; + } + if (scalar(@bestshift) > 0){ + print OUTPUT $bestshift[-1], "}"; + } + else { + print OUTPUT " = null"; + } + print OUTPUT <<EOF; +; /** * The mapping of character blocks to their location in <code>DATA</code>. * Each entry has been adjusted so that the 16-bit sum with the desired * character gives the actual index into <code>DATA</code>. */ - String BLOCKS + String[] BLOCKS = new String[]{ EOF - - for ($i = 0; $i < @blocks / 11; $i++) { - print OUTPUT $i ? "\n + \"" : " = \""; - for $j (0 .. 10) { - last if @blocks <= $i * 11 + $j; - my $val = $blocks[$i * 11 + $j]; - print OUTPUT javaChar($val); - } - print OUTPUT "\""; + for ($plane = 0; $plane <= 0x10; $plane++) { + # The following if statement handles the cases of unassigned planes + # specially so we don't waste space with unused Strings. As of + # Unicode version 4.0.0 only planes 0, 1, 2, and 14 are used. If + # you are updating this script to work with a later version of + # Unicode you may have to alter this if statement. + if ($plane > 2 && $plane != 14) { + print OUTPUT ($plane == 0x10) ? " \"\"}" : " \"\",\n\n"; + } + else { + for ($i = 0; $i < @{$blocksArray[$plane]} / 11; $i++) { + print OUTPUT $i ? "\n + " : " "; + print OUTPUT "\""; + for $j (0 .. 10) { + last if @{$blocksArray[$plane]} <= $i * 11 + $j; + my $val = $blocksArray[$plane]->[$i * 11 + $j]; + print OUTPUT javaChar($val); + } + print OUTPUT "\""; + } + print OUTPUT ",\n\n"; + } } - print OUTPUT <<EOF; ; /** + * The array containing the numeric values that are too large to be stored as + * chars in NUM_VALUE. NUM_VALUE in this case will contain a negative integer + * N such that LARGENUMS[-N - 3] contains the correct numeric value. + */ + int[] LARGENUMS +EOF + for ($i = 0; $i < @largeNums - 1; $i++) { + if ($i == 0){ + print OUTPUT " = new int[] {"; + } + print OUTPUT $largeNums[$i], ", "; + } + if (scalar(@largeNums) > 0){ + print OUTPUT $largeNums[-1], "}"; + } + else { + print OUTPUT " = null"; + } + print OUTPUT <<EOF; +; + + /** * Information about each character. The low order 5 bits form the * character type, the next bit is a flag for non-breaking spaces, and the * next bit is a flag for mirrored directionality. The high order 9 bits * form the offset into the attribute tables. Note that this limits the * number of unique character attributes to 512, which is not a problem - * as of Unicode version 3.2.0, but may soon become one. + * as of Unicode version 4.0.0, but may soon become one. */ - String DATA + String[] DATA = new String[]{ EOF - - my $len = length($bestblkstr) / 2; - for ($i = 0; $i < $len / 11; $i++) { - print OUTPUT $i ? "\n + \"" : " = \""; - for $j (0 .. 10) { - last if $len <= $i * 11 + $j; - my $val = unpack "n", substr($bestblkstr, 2 * ($i * 11 + $j), 2); - print OUTPUT javaChar($val); - } - print OUTPUT "\""; + for ($plane = 0; $plane <= 0x10; $plane++) { + # The following if statement handles the cases of unassigned planes + # specially so we don't waste space with unused Strings. As of + # Unicode version 4.0.0 only planes 0, 1, 2, and 14 are used. If + # you are updating this script to work with a later version of + # Unicode you may have to alter this if statement. + if ($plane > 2 && $plane != 14) { + print OUTPUT ($plane == 0x10) ? " \"\"}" : " \"\",\n\n"; + } + else { + my $len = length($bestblkstr[$plane]) / 2; + for ($i = 0; $i < $len / 11; $i++) { + print OUTPUT $i ? "\n + " : " "; + print OUTPUT "\""; + for $j (0 .. 10) { + last if $len <= $i * 11 + $j; + my $val = unpack "n", substr($bestblkstr[$plane], 2 * ($i * 11 + $j), 2); + print OUTPUT javaChar($val); + } + print OUTPUT "\""; + } + print OUTPUT ",\n\n"; + } } - print OUTPUT <<EOF; ; @@ -462,20 +639,33 @@ EOF * Note that this is a signed value, but stored as an unsigned char * since this is a String literal. */ - String NUM_VALUE + String[] NUM_VALUE = new String[]{ EOF - $len = @charinfo; - for ($i = 0; $i < $len / 11; $i++) { - print OUTPUT $i ? "\n + \"" : " = \""; - for $j (0 .. 10) { - last if $len <= $i * 11 + $j; - my $val = $charinfo[$i * 11 + $j][0]; - print OUTPUT javaChar($val); - } - print OUTPUT "\""; + for ($plane = 0; $plane <= 0x10; $plane++) { + # The following if statement handles the cases of unassigned planes + # specially so we don't waste space with unused Strings. As of + # Unicode version 4.0.0 only planes 0, 1, 2, and 14 are used. If + # you are updating this script to work with a later version of + # Unicode you may have to alter this if statement. + if ($plane > 2 && $plane != 14) { + print OUTPUT ($plane == 0x10) ? " \"\"}" : " \"\",\n\n"; + } + else { + $len = @{$charinfoArray[$plane]}; + for ($i = 0; $i < $len / 11; $i++) { + print OUTPUT $i ? "\n + " : " "; + print OUTPUT "\""; + for $j (0 .. 10) { + last if $len <= $i * 11 + $j; + my $val = $charinfoArray[$plane]->[$i * 11 + $j][0]; + print OUTPUT javaChar($val); + } + print OUTPUT "\""; + } + print OUTPUT ",\n\n"; + } } - print OUTPUT <<EOF; ; @@ -487,20 +677,33 @@ EOF * capitalizing a String, you must first check if a multi-character uppercase * sequence exists before using this character. */ - String UPPER + String[] UPPER = new String[]{ EOF - $len = @charinfo; - for ($i = 0; $i < $len / 11; $i++) { - print OUTPUT $i ? "\n + \"" : " = \""; - for $j (0 .. 10) { - last if $len <= $i * 11 + $j; - my $val = $charinfo[$i * 11 + $j][1]; - print OUTPUT javaChar($val); - } - print OUTPUT "\""; + for ($plane = 0; $plane <= 0x10; $plane++) { + # The following if statement handles the cases of unassigned planes + # specially so we don't waste space with unused Strings. As of + # Unicode version 4.0.0 only planes 0, 1, 2, and 14 are used. If + # you are updating this script to work with a later version of + # Unicode you may have to alter this if statement. + if ($plane > 2 && $plane != 14) { + print OUTPUT ($plane == 0x10) ? " \"\"}" : " \"\",\n\n"; + } + else { + $len = @{$charinfoArray[$plane]}; + for ($i = 0; $i < $len / 11; $i++) { + print OUTPUT $i ? "\n + " : " "; + print OUTPUT "\""; + for $j (0 .. 10) { + last if $len <= $i * 11 + $j; + my $val = $charinfoArray[$plane]->[$i * 11 + $j][1]; + print OUTPUT javaChar($val); + } + print OUTPUT "\""; + } + print OUTPUT ",\n\n"; + } } - print OUTPUT <<EOF; ; @@ -510,20 +713,33 @@ EOF * character and its lowercase version. Note that this is stored as an * unsigned char since this is a String literal. */ - String LOWER + String[] LOWER = new String[]{ EOF - $len = @charinfo; - for ($i = 0; $i < $len / 13; $i++) { - print OUTPUT $i ? "\n + \"" : " = \""; - for $j (0 .. 12) { - last if $len <= $i * 13 + $j; - my $val = $charinfo[$i * 13 + $j][2]; - print OUTPUT javaChar($val); - } - print OUTPUT "\""; + for ($plane = 0; $plane <= 0x10; $plane++) { + # The following if statement handles the cases of unassigned planes + # specially so we don't waste space with unused Strings. As of + # Unicode version 4.0.0 only planes 0, 1, 2, and 14 are used. If + # you are updating this script to work with a later version of + # Unicode you may have to alter this if statement. + if ($plane > 2 && $plane != 14) { + print OUTPUT ($plane == 0x10) ? " \"\"}" : " \"\",\n\n"; + } + else { + $len = @{$charinfoArray[$plane]}; + for ($i = 0; $i < $len / 11; $i++) { + print OUTPUT $i ? "\n + " : " "; + print OUTPUT "\""; + for $j (0 .. 10) { + last if $len <= $i * 11 + $j; + my $val = $charinfoArray[$plane]->[$i * 11 + $j][2]; + print OUTPUT javaChar($val); + } + print OUTPUT "\""; + } + print OUTPUT ",\n\n"; + } } - print OUTPUT <<EOF; ; @@ -539,20 +755,33 @@ EOF * when performing the case conversion. Note that this information is stored * as an unsigned char since this is a String literal. */ - String DIRECTION + String[] DIRECTION = new String[]{ EOF - $len = @charinfo; - for ($i = 0; $i < $len / 17; $i++) { - print OUTPUT $i ? "\n + \"" : " = \""; - for $j (0 .. 16) { - last if $len <= $i * 17 + $j; - my $val = $charinfo[$i * 17 + $j][3]; - print OUTPUT javaChar($val); - } - print OUTPUT "\""; + for ($plane = 0; $plane <= 0x10; $plane++) { + # The following if statement handles the cases of unassigned planes + # specially so we don't waste space with unused Strings. As of + # Unicode version 4.0.0 only planes 0, 1, 2, and 14 are used. If + # you are updating this script to work with a later version of + # Unicode you may have to alter this if statement. + if ($plane > 2 && $plane != 14) { + print OUTPUT ($plane == 0x10) ? " \"\"}" : " \"\",\n\n"; + } + else { + $len = @{$charinfoArray[$plane]}; + for ($i = 0; $i < $len / 11; $i++) { + print OUTPUT $i ? "\n + " : " "; + print OUTPUT "\""; + for $j (0 .. 10) { + last if $len <= $i * 11 + $j; + my $val = $charinfoArray[$plane]->[$i * 11 + $j][3]; + print OUTPUT javaChar($val); + } + print OUTPUT "\""; + } + print OUTPUT ",\n\n"; + } } - print OUTPUT <<EOF; ; |