]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/rbbiscan.h
ICU-59131.0.1.tar.gz
[apple/icu.git] / icuSources / common / rbbiscan.h
index 89748318eeebe7ecb6dfe772b848883cde31391b..8bec8234e58f1e8b8fbb7cfd562e7d81cfda55dc 100644 (file)
@@ -1,7 +1,9 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 //
 //  rbbiscan.h
 //
-//  Copyright (C) 2002-2005, International Business Machines Corporation and others.
+//  Copyright (C) 2002-2016, International Business Machines Corporation and others.
 //  All Rights Reserved.
 //
 //  This file contains declarations for class RBBIRuleScanner
@@ -21,9 +23,7 @@
 #include "unicode/symtable.h"// For UnicodeSet parsing, is the interface that
                           //    looks up references to $variables within a set.
 #include "rbbinode.h"
-//#include "rbbitblb.h"
-
-
+#include "rbbirpt.h"
 
 U_NAMESPACE_BEGIN
 
@@ -41,21 +41,20 @@ class   RBBISymbolTable;
 //                        encountered.
 //
 //--------------------------------------------------------------------------------
-static const int    kStackSize = 100;               // The size of the state stack for
-                                                    //   rules parsing.  Corresponds roughly
-                                                    //   to the depth of parentheses nesting
-                                                    //   that is allowed in the rules.
-
-enum EParseAction {dummy01, dummy02};               // Placeholder enum for the specifier for
-                                                    //   actions that are specified in the
-                                                    //   rule parsing state table.
 
 class RBBIRuleScanner : public UMemory {
 public:
 
+    enum {
+        kStackSize = 100            // The size of the state stack for
+    };                              //   rules parsing.  Corresponds roughly
+                                    //   to the depth of parentheses nesting
+                                    //   that is allowed in the rules.
+
     struct RBBIRuleChar {
         UChar32             fChar;
         UBool               fEscaped;
+        RBBIRuleChar() : fChar(0), fEscaped(FALSE) {};
     };
 
     RBBIRuleScanner(RBBIRuleBuilder  *rb);
@@ -81,7 +80,7 @@ public:
     static UnicodeString stripRules(const UnicodeString &rules);
 private:
 
-    UBool       doParseActions(EParseAction a);
+    UBool       doParseActions(int32_t a);
     void        error(UErrorCode e);                   // error reporting convenience function.
     void        fixOpStack(RBBINode::OpPrecedence p);
                                                        //   a character.
@@ -131,6 +130,8 @@ private:
     UBool                          fLookAheadRule;   // True if the rule includes a '/'
                                                      //   somewhere within it.
 
+    UBool                          fNoChainInRule;   // True if the current rule starts with a '^'.
+
     RBBISymbolTable               *fSymbolTable;     // symbol table, holds definitions of
                                                      //   $variable symbols.
 
@@ -139,7 +140,7 @@ private:
                                                      //   The key is the string used for creating
                                                      //   the set.
 
-    UnicodeSet                    *fRuleSets[10];    // Unicode Sets that are needed during
+    UnicodeSet                     fRuleSets[10];    // Unicode Sets that are needed during
                                                      //  the scanning of RBBI rules.  The
                                                      //  indicies for these are assigned by the
                                                      //  perl script that builds the state tables.