ruby-sfst 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2197 @@
1
+ #line 2 "utf8-scanner.C"
2
+
3
+ #line 4 "utf8-scanner.C"
4
+
5
+ #define YY_INT_ALIGNED short int
6
+
7
+ /* A lexical scanner generated by flex */
8
+
9
+ #define FLEX_SCANNER
10
+ #define YY_FLEX_MAJOR_VERSION 2
11
+ #define YY_FLEX_MINOR_VERSION 5
12
+ #define YY_FLEX_SUBMINOR_VERSION 34
13
+ #if YY_FLEX_SUBMINOR_VERSION > 0
14
+ #define FLEX_BETA
15
+ #endif
16
+
17
+ /* First, we deal with platform-specific or compiler-specific issues. */
18
+
19
+ /* begin standard C headers. */
20
+ #include <stdio.h>
21
+ #include <string.h>
22
+ #include <errno.h>
23
+ #include <stdlib.h>
24
+
25
+ /* end standard C headers. */
26
+
27
+ /* flex integer type definitions */
28
+
29
+ #ifndef FLEXINT_H
30
+ #define FLEXINT_H
31
+
32
+ /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
33
+
34
+ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
35
+
36
+ /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
37
+ * if you want the limit (max/min) macros for int types.
38
+ */
39
+ #ifndef __STDC_LIMIT_MACROS
40
+ #define __STDC_LIMIT_MACROS 1
41
+ #endif
42
+
43
+ #include <inttypes.h>
44
+ typedef int8_t flex_int8_t;
45
+ typedef uint8_t flex_uint8_t;
46
+ typedef int16_t flex_int16_t;
47
+ typedef uint16_t flex_uint16_t;
48
+ typedef int32_t flex_int32_t;
49
+ typedef uint32_t flex_uint32_t;
50
+ #else
51
+ typedef signed char flex_int8_t;
52
+ typedef short int flex_int16_t;
53
+ typedef int flex_int32_t;
54
+ typedef unsigned char flex_uint8_t;
55
+ typedef unsigned short int flex_uint16_t;
56
+ typedef unsigned int flex_uint32_t;
57
+ #endif /* ! C99 */
58
+
59
+ /* Limits of integral types. */
60
+ #ifndef INT8_MIN
61
+ #define INT8_MIN (-128)
62
+ #endif
63
+ #ifndef INT16_MIN
64
+ #define INT16_MIN (-32767-1)
65
+ #endif
66
+ #ifndef INT32_MIN
67
+ #define INT32_MIN (-2147483647-1)
68
+ #endif
69
+ #ifndef INT8_MAX
70
+ #define INT8_MAX (127)
71
+ #endif
72
+ #ifndef INT16_MAX
73
+ #define INT16_MAX (32767)
74
+ #endif
75
+ #ifndef INT32_MAX
76
+ #define INT32_MAX (2147483647)
77
+ #endif
78
+ #ifndef UINT8_MAX
79
+ #define UINT8_MAX (255U)
80
+ #endif
81
+ #ifndef UINT16_MAX
82
+ #define UINT16_MAX (65535U)
83
+ #endif
84
+ #ifndef UINT32_MAX
85
+ #define UINT32_MAX (4294967295U)
86
+ #endif
87
+
88
+ #endif /* ! FLEXINT_H */
89
+
90
+ #ifdef __cplusplus
91
+
92
+ /* The "const" storage-class-modifier is valid. */
93
+ #define YY_USE_CONST
94
+
95
+ #else /* ! __cplusplus */
96
+
97
+ /* C99 requires __STDC__ to be defined as 1. */
98
+ #if defined (__STDC__)
99
+
100
+ #define YY_USE_CONST
101
+
102
+ #endif /* defined (__STDC__) */
103
+ #endif /* ! __cplusplus */
104
+
105
+ #ifdef YY_USE_CONST
106
+ #define yyconst const
107
+ #else
108
+ #define yyconst
109
+ #endif
110
+
111
+ /* Returned upon end-of-file. */
112
+ #define YY_NULL 0
113
+
114
+ /* Promotes a possibly negative, possibly signed char to an unsigned
115
+ * integer for use as an array index. If the signed char is negative,
116
+ * we want to instead treat it as an 8-bit unsigned char, hence the
117
+ * double cast.
118
+ */
119
+ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
120
+
121
+ /* Enter a start condition. This macro really ought to take a parameter,
122
+ * but we do it the disgusting crufty way forced on us by the ()-less
123
+ * definition of BEGIN.
124
+ */
125
+ #define BEGIN (yy_start) = 1 + 2 *
126
+
127
+ /* Translate the current start state into a value that can be later handed
128
+ * to BEGIN to return to the state. The YYSTATE alias is for lex
129
+ * compatibility.
130
+ */
131
+ #define YY_START (((yy_start) - 1) / 2)
132
+ #define YYSTATE YY_START
133
+
134
+ /* Action number for EOF rule of a given start state. */
135
+ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
136
+
137
+ /* Special action meaning "start processing a new file". */
138
+ #define YY_NEW_FILE yyrestart(yyin )
139
+
140
+ #define YY_END_OF_BUFFER_CHAR 0
141
+
142
+ /* Size of default input buffer. */
143
+ #ifndef YY_BUF_SIZE
144
+ #define YY_BUF_SIZE 16384
145
+ #endif
146
+
147
+ /* The state buf must be large enough to hold one state per character in the main buffer.
148
+ */
149
+ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
150
+
151
+ #ifndef YY_TYPEDEF_YY_BUFFER_STATE
152
+ #define YY_TYPEDEF_YY_BUFFER_STATE
153
+ typedef struct yy_buffer_state *YY_BUFFER_STATE;
154
+ #endif
155
+
156
+ extern int yyleng;
157
+
158
+ extern FILE *yyin, *yyout;
159
+
160
+ #define EOB_ACT_CONTINUE_SCAN 0
161
+ #define EOB_ACT_END_OF_FILE 1
162
+ #define EOB_ACT_LAST_MATCH 2
163
+
164
+ /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
165
+ * access to the local variable yy_act. Since yyless() is a macro, it would break
166
+ * existing scanners that call yyless() from OUTSIDE yylex.
167
+ * One obvious solution it to make yy_act a global. I tried that, and saw
168
+ * a 5% performance hit in a non-yylineno scanner, because yy_act is
169
+ * normally declared as a register variable-- so it is not worth it.
170
+ */
171
+ #define YY_LESS_LINENO(n) \
172
+ do { \
173
+ int yyl;\
174
+ for ( yyl = n; yyl < yyleng; ++yyl )\
175
+ if ( yytext[yyl] == '\n' )\
176
+ --yylineno;\
177
+ }while(0)
178
+
179
+ /* Return all but the first "n" matched characters back to the input stream. */
180
+ #define yyless(n) \
181
+ do \
182
+ { \
183
+ /* Undo effects of setting up yytext. */ \
184
+ int yyless_macro_arg = (n); \
185
+ YY_LESS_LINENO(yyless_macro_arg);\
186
+ *yy_cp = (yy_hold_char); \
187
+ YY_RESTORE_YY_MORE_OFFSET \
188
+ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
189
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
190
+ } \
191
+ while ( 0 )
192
+
193
+ #define unput(c) yyunput( c, (yytext_ptr) )
194
+
195
+ /* The following is because we cannot portably get our hands on size_t
196
+ * (without autoconf's help, which isn't available because we want
197
+ * flex-generated scanners to compile on their own).
198
+ * Given that the standard has decreed that size_t exists since 1989,
199
+ * I guess we can afford to depend on it. Manoj.
200
+ */
201
+
202
+ #ifndef YY_TYPEDEF_YY_SIZE_T
203
+ #define YY_TYPEDEF_YY_SIZE_T
204
+ typedef size_t yy_size_t;
205
+ #endif
206
+
207
+ #ifndef YY_STRUCT_YY_BUFFER_STATE
208
+ #define YY_STRUCT_YY_BUFFER_STATE
209
+ struct yy_buffer_state
210
+ {
211
+ FILE *yy_input_file;
212
+
213
+ char *yy_ch_buf; /* input buffer */
214
+ char *yy_buf_pos; /* current position in input buffer */
215
+
216
+ /* Size of input buffer in bytes, not including room for EOB
217
+ * characters.
218
+ */
219
+ yy_size_t yy_buf_size;
220
+
221
+ /* Number of characters read into yy_ch_buf, not including EOB
222
+ * characters.
223
+ */
224
+ int yy_n_chars;
225
+
226
+ /* Whether we "own" the buffer - i.e., we know we created it,
227
+ * and can realloc() it to grow it, and should free() it to
228
+ * delete it.
229
+ */
230
+ int yy_is_our_buffer;
231
+
232
+ /* Whether this is an "interactive" input source; if so, and
233
+ * if we're using stdio for input, then we want to use getc()
234
+ * instead of fread(), to make sure we stop fetching input after
235
+ * each newline.
236
+ */
237
+ int yy_is_interactive;
238
+
239
+ /* Whether we're considered to be at the beginning of a line.
240
+ * If so, '^' rules will be active on the next match, otherwise
241
+ * not.
242
+ */
243
+ int yy_at_bol;
244
+
245
+ int yy_bs_lineno; /**< The line count. */
246
+ int yy_bs_column; /**< The column count. */
247
+
248
+ /* Whether to try to fill the input buffer when we reach the
249
+ * end of it.
250
+ */
251
+ int yy_fill_buffer;
252
+
253
+ int yy_buffer_status;
254
+
255
+ #define YY_BUFFER_NEW 0
256
+ #define YY_BUFFER_NORMAL 1
257
+ /* When an EOF's been seen but there's still some text to process
258
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
259
+ * shouldn't try reading from the input source any more. We might
260
+ * still have a bunch of tokens to match, though, because of
261
+ * possible backing-up.
262
+ *
263
+ * When we actually see the EOF, we change the status to "new"
264
+ * (via yyrestart()), so that the user can continue scanning by
265
+ * just pointing yyin at a new input file.
266
+ */
267
+ #define YY_BUFFER_EOF_PENDING 2
268
+
269
+ };
270
+ #endif /* !YY_STRUCT_YY_BUFFER_STATE */
271
+
272
+ /* Stack of input buffers. */
273
+ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
274
+ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
275
+ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
276
+
277
+ /* We provide macros for accessing buffer states in case in the
278
+ * future we want to put the buffer states in a more general
279
+ * "scanner state".
280
+ *
281
+ * Returns the top of the stack, or NULL.
282
+ */
283
+ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
284
+ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
285
+ : NULL)
286
+
287
+ /* Same as previous macro, but useful when we know that the buffer stack is not
288
+ * NULL or when we need an lvalue. For internal use only.
289
+ */
290
+ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
291
+
292
+ /* yy_hold_char holds the character lost when yytext is formed. */
293
+ static char yy_hold_char;
294
+ static int yy_n_chars; /* number of characters read into yy_ch_buf */
295
+ int yyleng;
296
+
297
+ /* Points to current character in buffer. */
298
+ static char *yy_c_buf_p = (char *) 0;
299
+ static int yy_init = 0; /* whether we need to initialize */
300
+ static int yy_start = 0; /* start state number */
301
+
302
+ /* Flag which is used to allow yywrap()'s to do buffer switches
303
+ * instead of setting up a fresh yyin. A bit of a hack ...
304
+ */
305
+ static int yy_did_buffer_switch_on_eof;
306
+
307
+ void yyrestart (FILE *input_file );
308
+ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
309
+ YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
310
+ void yy_delete_buffer (YY_BUFFER_STATE b );
311
+ void yy_flush_buffer (YY_BUFFER_STATE b );
312
+ void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
313
+ void yypop_buffer_state (void );
314
+
315
+ static void yyensure_buffer_stack (void );
316
+ static void yy_load_buffer_state (void );
317
+ static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
318
+
319
+ #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
320
+
321
+ YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
322
+ YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
323
+ YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
324
+
325
+ void *yyalloc (yy_size_t );
326
+ void *yyrealloc (void *,yy_size_t );
327
+ void yyfree (void * );
328
+
329
+ #define yy_new_buffer yy_create_buffer
330
+
331
+ #define yy_set_interactive(is_interactive) \
332
+ { \
333
+ if ( ! YY_CURRENT_BUFFER ){ \
334
+ yyensure_buffer_stack (); \
335
+ YY_CURRENT_BUFFER_LVALUE = \
336
+ yy_create_buffer(yyin,YY_BUF_SIZE ); \
337
+ } \
338
+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
339
+ }
340
+
341
+ #define yy_set_bol(at_bol) \
342
+ { \
343
+ if ( ! YY_CURRENT_BUFFER ){\
344
+ yyensure_buffer_stack (); \
345
+ YY_CURRENT_BUFFER_LVALUE = \
346
+ yy_create_buffer(yyin,YY_BUF_SIZE ); \
347
+ } \
348
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
349
+ }
350
+
351
+ #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
352
+
353
+ /* Begin user sect3 */
354
+
355
+ #define yywrap(n) 1
356
+ #define YY_SKIP_YYWRAP
357
+
358
+ typedef unsigned char YY_CHAR;
359
+
360
+ FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
361
+
362
+ typedef int yy_state_type;
363
+
364
+ extern int yylineno;
365
+
366
+ int yylineno = 1;
367
+
368
+ extern char *yytext;
369
+ #define yytext_ptr yytext
370
+
371
+ static yy_state_type yy_get_previous_state (void );
372
+ static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
373
+ static int yy_get_next_buffer (void );
374
+ static void yy_fatal_error (yyconst char msg[] );
375
+
376
+ /* Done after the current pattern has been matched and before the
377
+ * corresponding action - sets up yytext.
378
+ */
379
+ #define YY_DO_BEFORE_ACTION \
380
+ (yytext_ptr) = yy_bp; \
381
+ yyleng = (size_t) (yy_cp - yy_bp); \
382
+ (yy_hold_char) = *yy_cp; \
383
+ *yy_cp = '\0'; \
384
+ (yy_c_buf_p) = yy_cp;
385
+
386
+ #define YY_NUM_RULES 38
387
+ #define YY_END_OF_BUFFER 39
388
+ /* This struct is not used in this scanner,
389
+ but its presence is necessary. */
390
+ struct yy_trans_info
391
+ {
392
+ flex_int32_t yy_verify;
393
+ flex_int32_t yy_nxt;
394
+ };
395
+ static yyconst flex_int16_t yy_accept[128] =
396
+ { 0,
397
+ 0, 0, 2, 2, 39, 34, 29, 31, 34, 21,
398
+ 34, 34, 34, 7, 34, 34, 21, 34, 34, 21,
399
+ 21, 21, 38, 38, 38, 38, 29, 7, 34, 2,
400
+ 38, 3, 31, 0, 0, 0, 0, 0, 0, 0,
401
+ 0, 0, 7, 7, 0, 0, 18, 12, 26, 0,
402
+ 11, 17, 33, 33, 30, 33, 33, 32, 0, 20,
403
+ 0, 19, 9, 35, 0, 0, 0, 0, 0, 7,
404
+ 5, 7, 7, 0, 2, 0, 3, 28, 0, 25,
405
+ 0, 0, 0, 23, 0, 0, 7, 6, 7, 15,
406
+ 10, 0, 0, 0, 16, 32, 13, 14, 36, 0,
407
+
408
+ 0, 0, 7, 5, 7, 0, 4, 0, 24, 0,
409
+ 22, 0, 0, 37, 0, 27, 0, 0, 0, 0,
410
+ 0, 0, 1, 0, 0, 8, 0
411
+ } ;
412
+
413
+ static yyconst flex_int32_t yy_ec[256] =
414
+ { 0,
415
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
416
+ 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
417
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
418
+ 1, 2, 5, 6, 7, 8, 9, 10, 11, 10,
419
+ 10, 12, 13, 10, 14, 13, 15, 16, 16, 16,
420
+ 16, 16, 16, 16, 16, 16, 16, 5, 11, 17,
421
+ 18, 19, 10, 11, 20, 21, 22, 22, 23, 22,
422
+ 22, 24, 22, 22, 22, 25, 22, 22, 22, 26,
423
+ 22, 22, 22, 27, 22, 22, 22, 22, 22, 22,
424
+ 5, 28, 5, 29, 30, 11, 22, 22, 31, 32,
425
+
426
+ 33, 22, 22, 22, 34, 22, 22, 35, 22, 36,
427
+ 22, 22, 22, 22, 22, 22, 37, 22, 22, 22,
428
+ 22, 22, 5, 38, 5, 39, 1, 40, 40, 40,
429
+ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
430
+ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
431
+ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
432
+ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
433
+ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
434
+ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
435
+ 40, 41, 41, 41, 41, 41, 41, 41, 41, 41,
436
+
437
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
438
+ 41, 41, 41, 41, 41, 41, 41, 41, 41, 41,
439
+ 41, 41, 41, 42, 42, 42, 42, 42, 42, 42,
440
+ 42, 42, 42, 42, 42, 42, 42, 42, 42, 43,
441
+ 43, 43, 43, 43, 43, 43, 43, 43, 43, 43,
442
+ 43, 43, 43, 43, 43
443
+ } ;
444
+
445
+ static yyconst flex_int32_t yy_meta[44] =
446
+ { 0,
447
+ 1, 1, 2, 1, 3, 3, 4, 5, 3, 6,
448
+ 3, 7, 8, 8, 8, 8, 9, 6, 6, 8,
449
+ 8, 8, 8, 8, 8, 8, 8, 6, 6, 8,
450
+ 8, 8, 8, 8, 8, 8, 8, 6, 6, 1,
451
+ 1, 1, 1
452
+ } ;
453
+
454
+ static yyconst flex_int16_t yy_base[142] =
455
+ { 0,
456
+ 0, 42, 62, 0, 284, 438, 438, 438, 280, 438,
457
+ 265, 27, 28, 253, 266, 30, 258, 256, 104, 95,
458
+ 96, 236, 438, 230, 223, 222, 110, 110, 236, 258,
459
+ 0, 0, 438, 105, 0, 108, 109, 138, 120, 113,
460
+ 123, 181, 231, 130, 239, 135, 438, 136, 438, 224,
461
+ 438, 438, 438, 50, 438, 250, 228, 230, 226, 438,
462
+ 224, 438, 438, 438, 202, 201, 115, 125, 215, 156,
463
+ 438, 163, 166, 209, 232, 226, 0, 438, 196, 438,
464
+ 167, 267, 168, 438, 149, 310, 169, 438, 173, 438,
465
+ 438, 200, 197, 158, 438, 182, 438, 438, 438, 148,
466
+
467
+ 202, 204, 208, 438, 210, 141, 438, 140, 438, 209,
468
+ 438, 214, 216, 438, 103, 438, 220, 39, 222, 34,
469
+ 223, 23, 224, 231, 237, 438, 438, 347, 352, 358,
470
+ 367, 374, 383, 392, 395, 397, 399, 404, 410, 419,
471
+ 428
472
+ } ;
473
+
474
+ static yyconst flex_int16_t yy_def[142] =
475
+ { 0,
476
+ 127, 1, 127, 3, 127, 127, 127, 127, 127, 127,
477
+ 128, 129, 130, 131, 127, 132, 127, 127, 133, 127,
478
+ 127, 127, 127, 127, 127, 127, 127, 134, 127, 127,
479
+ 135, 136, 127, 128, 137, 129, 138, 129, 129, 130,
480
+ 139, 130, 131, 131, 127, 132, 127, 132, 127, 132,
481
+ 127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
482
+ 127, 127, 127, 127, 127, 127, 127, 140, 127, 134,
483
+ 127, 134, 134, 127, 127, 135, 136, 127, 137, 127,
484
+ 138, 138, 129, 127, 139, 139, 131, 127, 131, 127,
485
+ 127, 127, 127, 141, 127, 127, 127, 127, 127, 127,
486
+
487
+ 140, 140, 134, 127, 134, 127, 127, 127, 127, 129,
488
+ 127, 141, 141, 127, 127, 127, 129, 127, 129, 127,
489
+ 129, 127, 129, 127, 127, 127, 0, 127, 127, 127,
490
+ 127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
491
+ 127
492
+ } ;
493
+
494
+ static yyconst flex_int16_t yy_nxt[482] =
495
+ { 0,
496
+ 6, 7, 8, 9, 10, 11, 12, 13, 14, 10,
497
+ 6, 10, 10, 10, 15, 6, 16, 17, 18, 6,
498
+ 6, 6, 6, 6, 6, 6, 6, 19, 20, 21,
499
+ 6, 6, 6, 6, 6, 6, 6, 22, 6, 23,
500
+ 24, 25, 26, 27, 37, 41, 47, 48, 49, 124,
501
+ 28, 92, 55, 93, 38, 42, 122, 50, 94, 120,
502
+ 39, 29, 23, 30, 23, 23, 23, 31, 23, 23,
503
+ 23, 23, 23, 32, 32, 32, 32, 32, 23, 23,
504
+ 23, 32, 32, 32, 32, 32, 32, 32, 32, 23,
505
+ 23, 32, 32, 32, 32, 32, 32, 32, 32, 23,
506
+
507
+ 23, 23, 23, 23, 23, 54, 55, 56, 59, 61,
508
+ 78, 67, 71, 72, 80, 80, 67, 57, 68, 58,
509
+ 84, 127, 118, 68, 60, 62, 80, 71, 102, 69,
510
+ 84, 87, 88, 89, 69, 38, 82, 73, 36, 36,
511
+ 42, 36, 36, 36, 36, 116, 36, 38, 36, 36,
512
+ 86, 127, 127, 49, 91, 83, 111, 44, 71, 72,
513
+ 55, 113, 50, 50, 115, 71, 72, 103, 104, 105,
514
+ 87, 88, 89, 109, 80, 88, 86, 36, 36, 36,
515
+ 36, 40, 40, 73, 40, 40, 40, 114, 40, 40,
516
+ 73, 40, 40, 73, 82, 38, 44, 96, 110, 55,
517
+
518
+ 44, 92, 55, 93, 71, 102, 71, 102, 94, 103,
519
+ 104, 105, 104, 72, 108, 80, 55, 113, 55, 113,
520
+ 40, 40, 40, 40, 46, 46, 80, 46, 80, 80,
521
+ 80, 107, 125, 75, 106, 73, 38, 73, 125, 74,
522
+ 100, 99, 98, 117, 97, 96, 95, 38, 126, 38,
523
+ 38, 38, 55, 121, 126, 123, 119, 90, 44, 75,
524
+ 74, 66, 65, 46, 46, 46, 46, 81, 81, 64,
525
+ 81, 81, 81, 63, 52, 81, 51, 81, 81, 45,
526
+ 44, 35, 33, 127, 127, 127, 127, 127, 127, 127,
527
+ 127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
528
+
529
+ 127, 127, 127, 127, 127, 127, 81, 81, 81, 81,
530
+ 85, 85, 127, 85, 85, 85, 127, 127, 85, 127,
531
+ 85, 85, 127, 127, 127, 127, 127, 127, 127, 127,
532
+ 127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
533
+ 127, 127, 127, 127, 127, 127, 127, 127, 127, 85,
534
+ 85, 85, 85, 34, 34, 34, 36, 36, 127, 36,
535
+ 36, 40, 127, 40, 127, 40, 40, 43, 127, 43,
536
+ 43, 43, 43, 43, 43, 43, 46, 46, 46, 46,
537
+ 46, 46, 46, 53, 53, 53, 53, 53, 53, 53,
538
+ 53, 53, 70, 70, 70, 70, 70, 70, 70, 70,
539
+
540
+ 70, 76, 76, 77, 77, 79, 79, 81, 81, 81,
541
+ 127, 81, 81, 85, 85, 85, 127, 85, 85, 101,
542
+ 101, 101, 101, 101, 101, 101, 101, 101, 112, 112,
543
+ 112, 112, 112, 112, 112, 112, 112, 5, 127, 127,
544
+ 127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
545
+ 127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
546
+ 127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
547
+ 127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
548
+ 127
549
+ } ;
550
+
551
+ static yyconst flex_int16_t yy_chk[482] =
552
+ { 0,
553
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
554
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
555
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
556
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
557
+ 1, 1, 1, 2, 12, 13, 16, 16, 16, 122,
558
+ 2, 54, 54, 54, 12, 13, 120, 16, 54, 118,
559
+ 12, 2, 3, 3, 3, 3, 3, 3, 3, 3,
560
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
561
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
562
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
563
+
564
+ 3, 3, 3, 3, 3, 19, 19, 19, 20, 21,
565
+ 34, 27, 28, 28, 36, 37, 67, 19, 27, 19,
566
+ 40, 34, 115, 67, 20, 21, 39, 68, 68, 27,
567
+ 41, 44, 44, 44, 67, 36, 37, 28, 38, 38,
568
+ 40, 38, 38, 38, 38, 108, 38, 39, 38, 38,
569
+ 41, 46, 48, 46, 48, 39, 85, 44, 70, 70,
570
+ 94, 94, 46, 48, 106, 72, 72, 73, 73, 73,
571
+ 87, 87, 87, 81, 83, 89, 85, 38, 38, 38,
572
+ 38, 42, 42, 70, 42, 42, 42, 100, 42, 42,
573
+ 72, 42, 42, 73, 81, 83, 87, 96, 83, 93,
574
+
575
+ 89, 92, 92, 92, 101, 101, 102, 102, 92, 103,
576
+ 103, 103, 105, 105, 79, 110, 112, 112, 113, 113,
577
+ 42, 42, 42, 42, 50, 50, 117, 50, 119, 121,
578
+ 123, 76, 124, 75, 74, 103, 110, 105, 125, 69,
579
+ 66, 65, 61, 110, 59, 58, 57, 117, 124, 119,
580
+ 121, 123, 56, 119, 125, 121, 117, 45, 43, 30,
581
+ 29, 26, 25, 50, 50, 50, 50, 82, 82, 24,
582
+ 82, 82, 82, 22, 18, 82, 17, 82, 82, 15,
583
+ 14, 11, 9, 5, 0, 0, 0, 0, 0, 0,
584
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
585
+
586
+ 0, 0, 0, 0, 0, 0, 82, 82, 82, 82,
587
+ 86, 86, 0, 86, 86, 86, 0, 0, 86, 0,
588
+ 86, 86, 0, 0, 0, 0, 0, 0, 0, 0,
589
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
590
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 86,
591
+ 86, 86, 86, 128, 128, 128, 129, 129, 0, 129,
592
+ 129, 130, 0, 130, 0, 130, 130, 131, 0, 131,
593
+ 131, 131, 131, 131, 131, 131, 132, 132, 132, 132,
594
+ 132, 132, 132, 133, 133, 133, 133, 133, 133, 133,
595
+ 133, 133, 134, 134, 134, 134, 134, 134, 134, 134,
596
+
597
+ 134, 135, 135, 136, 136, 137, 137, 138, 138, 138,
598
+ 0, 138, 138, 139, 139, 139, 0, 139, 139, 140,
599
+ 140, 140, 140, 140, 140, 140, 140, 140, 141, 141,
600
+ 141, 141, 141, 141, 141, 141, 141, 127, 127, 127,
601
+ 127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
602
+ 127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
603
+ 127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
604
+ 127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
605
+ 127
606
+ } ;
607
+
608
+ /* Table of booleans, true if rule could match eol. */
609
+ static yyconst flex_int32_t yy_rule_can_match_eol[39] =
610
+ { 0,
611
+ 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
612
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, };
613
+
614
+ static yy_state_type yy_last_accepting_state;
615
+ static char *yy_last_accepting_cpos;
616
+
617
+ extern int yy_flex_debug;
618
+ int yy_flex_debug = 0;
619
+
620
+ /* The intent behind this definition is that it'll catch
621
+ * any uses of REJECT which flex missed.
622
+ */
623
+ #define REJECT reject_used_but_not_detected
624
+ #define yymore() yymore_used_but_not_detected
625
+ #define YY_MORE_ADJ 0
626
+ #define YY_RESTORE_YY_MORE_OFFSET
627
+ char *yytext;
628
+ #line 1 "utf8-scanner.ll"
629
+ /* the "incl" state is used to pick up the name of an include file */
630
+
631
+ #line 7 "utf8-scanner.ll"
632
+ /*******************************************************************/
633
+ /* */
634
+ /* FILE scanner.ll */
635
+ /* MODULE scanner */
636
+ /* PROGRAM SFST */
637
+ /* AUTHOR Helmut Schmid, IMS, University of Stuttgart */
638
+ /* */
639
+ /*******************************************************************/
640
+
641
+ #include <string.h>
642
+
643
+ #include "interface.h"
644
+ #include "fst-compiler.h"
645
+
646
+ #define MAX_INCLUDE_DEPTH 10
647
+
648
+ int Include_Stack_Ptr = 0;
649
+ YY_BUFFER_STATE Include_Stack[MAX_INCLUDE_DEPTH];
650
+ char *Name_Stack[MAX_INCLUDE_DEPTH];
651
+ int Lineno_Stack[MAX_INCLUDE_DEPTH];
652
+
653
+ char *FileName;
654
+
655
+ bool UTF8=true;
656
+
657
+ static char *unquote(char *string, bool del_quote=true) {
658
+ char *s=string, *result=string;
659
+ if (del_quote)
660
+ string++;
661
+
662
+ while (*string) {
663
+ if (*string == '\\')
664
+ string++;
665
+ *(s++) = *(string++);
666
+ }
667
+
668
+ if (del_quote)
669
+ s--;
670
+ *s = '\0';
671
+
672
+ return fst_strdup(result);
673
+ }
674
+
675
+ static void print_lineno() {
676
+ if (!Verbose)
677
+ return;
678
+ fputc('\r',stderr);
679
+ for( int i=0; i<Include_Stack_Ptr; i++ )
680
+ fputs(" ", stderr);
681
+ fprintf(stderr,"%s: %d", FileName, yylineno);
682
+ }
683
+
684
+ extern void yyerror(char *text);
685
+
686
+ #line 687 "utf8-scanner.C"
687
+
688
+ #define INITIAL 0
689
+ #define incl 1
690
+
691
+ #ifndef YY_NO_UNISTD_H
692
+ /* Special case for "unistd.h", since it is non-ANSI. We include it way
693
+ * down here because we want the user's section 1 to have been scanned first.
694
+ * The user has a chance to override it with an option.
695
+ */
696
+ #include <unistd.h>
697
+ #endif
698
+
699
+ #ifndef YY_EXTRA_TYPE
700
+ #define YY_EXTRA_TYPE void *
701
+ #endif
702
+
703
+ static int yy_init_globals (void );
704
+
705
+ /* Macros after this point can all be overridden by user definitions in
706
+ * section 1.
707
+ */
708
+
709
+ #ifndef YY_SKIP_YYWRAP
710
+ #ifdef __cplusplus
711
+ extern "C" int yywrap (void );
712
+ #else
713
+ extern int yywrap (void );
714
+ #endif
715
+ #endif
716
+
717
+ static void yyunput (int c,char *buf_ptr );
718
+
719
+ #ifndef yytext_ptr
720
+ static void yy_flex_strncpy (char *,yyconst char *,int );
721
+ #endif
722
+
723
+ #ifdef YY_NEED_STRLEN
724
+ static int yy_flex_strlen (yyconst char * );
725
+ #endif
726
+
727
+ #ifndef YY_NO_INPUT
728
+
729
+ #ifdef __cplusplus
730
+ static int yyinput (void );
731
+ #else
732
+ static int input (void );
733
+ #endif
734
+
735
+ #endif
736
+
737
+ /* Amount of stuff to slurp up with each read. */
738
+ #ifndef YY_READ_BUF_SIZE
739
+ #define YY_READ_BUF_SIZE 8192
740
+ #endif
741
+
742
+ /* Copy whatever the last rule matched to the standard output. */
743
+ #ifndef ECHO
744
+ /* This used to be an fputs(), but since the string might contain NUL's,
745
+ * we now use fwrite().
746
+ */
747
+ #define ECHO fwrite( yytext, yyleng, 1, yyout )
748
+ #endif
749
+
750
+ /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
751
+ * is returned in "result".
752
+ */
753
+ #ifndef YY_INPUT
754
+ #define YY_INPUT(buf,result,max_size) \
755
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
756
+ { \
757
+ int c = '*'; \
758
+ int n; \
759
+ for ( n = 0; n < max_size && \
760
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
761
+ buf[n] = (char) c; \
762
+ if ( c == '\n' ) \
763
+ buf[n++] = (char) c; \
764
+ if ( c == EOF && ferror( yyin ) ) \
765
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
766
+ result = n; \
767
+ } \
768
+ else \
769
+ { \
770
+ errno=0; \
771
+ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
772
+ { \
773
+ if( errno != EINTR) \
774
+ { \
775
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
776
+ break; \
777
+ } \
778
+ errno=0; \
779
+ clearerr(yyin); \
780
+ } \
781
+ }\
782
+ \
783
+
784
+ #endif
785
+
786
+ /* No semi-colon after return; correct usage is to write "yyterminate();" -
787
+ * we don't want an extra ';' after the "return" because that will cause
788
+ * some compilers to complain about unreachable statements.
789
+ */
790
+ #ifndef yyterminate
791
+ #define yyterminate() return YY_NULL
792
+ #endif
793
+
794
+ /* Number of entries by which start-condition stack grows. */
795
+ #ifndef YY_START_STACK_INCR
796
+ #define YY_START_STACK_INCR 25
797
+ #endif
798
+
799
+ /* Report a fatal error. */
800
+ #ifndef YY_FATAL_ERROR
801
+ #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
802
+ #endif
803
+
804
+ /* end tables serialization structures and prototypes */
805
+
806
+ /* Default declaration of generated scanner - a define so the user can
807
+ * easily add parameters.
808
+ */
809
+ #ifndef YY_DECL
810
+ #define YY_DECL_IS_OURS 1
811
+
812
+ extern int yylex (void);
813
+
814
+ #define YY_DECL int yylex (void)
815
+ #endif /* !YY_DECL */
816
+
817
+ /* Code executed at the beginning of each rule, after yytext and yyleng
818
+ * have been set up.
819
+ */
820
+ #ifndef YY_USER_ACTION
821
+ #define YY_USER_ACTION
822
+ #endif
823
+
824
+ /* Code executed at the end of each rule. */
825
+ #ifndef YY_BREAK
826
+ #define YY_BREAK break;
827
+ #endif
828
+
829
+ #define YY_RULE_SETUP \
830
+ if ( yyleng > 0 ) \
831
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
832
+ (yytext[yyleng - 1] == '\n'); \
833
+ YY_USER_ACTION
834
+
835
+ /** The main scanner function which does all the work.
836
+ */
837
+ YY_DECL
838
+ {
839
+ register yy_state_type yy_current_state;
840
+ register char *yy_cp, *yy_bp;
841
+ register int yy_act;
842
+
843
+ #line 71 "utf8-scanner.ll"
844
+
845
+
846
+ #line 847 "utf8-scanner.C"
847
+
848
+ if ( !(yy_init) )
849
+ {
850
+ (yy_init) = 1;
851
+
852
+ #ifdef YY_USER_INIT
853
+ YY_USER_INIT;
854
+ #endif
855
+
856
+ if ( ! (yy_start) )
857
+ (yy_start) = 1; /* first start state */
858
+
859
+ if ( ! yyin )
860
+ yyin = stdin;
861
+
862
+ if ( ! yyout )
863
+ yyout = stdout;
864
+
865
+ if ( ! YY_CURRENT_BUFFER ) {
866
+ yyensure_buffer_stack ();
867
+ YY_CURRENT_BUFFER_LVALUE =
868
+ yy_create_buffer(yyin,YY_BUF_SIZE );
869
+ }
870
+
871
+ yy_load_buffer_state( );
872
+ }
873
+
874
+ while ( 1 ) /* loops until end-of-file is reached */
875
+ {
876
+ yy_cp = (yy_c_buf_p);
877
+
878
+ /* Support of yytext. */
879
+ *yy_cp = (yy_hold_char);
880
+
881
+ /* yy_bp points to the position in yy_ch_buf of the start of
882
+ * the current run.
883
+ */
884
+ yy_bp = yy_cp;
885
+
886
+ yy_current_state = (yy_start);
887
+ yy_current_state += YY_AT_BOL();
888
+ yy_match:
889
+ do
890
+ {
891
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
892
+ if ( yy_accept[yy_current_state] )
893
+ {
894
+ (yy_last_accepting_state) = yy_current_state;
895
+ (yy_last_accepting_cpos) = yy_cp;
896
+ }
897
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
898
+ {
899
+ yy_current_state = (int) yy_def[yy_current_state];
900
+ if ( yy_current_state >= 128 )
901
+ yy_c = yy_meta[(unsigned int) yy_c];
902
+ }
903
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
904
+ ++yy_cp;
905
+ }
906
+ while ( yy_current_state != 127 );
907
+ yy_cp = (yy_last_accepting_cpos);
908
+ yy_current_state = (yy_last_accepting_state);
909
+
910
+ yy_find_action:
911
+ yy_act = yy_accept[yy_current_state];
912
+
913
+ YY_DO_BEFORE_ACTION;
914
+
915
+ if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
916
+ {
917
+ int yyl;
918
+ for ( yyl = 0; yyl < yyleng; ++yyl )
919
+ if ( yytext[yyl] == '\n' )
920
+
921
+ yylineno++;
922
+ ;
923
+ }
924
+
925
+ do_action: /* This label is used only to access EOF actions. */
926
+
927
+ switch ( yy_act )
928
+ { /* beginning of action switch */
929
+ case 0: /* must back up */
930
+ /* undo the effects of YY_DO_BEFORE_ACTION */
931
+ *yy_cp = (yy_hold_char);
932
+ yy_cp = (yy_last_accepting_cpos);
933
+ yy_current_state = (yy_last_accepting_state);
934
+ goto yy_find_action;
935
+
936
+ case 1:
937
+ YY_RULE_SETUP
938
+ #line 73 "utf8-scanner.ll"
939
+ BEGIN(incl);
940
+ YY_BREAK
941
+ case 2:
942
+ YY_RULE_SETUP
943
+ #line 74 "utf8-scanner.ll"
944
+ /* eat the whitespace */
945
+ YY_BREAK
946
+ case 3:
947
+ YY_RULE_SETUP
948
+ #line 75 "utf8-scanner.ll"
949
+ { error2("Missing quotes",yytext); }
950
+ YY_BREAK
951
+ case 4:
952
+ YY_RULE_SETUP
953
+ #line 76 "utf8-scanner.ll"
954
+ { /* got the include file name */
955
+ FILE *file;
956
+ char *name=unquote(yytext);
957
+ if ( Include_Stack_Ptr >= MAX_INCLUDE_DEPTH )
958
+ {
959
+ fprintf( stderr, "Includes nested too deeply" );
960
+ exit( 1 );
961
+ }
962
+ if (Verbose) fputc('\n', stderr);
963
+ file = fopen( name, "rt" );
964
+ if (!file)
965
+ error2("Can't open include file",name);
966
+ else
967
+ {
968
+ Name_Stack[Include_Stack_Ptr] = FileName;
969
+ FileName = name;
970
+ Lineno_Stack[Include_Stack_Ptr] = yylineno;
971
+ yylineno = 1;
972
+ Include_Stack[Include_Stack_Ptr++]=YY_CURRENT_BUFFER;
973
+ yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE));
974
+ yyin = file;
975
+ print_lineno();
976
+ BEGIN(INITIAL);
977
+ }
978
+ }
979
+ YY_BREAK
980
+ case YY_STATE_EOF(INITIAL):
981
+ case YY_STATE_EOF(incl):
982
+ #line 102 "utf8-scanner.ll"
983
+ {
984
+ if (Verbose)
985
+ fputc('\n', stderr);
986
+ if ( --Include_Stack_Ptr < 0 )
987
+ yyterminate();
988
+ else
989
+ {
990
+ free(FileName);
991
+ FileName = Name_Stack[Include_Stack_Ptr];
992
+ yylineno = Lineno_Stack[Include_Stack_Ptr];
993
+ yy_delete_buffer(YY_CURRENT_BUFFER );
994
+ yy_switch_to_buffer(Include_Stack[Include_Stack_Ptr]);
995
+ }
996
+ }
997
+ YY_BREAK
998
+ case 5:
999
+ /* rule 5 can match eol */
1000
+ YY_RULE_SETUP
1001
+ #line 118 "utf8-scanner.ll"
1002
+ { print_lineno(); /* ignore comments */ }
1003
+ YY_BREAK
1004
+ case 6:
1005
+ /* rule 6 can match eol */
1006
+ YY_RULE_SETUP
1007
+ #line 120 "utf8-scanner.ll"
1008
+ { print_lineno(); /* ignore comments */ }
1009
+ YY_BREAK
1010
+ case 7:
1011
+ YY_RULE_SETUP
1012
+ #line 122 "utf8-scanner.ll"
1013
+ { /* ignore comments */ }
1014
+ YY_BREAK
1015
+ case 8:
1016
+ YY_RULE_SETUP
1017
+ #line 125 "utf8-scanner.ll"
1018
+ { return ALPHA; }
1019
+ YY_BREAK
1020
+ case 9:
1021
+ YY_RULE_SETUP
1022
+ #line 127 "utf8-scanner.ll"
1023
+ { return COMPOSE; }
1024
+ YY_BREAK
1025
+ case 10:
1026
+ YY_RULE_SETUP
1027
+ #line 128 "utf8-scanner.ll"
1028
+ { yylval.type = twol_both; return ARROW; }
1029
+ YY_BREAK
1030
+ case 11:
1031
+ YY_RULE_SETUP
1032
+ #line 129 "utf8-scanner.ll"
1033
+ { yylval.type = twol_right;return ARROW; }
1034
+ YY_BREAK
1035
+ case 12:
1036
+ YY_RULE_SETUP
1037
+ #line 130 "utf8-scanner.ll"
1038
+ { yylval.type = twol_left; return ARROW; }
1039
+ YY_BREAK
1040
+ case 13:
1041
+ YY_RULE_SETUP
1042
+ #line 131 "utf8-scanner.ll"
1043
+ { yylval.rtype = repl_up; return REPLACE; }
1044
+ YY_BREAK
1045
+ case 14:
1046
+ YY_RULE_SETUP
1047
+ #line 132 "utf8-scanner.ll"
1048
+ { yylval.rtype = repl_down; return REPLACE; }
1049
+ YY_BREAK
1050
+ case 15:
1051
+ YY_RULE_SETUP
1052
+ #line 133 "utf8-scanner.ll"
1053
+ { yylval.rtype = repl_right;return REPLACE; }
1054
+ YY_BREAK
1055
+ case 16:
1056
+ YY_RULE_SETUP
1057
+ #line 134 "utf8-scanner.ll"
1058
+ { yylval.rtype = repl_left; return REPLACE; }
1059
+ YY_BREAK
1060
+ case 17:
1061
+ YY_RULE_SETUP
1062
+ #line 135 "utf8-scanner.ll"
1063
+ { return PRINT; }
1064
+ YY_BREAK
1065
+ case 18:
1066
+ YY_RULE_SETUP
1067
+ #line 136 "utf8-scanner.ll"
1068
+ { return INSERT; }
1069
+ YY_BREAK
1070
+ case 19:
1071
+ YY_RULE_SETUP
1072
+ #line 137 "utf8-scanner.ll"
1073
+ { return POS; }
1074
+ YY_BREAK
1075
+ case 20:
1076
+ YY_RULE_SETUP
1077
+ #line 138 "utf8-scanner.ll"
1078
+ { return REV; }
1079
+ YY_BREAK
1080
+ case 21:
1081
+ YY_RULE_SETUP
1082
+ #line 140 "utf8-scanner.ll"
1083
+ { return yytext[0]; }
1084
+ YY_BREAK
1085
+ case 22:
1086
+ YY_RULE_SETUP
1087
+ #line 142 "utf8-scanner.ll"
1088
+ { yylval.name = fst_strdup(yytext); return RVAR; }
1089
+ YY_BREAK
1090
+ case 23:
1091
+ YY_RULE_SETUP
1092
+ #line 144 "utf8-scanner.ll"
1093
+ { yylval.name = fst_strdup(yytext); return VAR; }
1094
+ YY_BREAK
1095
+ case 24:
1096
+ YY_RULE_SETUP
1097
+ #line 146 "utf8-scanner.ll"
1098
+ { yylval.name = fst_strdup(yytext); return RSVAR; }
1099
+ YY_BREAK
1100
+ case 25:
1101
+ YY_RULE_SETUP
1102
+ #line 148 "utf8-scanner.ll"
1103
+ { yylval.name = fst_strdup(yytext); return SVAR; }
1104
+ YY_BREAK
1105
+ case 26:
1106
+ YY_RULE_SETUP
1107
+ #line 150 "utf8-scanner.ll"
1108
+ { yylval.name = unquote(yytext,false); return SYMBOL; }
1109
+ YY_BREAK
1110
+ case 27:
1111
+ YY_RULE_SETUP
1112
+ #line 152 "utf8-scanner.ll"
1113
+ {
1114
+ yylval.value = unquote(yytext)+1;
1115
+ yylval.value[strlen(yylval.value)-1] = 0;
1116
+ return STRING2;
1117
+ }
1118
+ YY_BREAK
1119
+ case 28:
1120
+ YY_RULE_SETUP
1121
+ #line 158 "utf8-scanner.ll"
1122
+ {
1123
+ yylval.value = unquote(yytext);
1124
+ return STRING;
1125
+ }
1126
+ YY_BREAK
1127
+ case 29:
1128
+ YY_RULE_SETUP
1129
+ #line 163 "utf8-scanner.ll"
1130
+ { /* ignored */ }
1131
+ YY_BREAK
1132
+ case 30:
1133
+ /* rule 30 can match eol */
1134
+ YY_RULE_SETUP
1135
+ #line 164 "utf8-scanner.ll"
1136
+ { print_lineno(); /* ignored */ }
1137
+ YY_BREAK
1138
+ case 31:
1139
+ /* rule 31 can match eol */
1140
+ YY_RULE_SETUP
1141
+ #line 165 "utf8-scanner.ll"
1142
+ { print_lineno(); return NEWLINE; }
1143
+ YY_BREAK
1144
+ case 32:
1145
+ YY_RULE_SETUP
1146
+ #line 167 "utf8-scanner.ll"
1147
+ { long l=atol(yytext+1);
1148
+ if (l <= 1114112) { yylval.uchar=l; return CHARACTER; }
1149
+ yyerror("invalid expression");
1150
+ }
1151
+ YY_BREAK
1152
+ case 33:
1153
+ YY_RULE_SETUP
1154
+ #line 173 "utf8-scanner.ll"
1155
+ { yylval.value=fst_strdup(yytext+1); return UTF8CHAR; }
1156
+ YY_BREAK
1157
+ case 34:
1158
+ /* rule 34 can match eol */
1159
+ YY_RULE_SETUP
1160
+ #line 174 "utf8-scanner.ll"
1161
+ { yylval.value=fst_strdup(yytext); return UTF8CHAR; }
1162
+ YY_BREAK
1163
+ case 35:
1164
+ YY_RULE_SETUP
1165
+ #line 175 "utf8-scanner.ll"
1166
+ { yylval.value=fst_strdup(yytext); return UTF8CHAR; }
1167
+ YY_BREAK
1168
+ case 36:
1169
+ YY_RULE_SETUP
1170
+ #line 176 "utf8-scanner.ll"
1171
+ { yylval.value=fst_strdup(yytext); return UTF8CHAR; }
1172
+ YY_BREAK
1173
+ case 37:
1174
+ YY_RULE_SETUP
1175
+ #line 177 "utf8-scanner.ll"
1176
+ { yylval.value=fst_strdup(yytext); return UTF8CHAR; }
1177
+ YY_BREAK
1178
+ case 38:
1179
+ YY_RULE_SETUP
1180
+ #line 179 "utf8-scanner.ll"
1181
+ ECHO;
1182
+ YY_BREAK
1183
+ #line 1184 "utf8-scanner.C"
1184
+
1185
+ case YY_END_OF_BUFFER:
1186
+ {
1187
+ /* Amount of text matched not including the EOB char. */
1188
+ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
1189
+
1190
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
1191
+ *yy_cp = (yy_hold_char);
1192
+ YY_RESTORE_YY_MORE_OFFSET
1193
+
1194
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
1195
+ {
1196
+ /* We're scanning a new file or input source. It's
1197
+ * possible that this happened because the user
1198
+ * just pointed yyin at a new source and called
1199
+ * yylex(). If so, then we have to assure
1200
+ * consistency between YY_CURRENT_BUFFER and our
1201
+ * globals. Here is the right place to do so, because
1202
+ * this is the first action (other than possibly a
1203
+ * back-up) that will match for the new input source.
1204
+ */
1205
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1206
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
1207
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
1208
+ }
1209
+
1210
+ /* Note that here we test for yy_c_buf_p "<=" to the position
1211
+ * of the first EOB in the buffer, since yy_c_buf_p will
1212
+ * already have been incremented past the NUL character
1213
+ * (since all states make transitions on EOB to the
1214
+ * end-of-buffer state). Contrast this with the test
1215
+ * in input().
1216
+ */
1217
+ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1218
+ { /* This was really a NUL. */
1219
+ yy_state_type yy_next_state;
1220
+
1221
+ (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
1222
+
1223
+ yy_current_state = yy_get_previous_state( );
1224
+
1225
+ /* Okay, we're now positioned to make the NUL
1226
+ * transition. We couldn't have
1227
+ * yy_get_previous_state() go ahead and do it
1228
+ * for us because it doesn't know how to deal
1229
+ * with the possibility of jamming (and we don't
1230
+ * want to build jamming into it because then it
1231
+ * will run more slowly).
1232
+ */
1233
+
1234
+ yy_next_state = yy_try_NUL_trans( yy_current_state );
1235
+
1236
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1237
+
1238
+ if ( yy_next_state )
1239
+ {
1240
+ /* Consume the NUL. */
1241
+ yy_cp = ++(yy_c_buf_p);
1242
+ yy_current_state = yy_next_state;
1243
+ goto yy_match;
1244
+ }
1245
+
1246
+ else
1247
+ {
1248
+ yy_cp = (yy_last_accepting_cpos);
1249
+ yy_current_state = (yy_last_accepting_state);
1250
+ goto yy_find_action;
1251
+ }
1252
+ }
1253
+
1254
+ else switch ( yy_get_next_buffer( ) )
1255
+ {
1256
+ case EOB_ACT_END_OF_FILE:
1257
+ {
1258
+ (yy_did_buffer_switch_on_eof) = 0;
1259
+
1260
+ if ( yywrap( ) )
1261
+ {
1262
+ /* Note: because we've taken care in
1263
+ * yy_get_next_buffer() to have set up
1264
+ * yytext, we can now set up
1265
+ * yy_c_buf_p so that if some total
1266
+ * hoser (like flex itself) wants to
1267
+ * call the scanner after we return the
1268
+ * YY_NULL, it'll still work - another
1269
+ * YY_NULL will get returned.
1270
+ */
1271
+ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
1272
+
1273
+ yy_act = YY_STATE_EOF(YY_START);
1274
+ goto do_action;
1275
+ }
1276
+
1277
+ else
1278
+ {
1279
+ if ( ! (yy_did_buffer_switch_on_eof) )
1280
+ YY_NEW_FILE;
1281
+ }
1282
+ break;
1283
+ }
1284
+
1285
+ case EOB_ACT_CONTINUE_SCAN:
1286
+ (yy_c_buf_p) =
1287
+ (yytext_ptr) + yy_amount_of_matched_text;
1288
+
1289
+ yy_current_state = yy_get_previous_state( );
1290
+
1291
+ yy_cp = (yy_c_buf_p);
1292
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1293
+ goto yy_match;
1294
+
1295
+ case EOB_ACT_LAST_MATCH:
1296
+ (yy_c_buf_p) =
1297
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
1298
+
1299
+ yy_current_state = yy_get_previous_state( );
1300
+
1301
+ yy_cp = (yy_c_buf_p);
1302
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
1303
+ goto yy_find_action;
1304
+ }
1305
+ break;
1306
+ }
1307
+
1308
+ default:
1309
+ YY_FATAL_ERROR(
1310
+ "fatal flex scanner internal error--no action found" );
1311
+ } /* end of action switch */
1312
+ } /* end of scanning one token */
1313
+ } /* end of yylex */
1314
+
1315
+ /* yy_get_next_buffer - try to read in a new buffer
1316
+ *
1317
+ * Returns a code representing an action:
1318
+ * EOB_ACT_LAST_MATCH -
1319
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1320
+ * EOB_ACT_END_OF_FILE - end of file
1321
+ */
1322
+ static int yy_get_next_buffer (void)
1323
+ {
1324
+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
1325
+ register char *source = (yytext_ptr);
1326
+ register int number_to_move, i;
1327
+ int ret_val;
1328
+
1329
+ if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
1330
+ YY_FATAL_ERROR(
1331
+ "fatal flex scanner internal error--end of buffer missed" );
1332
+
1333
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
1334
+ { /* Don't try to fill the buffer, so this is an EOF. */
1335
+ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
1336
+ {
1337
+ /* We matched a single character, the EOB, so
1338
+ * treat this as a final EOF.
1339
+ */
1340
+ return EOB_ACT_END_OF_FILE;
1341
+ }
1342
+
1343
+ else
1344
+ {
1345
+ /* We matched some text prior to the EOB, first
1346
+ * process it.
1347
+ */
1348
+ return EOB_ACT_LAST_MATCH;
1349
+ }
1350
+ }
1351
+
1352
+ /* Try to read more data. */
1353
+
1354
+ /* First move last chars to start of buffer. */
1355
+ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
1356
+
1357
+ for ( i = 0; i < number_to_move; ++i )
1358
+ *(dest++) = *(source++);
1359
+
1360
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1361
+ /* don't do the read, it's not guaranteed to return an EOF,
1362
+ * just force an EOF
1363
+ */
1364
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
1365
+
1366
+ else
1367
+ {
1368
+ int num_to_read =
1369
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
1370
+
1371
+ while ( num_to_read <= 0 )
1372
+ { /* Not enough room in the buffer - grow it. */
1373
+
1374
+ /* just a shorter name for the current buffer */
1375
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
1376
+
1377
+ int yy_c_buf_p_offset =
1378
+ (int) ((yy_c_buf_p) - b->yy_ch_buf);
1379
+
1380
+ if ( b->yy_is_our_buffer )
1381
+ {
1382
+ int new_size = b->yy_buf_size * 2;
1383
+
1384
+ if ( new_size <= 0 )
1385
+ b->yy_buf_size += b->yy_buf_size / 8;
1386
+ else
1387
+ b->yy_buf_size *= 2;
1388
+
1389
+ b->yy_ch_buf = (char *)
1390
+ /* Include room in for 2 EOB chars. */
1391
+ yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
1392
+ }
1393
+ else
1394
+ /* Can't grow it, we don't own it. */
1395
+ b->yy_ch_buf = 0;
1396
+
1397
+ if ( ! b->yy_ch_buf )
1398
+ YY_FATAL_ERROR(
1399
+ "fatal error - scanner input buffer overflow" );
1400
+
1401
+ (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
1402
+
1403
+ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
1404
+ number_to_move - 1;
1405
+
1406
+ }
1407
+
1408
+ if ( num_to_read > YY_READ_BUF_SIZE )
1409
+ num_to_read = YY_READ_BUF_SIZE;
1410
+
1411
+ /* Read in more data. */
1412
+ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
1413
+ (yy_n_chars), (size_t) num_to_read );
1414
+
1415
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1416
+ }
1417
+
1418
+ if ( (yy_n_chars) == 0 )
1419
+ {
1420
+ if ( number_to_move == YY_MORE_ADJ )
1421
+ {
1422
+ ret_val = EOB_ACT_END_OF_FILE;
1423
+ yyrestart(yyin );
1424
+ }
1425
+
1426
+ else
1427
+ {
1428
+ ret_val = EOB_ACT_LAST_MATCH;
1429
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
1430
+ YY_BUFFER_EOF_PENDING;
1431
+ }
1432
+ }
1433
+
1434
+ else
1435
+ ret_val = EOB_ACT_CONTINUE_SCAN;
1436
+
1437
+ if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
1438
+ /* Extend the array by 50%, plus the number we really need. */
1439
+ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
1440
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size );
1441
+ if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1442
+ YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
1443
+ }
1444
+
1445
+ (yy_n_chars) += number_to_move;
1446
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
1447
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
1448
+
1449
+ (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
1450
+
1451
+ return ret_val;
1452
+ }
1453
+
1454
+ /* yy_get_previous_state - get the state just before the EOB char was reached */
1455
+
1456
+ static yy_state_type yy_get_previous_state (void)
1457
+ {
1458
+ register yy_state_type yy_current_state;
1459
+ register char *yy_cp;
1460
+
1461
+ yy_current_state = (yy_start);
1462
+ yy_current_state += YY_AT_BOL();
1463
+
1464
+ for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
1465
+ {
1466
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1467
+ if ( yy_accept[yy_current_state] )
1468
+ {
1469
+ (yy_last_accepting_state) = yy_current_state;
1470
+ (yy_last_accepting_cpos) = yy_cp;
1471
+ }
1472
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1473
+ {
1474
+ yy_current_state = (int) yy_def[yy_current_state];
1475
+ if ( yy_current_state >= 128 )
1476
+ yy_c = yy_meta[(unsigned int) yy_c];
1477
+ }
1478
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1479
+ }
1480
+
1481
+ return yy_current_state;
1482
+ }
1483
+
1484
+ /* yy_try_NUL_trans - try to make a transition on the NUL character
1485
+ *
1486
+ * synopsis
1487
+ * next_state = yy_try_NUL_trans( current_state );
1488
+ */
1489
+ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
1490
+ {
1491
+ register int yy_is_jam;
1492
+ register char *yy_cp = (yy_c_buf_p);
1493
+
1494
+ register YY_CHAR yy_c = 1;
1495
+ if ( yy_accept[yy_current_state] )
1496
+ {
1497
+ (yy_last_accepting_state) = yy_current_state;
1498
+ (yy_last_accepting_cpos) = yy_cp;
1499
+ }
1500
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1501
+ {
1502
+ yy_current_state = (int) yy_def[yy_current_state];
1503
+ if ( yy_current_state >= 128 )
1504
+ yy_c = yy_meta[(unsigned int) yy_c];
1505
+ }
1506
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1507
+ yy_is_jam = (yy_current_state == 127);
1508
+
1509
+ return yy_is_jam ? 0 : yy_current_state;
1510
+ }
1511
+
1512
+ static void yyunput (int c, register char * yy_bp )
1513
+ {
1514
+ register char *yy_cp;
1515
+
1516
+ yy_cp = (yy_c_buf_p);
1517
+
1518
+ /* undo effects of setting up yytext */
1519
+ *yy_cp = (yy_hold_char);
1520
+
1521
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1522
+ { /* need to shift things up to make room */
1523
+ /* +2 for EOB chars. */
1524
+ register int number_to_move = (yy_n_chars) + 2;
1525
+ register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
1526
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
1527
+ register char *source =
1528
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
1529
+
1530
+ while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
1531
+ *--dest = *--source;
1532
+
1533
+ yy_cp += (int) (dest - source);
1534
+ yy_bp += (int) (dest - source);
1535
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
1536
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
1537
+
1538
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
1539
+ YY_FATAL_ERROR( "flex scanner push-back overflow" );
1540
+ }
1541
+
1542
+ *--yy_cp = (char) c;
1543
+
1544
+ if ( c == '\n' ){
1545
+ --yylineno;
1546
+ }
1547
+
1548
+ (yytext_ptr) = yy_bp;
1549
+ (yy_hold_char) = *yy_cp;
1550
+ (yy_c_buf_p) = yy_cp;
1551
+ }
1552
+
1553
+ #ifndef YY_NO_INPUT
1554
+ #ifdef __cplusplus
1555
+ static int yyinput (void)
1556
+ #else
1557
+ static int input (void)
1558
+ #endif
1559
+
1560
+ {
1561
+ int c;
1562
+
1563
+ *(yy_c_buf_p) = (yy_hold_char);
1564
+
1565
+ if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
1566
+ {
1567
+ /* yy_c_buf_p now points to the character we want to return.
1568
+ * If this occurs *before* the EOB characters, then it's a
1569
+ * valid NUL; if not, then we've hit the end of the buffer.
1570
+ */
1571
+ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
1572
+ /* This was really a NUL. */
1573
+ *(yy_c_buf_p) = '\0';
1574
+
1575
+ else
1576
+ { /* need more input */
1577
+ int offset = (yy_c_buf_p) - (yytext_ptr);
1578
+ ++(yy_c_buf_p);
1579
+
1580
+ switch ( yy_get_next_buffer( ) )
1581
+ {
1582
+ case EOB_ACT_LAST_MATCH:
1583
+ /* This happens because yy_g_n_b()
1584
+ * sees that we've accumulated a
1585
+ * token and flags that we need to
1586
+ * try matching the token before
1587
+ * proceeding. But for input(),
1588
+ * there's no matching to consider.
1589
+ * So convert the EOB_ACT_LAST_MATCH
1590
+ * to EOB_ACT_END_OF_FILE.
1591
+ */
1592
+
1593
+ /* Reset buffer status. */
1594
+ yyrestart(yyin );
1595
+
1596
+ /*FALLTHROUGH*/
1597
+
1598
+ case EOB_ACT_END_OF_FILE:
1599
+ {
1600
+ if ( yywrap( ) )
1601
+ return EOF;
1602
+
1603
+ if ( ! (yy_did_buffer_switch_on_eof) )
1604
+ YY_NEW_FILE;
1605
+ #ifdef __cplusplus
1606
+ return yyinput();
1607
+ #else
1608
+ return input();
1609
+ #endif
1610
+ }
1611
+
1612
+ case EOB_ACT_CONTINUE_SCAN:
1613
+ (yy_c_buf_p) = (yytext_ptr) + offset;
1614
+ break;
1615
+ }
1616
+ }
1617
+ }
1618
+
1619
+ c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
1620
+ *(yy_c_buf_p) = '\0'; /* preserve yytext */
1621
+ (yy_hold_char) = *++(yy_c_buf_p);
1622
+
1623
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
1624
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol )
1625
+
1626
+ yylineno++;
1627
+ ;
1628
+
1629
+ return c;
1630
+ }
1631
+ #endif /* ifndef YY_NO_INPUT */
1632
+
1633
+ /** Immediately switch to a different input stream.
1634
+ * @param input_file A readable stream.
1635
+ *
1636
+ * @note This function does not reset the start condition to @c INITIAL .
1637
+ */
1638
+ void yyrestart (FILE * input_file )
1639
+ {
1640
+
1641
+ if ( ! YY_CURRENT_BUFFER ){
1642
+ yyensure_buffer_stack ();
1643
+ YY_CURRENT_BUFFER_LVALUE =
1644
+ yy_create_buffer(yyin,YY_BUF_SIZE );
1645
+ }
1646
+
1647
+ yy_init_buffer(YY_CURRENT_BUFFER,input_file );
1648
+ yy_load_buffer_state( );
1649
+ }
1650
+
1651
+ /** Switch to a different input buffer.
1652
+ * @param new_buffer The new input buffer.
1653
+ *
1654
+ */
1655
+ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
1656
+ {
1657
+
1658
+ /* TODO. We should be able to replace this entire function body
1659
+ * with
1660
+ * yypop_buffer_state();
1661
+ * yypush_buffer_state(new_buffer);
1662
+ */
1663
+ yyensure_buffer_stack ();
1664
+ if ( YY_CURRENT_BUFFER == new_buffer )
1665
+ return;
1666
+
1667
+ if ( YY_CURRENT_BUFFER )
1668
+ {
1669
+ /* Flush out information for old buffer. */
1670
+ *(yy_c_buf_p) = (yy_hold_char);
1671
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1672
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1673
+ }
1674
+
1675
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
1676
+ yy_load_buffer_state( );
1677
+
1678
+ /* We don't actually know whether we did this switch during
1679
+ * EOF (yywrap()) processing, but the only time this flag
1680
+ * is looked at is after yywrap() is called, so it's safe
1681
+ * to go ahead and always set it.
1682
+ */
1683
+ (yy_did_buffer_switch_on_eof) = 1;
1684
+ }
1685
+
1686
+ static void yy_load_buffer_state (void)
1687
+ {
1688
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
1689
+ (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
1690
+ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
1691
+ (yy_hold_char) = *(yy_c_buf_p);
1692
+ }
1693
+
1694
+ /** Allocate and initialize an input buffer state.
1695
+ * @param file A readable stream.
1696
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
1697
+ *
1698
+ * @return the allocated buffer state.
1699
+ */
1700
+ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
1701
+ {
1702
+ YY_BUFFER_STATE b;
1703
+
1704
+ b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1705
+ if ( ! b )
1706
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1707
+
1708
+ b->yy_buf_size = size;
1709
+
1710
+ /* yy_ch_buf has to be 2 characters longer than the size given because
1711
+ * we need to put in 2 end-of-buffer characters.
1712
+ */
1713
+ b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
1714
+ if ( ! b->yy_ch_buf )
1715
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1716
+
1717
+ b->yy_is_our_buffer = 1;
1718
+
1719
+ yy_init_buffer(b,file );
1720
+
1721
+ return b;
1722
+ }
1723
+
1724
+ /** Destroy the buffer.
1725
+ * @param b a buffer created with yy_create_buffer()
1726
+ *
1727
+ */
1728
+ void yy_delete_buffer (YY_BUFFER_STATE b )
1729
+ {
1730
+
1731
+ if ( ! b )
1732
+ return;
1733
+
1734
+ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
1735
+ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
1736
+
1737
+ if ( b->yy_is_our_buffer )
1738
+ yyfree((void *) b->yy_ch_buf );
1739
+
1740
+ yyfree((void *) b );
1741
+ }
1742
+
1743
+ #ifndef __cplusplus
1744
+ extern int isatty (int );
1745
+ #endif /* __cplusplus */
1746
+
1747
+ /* Initializes or reinitializes a buffer.
1748
+ * This function is sometimes called more than once on the same buffer,
1749
+ * such as during a yyrestart() or at EOF.
1750
+ */
1751
+ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
1752
+
1753
+ {
1754
+ int oerrno = errno;
1755
+
1756
+ yy_flush_buffer(b );
1757
+
1758
+ b->yy_input_file = file;
1759
+ b->yy_fill_buffer = 1;
1760
+
1761
+ /* If b is the current buffer, then yy_init_buffer was _probably_
1762
+ * called from yyrestart() or through yy_get_next_buffer.
1763
+ * In that case, we don't want to reset the lineno or column.
1764
+ */
1765
+ if (b != YY_CURRENT_BUFFER){
1766
+ b->yy_bs_lineno = 1;
1767
+ b->yy_bs_column = 0;
1768
+ }
1769
+
1770
+ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1771
+
1772
+ errno = oerrno;
1773
+ }
1774
+
1775
+ /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
1776
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
1777
+ *
1778
+ */
1779
+ void yy_flush_buffer (YY_BUFFER_STATE b )
1780
+ {
1781
+ if ( ! b )
1782
+ return;
1783
+
1784
+ b->yy_n_chars = 0;
1785
+
1786
+ /* We always need two end-of-buffer characters. The first causes
1787
+ * a transition to the end-of-buffer state. The second causes
1788
+ * a jam in that state.
1789
+ */
1790
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1791
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1792
+
1793
+ b->yy_buf_pos = &b->yy_ch_buf[0];
1794
+
1795
+ b->yy_at_bol = 1;
1796
+ b->yy_buffer_status = YY_BUFFER_NEW;
1797
+
1798
+ if ( b == YY_CURRENT_BUFFER )
1799
+ yy_load_buffer_state( );
1800
+ }
1801
+
1802
+ /** Pushes the new state onto the stack. The new state becomes
1803
+ * the current state. This function will allocate the stack
1804
+ * if necessary.
1805
+ * @param new_buffer The new state.
1806
+ *
1807
+ */
1808
+ void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
1809
+ {
1810
+ if (new_buffer == NULL)
1811
+ return;
1812
+
1813
+ yyensure_buffer_stack();
1814
+
1815
+ /* This block is copied from yy_switch_to_buffer. */
1816
+ if ( YY_CURRENT_BUFFER )
1817
+ {
1818
+ /* Flush out information for old buffer. */
1819
+ *(yy_c_buf_p) = (yy_hold_char);
1820
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
1821
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
1822
+ }
1823
+
1824
+ /* Only push if top exists. Otherwise, replace top. */
1825
+ if (YY_CURRENT_BUFFER)
1826
+ (yy_buffer_stack_top)++;
1827
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
1828
+
1829
+ /* copied from yy_switch_to_buffer. */
1830
+ yy_load_buffer_state( );
1831
+ (yy_did_buffer_switch_on_eof) = 1;
1832
+ }
1833
+
1834
+ /** Removes and deletes the top of the stack, if present.
1835
+ * The next element becomes the new top.
1836
+ *
1837
+ */
1838
+ void yypop_buffer_state (void)
1839
+ {
1840
+ if (!YY_CURRENT_BUFFER)
1841
+ return;
1842
+
1843
+ yy_delete_buffer(YY_CURRENT_BUFFER );
1844
+ YY_CURRENT_BUFFER_LVALUE = NULL;
1845
+ if ((yy_buffer_stack_top) > 0)
1846
+ --(yy_buffer_stack_top);
1847
+
1848
+ if (YY_CURRENT_BUFFER) {
1849
+ yy_load_buffer_state( );
1850
+ (yy_did_buffer_switch_on_eof) = 1;
1851
+ }
1852
+ }
1853
+
1854
+ /* Allocates the stack if it does not exist.
1855
+ * Guarantees space for at least one push.
1856
+ */
1857
+ static void yyensure_buffer_stack (void)
1858
+ {
1859
+ int num_to_alloc;
1860
+
1861
+ if (!(yy_buffer_stack)) {
1862
+
1863
+ /* First allocation is just for 2 elements, since we don't know if this
1864
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
1865
+ * immediate realloc on the next call.
1866
+ */
1867
+ num_to_alloc = 1;
1868
+ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
1869
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
1870
+ );
1871
+ if ( ! (yy_buffer_stack) )
1872
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1873
+
1874
+ memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
1875
+
1876
+ (yy_buffer_stack_max) = num_to_alloc;
1877
+ (yy_buffer_stack_top) = 0;
1878
+ return;
1879
+ }
1880
+
1881
+ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
1882
+
1883
+ /* Increase the buffer to prepare for a possible push. */
1884
+ int grow_size = 8 /* arbitrary grow size */;
1885
+
1886
+ num_to_alloc = (yy_buffer_stack_max) + grow_size;
1887
+ (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
1888
+ ((yy_buffer_stack),
1889
+ num_to_alloc * sizeof(struct yy_buffer_state*)
1890
+ );
1891
+ if ( ! (yy_buffer_stack) )
1892
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
1893
+
1894
+ /* zero only the new slots.*/
1895
+ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
1896
+ (yy_buffer_stack_max) = num_to_alloc;
1897
+ }
1898
+ }
1899
+
1900
+ /** Setup the input buffer state to scan directly from a user-specified character buffer.
1901
+ * @param base the character buffer
1902
+ * @param size the size in bytes of the character buffer
1903
+ *
1904
+ * @return the newly allocated buffer state object.
1905
+ */
1906
+ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
1907
+ {
1908
+ YY_BUFFER_STATE b;
1909
+
1910
+ if ( size < 2 ||
1911
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
1912
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
1913
+ /* They forgot to leave room for the EOB's. */
1914
+ return 0;
1915
+
1916
+ b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
1917
+ if ( ! b )
1918
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1919
+
1920
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1921
+ b->yy_buf_pos = b->yy_ch_buf = base;
1922
+ b->yy_is_our_buffer = 0;
1923
+ b->yy_input_file = 0;
1924
+ b->yy_n_chars = b->yy_buf_size;
1925
+ b->yy_is_interactive = 0;
1926
+ b->yy_at_bol = 1;
1927
+ b->yy_fill_buffer = 0;
1928
+ b->yy_buffer_status = YY_BUFFER_NEW;
1929
+
1930
+ yy_switch_to_buffer(b );
1931
+
1932
+ return b;
1933
+ }
1934
+
1935
+ /** Setup the input buffer state to scan a string. The next call to yylex() will
1936
+ * scan from a @e copy of @a str.
1937
+ * @param yystr a NUL-terminated string to scan
1938
+ *
1939
+ * @return the newly allocated buffer state object.
1940
+ * @note If you want to scan bytes that may contain NUL values, then use
1941
+ * yy_scan_bytes() instead.
1942
+ */
1943
+ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
1944
+ {
1945
+
1946
+ return yy_scan_bytes(yystr,strlen(yystr) );
1947
+ }
1948
+
1949
+ /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
1950
+ * scan from a @e copy of @a bytes.
1951
+ * @param bytes the byte buffer to scan
1952
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
1953
+ *
1954
+ * @return the newly allocated buffer state object.
1955
+ */
1956
+ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
1957
+ {
1958
+ YY_BUFFER_STATE b;
1959
+ char *buf;
1960
+ yy_size_t n;
1961
+ int i;
1962
+
1963
+ /* Get memory for full buffer, including space for trailing EOB's. */
1964
+ n = _yybytes_len + 2;
1965
+ buf = (char *) yyalloc(n );
1966
+ if ( ! buf )
1967
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1968
+
1969
+ for ( i = 0; i < _yybytes_len; ++i )
1970
+ buf[i] = yybytes[i];
1971
+
1972
+ buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
1973
+
1974
+ b = yy_scan_buffer(buf,n );
1975
+ if ( ! b )
1976
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1977
+
1978
+ /* It's okay to grow etc. this buffer, and we should throw it
1979
+ * away when we're done.
1980
+ */
1981
+ b->yy_is_our_buffer = 1;
1982
+
1983
+ return b;
1984
+ }
1985
+
1986
+ #ifndef YY_EXIT_FAILURE
1987
+ #define YY_EXIT_FAILURE 2
1988
+ #endif
1989
+
1990
+ static void yy_fatal_error (yyconst char* msg )
1991
+ {
1992
+ (void) fprintf( stderr, "%s\n", msg );
1993
+ exit( YY_EXIT_FAILURE );
1994
+ }
1995
+
1996
+ /* Redefine yyless() so it works in section 3 code. */
1997
+
1998
+ #undef yyless
1999
+ #define yyless(n) \
2000
+ do \
2001
+ { \
2002
+ /* Undo effects of setting up yytext. */ \
2003
+ int yyless_macro_arg = (n); \
2004
+ YY_LESS_LINENO(yyless_macro_arg);\
2005
+ yytext[yyleng] = (yy_hold_char); \
2006
+ (yy_c_buf_p) = yytext + yyless_macro_arg; \
2007
+ (yy_hold_char) = *(yy_c_buf_p); \
2008
+ *(yy_c_buf_p) = '\0'; \
2009
+ yyleng = yyless_macro_arg; \
2010
+ } \
2011
+ while ( 0 )
2012
+
2013
+ /* Accessor methods (get/set functions) to struct members. */
2014
+
2015
+ /** Get the current line number.
2016
+ *
2017
+ */
2018
+ int yyget_lineno (void)
2019
+ {
2020
+
2021
+ return yylineno;
2022
+ }
2023
+
2024
+ /** Get the input stream.
2025
+ *
2026
+ */
2027
+ FILE *yyget_in (void)
2028
+ {
2029
+ return yyin;
2030
+ }
2031
+
2032
+ /** Get the output stream.
2033
+ *
2034
+ */
2035
+ FILE *yyget_out (void)
2036
+ {
2037
+ return yyout;
2038
+ }
2039
+
2040
+ /** Get the length of the current token.
2041
+ *
2042
+ */
2043
+ int yyget_leng (void)
2044
+ {
2045
+ return yyleng;
2046
+ }
2047
+
2048
+ /** Get the current token.
2049
+ *
2050
+ */
2051
+
2052
+ char *yyget_text (void)
2053
+ {
2054
+ return yytext;
2055
+ }
2056
+
2057
+ /** Set the current line number.
2058
+ * @param line_number
2059
+ *
2060
+ */
2061
+ void yyset_lineno (int line_number )
2062
+ {
2063
+
2064
+ yylineno = line_number;
2065
+ }
2066
+
2067
+ /** Set the input stream. This does not discard the current
2068
+ * input buffer.
2069
+ * @param in_str A readable stream.
2070
+ *
2071
+ * @see yy_switch_to_buffer
2072
+ */
2073
+ void yyset_in (FILE * in_str )
2074
+ {
2075
+ yyin = in_str ;
2076
+ }
2077
+
2078
+ void yyset_out (FILE * out_str )
2079
+ {
2080
+ yyout = out_str ;
2081
+ }
2082
+
2083
+ int yyget_debug (void)
2084
+ {
2085
+ return yy_flex_debug;
2086
+ }
2087
+
2088
+ void yyset_debug (int bdebug )
2089
+ {
2090
+ yy_flex_debug = bdebug ;
2091
+ }
2092
+
2093
+ static int yy_init_globals (void)
2094
+ {
2095
+ /* Initialization is the same as for the non-reentrant scanner.
2096
+ * This function is called from yylex_destroy(), so don't allocate here.
2097
+ */
2098
+
2099
+ /* We do not touch yylineno unless the option is enabled. */
2100
+ yylineno = 1;
2101
+
2102
+ (yy_buffer_stack) = 0;
2103
+ (yy_buffer_stack_top) = 0;
2104
+ (yy_buffer_stack_max) = 0;
2105
+ (yy_c_buf_p) = (char *) 0;
2106
+ (yy_init) = 0;
2107
+ (yy_start) = 0;
2108
+
2109
+ /* Defined in main.c */
2110
+ #ifdef YY_STDINIT
2111
+ yyin = stdin;
2112
+ yyout = stdout;
2113
+ #else
2114
+ yyin = (FILE *) 0;
2115
+ yyout = (FILE *) 0;
2116
+ #endif
2117
+
2118
+ /* For future reference: Set errno on error, since we are called by
2119
+ * yylex_init()
2120
+ */
2121
+ return 0;
2122
+ }
2123
+
2124
+ /* yylex_destroy is for both reentrant and non-reentrant scanners. */
2125
+ int yylex_destroy (void)
2126
+ {
2127
+
2128
+ /* Pop the buffer stack, destroying each element. */
2129
+ while(YY_CURRENT_BUFFER){
2130
+ yy_delete_buffer(YY_CURRENT_BUFFER );
2131
+ YY_CURRENT_BUFFER_LVALUE = NULL;
2132
+ yypop_buffer_state();
2133
+ }
2134
+
2135
+ /* Destroy the stack itself. */
2136
+ yyfree((yy_buffer_stack) );
2137
+ (yy_buffer_stack) = NULL;
2138
+
2139
+ /* Reset the globals. This is important in a non-reentrant scanner so the next time
2140
+ * yylex() is called, initialization will occur. */
2141
+ yy_init_globals( );
2142
+
2143
+ return 0;
2144
+ }
2145
+
2146
+ /*
2147
+ * Internal utility routines.
2148
+ */
2149
+
2150
+ #ifndef yytext_ptr
2151
+ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
2152
+ {
2153
+ register int i;
2154
+ for ( i = 0; i < n; ++i )
2155
+ s1[i] = s2[i];
2156
+ }
2157
+ #endif
2158
+
2159
+ #ifdef YY_NEED_STRLEN
2160
+ static int yy_flex_strlen (yyconst char * s )
2161
+ {
2162
+ register int n;
2163
+ for ( n = 0; s[n]; ++n )
2164
+ ;
2165
+
2166
+ return n;
2167
+ }
2168
+ #endif
2169
+
2170
+ void *yyalloc (yy_size_t size )
2171
+ {
2172
+ return (void *) malloc( size );
2173
+ }
2174
+
2175
+ void *yyrealloc (void * ptr, yy_size_t size )
2176
+ {
2177
+ /* The cast to (char *) in the following accommodates both
2178
+ * implementations that use char* generic pointers, and those
2179
+ * that use void* generic pointers. It works with the latter
2180
+ * because both ANSI C and C++ allow castless assignment from
2181
+ * any pointer type to void*, and deal with argument conversions
2182
+ * as though doing an assignment.
2183
+ */
2184
+ return (void *) realloc( (char *) ptr, size );
2185
+ }
2186
+
2187
+ void yyfree (void * ptr )
2188
+ {
2189
+ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
2190
+ }
2191
+
2192
+ #define YYTABLES_NAME "yytables"
2193
+
2194
+ #line 179 "utf8-scanner.ll"
2195
+
2196
+
2197
+