1 // Copyright (C) 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 //---------------------------------------------------------------------------------
5 // Generated Header File. Do not edit by hand.
6 // This file contains the state table for the ICU Rule Based Break Iterator
8 // It is generated by the Perl script "rbbicst.pl" from
9 // the rule parser state definitions file "rbbirpt.txt".
11 // Copyright (C) 2002-2016 International Business Machines Corporation
12 // and others. All rights reserved.
14 //---------------------------------------------------------------------------------
18 #include "unicode/utypes.h"
22 // Character classes for RBBI rule scanning.
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;
31 enum RBBI_RuleParseAction {
51 doRuleErrorAssignExpr,
63 doVariableNameExpectedErr,
66 //-------------------------------------------------------------------------------
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.
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
188 static const char * const RBBIRuleStateNames[] = { 0,
245 "expr-cont-no-slash",