mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 22:44:49 +00:00
ICU-45 RBBI impl, change some internal data to static const.
X-SVN-Rev: 9101
This commit is contained in:
parent
59b63b3029
commit
edb4aebf05
3 changed files with 12 additions and 12 deletions
|
@ -233,7 +233,7 @@ foreach $setName (keys %charClasses) {
|
|||
$charClasses{$setName} = 252;}
|
||||
else {
|
||||
# Normal character class. Fill in array with a ptr to the corresponding UnicodeSet in the state machine.
|
||||
print " const uint8_t kRuleSet_$setName = $i;\n";
|
||||
print " static const uint8_t kRuleSet_$setName = $i;\n";
|
||||
$charClasses{$setName} = $i;
|
||||
$i++;
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ print "};\n\n";
|
|||
#
|
||||
# emit the state transition table
|
||||
#
|
||||
print "struct RBBIRuleTableEl gRuleParseStateTable[] = {\n";
|
||||
print "static const struct RBBIRuleTableEl gRuleParseStateTable[] = {\n";
|
||||
print " {doNOP, 0, 0, 0, TRUE}\n"; # State 0 is a dummy. Real states start with index = 1.
|
||||
for ($state=1; $state < $num_states; $state++) {
|
||||
print " , {$state_func_name[$state],";
|
||||
|
@ -307,7 +307,7 @@ print " };\n";
|
|||
#
|
||||
# This array is used for producing debugging output from the rule parser.
|
||||
#
|
||||
print "const char *RBBIRuleStateNames[] = {";
|
||||
print "static const char *RBBIRuleStateNames[] = {";
|
||||
for ($state=0; $state<$num_states; $state++) {
|
||||
if ($stateNames[$state] ne "") {
|
||||
print " \"$stateNames[$state]\",\n";
|
||||
|
|
|
@ -17,11 +17,11 @@ U_NAMESPACE_BEGIN
|
|||
//
|
||||
// Character classes for RBBI rule scanning.
|
||||
//
|
||||
const uint8_t kRuleSet_digit_char = 128;
|
||||
const uint8_t kRuleSet_rule_char = 129;
|
||||
const uint8_t kRuleSet_white_space = 130;
|
||||
const uint8_t kRuleSet_name_char = 131;
|
||||
const uint8_t kRuleSet_name_start_char = 132;
|
||||
static const uint8_t kRuleSet_digit_char = 128;
|
||||
static const uint8_t kRuleSet_rule_char = 129;
|
||||
static const uint8_t kRuleSet_white_space = 130;
|
||||
static const uint8_t kRuleSet_name_char = 131;
|
||||
static const uint8_t kRuleSet_name_start_char = 132;
|
||||
|
||||
|
||||
enum RBBI_RuleParseAction {
|
||||
|
@ -71,7 +71,7 @@ struct RBBIRuleTableEl {
|
|||
UBool fNextChar;
|
||||
};
|
||||
|
||||
struct RBBIRuleTableEl gRuleParseStateTable[] = {
|
||||
static const struct RBBIRuleTableEl gRuleParseStateTable[] = {
|
||||
{doNOP, 0, 0, 0, TRUE}
|
||||
, {doExprStart, 254, 12, 8, FALSE} // 1 start
|
||||
, {doNOP, 130, 1,0, TRUE} // 2
|
||||
|
@ -159,7 +159,7 @@ struct RBBIRuleTableEl gRuleParseStateTable[] = {
|
|||
, {doRuleErrorAssignExpr, 255, 85,0, FALSE} // 84
|
||||
, {doExit, 255, 85,0, TRUE} // 85 errorDeath
|
||||
};
|
||||
const char *RBBIRuleStateNames[] = { 0,
|
||||
static const char *RBBIRuleStateNames[] = { 0,
|
||||
"start",
|
||||
0,
|
||||
0,
|
||||
|
|
|
@ -838,8 +838,8 @@ void RBBIRuleScanner::nextChar(RBBIRuleChar &c) {
|
|||
//
|
||||
//---------------------------------------------------------------------------------
|
||||
void RBBIRuleScanner::parse() {
|
||||
uint16_t state;
|
||||
RBBIRuleTableEl *tableEl;
|
||||
uint16_t state;
|
||||
const RBBIRuleTableEl *tableEl;
|
||||
|
||||
if (U_FAILURE(*fRB->fStatus)) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Reference in a new issue