rbbirpt.h 9.6 KB

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