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