| 1 | // © 2016 and later: Unicode, Inc. and others. | 
| 2 | // License & terms of use: http://www.unicode.org/copyright.html | 
| 3 | //--------------------------------------------------------------------------------- | 
| 4 | // | 
| 5 | // Generated Header File.  Do not edit by hand. | 
| 6 | //    This file contains the state table for the ICU Rule Based Break Iterator | 
| 7 | //    rule parser. | 
| 8 | //    It is generated by the Perl script "rbbicst.pl" from | 
| 9 | //    the rule parser state definitions file "rbbirpt.txt". | 
| 10 | // | 
| 11 | //   Copyright (C) 2002-2016 International Business Machines Corporation  | 
| 12 | //   and others. All rights reserved.   | 
| 13 | // | 
| 14 | //--------------------------------------------------------------------------------- | 
| 15 | #ifndef RBBIRPT_H | 
| 16 | #define RBBIRPT_H | 
| 17 |  | 
| 18 | #include "unicode/utypes.h" | 
| 19 |  | 
| 20 | U_NAMESPACE_BEGIN | 
| 21 | // | 
| 22 | // Character classes for RBBI rule scanning. | 
| 23 | // | 
| 24 |     static const uint8_t kRuleSet_digit_char = 128; | 
| 25 |     static const uint8_t kRuleSet_name_char = 129; | 
| 26 |     static const uint8_t kRuleSet_name_start_char = 130; | 
| 27 |     static const uint8_t kRuleSet_rule_char = 131; | 
| 28 |     static const uint8_t kRuleSet_white_space = 132; | 
| 29 |  | 
| 30 |  | 
| 31 | enum RBBI_RuleParseAction { | 
| 32 |     doCheckVarDef, | 
| 33 |     doDotAny, | 
| 34 |     doEndAssign, | 
| 35 |     doEndOfRule, | 
| 36 |     doEndVariableName, | 
| 37 |     doExit, | 
| 38 |     doExprCatOperator, | 
| 39 |     doExprFinished, | 
| 40 |     doExprOrOperator, | 
| 41 |     doExprRParen, | 
| 42 |     doExprStart, | 
| 43 |     doLParen, | 
| 44 |     doNOP, | 
| 45 |     doNoChain, | 
| 46 |     doOptionEnd, | 
| 47 |     doOptionStart, | 
| 48 |     doReverseDir, | 
| 49 |     doRuleChar, | 
| 50 |     doRuleError, | 
| 51 |     doRuleErrorAssignExpr, | 
| 52 |     doScanUnicodeSet, | 
| 53 |     doSlash, | 
| 54 |     doStartAssign, | 
| 55 |     doStartTagValue, | 
| 56 |     doStartVariableName, | 
| 57 |     doTagDigit, | 
| 58 |     doTagExpectedError, | 
| 59 |     doTagValue, | 
| 60 |     doUnaryOpPlus, | 
| 61 |     doUnaryOpQuestion, | 
| 62 |     doUnaryOpStar, | 
| 63 |     doVariableNameExpectedErr, | 
| 64 |     rbbiLastAction}; | 
| 65 |  | 
| 66 | //------------------------------------------------------------------------------- | 
| 67 | // | 
| 68 | //  RBBIRuleTableEl    represents the structure of a row in the transition table | 
| 69 | //                     for the rule parser state machine. | 
| 70 | //------------------------------------------------------------------------------- | 
| 71 | struct RBBIRuleTableEl { | 
| 72 |     RBBI_RuleParseAction          fAction; | 
| 73 |     uint8_t                       fCharClass;       // 0-127:    an individual ASCII character | 
| 74 |                                                     // 128-255:  character class index | 
| 75 |     uint8_t                       fNextState;       // 0-250:    normal next-stat numbers | 
| 76 |                                                     // 255:      pop next-state from stack. | 
| 77 |     uint8_t                       fPushState; | 
| 78 |     UBool                         fNextChar; | 
| 79 | }; | 
| 80 |  | 
| 81 | static const struct RBBIRuleTableEl gRuleParseStateTable[] = { | 
| 82 |     {doNOP, 0, 0, 0, TRUE} | 
| 83 |     , {doExprStart, 254, 29, 9, FALSE}     //  1      start | 
| 84 |     , {doNOP, 132, 1,0,  TRUE}     //  2  | 
| 85 |     , {doNoChain, 94 /* ^ */, 12, 9, TRUE}     //  3  | 
| 86 |     , {doExprStart, 36 /* $ */, 88, 98, FALSE}     //  4  | 
| 87 |     , {doNOP, 33 /* ! */, 19,0,  TRUE}     //  5  | 
| 88 |     , {doNOP, 59 /* ; */, 1,0,  TRUE}     //  6  | 
| 89 |     , {doNOP, 252, 0,0,  FALSE}     //  7  | 
| 90 |     , {doExprStart, 255, 29, 9, FALSE}     //  8  | 
| 91 |     , {doEndOfRule, 59 /* ; */, 1,0,  TRUE}     //  9      break-rule-end | 
| 92 |     , {doNOP, 132, 9,0,  TRUE}     //  10  | 
| 93 |     , {doRuleError, 255, 103,0,  FALSE}     //  11  | 
| 94 |     , {doExprStart, 254, 29,0,  FALSE}     //  12      start-after-caret | 
| 95 |     , {doNOP, 132, 12,0,  TRUE}     //  13  | 
| 96 |     , {doRuleError, 94 /* ^ */, 103,0,  FALSE}     //  14  | 
| 97 |     , {doExprStart, 36 /* $ */, 88, 37, FALSE}     //  15  | 
| 98 |     , {doRuleError, 59 /* ; */, 103,0,  FALSE}     //  16  | 
| 99 |     , {doRuleError, 252, 103,0,  FALSE}     //  17  | 
| 100 |     , {doExprStart, 255, 29,0,  FALSE}     //  18  | 
| 101 |     , {doNOP, 33 /* ! */, 21,0,  TRUE}     //  19      rev-option | 
| 102 |     , {doReverseDir, 255, 28, 9, FALSE}     //  20  | 
| 103 |     , {doOptionStart, 130, 23,0,  TRUE}     //  21      option-scan1 | 
| 104 |     , {doRuleError, 255, 103,0,  FALSE}     //  22  | 
| 105 |     , {doNOP, 129, 23,0,  TRUE}     //  23      option-scan2 | 
| 106 |     , {doOptionEnd, 255, 25,0,  FALSE}     //  24  | 
| 107 |     , {doNOP, 59 /* ; */, 1,0,  TRUE}     //  25      option-scan3 | 
| 108 |     , {doNOP, 132, 25,0,  TRUE}     //  26  | 
| 109 |     , {doRuleError, 255, 103,0,  FALSE}     //  27  | 
| 110 |     , {doExprStart, 255, 29, 9, FALSE}     //  28      reverse-rule | 
| 111 |     , {doRuleChar, 254, 38,0,  TRUE}     //  29      term | 
| 112 |     , {doNOP, 132, 29,0,  TRUE}     //  30  | 
| 113 |     , {doRuleChar, 131, 38,0,  TRUE}     //  31  | 
| 114 |     , {doNOP, 91 /* [ */, 94, 38, FALSE}     //  32  | 
| 115 |     , {doLParen, 40 /* ( */, 29, 38, TRUE}     //  33  | 
| 116 |     , {doNOP, 36 /* $ */, 88, 37, FALSE}     //  34  | 
| 117 |     , {doDotAny, 46 /* . */, 38,0,  TRUE}     //  35  | 
| 118 |     , {doRuleError, 255, 103,0,  FALSE}     //  36  | 
| 119 |     , {doCheckVarDef, 255, 38,0,  FALSE}     //  37      term-var-ref | 
| 120 |     , {doNOP, 132, 38,0,  TRUE}     //  38      expr-mod | 
| 121 |     , {doUnaryOpStar, 42 /* * */, 43,0,  TRUE}     //  39  | 
| 122 |     , {doUnaryOpPlus, 43 /* + */, 43,0,  TRUE}     //  40  | 
| 123 |     , {doUnaryOpQuestion, 63 /* ? */, 43,0,  TRUE}     //  41  | 
| 124 |     , {doNOP, 255, 43,0,  FALSE}     //  42  | 
| 125 |     , {doExprCatOperator, 254, 29,0,  FALSE}     //  43      expr-cont | 
| 126 |     , {doNOP, 132, 43,0,  TRUE}     //  44  | 
| 127 |     , {doExprCatOperator, 131, 29,0,  FALSE}     //  45  | 
| 128 |     , {doExprCatOperator, 91 /* [ */, 29,0,  FALSE}     //  46  | 
| 129 |     , {doExprCatOperator, 40 /* ( */, 29,0,  FALSE}     //  47  | 
| 130 |     , {doExprCatOperator, 36 /* $ */, 29,0,  FALSE}     //  48  | 
| 131 |     , {doExprCatOperator, 46 /* . */, 29,0,  FALSE}     //  49  | 
| 132 |     , {doExprCatOperator, 47 /* / */, 55,0,  FALSE}     //  50  | 
| 133 |     , {doExprCatOperator, 123 /* { */, 67,0,  TRUE}     //  51  | 
| 134 |     , {doExprOrOperator, 124 /* | */, 29,0,  TRUE}     //  52  | 
| 135 |     , {doExprRParen, 41 /* ) */, 255,0,  TRUE}     //  53  | 
| 136 |     , {doExprFinished, 255, 255,0,  FALSE}     //  54  | 
| 137 |     , {doSlash, 47 /* / */, 57,0,  TRUE}     //  55      look-ahead | 
| 138 |     , {doNOP, 255, 103,0,  FALSE}     //  56  | 
| 139 |     , {doExprCatOperator, 254, 29,0,  FALSE}     //  57      expr-cont-no-slash | 
| 140 |     , {doNOP, 132, 43,0,  TRUE}     //  58  | 
| 141 |     , {doExprCatOperator, 131, 29,0,  FALSE}     //  59  | 
| 142 |     , {doExprCatOperator, 91 /* [ */, 29,0,  FALSE}     //  60  | 
| 143 |     , {doExprCatOperator, 40 /* ( */, 29,0,  FALSE}     //  61  | 
| 144 |     , {doExprCatOperator, 36 /* $ */, 29,0,  FALSE}     //  62  | 
| 145 |     , {doExprCatOperator, 46 /* . */, 29,0,  FALSE}     //  63  | 
| 146 |     , {doExprOrOperator, 124 /* | */, 29,0,  TRUE}     //  64  | 
| 147 |     , {doExprRParen, 41 /* ) */, 255,0,  TRUE}     //  65  | 
| 148 |     , {doExprFinished, 255, 255,0,  FALSE}     //  66  | 
| 149 |     , {doNOP, 132, 67,0,  TRUE}     //  67      tag-open | 
| 150 |     , {doStartTagValue, 128, 70,0,  FALSE}     //  68  | 
| 151 |     , {doTagExpectedError, 255, 103,0,  FALSE}     //  69  | 
| 152 |     , {doNOP, 132, 74,0,  TRUE}     //  70      tag-value | 
| 153 |     , {doNOP, 125 /* } */, 74,0,  FALSE}     //  71  | 
| 154 |     , {doTagDigit, 128, 70,0,  TRUE}     //  72  | 
| 155 |     , {doTagExpectedError, 255, 103,0,  FALSE}     //  73  | 
| 156 |     , {doNOP, 132, 74,0,  TRUE}     //  74      tag-close | 
| 157 |     , {doTagValue, 125 /* } */, 77,0,  TRUE}     //  75  | 
| 158 |     , {doTagExpectedError, 255, 103,0,  FALSE}     //  76  | 
| 159 |     , {doExprCatOperator, 254, 29,0,  FALSE}     //  77      expr-cont-no-tag | 
| 160 |     , {doNOP, 132, 77,0,  TRUE}     //  78  | 
| 161 |     , {doExprCatOperator, 131, 29,0,  FALSE}     //  79  | 
| 162 |     , {doExprCatOperator, 91 /* [ */, 29,0,  FALSE}     //  80  | 
| 163 |     , {doExprCatOperator, 40 /* ( */, 29,0,  FALSE}     //  81  | 
| 164 |     , {doExprCatOperator, 36 /* $ */, 29,0,  FALSE}     //  82  | 
| 165 |     , {doExprCatOperator, 46 /* . */, 29,0,  FALSE}     //  83  | 
| 166 |     , {doExprCatOperator, 47 /* / */, 55,0,  FALSE}     //  84  | 
| 167 |     , {doExprOrOperator, 124 /* | */, 29,0,  TRUE}     //  85  | 
| 168 |     , {doExprRParen, 41 /* ) */, 255,0,  TRUE}     //  86  | 
| 169 |     , {doExprFinished, 255, 255,0,  FALSE}     //  87  | 
| 170 |     , {doStartVariableName, 36 /* $ */, 90,0,  TRUE}     //  88      scan-var-name | 
| 171 |     , {doNOP, 255, 103,0,  FALSE}     //  89  | 
| 172 |     , {doNOP, 130, 92,0,  TRUE}     //  90      scan-var-start | 
| 173 |     , {doVariableNameExpectedErr, 255, 103,0,  FALSE}     //  91  | 
| 174 |     , {doNOP, 129, 92,0,  TRUE}     //  92      scan-var-body | 
| 175 |     , {doEndVariableName, 255, 255,0,  FALSE}     //  93  | 
| 176 |     , {doScanUnicodeSet, 91 /* [ */, 255,0,  TRUE}     //  94      scan-unicode-set | 
| 177 |     , {doScanUnicodeSet, 112 /* p */, 255,0,  TRUE}     //  95  | 
| 178 |     , {doScanUnicodeSet, 80 /* P */, 255,0,  TRUE}     //  96  | 
| 179 |     , {doNOP, 255, 103,0,  FALSE}     //  97  | 
| 180 |     , {doNOP, 132, 98,0,  TRUE}     //  98      assign-or-rule | 
| 181 |     , {doStartAssign, 61 /* = */, 29, 101, TRUE}     //  99  | 
| 182 |     , {doNOP, 255, 37, 9, FALSE}     //  100  | 
| 183 |     , {doEndAssign, 59 /* ; */, 1,0,  TRUE}     //  101      assign-end | 
| 184 |     , {doRuleErrorAssignExpr, 255, 103,0,  FALSE}     //  102  | 
| 185 |     , {doExit, 255, 103,0,  TRUE}     //  103      errorDeath | 
| 186 |  }; | 
| 187 | #ifdef RBBI_DEBUG | 
| 188 | static const char * const RBBIRuleStateNames[] = {    0, | 
| 189 |      "start" , | 
| 190 |     0, | 
| 191 |     0, | 
| 192 |     0, | 
| 193 |     0, | 
| 194 |     0, | 
| 195 |     0, | 
| 196 |     0, | 
| 197 |      "break-rule-end" , | 
| 198 |     0, | 
| 199 |     0, | 
| 200 |      "start-after-caret" , | 
| 201 |     0, | 
| 202 |     0, | 
| 203 |     0, | 
| 204 |     0, | 
| 205 |     0, | 
| 206 |     0, | 
| 207 |      "rev-option" , | 
| 208 |     0, | 
| 209 |      "option-scan1" , | 
| 210 |     0, | 
| 211 |      "option-scan2" , | 
| 212 |     0, | 
| 213 |      "option-scan3" , | 
| 214 |     0, | 
| 215 |     0, | 
| 216 |      "reverse-rule" , | 
| 217 |      "term" , | 
| 218 |     0, | 
| 219 |     0, | 
| 220 |     0, | 
| 221 |     0, | 
| 222 |     0, | 
| 223 |     0, | 
| 224 |     0, | 
| 225 |      "term-var-ref" , | 
| 226 |      "expr-mod" , | 
| 227 |     0, | 
| 228 |     0, | 
| 229 |     0, | 
| 230 |     0, | 
| 231 |      "expr-cont" , | 
| 232 |     0, | 
| 233 |     0, | 
| 234 |     0, | 
| 235 |     0, | 
| 236 |     0, | 
| 237 |     0, | 
| 238 |     0, | 
| 239 |     0, | 
| 240 |     0, | 
| 241 |     0, | 
| 242 |     0, | 
| 243 |      "look-ahead" , | 
| 244 |     0, | 
| 245 |      "expr-cont-no-slash" , | 
| 246 |     0, | 
| 247 |     0, | 
| 248 |     0, | 
| 249 |     0, | 
| 250 |     0, | 
| 251 |     0, | 
| 252 |     0, | 
| 253 |     0, | 
| 254 |     0, | 
| 255 |      "tag-open" , | 
| 256 |     0, | 
| 257 |     0, | 
| 258 |      "tag-value" , | 
| 259 |     0, | 
| 260 |     0, | 
| 261 |     0, | 
| 262 |      "tag-close" , | 
| 263 |     0, | 
| 264 |     0, | 
| 265 |      "expr-cont-no-tag" , | 
| 266 |     0, | 
| 267 |     0, | 
| 268 |     0, | 
| 269 |     0, | 
| 270 |     0, | 
| 271 |     0, | 
| 272 |     0, | 
| 273 |     0, | 
| 274 |     0, | 
| 275 |     0, | 
| 276 |      "scan-var-name" , | 
| 277 |     0, | 
| 278 |      "scan-var-start" , | 
| 279 |     0, | 
| 280 |      "scan-var-body" , | 
| 281 |     0, | 
| 282 |      "scan-unicode-set" , | 
| 283 |     0, | 
| 284 |     0, | 
| 285 |     0, | 
| 286 |      "assign-or-rule" , | 
| 287 |     0, | 
| 288 |     0, | 
| 289 |      "assign-end" , | 
| 290 |     0, | 
| 291 |      "errorDeath" , | 
| 292 |     0}; | 
| 293 | #endif | 
| 294 |  | 
| 295 | U_NAMESPACE_END | 
| 296 | #endif | 
| 297 |  |