Package org.antlr.v4.unicode
Class UnicodeDataTemplateController
java.lang.Object
org.antlr.v4.unicode.UnicodeDataTemplateController
StringTemplate controller used to generate parameters to feed
to
unicodedata.st
to code-generate UnicodeData.java
,
used by the tool for Unicode property escapes like \\p\{Lu\}
.
Uses ICU to iterate over Unicode character categories, properties,
and script codes, as well as aliases for those codes.
This class exists in its own Maven module to avoid adding a
dependency from the tool onto the (large) ICU runtime.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
addEmojiPresentationPropertyCodesToCodePointRanges
(Map<String, IntervalSet> propertyCodePointRanges) private static void
addIntervalForCategory
(Map<String, IntervalSet> categoryMap, String categoryName, int start, int finish) private static void
addIntPropertyAliases
(int property, String namePrefix, Map<String, String> propertyAliases) private static void
addIntPropertyRanges
(int property, String namePrefix, Map<String, IntervalSet> propertyCodePointRanges) private static void
private static void
addPropertyAliases
(Map<String, String> propertyAliases, String propertyName, int property) private static void
addTR35ExtendedPictographicPropertyCodesToCodePointRanges
(Map<String, IntervalSet> propertyCodePointRanges) private static void
addUnicodeBinaryPropertyCodesToCodePointRanges
(Map<String, IntervalSet> propertyCodePointRanges) private static void
addUnicodeBinaryPropertyCodesToNames
(Map<String, String> propertyAliases) private static void
addUnicodeBlocksToNames
(Map<String, String> propertyAliases) private static void
addUnicodeCategoryCodesToCodePointRanges
(Map<String, IntervalSet> propertyCodePointRanges) private static void
addUnicodeCategoryCodesToNames
(Map<String, String> propertyAliases) private static void
addUnicodeIntPropertyCodesToCodePointRanges
(Map<String, IntervalSet> propertyCodePointRanges) private static void
addUnicodeIntPropertyCodesToNames
(Map<String, String> propertyAliases) private static void
addUnicodeScriptCodesToNames
(Map<String, String> propertyAliases) private static void
addUnicodeSetToIntervalSet
(com.ibm.icu.text.UnicodeSet unicodeSet, IntervalSet intervalSet) convertToRawArray
(IntervalSet intervalSet) private static String
getShortPropertyName
(int property)
-
Constructor Details
-
UnicodeDataTemplateController
public UnicodeDataTemplateController()
-
-
Method Details
-
addIntervalForCategory
private static void addIntervalForCategory(Map<String, IntervalSet> categoryMap, String categoryName, int start, int finish) -
addPropertyAliases
-
addPropertyAlias
-
getProperties
-
convertToRawArray
-
getShortPropertyName
-
addUnicodeCategoryCodesToCodePointRanges
private static void addUnicodeCategoryCodesToCodePointRanges(Map<String, IntervalSet> propertyCodePointRanges) -
addUnicodeCategoryCodesToNames
-
addUnicodeBinaryPropertyCodesToCodePointRanges
private static void addUnicodeBinaryPropertyCodesToCodePointRanges(Map<String, IntervalSet> propertyCodePointRanges) -
addUnicodeBinaryPropertyCodesToNames
-
addIntPropertyRanges
private static void addIntPropertyRanges(int property, String namePrefix, Map<String, IntervalSet> propertyCodePointRanges) -
addUnicodeSetToIntervalSet
private static void addUnicodeSetToIntervalSet(com.ibm.icu.text.UnicodeSet unicodeSet, IntervalSet intervalSet) -
addUnicodeIntPropertyCodesToCodePointRanges
private static void addUnicodeIntPropertyCodesToCodePointRanges(Map<String, IntervalSet> propertyCodePointRanges) -
addTR35ExtendedPictographicPropertyCodesToCodePointRanges
private static void addTR35ExtendedPictographicPropertyCodesToCodePointRanges(Map<String, IntervalSet> propertyCodePointRanges) -
addEmojiPresentationPropertyCodesToCodePointRanges
private static void addEmojiPresentationPropertyCodesToCodePointRanges(Map<String, IntervalSet> propertyCodePointRanges) -
addIntPropertyAliases
-
addUnicodeScriptCodesToNames
-
addUnicodeBlocksToNames
-
addUnicodeIntPropertyCodesToNames
-