aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/icu/common/rbbirpt.h
blob: 586953c90c6fa4e0f817432e113cc97a89fdb175 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
//---------------------------------------------------------------------------------
//
// Generated Header File.  Do not edit by hand.
//    This file contains the state table for the ICU Rule Based Break Iterator
//    rule parser.
//    It is generated by the Perl script "rbbicst.pl" from
//    the rule parser state definitions file "rbbirpt.txt".
//
//   Copyright (C) 2002-2016 International Business Machines Corporation 
//   and others. All rights reserved.  
//
//---------------------------------------------------------------------------------
#ifndef RBBIRPT_H
#define RBBIRPT_H

#include "unicode/utypes.h"

U_NAMESPACE_BEGIN
//
// Character classes for RBBI rule scanning.
//
    static const uint8_t kRuleSet_digit_char = 128;
    static const uint8_t kRuleSet_name_char = 129;
    static const uint8_t kRuleSet_name_start_char = 130;
    static const uint8_t kRuleSet_rule_char = 131;
    static const uint8_t kRuleSet_white_space = 132;


enum RBBI_RuleParseAction {
    doCheckVarDef,
    doDotAny,
    doEndAssign,
    doEndOfRule,
    doEndVariableName,
    doExit,
    doExprCatOperator,
    doExprFinished,
    doExprOrOperator,
    doExprRParen,
    doExprStart,
    doLParen,
    doNOP,
    doNoChain,
    doOptionEnd,
    doOptionStart,
    doReverseDir,
    doRuleChar,
    doRuleError,
    doRuleErrorAssignExpr,
    doScanUnicodeSet,
    doSlash,
    doStartAssign,
    doStartTagValue,
    doStartVariableName,
    doTagDigit,
    doTagExpectedError,
    doTagValue,
    doUnaryOpPlus,
    doUnaryOpQuestion,
    doUnaryOpStar,
    doVariableNameExpectedErr,
    rbbiLastAction};

//-------------------------------------------------------------------------------
//
//  RBBIRuleTableEl    represents the structure of a row in the transition table
//                     for the rule parser state machine.
//-------------------------------------------------------------------------------
struct RBBIRuleTableEl {
    RBBI_RuleParseAction          fAction;
    uint8_t                       fCharClass;       // 0-127:    an individual ASCII character
                                                    // 128-255:  character class index
    uint8_t                       fNextState;       // 0-250:    normal next-stat numbers
                                                    // 255:      pop next-state from stack.
    uint8_t                       fPushState;
    UBool                         fNextChar;
};

