+// © 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
#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
// 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);
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.
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.
// 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.