ruby-sfst 0.4.1 → 0.4.2

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