From 26c1c65d9c27ff31d8c273ec4985ce2c6f308f81 Mon Sep 17 00:00:00 2001 From: Andy Heninger Date: Thu, 6 Nov 2003 21:54:53 +0000 Subject: [PATCH] ICU-2924 RBBI rule builder, detect rule syntax error on missing ';' after !!options X-SVN-Rev: 13608 --- icu4c/source/common/rbbirpt.h | 2 +- icu4c/source/common/rbbirpt.txt | 2 +- icu4c/source/common/rbbiscan.cpp | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/icu4c/source/common/rbbirpt.h b/icu4c/source/common/rbbirpt.h index 908d2b5ad9d..f7dfd0bcc6b 100644 --- a/icu4c/source/common/rbbirpt.h +++ b/icu4c/source/common/rbbirpt.h @@ -93,7 +93,7 @@ static const struct RBBIRuleTableEl gRuleParseStateTable[] = { , {doOptionEnd, 255, 17,0, FALSE} // 16 , {doNOP, 59 /* ; */, 1,0, TRUE} // 17 option-scan3 , {doNOP, 129, 17,0, TRUE} // 18 - , {doNOP, 255, 95,0, FALSE} // 19 + , {doRuleError, 255, 95,0, FALSE} // 19 , {doExprStart, 255, 21, 8, FALSE} // 20 reverse-rule , {doRuleChar, 254, 30,0, TRUE} // 21 term , {doNOP, 129, 21,0, TRUE} // 22 diff --git a/icu4c/source/common/rbbirpt.txt b/icu4c/source/common/rbbirpt.txt index 00f6f94a515..fdecb186642 100644 --- a/icu4c/source/common/rbbirpt.txt +++ b/icu4c/source/common/rbbirpt.txt @@ -91,7 +91,7 @@ option-scan2: option-scan3: ';' n start white_space n option-scan3 - default errorDeath + default errorDeath doRuleError reverse-rule: diff --git a/icu4c/source/common/rbbiscan.cpp b/icu4c/source/common/rbbiscan.cpp index fd8dd8ae268..d22ac5ea1d4 100644 --- a/icu4c/source/common/rbbiscan.cpp +++ b/icu4c/source/common/rbbiscan.cpp @@ -319,11 +319,10 @@ UBool RBBIRuleScanner::doParseActions(EParseAction action) // The ';' that terminates an expression really just functions as a '|' with // a low operator prededence. // - // Each of the four sets of rules are collected separately. - // (Forward, Reverse, ForwardSafe, ReverseSafe) + // Each of the four sets of rules are collected separately. + // (forward, reverse, safe_forward, safe_reverse) // OR this rule into the appropriate group of them. // - // RBBINode **destRules = (fReverseRule? &fRB->fReverseTree : &fRB->fForwardTree); TODO: delete RBBINode **destRules = (fReverseRule? &fRB->fReverseTree : fRB->fDefaultTree); if (*destRules != NULL) { @@ -879,7 +878,7 @@ void RBBIRuleScanner::nextChar(RBBIRuleChar &c) { //--------------------------------------------------------------------------------- // // Parse RBBI rules. The state machine for rules parsing is here. -// The state tables are hand-written in the file TODO.txt, +// The state tables are hand-written in the file rbbirpt.txt, // and converted to the form used here by a perl // script rbbicst.pl //