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