]> git.saurik.com Git - apple/icu.git/blame - icuSources/i18n/regexcst.h
ICU-3.13.tar.gz
[apple/icu.git] / icuSources / i18n / regexcst.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 Regular Expression Pattern Parser
5// It is generated by the Perl script "regexcst.pl" from
6// the rule parser state definitions file "regexcst.txt".
7//
8// Copyright (C) 2002-2003 International Business Machines Corporation
9// and others. All rights reserved.
10//
11//---------------------------------------------------------------------------------
12#ifndef RBBIRPT_H
13#define RBBIRPT_H
14
15U_NAMESPACE_BEGIN
16//
17// Character classes for regex pattern scanning.
18//
19 static const uint8_t kRuleSet_digit_char = 128;
20 static const uint8_t kRuleSet_white_space = 129;
21 static const uint8_t kRuleSet_rule_char = 130;
22
23
24enum Regex_PatternParseAction {
25 doPossessivePlus,
26 doCloseParen,
27 doProperty,
28 doBeginMatchMode,
29 doOrOperator,
30 doOpenCaptureParen,
31 doBadOpenParenType,
32 doRuleError,
33 doIntevalLowerDigit,
34 doBackslashs,
35 doOctal,
36 doNGOpt,
37 doBackslashw,
38 doMismatchedParenErr,
39 doOpenLookBehind,
40 doBackslashz,
41 doIntervalError,
42 doStar,
43 doCaret,
44 doEnterQuoteMode,
45 doNGStar,
46 doMatchMode,
47 doIntervalUpperDigit,
48 doOpenLookAheadNeg,
49 doPlus,
50 doOpenNonCaptureParen,
51 doBackslashA,
52 doBackslashB,
53 doNGPlus,
54 doSetMatchMode,
55 doPatFinish,
56 doBackslashD,
57 doPossessiveInterval,
58 doEscapeError,
59 doBackslashG,
60 doSuppressComments,
61 doMatchModeParen,
62 doOpt,
63 doInterval,
64 doLiteralChar,
65 doIntervalInit,
66 doOpenAtomicParen,
67 doBackslashS,
68 doOpenLookAhead,
69 doBackRef,
70 doDollar,
71 doDotAny,
72 doBackslashW,
73 doBackslashX,
74 doScanUnicodeSet,
75 doBackslashZ,
76 doPerlInline,
77 doPossessiveOpt,
78 doNOP,
79 doConditionalExpr,
80 doExit,
81 doNGInterval,
82 doPatStart,
83 doBackslashb,
84 doPossessiveStar,
85 doBackslashd,
86 doIntervalSame,
87 doOpenLookBehindNeg,
88 rbbiLastAction};
89
90//-------------------------------------------------------------------------------
91//
92// RegexTableEl represents the structure of a row in the transition table
93// for the pattern parser state machine.
94//-------------------------------------------------------------------------------
95struct RegexTableEl {
96 Regex_PatternParseAction fAction;
97 uint8_t fCharClass; // 0-127: an individual ASCII character
98 // 128-255: character class index
99 uint8_t fNextState; // 0-250: normal next-state numbers
100 // 255: pop next-state from stack.
101 uint8_t fPushState;
102 UBool fNextChar;
103};
104
105static const struct RegexTableEl gRuleParseStateTable[] = {
106 {doNOP, 0, 0, 0, TRUE}
107 , {doPatStart, 255, 2,0, FALSE} // 1 start
108 , {doLiteralChar, 254, 14,0, TRUE} // 2 term
109 , {doLiteralChar, 130, 14,0, TRUE} // 3
110 , {doScanUnicodeSet, 91 /* [ */, 14,0, TRUE} // 4
111 , {doNOP, 40 /* ( */, 27,0, TRUE} // 5
112 , {doDotAny, 46 /* . */, 14,0, TRUE} // 6
113 , {doCaret, 94 /* ^ */, 2,0, TRUE} // 7
114 , {doDollar, 36 /* $ */, 2,0, TRUE} // 8
115 , {doNOP, 92 /* \ */, 79,0, TRUE} // 9
116 , {doOrOperator, 124 /* | */, 2,0, TRUE} // 10
117 , {doCloseParen, 41 /* ) */, 255,0, TRUE} // 11
118 , {doPatFinish, 253, 2,0, FALSE} // 12
119 , {doRuleError, 255, 100,0, FALSE} // 13
120 , {doNOP, 42 /* * */, 57,0, TRUE} // 14 expr-quant
121 , {doNOP, 43 /* + */, 60,0, TRUE} // 15
122 , {doNOP, 63 /* ? */, 63,0, TRUE} // 16
123 , {doIntervalInit, 123 /* { */, 66,0, TRUE} // 17
124 , {doNOP, 40 /* ( */, 23,0, TRUE} // 18
125 , {doNOP, 255, 20,0, FALSE} // 19
126 , {doOrOperator, 124 /* | */, 2,0, TRUE} // 20 expr-cont
127 , {doCloseParen, 41 /* ) */, 255,0, TRUE} // 21
128 , {doNOP, 255, 2,0, FALSE} // 22
129 , {doSuppressComments, 63 /* ? */, 25,0, TRUE} // 23 open-paren-quant
130 , {doNOP, 255, 27,0, FALSE} // 24
131 , {doNOP, 35 /* # */, 46, 14, TRUE} // 25 open-paren-quant2
132 , {doNOP, 255, 29,0, FALSE} // 26
133 , {doSuppressComments, 63 /* ? */, 29,0, TRUE} // 27 open-paren
134 , {doOpenCaptureParen, 255, 2, 14, FALSE} // 28
135 , {doOpenNonCaptureParen, 58 /* : */, 2, 14, TRUE} // 29 open-paren-extended
136 , {doOpenAtomicParen, 62 /* > */, 2, 14, TRUE} // 30
137 , {doOpenLookAhead, 61 /* = */, 2, 20, TRUE} // 31
138 , {doOpenLookAheadNeg, 33 /* ! */, 2, 20, TRUE} // 32
139 , {doNOP, 60 /* < */, 43,0, TRUE} // 33
140 , {doNOP, 35 /* # */, 46, 2, TRUE} // 34
141 , {doBeginMatchMode, 105 /* i */, 49,0, FALSE} // 35
142 , {doBeginMatchMode, 109 /* m */, 49,0, FALSE} // 36
143 , {doBeginMatchMode, 115 /* s */, 49,0, FALSE} // 37
144 , {doBeginMatchMode, 120 /* x */, 49,0, FALSE} // 38
145 , {doBeginMatchMode, 45 /* - */, 49,0, FALSE} // 39
146 , {doConditionalExpr, 40 /* ( */, 100,0, TRUE} // 40
147 , {doPerlInline, 123 /* { */, 100,0, TRUE} // 41
148 , {doBadOpenParenType, 255, 100,0, FALSE} // 42
149 , {doOpenLookBehind, 61 /* = */, 2, 20, TRUE} // 43 open-paren-lookbehind
150 , {doOpenLookBehindNeg, 33 /* ! */, 2, 20, TRUE} // 44
151 , {doBadOpenParenType, 255, 100,0, FALSE} // 45
152 , {doNOP, 41 /* ) */, 255,0, TRUE} // 46 paren-comment
153 , {doMismatchedParenErr, 253, 100,0, FALSE} // 47
154 , {doNOP, 255, 46,0, TRUE} // 48
155 , {doMatchMode, 105 /* i */, 49,0, TRUE} // 49 paren-flag
156 , {doMatchMode, 109 /* m */, 49,0, TRUE} // 50
157 , {doMatchMode, 115 /* s */, 49,0, TRUE} // 51
158 , {doMatchMode, 120 /* x */, 49,0, TRUE} // 52
159 , {doMatchMode, 45 /* - */, 49,0, TRUE} // 53
160 , {doSetMatchMode, 41 /* ) */, 2,0, TRUE} // 54
161 , {doMatchModeParen, 58 /* : */, 2, 14, TRUE} // 55
162 , {doNOP, 255, 100,0, FALSE} // 56
163 , {doNGStar, 63 /* ? */, 20,0, TRUE} // 57 quant-star
164 , {doPossessiveStar, 43 /* + */, 20,0, TRUE} // 58
165 , {doStar, 255, 20,0, FALSE} // 59
166 , {doNGPlus, 63 /* ? */, 20,0, TRUE} // 60 quant-plus
167 , {doPossessivePlus, 43 /* + */, 20,0, TRUE} // 61
168 , {doPlus, 255, 20,0, FALSE} // 62
169 , {doNGOpt, 63 /* ? */, 20,0, TRUE} // 63 quant-opt
170 , {doPossessiveOpt, 43 /* + */, 20,0, TRUE} // 64
171 , {doOpt, 255, 20,0, FALSE} // 65
172 , {doNOP, 129, 66,0, TRUE} // 66 interval-open
173 , {doNOP, 128, 69,0, FALSE} // 67
174 , {doIntervalError, 255, 100,0, FALSE} // 68
175 , {doIntevalLowerDigit, 128, 69,0, TRUE} // 69 interval-lower
176 , {doNOP, 44 /* , */, 73,0, TRUE} // 70
177 , {doIntervalSame, 125 /* } */, 76,0, TRUE} // 71
178 , {doIntervalError, 255, 100,0, FALSE} // 72
179 , {doIntervalUpperDigit, 128, 73,0, TRUE} // 73 interval-upper
180 , {doNOP, 125 /* } */, 76,0, TRUE} // 74
181 , {doIntervalError, 255, 100,0, FALSE} // 75
182 , {doNGInterval, 63 /* ? */, 20,0, TRUE} // 76 interval-type
183 , {doPossessiveInterval, 43 /* + */, 20,0, TRUE} // 77
184 , {doInterval, 255, 20,0, FALSE} // 78
185 , {doBackslashA, 65 /* A */, 2,0, TRUE} // 79 backslash
186 , {doBackslashB, 66 /* B */, 2,0, TRUE} // 80
187 , {doBackslashb, 98 /* b */, 2,0, TRUE} // 81
188 , {doBackslashd, 100 /* d */, 14,0, TRUE} // 82
189 , {doBackslashD, 68 /* D */, 14,0, TRUE} // 83
190 , {doBackslashG, 71 /* G */, 2,0, TRUE} // 84
191 , {doProperty, 78 /* N */, 14,0, FALSE} // 85
192 , {doProperty, 112 /* p */, 14,0, FALSE} // 86
193 , {doProperty, 80 /* P */, 14,0, FALSE} // 87
194 , {doEnterQuoteMode, 81 /* Q */, 2,0, TRUE} // 88
195 , {doBackslashS, 83 /* S */, 14,0, TRUE} // 89
196 , {doBackslashs, 115 /* s */, 14,0, TRUE} // 90
197 , {doBackslashW, 87 /* W */, 14,0, TRUE} // 91
198 , {doBackslashw, 119 /* w */, 14,0, TRUE} // 92
199 , {doBackslashX, 88 /* X */, 14,0, TRUE} // 93
200 , {doBackslashZ, 90 /* Z */, 2,0, TRUE} // 94
201 , {doBackslashz, 122 /* z */, 2,0, TRUE} // 95
202 , {doOctal, 48 /* 0 */, 14,0, TRUE} // 96
203 , {doBackRef, 128, 14,0, TRUE} // 97
204 , {doEscapeError, 253, 100,0, FALSE} // 98
205 , {doLiteralChar, 255, 14,0, TRUE} // 99
206 , {doExit, 255, 100,0, TRUE} // 100 errorDeath
207 };
208static const char * const RegexStateNames[] = { 0,
209 "start",
210 "term",
211 0,
212 0,
213 0,
214 0,
215 0,
216 0,
217 0,
218 0,
219 0,
220 0,
221 0,
222 "expr-quant",
223 0,
224 0,
225 0,
226 0,
227 0,
228 "expr-cont",
229 0,
230 0,
231 "open-paren-quant",
232 0,
233 "open-paren-quant2",
234 0,
235 "open-paren",
236 0,
237 "open-paren-extended",
238 0,
239 0,
240 0,
241 0,
242 0,
243 0,
244 0,
245 0,
246 0,
247 0,
248 0,
249 0,
250 0,
251 "open-paren-lookbehind",
252 0,
253 0,
254 "paren-comment",
255 0,
256 0,
257 "paren-flag",
258 0,
259 0,
260 0,
261 0,
262 0,
263 0,
264 0,
265 "quant-star",
266 0,
267 0,
268 "quant-plus",
269 0,
270 0,
271 "quant-opt",
272 0,
273 0,
274 "interval-open",
275 0,
276 0,
277 "interval-lower",
278 0,
279 0,
280 0,
281 "interval-upper",
282 0,
283 0,
284 "interval-type",
285 0,
286 0,
287 "backslash",
288 0,
289 0,
290 0,
291 0,
292 0,
293 0,
294 0,
295 0,
296 0,
297 0,
298 0,
299 0,
300 0,
301 0,
302 0,
303 0,
304 0,
305 0,
306 0,
307 0,
308 "errorDeath",
309 0};
310
311U_NAMESPACE_END
312#endif