]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/i18n/rbt.cpp
ICU-8.11.tar.gz
[apple/icu.git] / icuSources / i18n / rbt.cpp
index a7d26356ebe79edb5a0c0de667558109cc52cb72..c22b2bd7f36282e77e8a6f4808ab7e749592b8bf 100644 (file)
@@ -1,6 +1,6 @@
 /*
 **********************************************************************
-*   Copyright (C) 1999-2004, International Business Machines
+*   Copyright (C) 1999-2006, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 **********************************************************************
 *   Date        Name        Description
@@ -37,19 +37,20 @@ void RuleBasedTransliterator::_construct(const UnicodeString& rules,
         return;
     }
 
-    TransliteratorParser parser;
+    TransliteratorParser parser(status);
     parser.parse(rules, direction, parseError, status);
     if (U_FAILURE(status)) {
         return;
     }
 
-    if (parser.idBlock.length() != 0 ||
-        parser.compoundFilter != NULL) {
+    if (parser.idBlockVector.size() != 0 ||
+        parser.compoundFilter != NULL ||
+        parser.dataVector.size() == 0) {
         status = U_INVALID_RBT_SYNTAX; // ::ID blocks disallowed in RBT
         return;
     }
 
-    fData = parser.orphanData();
+    fData = (TransliterationRuleData*)parser.dataVector.orphanElementAt(0);
     setMaximumContextLength(fData->ruleSet.getMaximumContextLength());
 }