static const struct RBBIRuleTableEl gRuleParseStateTable[] = {
    {doNOP, 0, 0, 0, TRUE}
    , {doExprStart, 254, 29, 9, FALSE}     //  1      start
    , {doNOP, 132, 1,0,  TRUE}     //  2 
    , {doNoChain, 94 /* ^ */, 12, 9, TRUE}     //  3 
    , {doExprStart, 36 /* $ */, 88, 98, FALSE}     //  4 
    , {doNOP, 33 /* ! */, 19,0,  TRUE}     //  5 
    , {doNOP, 59 /* ; */, 1,0,  TRUE}     //  6 
    , {doNOP, 252, 0,0,  FALSE}     //  7 
    , {doExprStart, 255, 29, 9, FALSE}     //  8 
    , {doEndOfRule, 59 /* ; */, 1,0,  TRUE}     //  9      break-rule-end
    , {doNOP, 132, 9,0,  TRUE}     //  10 
    , {doRuleError, 255, 103,0,  FALSE}     //  11 
    , {doExprStart, 254, 29,0,  FALSE}     //  12      start-after-caret
    , {doNOP, 132, 12,0,  TRUE}     //  13 
    , {doRuleError, 94 /* ^ */, 103,0,  FALSE}     //  14 
    , {doExprStart, 36 /* $ */, 88, 37, FALSE}     //  15 
    , {doRuleError, 59 /* ; */, 103,0,  FALSE}     //  16 
    , {doRuleError, 252, 103,0,  FALSE}     //  17 
    , {doExprStart, 255, 29,0,  FALSE}     //  18 
    , {doNOP, 33 /* ! */, 21,0,  TRUE}     //  19      rev-option
    , {doReverseDir, 255, 28, 9, FALSE}     //  20 
    , {doOptionStart, 130, 23,0,  TRUE}     //  21      option-scan1
    , {doRuleError, 255, 103,0,  FALSE}     //  22 
    , {doNOP, 129, 23,0,  TRUE}     //  23      option-scan2
    , {doOptionEnd, 255, 25,0,  FALSE}     //  24 
    , {doNOP, 59 /* ; */, 1,0,  TRUE}     //  25      option-scan3
    , {doNOP, 132, 25,0,  TRUE}     //  26 
    , {doRuleError, 255, 103,0,  FALSE}     //  27 
    , {doExprStart, 255, 29, 9, FALSE}     //  28      reverse-rule
    , {doRuleChar, 254, 38,0,  TRUE}     //  29      term
    , {doNOP, 132, 29,0,  TRUE}     //  30 
    , {doRuleChar, 131, 38,0,  TRUE}     //  31 
    , {doNOP, 91 /* [ */, 94, 38, FALSE}     //  32 
    , {doLParen, 40 /* ( */, 29, 38, TRUE}     //  33 
    , {doNOP, 36 /* $ */, 88, 37, FALSE}     //  34 
    , {doDotAny, 46 /* . */, 38,0,  TRUE}     //  35 
    , {doRuleError, 255, 103,0,  FALSE}     //  36 
    , {doCheckVarDef, 255, 38,0,  FALSE}     //  37      term-var-ref
    , {doNOP, 132, 38,0,  TRUE}     //  38      expr-mod
    , {doUnaryOpStar, 42 /* * */, 43,0,  TRUE}     //  39 
    , {doUnaryOpPlus, 43 /* + */, 43,0,  TRUE}     //  40 
    , {doUnaryOpQuestion, 63 /* ? */, 43,0,  TRUE}     //  41 
    , {doNOP, 255, 43,0,  FALSE}     //  42 
    , {doExprCatOperator, 254, 29,0,  FALSE}     //  43      expr-cont
    , {doNOP, 132, 43,0,  TRUE}     //  44 
    , {doExprCatOperator, 131, 29,0,  FALSE}     //  45 
    , {doExprCatOperator, 91 /* [ */, 29,0,  FALSE}     //  46 
    , {doExprCatOperator, 40 /* ( */, 29,0,  FALSE}     //  47 
    , {doExprCatOperator, 36 /* $ */, 29,0,  FALSE}     //  48 
    , {doExprCatOperator, 46 /* . */, 29,0,  FALSE}     //  49 
    , {doExprCatOperator, 47 /* / */, 55,0,  FALSE}     //  50 
    , {doExprCatOperator, 123 /* { */, 67,0,  TRUE}     //  51 
    , {doExprOrOperator, 124 /* | */, 29,0,  TRUE}     //  52 
    , {doExprRParen, 41 /* ) */, 255,0,  TRUE}     //  53 
    , {doExprFinished, 255, 255,0,  FALSE}     //  54 
    , {doSlash, 47 /* / */, 57,0,  TRUE}     //  55      look-ahead
    , {doNOP, 255, 103,0,  FALSE}     //  56 
    , {doExprCatOperator, 254, 29,0,  FALSE}     //  57      expr-cont-no-slash
    , {doNOP, 132, 43,0,  TRUE}     //  58 
    , {doExprCatOperator, 131, 29,0,  FALSE}     //  59 
    , {doExprCatOperator, 91 /* [ */, 29,0,  FALSE}     //  60 
    , {doExprCatOperator, 40 /* ( */, 29,0,  FALSE}     //  61 
    , {doExprCatOperator, 36 /* $ */, 29,0,  FALSE}     //  62 
    , {doExprCatOperator, 46 /* . */, 29,0,  FALSE}     //  63 
    , {doExprOrOperator, 124 /* | */, 29,0,  TRUE}     //  64 
    , {doExprRParen, 41 /* ) */, 255,0,  TRUE}     //  65 
    , {doExprFinished, 255, 255,0,  FALSE}     //  66 
    , {doNOP, 132, 67,0,  TRUE}     //  67      tag-open
    , {doStartTagValue, 128, 70,0,  FALSE}     //  68 
    , {doTagExpectedError, 255, 103,0,  FALSE}     //  69 
    , {doNOP, 132, 74,0,  TRUE}     //  70      tag-value
    , {doNOP, 125 /* } */, 74,0,  FALSE}     //  71 
    , {doTagDigit, 128, 70,0,  TRUE}     //  72 
    , {doTagExpectedError, 255, 103,0,  FALSE}     //  73 
    , {doNOP, 132, 74,0,  TRUE}     //  74      tag-close
    , {doTagValue, 125 /* } */, 77,0,  TRUE}     //  75 
    , {doTagExpectedError, 255, 103,0,  FALSE}     //  76 
    , {doExprCatOperator, 254, 29,0,  FALSE}     //  77      expr-cont-no-tag
    , {doNOP, 132, 77,0,  TRUE}     //  78 
    , {doExprCatOperator, 131, 29,0,  FALSE}     //  79 
    , {doExprCatOperator, 91 /* [ */, 29,0,  FALSE}     //  80 
    , {doExprCatOperator, 40 /* ( */, 29,0,  FALSE}     //  81 
    , {doExprCatOperator, 36 /* $ */, 29,0,  FALSE}     //  82 
    , {doExprCatOperator, 46 /* . */, 29,0,  FALSE}     //  83 
    , {doExprCatOperator, 47 /* / */, 55,0,  FALSE}     //  84 
    , {doExprOrOperator, 124 /* | */, 29,0,  TRUE}     //  85 
    , {doExprRParen, 41 /* ) */, 255,0,  TRUE}     //  86 
    , {doExprFinished, 255, 255,0,  FALSE}     //  87 
    , {doStartVariableName, 36 /* $ */, 90,0,  TRUE}     //  88      scan-var-name
    , {doNOP, 255, 103,0,  FALSE}     //  89 
    , {doNOP, 130, 92,0,  TRUE}     //  90      scan-var-start
    , {doVariableNameExpectedErr, 255, 103,0,  FALSE}     //  91 
    , {doNOP, 129, 92,0,  TRUE}     //  92      scan-var-body
    , {doEndVariableName, 255, 255,0,  FALSE}     //  93 
    , {doScanUnicodeSet, 91 /* [ */, 255,0,  TRUE}     //  94      scan-unicode-set
    , {doScanUnicodeSet, 112 /* p */, 255,0,  TRUE}     //  95 
    , {doScanUnicodeSet, 80 /* P */, 255,0,  TRUE}     //  96 
    , {doNOP, 255, 103,0,  FALSE}     //  97 
    , {doNOP, 132, 98,0,  TRUE}     //  98      assign-or-rule
    , {doStartAssign, 61 /* = */, 29, 101, TRUE}     //  99 
    , {doNOP, 255, 37, 9, FALSE}     //  100 
    , {doEndAssign, 59 /* ; */, 1,0,  TRUE}     //  101      assign-end
    , {doRuleErrorAssignExpr, 255, 103,0,  FALSE}     //  102 
    , {doExit, 255, 103,0,  TRUE}     //  103      errorDeath
 };
#ifdef RBBI_DEBUG
static const char * const RBBIRuleStateNames[] = {    0,
     "start",
    0,
    0,
    0,
    0,
    0,
    0,
    0,
     "break-rule-end",
    0,
    0,
     "start-after-caret",
    0,
    0,
    0,
    0,
    0,
    0,
     "rev-option",
    0,
     "option-scan1",
    0,
     "option-scan2",
    0,
     "option-scan3",
    0,
    0,
     "reverse-rule",
     "term",
    0,
    0,
    0,
    0,
    0,
    0,
    0,
     "term-var-ref",
     "expr-mod",
    0,
    0,
    0,
    0,
     "expr-cont",
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
     "look-ahead",
    0,
     "expr-cont-no-slash",
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
     "tag-open",
    0,
    0,
     "tag-value",
    0,
    0,
    0,
     "tag-close",
    0,
    0,
     "expr-cont-no-tag",
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
     "scan-var-name",
    0,
     "scan-var-start",
    0,
     "scan-var-body",
    0,
     "scan-unicode-set",
    0,
    0,
    0,
     "assign-or-rule",
    0,
    0,
     "assign-end",
    0,
     "errorDeath",
    0};
#endif

U_NAMESPACE_END
#endif