]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/rbbiscan.h
ICU-531.30.tar.gz
[apple/icu.git] / icuSources / common / rbbiscan.h
index 918f5f9f21ccf19a10dc52574c2f793f8083276c..dd9b8e6370fb5e2fafdebf410f008084a22a88f9 100644 (file)
@@ -1,7 +1,7 @@
 //
 //  rbbiscan.h
 //
-//  Copyright (C) 2002-2003, International Business Machines Corporation and others.
+//  Copyright (C) 2002-2008, International Business Machines Corporation and others.
 //  All Rights Reserved.
 //
 //  This file contains declarations for class RBBIRuleScanner
@@ -41,18 +41,16 @@ 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;
@@ -81,14 +79,16 @@ 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.
     void        findSetFor(const UnicodeString &s, RBBINode *node, UnicodeSet *setToAdopt = NULL);
 
     UChar32     nextCharLL();
+#ifdef RBBI_DEBUG
     void        printNodeStack(const char *title);
+#endif
     RBBINode    *pushNewNode(RBBINode::NodeType  t);
     void        scanSet();
 
@@ -100,8 +100,8 @@ private:
     int32_t                       fNextIndex;        // Index of the next character, which
                                                      //   is the first character not yet scanned.
     UBool                         fQuoteMode;        // Scan is in a 'quoted region'
-    int                           fLineNum;          // Line number in input file.
-    int                           fCharNum;          // Char position within the line.
+    int32_t                       fLineNum;          // Line number in input file.
+    int32_t                       fCharNum;          // Char position within the line.
     UChar32                       fLastChar;         // Previous char, needed to count CR-LF
                                                      //   as a single line, not two.
 
@@ -114,12 +114,12 @@ private:
                                                      //   parsing.  index by p[state][char-class]
 
     uint16_t                      fStack[kStackSize];  // State stack, holds state pushes
-    int                           fStackPtr;           //  and pops as specified in the state
+    int32_t                       fStackPtr;           //  and pops as specified in the state
                                                        //  transition rules.
 
     RBBINode                      *fNodeStack[kStackSize]; // Node stack, holds nodes created
                                                            //  during the parse of a rule
-    int                            fNodeStackPtr;
+    int32_t                        fNodeStackPtr;
 
 
     UBool                          fReverseRule;     // True if the rule currently being scanned
@@ -137,7 +137,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.