Debian Codegraph @

CodeLite/PhpLexer.cpp

raw
1
2 #line 3 "PhpLexer.cpp"
3
4 #define YY_INT_ALIGNED short int
5
6 /* A lexical scanner generated by flex */
7
8 #define FLEX_SCANNER
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 5
11 #define YY_FLEX_SUBMINOR_VERSION 35
12 #if YY_FLEX_SUBMINOR_VERSION > 0
13 #define FLEX_BETA
14 #endif
15
16 /* First, we deal with platform-specific or compiler-specific issues. */
17
18 /* begin standard C headers. */
19 #include <stdio.h>
20 #include <string.h>
21 #include <errno.h>
22 #include <stdlib.h>
23
24 /* end standard C headers. */
25
26 /* flex integer type definitions */
27
28 #ifndef FLEXINT_H
29 #define FLEXINT_H
30
31 /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
32
33 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
34
35 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
36 * if you want the limit (max/min) macros for int types.
37 */
38 #ifndef __STDC_LIMIT_MACROS
39 #define __STDC_LIMIT_MACROS 1
40 #endif
41
42 #include <inttypes.h>
43 typedef int8_t flex_int8_t;
44 typedef uint8_t flex_uint8_t;
45 typedef int16_t flex_int16_t;
46 typedef uint16_t flex_uint16_t;
47 typedef int32_t flex_int32_t;
48 typedef uint32_t flex_uint32_t;
49 #else
50 typedef signed char flex_int8_t;
51 typedef short int flex_int16_t;
52 typedef int flex_int32_t;
53 typedef unsigned char flex_uint8_t;
54 typedef unsigned short int flex_uint16_t;
55 typedef unsigned int flex_uint32_t;
56
57 /* Limits of integral types. */
58 #ifndef INT8_MIN
59 #define INT8_MIN (-128)
60 #endif
61 #ifndef INT16_MIN
62 #define INT16_MIN (-32767-1)
63 #endif
64 #ifndef INT32_MIN
65 #define INT32_MIN (-2147483647-1)
66 #endif
67 #ifndef INT8_MAX
68 #define INT8_MAX (127)
69 #endif
70 #ifndef INT16_MAX
71 #define INT16_MAX (32767)
72 #endif
73 #ifndef INT32_MAX
74 #define INT32_MAX (2147483647)
75 #endif
76 #ifndef UINT8_MAX
77 #define UINT8_MAX (255U)
78 #endif
79 #ifndef UINT16_MAX
80 #define UINT16_MAX (65535U)
81 #endif
82 #ifndef UINT32_MAX
83 #define UINT32_MAX (4294967295U)
84 #endif
85
86 #endif /* ! C99 */
87
88 #endif /* ! FLEXINT_H */
89
90 #ifdef __cplusplus
91
92 /* The "const" storage-class-modifier is valid. */
93 #define YY_USE_CONST
94
95 #else /* ! __cplusplus */
96
97 /* C99 requires __STDC__ to be defined as 1. */
98 #if defined (__STDC__)
99
100 #define YY_USE_CONST
101
102 #endif /* defined (__STDC__) */
103 #endif /* ! __cplusplus */
104
105 #ifdef YY_USE_CONST
106 #define yyconst const
107 #else
108 #define yyconst
109 #endif
110
111 /* Returned upon end-of-file. */
112 #define YY_NULL 0
113
114 /* Promotes a possibly negative, possibly signed char to an unsigned
115 * integer for use as an array index. If the signed char is negative,
116 * we want to instead treat it as an 8-bit unsigned char, hence the
117 * double cast.
118 */
119 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
120
121 /* An opaque pointer. */
122 #ifndef YY_TYPEDEF_YY_SCANNER_T
123 #define YY_TYPEDEF_YY_SCANNER_T
124 typedef void* yyscan_t;
125 #endif
126
127 /* For convenience, these vars (plus the bison vars far below)
128 are macros in the reentrant scanner. */
129 #define yyin yyg->yyin_r
130 #define yyout yyg->yyout_r
131 #define yyextra yyg->yyextra_r
132 #define yyleng yyg->yyleng_r
133 #define yytext yyg->yytext_r
134 #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
135 #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
136 #define yy_flex_debug yyg->yy_flex_debug_r
137
138 /* Enter a start condition. This macro really ought to take a parameter,
139 * but we do it the disgusting crufty way forced on us by the ()-less
140 * definition of BEGIN.
141 */
142 #define BEGIN yyg->yy_start = 1 + 2 *
143
144 /* Translate the current start state into a value that can be later handed
145 * to BEGIN to return to the state. The YYSTATE alias is for lex
146 * compatibility.
147 */
148 #define YY_START ((yyg->yy_start - 1) / 2)
149 #define YYSTATE YY_START
150
151 /* Action number for EOF rule of a given start state. */
152 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
153
154 /* Special action meaning "start processing a new file". */
155 #define YY_NEW_FILE phprestart(yyin ,yyscanner )
156
157 #define YY_END_OF_BUFFER_CHAR 0
158
159 /* Size of default input buffer. */
160 #ifndef YY_BUF_SIZE
161 #ifdef __ia64__
162 /* On IA-64, the buffer size is 16k, not 8k.
163 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
164 * Ditto for the __ia64__ case accordingly.
165 */
166 #define YY_BUF_SIZE 32768
167 #else
168 #define YY_BUF_SIZE 16384
169 #endif /* __ia64__ */
170 #endif
171
172 /* The state buf must be large enough to hold one state per character in the main buffer.
173 */
174 #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
175
176 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
177 #define YY_TYPEDEF_YY_BUFFER_STATE
178 typedef struct yy_buffer_state *YY_BUFFER_STATE;
179 #endif
180
181 #define EOB_ACT_CONTINUE_SCAN 0
182 #define EOB_ACT_END_OF_FILE 1
183 #define EOB_ACT_LAST_MATCH 2
184
185 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
186 * access to the local variable yy_act. Since yyless() is a macro, it would break
187 * existing scanners that call yyless() from OUTSIDE phplex.
188 * One obvious solution it to make yy_act a global. I tried that, and saw
189 * a 5% performance hit in a non-yylineno scanner, because yy_act is
190 * normally declared as a register variable-- so it is not worth it.
191 */
192 #define YY_LESS_LINENO(n) \
193 do { \
194 int yyl;\
195 for ( yyl = n; yyl < yyleng; ++yyl )\
196 if ( yytext[yyl] == '\n' )\
197 --yylineno;\
198 }while(0)
199
200 /* Return all but the first "n" matched characters back to the input stream. */
201 #define yyless(n) \
202 do \
203 { \
204 /* Undo effects of setting up yytext. */ \
205 int yyless_macro_arg = (n); \
206 YY_LESS_LINENO(yyless_macro_arg);\
207 *yy_cp = yyg->yy_hold_char; \
208 YY_RESTORE_YY_MORE_OFFSET \
209 yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
210 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
211 } \
212 while ( 0 )
213
214 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
215
216 #ifndef YY_TYPEDEF_YY_SIZE_T
217 #define YY_TYPEDEF_YY_SIZE_T
218 typedef size_t yy_size_t;
219 #endif
220
221 #ifndef YY_STRUCT_YY_BUFFER_STATE
222 #define YY_STRUCT_YY_BUFFER_STATE
223 struct yy_buffer_state
224 {
225 FILE *yy_input_file;
226
227 char *yy_ch_buf; /* input buffer */
228 char *yy_buf_pos; /* current position in input buffer */
229
230 /* Size of input buffer in bytes, not including room for EOB
231 * characters.
232 */
233 yy_size_t yy_buf_size;
234
235 /* Number of characters read into yy_ch_buf, not including EOB
236 * characters.
237 */
238 int yy_n_chars;
239
240 /* Whether we "own" the buffer - i.e., we know we created it,
241 * and can realloc() it to grow it, and should free() it to
242 * delete it.
243 */
244 int yy_is_our_buffer;
245
246 /* Whether this is an "interactive" input source; if so, and
247 * if we're using stdio for input, then we want to use getc()
248 * instead of fread(), to make sure we stop fetching input after
249 * each newline.
250 */
251 int yy_is_interactive;
252
253 /* Whether we're considered to be at the beginning of a line.
254 * If so, '^' rules will be active on the next match, otherwise
255 * not.
256 */
257 int yy_at_bol;
258
259 int yy_bs_lineno; /**< The line count. */
260 int yy_bs_column; /**< The column count. */
261
262 /* Whether to try to fill the input buffer when we reach the
263 * end of it.
264 */
265 int yy_fill_buffer;
266
267 int yy_buffer_status;
268
269 #define YY_BUFFER_NEW 0
270 #define YY_BUFFER_NORMAL 1
271 /* When an EOF's been seen but there's still some text to process
272 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
273 * shouldn't try reading from the input source any more. We might
274 * still have a bunch of tokens to match, though, because of
275 * possible backing-up.
276 *
277 * When we actually see the EOF, we change the status to "new"
278 * (via phprestart()), so that the user can continue scanning by
279 * just pointing yyin at a new input file.
280 */
281 #define YY_BUFFER_EOF_PENDING 2
282
283 };
284 #endif /* !YY_STRUCT_YY_BUFFER_STATE */
285
286 /* We provide macros for accessing buffer states in case in the
287 * future we want to put the buffer states in a more general
288 * "scanner state".
289 *
290 * Returns the top of the stack, or NULL.
291 */
292 #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
293 ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
294 : NULL)
295
296 /* Same as previous macro, but useful when we know that the buffer stack is not
297 * NULL or when we need an lvalue. For internal use only.
298 */
299 #define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
300
301 void phprestart (FILE *input_file ,yyscan_t yyscanner );
302 void php_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
303 YY_BUFFER_STATE php_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
304 void php_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
305 void php_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
306 void phppush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
307 void phppop_buffer_state (yyscan_t yyscanner );
308
309 static void phpensure_buffer_stack (yyscan_t yyscanner );
310 static void php_load_buffer_state (yyscan_t yyscanner );
311 static void php_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
312
313 #define YY_FLUSH_BUFFER php_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
314
315 YY_BUFFER_STATE php_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
316 YY_BUFFER_STATE php_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
317 YY_BUFFER_STATE php_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
318
319 void *phpalloc (yy_size_t ,yyscan_t yyscanner );
320 void *phprealloc (void *,yy_size_t ,yyscan_t yyscanner );
321 void phpfree (void * ,yyscan_t yyscanner );
322
323 #define yy_new_buffer php_create_buffer
324
325 #define yy_set_interactive(is_interactive) \
326 { \
327 if ( ! YY_CURRENT_BUFFER ){ \
328 phpensure_buffer_stack (yyscanner); \
329 YY_CURRENT_BUFFER_LVALUE = \
330 php_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
331 } \
332 YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
333 }
334
335 #define yy_set_bol(at_bol) \
336 { \
337 if ( ! YY_CURRENT_BUFFER ){\
338 phpensure_buffer_stack (yyscanner); \
339 YY_CURRENT_BUFFER_LVALUE = \
340 php_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
341 } \
342 YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
343 }
344
345 #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
346
347 /* Begin user sect3 */
348
349 typedef unsigned char YY_CHAR;
350
351 typedef int yy_state_type;
352
353 #define yytext_ptr yytext_r
354
355 static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
356 static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
357 static int yy_get_next_buffer (yyscan_t yyscanner );
358 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
359
360 /* Done after the current pattern has been matched and before the
361 * corresponding action - sets up yytext.
362 */
363 #define YY_DO_BEFORE_ACTION \
364 yyg->yytext_ptr = yy_bp; \
365 yyleng = (size_t) (yy_cp - yy_bp); \
366 yyg->yy_hold_char = *yy_cp; \
367 *yy_cp = '\0'; \
368 yyg->yy_c_buf_p = yy_cp;
369
370 #define YY_NUM_RULES 153
371 #define YY_END_OF_BUFFER 154
372 /* This struct is not used in this scanner,
373 but its presence is necessary. */
374 struct yy_trans_info
375 {
376 flex_int32_t yy_verify;
377 flex_int32_t yy_nxt;
378 };
379 static yyconst flex_int16_t yy_accept[646] =
380 { 0,
381 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
382 0, 0, 0, 0, 154, 6, 5, 6, 144, 7,
383 8, 9, 144, 143, 22, 144, 144, 144, 142, 144,
384 144, 144, 144, 144, 144, 26, 25, 144, 144, 144,
385 144, 144, 139, 139, 139, 139, 69, 144, 139, 139,
386 139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
387 139, 139, 139, 139, 139, 139, 139, 144, 24, 23,
388 21, 20, 21, 17, 16, 15, 150, 149, 151, 152,
389 146, 145, 147, 148, 4, 0, 7, 8, 0, 9,
390 102, 13, 13, 110, 141, 117, 113, 0, 0, 0,
391
392 0, 0, 0, 0, 0, 0, 0, 107, 97, 105,
393 98, 106, 67, 28, 109, 18, 22, 108, 28, 26,
394 0, 0, 26, 26, 0, 25, 25, 25, 68, 0,
395 121, 103, 102, 101, 92, 104, 122, 140, 139, 139,
396 118, 139, 115, 139, 139, 139, 52, 0, 139, 139,
397 139, 139, 139, 139, 44, 139, 139, 139, 139, 139,
398 139, 139, 139, 139, 139, 139, 38, 139, 139, 139,
399 139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
400 139, 139, 139, 139, 139, 139, 139, 114, 116, 19,
401 15, 150, 150, 0, 146, 146, 0, 2, 0, 0,
402
403 100, 13, 13, 141, 0, 0, 0, 0, 0, 0,
404 0, 0, 0, 0, 0, 0, 28, 0, 28, 26,
405 27, 25, 0, 0, 111, 93, 99, 112, 140, 119,
406 120, 139, 139, 139, 139, 139, 139, 139, 139, 139,
407 139, 0, 139, 139, 139, 139, 139, 139, 139, 139,
408 139, 31, 139, 139, 139, 139, 139, 139, 139, 139,
409 45, 139, 139, 139, 139, 139, 139, 139, 139, 139,
410 139, 70, 139, 139, 139, 139, 139, 139, 139, 139,
411 139, 139, 139, 35, 139, 79, 72, 139, 139, 150,
412 150, 146, 146, 0, 0, 13, 0, 0, 0, 0,
413
414 0, 0, 0, 0, 0, 0, 0, 28, 27, 27,
415 0, 0, 0, 0, 0, 139, 139, 139, 139, 139,
416 139, 139, 139, 139, 139, 139, 139, 139, 55, 139,
417 139, 139, 139, 139, 139, 139, 139, 60, 41, 139,
418 139, 139, 139, 139, 139, 73, 30, 139, 139, 139,
419 139, 139, 59, 139, 139, 139, 139, 139, 94, 139,
420 139, 139, 139, 139, 139, 139, 139, 11, 139, 139,
421 139, 139, 139, 139, 139, 3, 0, 10, 0, 0,
422 0, 0, 0, 0, 132, 0, 0, 0, 0, 0,
423 27, 0, 0, 0, 14, 0, 0, 139, 139, 139,
424
425 139, 139, 139, 139, 139, 139, 139, 95, 57, 139,
426 36, 62, 71, 33, 139, 139, 139, 139, 139, 83,
427 139, 139, 40, 139, 139, 139, 87, 139, 139, 139,
428 139, 139, 139, 139, 139, 82, 139, 139, 61, 139,
429 139, 139, 139, 139, 139, 139, 37, 64, 91, 42,
430 131, 0, 0, 0, 0, 137, 0, 0, 0, 0,
431 0, 133, 0, 0, 0, 0, 0, 0, 139, 139,
432 139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
433 139, 139, 29, 39, 139, 46, 139, 139, 139, 139,
434 139, 81, 139, 139, 139, 139, 139, 139, 12, 139,
435
436 139, 90, 139, 34, 84, 53, 0, 0, 135, 0,
437 0, 0, 0, 0, 138, 0, 139, 129, 139, 139,
438 139, 139, 139, 139, 139, 139, 139, 139, 49, 56,
439 139, 139, 139, 139, 65, 47, 139, 139, 74, 139,
440 139, 139, 139, 88, 139, 76, 0, 0, 134, 0,
441 0, 0, 136, 0, 139, 128, 139, 127, 139, 139,
442 139, 139, 85, 96, 58, 139, 139, 139, 43, 32,
443 139, 139, 139, 139, 139, 139, 139, 139, 0, 0,
444 123, 139, 139, 139, 124, 139, 139, 139, 54, 139,
445 139, 139, 80, 63, 78, 89, 139, 0, 139, 126,
446
447 139, 139, 50, 48, 66, 139, 51, 139, 0, 139,
448 139, 139, 139, 139, 0, 125, 139, 139, 75, 77,
449 0, 130, 139, 0, 139, 0, 86, 0, 0, 0,
450 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
451 0, 0, 0, 1, 0
452 } ;
453
454 static yyconst flex_int32_t yy_ec[256] =
455 { 0,
456 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
457 4, 5, 6, 1, 1, 1, 1, 1, 1, 1,
458 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
459 1, 7, 8, 9, 10, 11, 12, 13, 14, 15,
460 16, 17, 18, 1, 19, 20, 21, 22, 23, 23,
461 23, 23, 23, 23, 23, 24, 24, 25, 1, 26,
462 27, 28, 29, 1, 30, 31, 32, 33, 34, 35,
463 36, 37, 38, 36, 36, 39, 40, 41, 42, 43,
464 36, 44, 45, 46, 47, 36, 36, 48, 36, 36,
465 1, 49, 1, 50, 51, 1, 52, 53, 54, 55,
466
467 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
468 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
469 76, 36, 1, 77, 1, 1, 36, 36, 36, 36,
470 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
471 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
472 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
473 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
474 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
475 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
476 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
477
478 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
479 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
480 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
481 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
482 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
483 36, 36, 36, 36, 36
484 } ;
485
486 static yyconst flex_int32_t yy_meta[78] =
487 { 0,
488 1, 2, 3, 1, 1, 3, 2, 1, 4, 1,
489 1, 1, 1, 5, 1, 1, 1, 1, 1, 1,
490 1, 6, 6, 7, 1, 1, 1, 1, 8, 9,
491 9, 9, 9, 9, 9, 10, 10, 10, 10, 10,
492 10, 10, 10, 10, 10, 10, 10, 10, 8, 1,
493 10, 11, 11, 9, 9, 9, 11, 10, 10, 10,
494 10, 10, 10, 10, 12, 10, 10, 10, 12, 10,
495 12, 10, 12, 10, 12, 10, 1
496 } ;
497
498 static yyconst flex_int16_t yy_base[666] =
499 { 0,
500 0, 1, 27, 0, 1078, 1077, 2, 3, 104, 0,
501 179, 180, 181, 182, 1079, 1082, 1082, 157, 1082, 5,
502 1082, 11, 1051, 1082, 1082, 1006, 163, 174, 1082, 190,
503 1049, 175, 179, 181, 192, 243, 201, 1050, 189, 172,
504 184, 1046, 1032, 0, 1028, 1029, 1082, 1043, 1018, 167,
505 192, 186, 166, 220, 209, 178, 222, 1008, 199, 228,
506 1011, 197, 219, 169, 1014, 1006, 1004, 219, 1082, 1082,
507 1082, 1082, 1042, 1082, 1082, 0, 1082, 1082, 1082, 279,
508 1082, 1082, 1082, 281, 187, 1008, 305, 1082, 317, 323,
509 1034, 0, 1001, 1082, 18, 1082, 1082, 329, 990, 210,
510
511 992, 994, 991, 1002, 998, 982, 987, 1082, 1082, 1082,
512 1082, 1082, 1082, 310, 1082, 1082, 1082, 1082, 337, 368,
513 318, 346, 186, 250, 0, 386, 267, 312, 1082, 981,
514 290, 1022, 1082, 1022, 1082, 1082, 1021, 1044, 0, 1013,
515 0, 1001, 1082, 395, 974, 974, 0, 1016, 985, 287,
516 296, 975, 289, 983, 0, 979, 967, 969, 980, 982,
517 234, 968, 963, 966, 964, 958, 0, 961, 309, 957,
518 956, 961, 950, 954, 287, 969, 343, 958, 968, 959,
519 949, 345, 947, 960, 946, 954, 957, 1082, 1082, 1082,
520 0, 1082, 0, 0, 1082, 355, 0, 1082, 953, 942,
521
522 1082, 0, 950, 1082, 1006, 939, 942, 940, 933, 938,
523 932, 941, 949, 931, 929, 394, 1082, 381, 421, 1082,
524 390, 1082, 944, 450, 1082, 1082, 1082, 1082, 1082, 0,
525 0, 958, 958, 349, 957, 960, 963, 948, 939, 919,
526 937, 962, 935, 923, 929, 930, 913, 917, 352, 918,
527 386, 0, 914, 923, 907, 406, 914, 905, 919, 922,
528 917, 918, 918, 904, 906, 905, 896, 910, 909, 893,
529 907, 0, 906, 374, 890, 897, 887, 886, 900, 885,
530 884, 888, 893, 0, 896, 0, 0, 888, 887, 428,
531 0, 445, 0, 882, 888, 877, 894, 893, 881, 890,
532
533 890, 463, 885, 877, 879, 882, 449, 459, 427, 430,
534 868, 483, 0, 0, 483, 906, 891, 895, 892, 891,
535 885, 890, 899, 865, 858, 850, 863, 872, 0, 864,
536 852, 865, 849, 859, 866, 845, 851, 0, 855, 838,
537 857, 846, 854, 836, 850, 0, 0, 843, 844, 854,
538 834, 852, 0, 847, 830, 435, 832, 829, 0, 829,
539 833, 826, 844, 839, 834, 833, 823, 0, 831, 836,
540 815, 817, 816, 830, 830, 1082, 817, 0, 807, 813,
541 493, 818, 809, 494, 1082, 821, 824, 501, 812, 805,
542 1082, 815, 865, 859, 1082, 869, 499, 826, 819, 835,
543
544 836, 833, 829, 831, 826, 792, 810, 0, 0, 808,
545 0, 0, 0, 0, 795, 790, 795, 801, 799, 0,
546 801, 785, 0, 793, 792, 796, 0, 796, 789, 785,
547 783, 791, 780, 792, 786, 0, 775, 770, 0, 769,
548 785, 784, 768, 771, 781, 775, 0, 0, 0, 0,
549 0, 762, 504, 756, 505, 1082, 779, 774, 773, 757,
550 511, 1082, 769, 521, 759, 523, 816, 810, 778, 771,
551 770, 774, 768, 776, 772, 770, 764, 760, 750, 736,
552 744, 726, 0, 0, 728, 732, 716, 710, 702, 712,
553 702, 0, 709, 707, 705, 702, 701, 699, 0, 688,
554
555 668, 0, 682, 0, 0, 0, 523, 529, 1082, 531,
556 671, 661, 532, 539, 1082, 658, 676, 0, 668, 674,
557 593, 610, 599, 590, 586, 568, 582, 580, 0, 0,
558 583, 582, 579, 576, 0, 0, 566, 565, 578, 572,
559 561, 572, 571, 0, 568, 572, 533, 549, 1082, 550,
560 551, 552, 1082, 562, 571, 0, 579, 0, 569, 589,
561 567, 551, 0, 0, 0, 547, 561, 555, 0, 0,
562 542, 546, 545, 553, 552, 550, 550, 538, 551, 569,
563 0, 561, 550, 568, 0, 535, 538, 534, 0, 521,
564 524, 525, 0, 0, 0, 0, 509, 498, 511, 0,
565
566 527, 493, 0, 0, 0, 496, 0, 490, 485, 491,
567 481, 464, 459, 458, 432, 0, 437, 414, 0, 0,
568 423, 0, 399, 390, 363, 370, 0, 568, 571, 570,
569 578, 352, 318, 324, 296, 278, 268, 231, 205, 579,
570 185, 11, 581, 1082, 1082, 645, 657, 669, 681, 693,
571 697, 704, 711, 720, 729, 736, 743, 749, 755, 765,
572 769, 773, 783, 792, 800
573 } ;
574
575 static yyconst flex_int16_t yy_def[666] =
576 { 0,
577 646, 646, 645, 3, 647, 647, 648, 648, 645, 9,
578 649, 649, 650, 650, 645, 645, 645, 645, 645, 645,
579 645, 645, 645, 645, 645, 651, 645, 645, 645, 645,
580 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
581 645, 645, 652, 652, 652, 652, 645, 645, 652, 652,
582 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
583 652, 652, 652, 652, 652, 652, 652, 645, 645, 645,
584 645, 645, 645, 645, 645, 653, 645, 645, 645, 654,
585 645, 645, 645, 655, 645, 645, 645, 645, 645, 645,
586 645, 656, 656, 645, 645, 645, 645, 645, 645, 645,
587
588 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
589 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
590 645, 645, 645, 645, 657, 645, 645, 645, 645, 645,
591 645, 645, 645, 645, 645, 645, 645, 645, 652, 652,
592 652, 652, 645, 652, 652, 652, 652, 645, 652, 652,
593 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
594 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
595 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
596 652, 652, 652, 652, 652, 652, 652, 645, 645, 645,
597 653, 645, 645, 658, 645, 645, 659, 645, 645, 645,
598
599 645, 656, 656, 645, 645, 645, 645, 645, 645, 645,
600 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
601 657, 645, 645, 660, 645, 645, 645, 645, 645, 652,
602 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
603 652, 645, 652, 652, 652, 652, 652, 652, 652, 652,
604 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
605 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
606 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
607 652, 652, 652, 652, 652, 652, 652, 652, 652, 645,
608 658, 645, 659, 645, 645, 656, 645, 645, 645, 645,
609
610 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
611 645, 660, 661, 662, 663, 652, 652, 652, 652, 652,
612 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
613 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
614 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
615 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
616 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
617 652, 652, 652, 652, 652, 645, 645, 656, 645, 645,
618 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
619 645, 645, 664, 665, 645, 645, 663, 652, 652, 652,
620
621 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
622 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
623 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
624 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
625 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
626 652, 645, 645, 645, 645, 645, 645, 645, 645, 645,
627 645, 645, 645, 645, 645, 645, 664, 665, 652, 652,
628 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
629 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
630 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
631
632 652, 652, 652, 652, 652, 652, 645, 645, 645, 645,
633 645, 645, 645, 645, 645, 645, 652, 652, 652, 652,
634 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
635 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
636 652, 652, 652, 652, 652, 652, 645, 645, 645, 645,
637 645, 645, 645, 645, 652, 652, 652, 652, 652, 652,
638 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
639 652, 652, 652, 652, 652, 652, 652, 652, 645, 645,
640 652, 652, 652, 652, 652, 652, 652, 652, 652, 652,
641 652, 652, 652, 652, 652, 652, 652, 645, 652, 652,
642
643 652, 652, 652, 652, 652, 652, 652, 652, 645, 652,
644 652, 652, 652, 652, 645, 652, 652, 652, 652, 652,
645 645, 652, 652, 645, 652, 645, 652, 645, 645, 645,
646 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
647 645, 645, 645, 645, 0, 645, 645, 645, 645, 645,
648 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
649 645, 645, 645, 645, 645
650 } ;
651
652 static yyconst flex_int16_t yy_nxt[1160] =
653 { 0,
654 645, 645, 17, 17, 72, 72, 87, 88, 89, 89,
655 89, 87, 89, 88, 90, 90, 90, 89, 73, 73,
656 204, 290, 290, 205, 640, 18, 18, 19, 20, 21,
657 22, 22, 22, 20, 23, 24, 25, 26, 27, 28,
658 29, 30, 19, 31, 32, 33, 34, 35, 36, 37,
659 37, 38, 39, 40, 41, 42, 43, 44, 44, 44,
660 44, 44, 44, 44, 44, 44, 44, 44, 45, 44,
661 44, 44, 44, 44, 46, 47, 48, 49, 50, 51,
662 52, 53, 54, 55, 56, 44, 57, 44, 44, 58,
663 44, 59, 44, 60, 44, 61, 62, 63, 64, 65,
664
665 66, 44, 67, 68, 74, 74, 75, 74, 74, 74,
666 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
667 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
668 74, 74, 74, 76, 76, 76, 76, 76, 76, 76,
669 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
670 76, 76, 74, 74, 76, 76, 76, 76, 76, 76,
671 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
672 76, 76, 76, 76, 76, 76, 76, 76, 76, 76,
673 74, 78, 78, 82, 82, 85, 96, 79, 79, 94,
674 95, 98, 109, 640, 83, 83, 98, 111, 134, 135,
675
676 97, 110, 114, 114, 114, 112, 113, 115, 116, 130,
677 136, 137, 117, 198, 131, 132, 133, 148, 118, 145,
678 119, 153, 126, 126, 126, 154, 86, 80, 80, 84,
679 84, 155, 220, 183, 122, 146, 147, 150, 184, 127,
680 165, 99, 100, 166, 101, 188, 102, 128, 151, 103,
681 172, 152, 178, 199, 173, 104, 122, 220, 105, 106,
682 149, 107, 119, 127, 120, 120, 121, 179, 162, 207,
683 180, 642, 128, 156, 163, 208, 122, 181, 167, 174,
684 164, 123, 157, 158, 159, 168, 169, 182, 220, 124,
685 125, 170, 160, 258, 161, 189, 175, 641, 122, 176,
686
687 193, 193, 196, 196, 259, 123, 87, 88, 89, 89,
688 89, 87, 220, 222, 124, 224, 225, 125, 89, 88,
689 89, 89, 89, 89, 89, 88, 90, 90, 90, 89,
690 98, 114, 114, 114, 640, 98, 639, 119, 222, 121,
691 121, 121, 250, 216, 217, 251, 274, 247, 217, 244,
692 222, 122, 275, 194, 638, 197, 245, 246, 114, 114,
693 114, 248, 266, 218, 218, 216, 217, 219, 219, 219,
694 216, 217, 217, 122, 222, 217, 292, 292, 267, 268,
695 99, 100, 637, 101, 636, 102, 318, 119, 103, 120,
696 120, 121, 216, 217, 104, 319, 283, 105, 106, 217,
697
698 107, 122, 219, 219, 219, 119, 123, 126, 126, 126,
699 277, 307, 307, 278, 124, 308, 308, 308, 635, 122,
700 284, 333, 334, 122, 127, 628, 232, 233, 309, 234,
701 123, 627, 128, 235, 236, 237, 310, 336, 362, 124,
702 238, 122, 219, 219, 219, 337, 363, 626, 127, 192,
703 192, 312, 309, 239, 625, 217, 312, 128, 313, 217,
704 341, 310, 342, 314, 384, 343, 195, 195, 391, 384,
705 308, 308, 308, 391, 624, 344, 623, 217, 385, 345,
706 308, 308, 308, 217, 312, 395, 433, 622, 396, 312,
707 434, 313, 391, 217, 455, 384, 314, 217, 391, 455,
708
709 384, 395, 461, 621, 396, 508, 455, 461, 456, 385,
710 508, 455, 461, 620, 619, 217, 462, 461, 386, 509,
711 456, 217, 514, 618, 547, 395, 462, 514, 396, 547,
712 508, 617, 548, 552, 547, 508, 515, 548, 552, 547,
713 514, 616, 615, 614, 509, 514, 549, 553, 457, 613,
714 548, 455, 384, 552, 515, 548, 455, 384, 552, 612,
715 611, 610, 609, 580, 549, 456, 385, 553, 580, 629,
716 580, 631, 629, 608, 629, 580, 631, 629, 632, 631,
717 643, 607, 643, 633, 631, 643, 632, 643, 606, 138,
718 605, 633, 604, 603, 630, 579, 138, 630, 602, 601,
719
720 600, 599, 598, 597, 596, 595, 644, 594, 644, 593,
721 592, 591, 590, 589, 588, 587, 586, 585, 584, 583,
722 582, 581, 578, 577, 576, 575, 574, 573, 572, 571,
723 570, 569, 568, 567, 566, 565, 634, 564, 563, 562,
724 561, 560, 559, 558, 634, 16, 16, 16, 16, 16,
725 16, 16, 16, 16, 16, 16, 16, 69, 69, 69,
726 69, 69, 69, 69, 69, 69, 69, 69, 69, 71,
727 71, 71, 71, 71, 71, 71, 71, 71, 71, 71,
728 71, 77, 77, 77, 77, 77, 77, 77, 77, 77,
729 77, 77, 77, 81, 81, 81, 81, 81, 81, 81,
730
731 81, 81, 81, 81, 81, 92, 92, 92, 92, 139,
732 139, 557, 139, 139, 139, 139, 191, 191, 556, 191,
733 191, 191, 191, 192, 192, 192, 555, 192, 554, 551,
734 192, 192, 195, 195, 195, 550, 195, 546, 545, 195,
735 195, 202, 202, 544, 202, 202, 202, 202, 221, 221,
736 543, 221, 542, 221, 291, 291, 541, 291, 540, 291,
737 293, 293, 539, 293, 538, 293, 315, 537, 315, 315,
738 536, 535, 534, 315, 315, 315, 315, 393, 393, 393,
739 393, 394, 394, 394, 394, 397, 533, 532, 397, 397,
740 531, 397, 397, 397, 397, 467, 530, 467, 467, 529,
741
742 467, 467, 467, 467, 468, 468, 468, 528, 468, 468,
743 468, 468, 527, 526, 525, 524, 523, 522, 521, 520,
744 519, 518, 517, 466, 466, 516, 510, 513, 512, 388,
745 511, 510, 507, 506, 505, 504, 503, 502, 501, 500,
746 499, 498, 497, 496, 495, 494, 493, 492, 491, 490,
747 489, 488, 487, 486, 485, 484, 483, 482, 481, 480,
748 479, 478, 477, 476, 475, 474, 473, 472, 471, 470,
749 469, 395, 466, 466, 465, 464, 463, 460, 459, 388,
750 458, 454, 453, 452, 451, 450, 449, 448, 447, 446,
751 445, 444, 443, 442, 441, 440, 439, 438, 437, 436,
752
753 435, 432, 431, 430, 429, 428, 427, 426, 425, 424,
754 423, 422, 421, 420, 419, 418, 417, 416, 415, 414,
755 413, 412, 411, 410, 409, 408, 407, 406, 405, 404,
756 403, 402, 401, 400, 399, 398, 392, 390, 389, 388,
757 387, 383, 382, 381, 380, 379, 378, 377, 376, 375,
758 374, 373, 372, 371, 370, 369, 368, 367, 366, 365,
759 364, 361, 360, 359, 358, 357, 356, 355, 354, 353,
760 352, 351, 350, 349, 348, 347, 346, 340, 339, 338,
761 335, 332, 331, 330, 329, 328, 327, 224, 326, 325,
762 324, 323, 322, 321, 320, 317, 316, 311, 306, 305,
763
764 304, 303, 302, 301, 300, 299, 298, 297, 204, 296,
765 295, 294, 289, 288, 287, 286, 285, 282, 281, 280,
766 279, 276, 273, 272, 271, 270, 269, 265, 264, 263,
767 262, 261, 260, 257, 256, 255, 254, 253, 252, 249,
768 243, 242, 241, 240, 231, 230, 229, 228, 227, 226,
769 223, 215, 214, 213, 212, 211, 210, 209, 206, 203,
770 201, 200, 190, 187, 186, 185, 177, 171, 144, 143,
771 142, 141, 140, 138, 129, 108, 93, 91, 645, 70,
772 70, 15, 645, 645, 645, 645, 645, 645, 645, 645,
773 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
774
775 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
776 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
777 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
778 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
779 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
780 645, 645, 645, 645, 645, 645, 645, 645, 645
781 } ;
782
783 static yyconst flex_int16_t yy_chk[1160] =
784 { 0,
785 0, 0, 1, 2, 7, 8, 20, 20, 20, 20,
786 20, 20, 22, 22, 22, 22, 22, 22, 7, 8,
787 95, 193, 193, 95, 642, 1, 2, 3, 3, 3,
788 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
789 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
790 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
791 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
792 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
793 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
794 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
795
796 3, 3, 3, 3, 9, 9, 9, 9, 9, 9,
797 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
798 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
799 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
800 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
801 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
802 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
803 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
804 9, 11, 12, 13, 14, 18, 28, 11, 12, 27,
805 27, 30, 32, 641, 13, 14, 30, 33, 40, 40,
806
807 28, 32, 34, 34, 34, 33, 33, 34, 35, 39,
808 41, 41, 35, 85, 39, 39, 39, 51, 35, 50,
809 37, 53, 37, 37, 37, 53, 18, 11, 12, 13,
810 14, 53, 123, 64, 37, 50, 50, 52, 64, 37,
811 56, 30, 30, 56, 30, 68, 30, 37, 52, 30,
812 59, 52, 62, 85, 59, 30, 37, 123, 30, 30,
813 51, 30, 36, 37, 36, 36, 36, 62, 55, 100,
814 62, 639, 37, 54, 55, 100, 36, 63, 57, 60,
815 55, 36, 54, 54, 54, 57, 57, 63, 124, 36,
816 36, 57, 54, 161, 54, 68, 60, 638, 36, 60,
817
818 80, 80, 84, 84, 161, 36, 87, 87, 87, 87,
819 87, 87, 124, 127, 36, 131, 131, 36, 89, 89,
820 89, 89, 89, 89, 90, 90, 90, 90, 90, 90,
821 98, 114, 114, 114, 637, 98, 636, 121, 127, 121,
822 121, 121, 153, 114, 114, 153, 175, 151, 114, 150,
823 128, 121, 175, 80, 635, 84, 150, 150, 119, 119,
824 119, 151, 169, 122, 122, 114, 114, 122, 122, 122,
825 119, 119, 114, 121, 128, 119, 196, 196, 169, 169,
826 98, 98, 634, 98, 633, 98, 234, 120, 98, 120,
827 120, 120, 119, 119, 98, 234, 182, 98, 98, 119,
828
829 98, 120, 218, 218, 218, 126, 120, 126, 126, 126,
830 177, 216, 216, 177, 120, 216, 216, 216, 632, 126,
831 182, 249, 249, 120, 126, 626, 144, 144, 221, 144,
832 120, 625, 126, 144, 144, 144, 221, 251, 274, 120,
833 144, 126, 219, 219, 219, 251, 274, 624, 126, 290,
834 290, 224, 221, 144, 623, 219, 224, 126, 224, 219,
835 256, 221, 256, 224, 302, 256, 292, 292, 310, 302,
836 307, 307, 307, 309, 621, 256, 618, 219, 302, 256,
837 308, 308, 308, 219, 312, 315, 356, 617, 315, 312,
838 356, 312, 310, 308, 381, 384, 312, 308, 309, 381,
839
840 384, 397, 388, 615, 397, 453, 455, 388, 381, 384,
841 453, 455, 461, 614, 613, 308, 388, 461, 302, 453,
842 455, 308, 464, 612, 507, 466, 461, 464, 466, 507,
843 508, 611, 510, 513, 547, 508, 464, 510, 513, 547,
844 514, 610, 609, 608, 508, 514, 510, 513, 381, 606,
845 548, 550, 551, 552, 514, 548, 550, 551, 552, 602,
846 601, 599, 598, 554, 548, 550, 551, 552, 554, 628,
847 580, 630, 629, 597, 628, 580, 630, 629, 630, 631,
848 640, 592, 643, 630, 631, 640, 631, 643, 591, 554,
849 590, 631, 588, 587, 628, 547, 580, 629, 586, 584,
850
851 583, 582, 579, 578, 577, 576, 640, 575, 643, 574,
852 573, 572, 571, 568, 567, 566, 562, 561, 560, 559,
853 557, 555, 546, 545, 543, 542, 541, 540, 539, 538,
854 537, 534, 533, 532, 531, 528, 630, 527, 526, 525,
855 524, 523, 522, 521, 631, 646, 646, 646, 646, 646,
856 646, 646, 646, 646, 646, 646, 646, 647, 647, 647,
857 647, 647, 647, 647, 647, 647, 647, 647, 647, 648,
858 648, 648, 648, 648, 648, 648, 648, 648, 648, 648,
859 648, 649, 649, 649, 649, 649, 649, 649, 649, 649,
860 649, 649, 649, 650, 650, 650, 650, 650, 650, 650,
861
862 650, 650, 650, 650, 650, 651, 651, 651, 651, 652,
863 652, 520, 652, 652, 652, 652, 653, 653, 519, 653,
864 653, 653, 653, 654, 654, 654, 517, 654, 516, 512,
865 654, 654, 655, 655, 655, 511, 655, 503, 501, 655,
866 655, 656, 656, 500, 656, 656, 656, 656, 657, 657,
867 498, 657, 497, 657, 658, 658, 496, 658, 495, 658,
868 659, 659, 494, 659, 493, 659, 660, 491, 660, 660,
869 490, 489, 488, 660, 660, 660, 660, 661, 661, 661,
870 661, 662, 662, 662, 662, 663, 487, 486, 663, 663,
871 485, 663, 663, 663, 663, 664, 482, 664, 664, 481,
872
873 664, 664, 664, 664, 665, 665, 665, 480, 665, 665,
874 665, 665, 479, 478, 477, 476, 475, 474, 473, 472,
875 471, 470, 469, 468, 467, 465, 463, 460, 459, 458,
876 457, 454, 452, 446, 445, 444, 443, 442, 441, 440,
877 438, 437, 435, 434, 433, 432, 431, 430, 429, 428,
878 426, 425, 424, 422, 421, 419, 418, 417, 416, 415,
879 410, 407, 406, 405, 404, 403, 402, 401, 400, 399,
880 398, 396, 394, 393, 392, 390, 389, 387, 386, 383,
881 382, 380, 379, 377, 375, 374, 373, 372, 371, 370,
882 369, 367, 366, 365, 364, 363, 362, 361, 360, 358,
883
884 357, 355, 354, 352, 351, 350, 349, 348, 345, 344,
885 343, 342, 341, 340, 339, 337, 336, 335, 334, 333,
886 332, 331, 330, 328, 327, 326, 325, 324, 323, 322,
887 321, 320, 319, 318, 317, 316, 311, 306, 305, 304,
888 303, 301, 300, 299, 298, 297, 296, 295, 294, 289,
889 288, 285, 283, 282, 281, 280, 279, 278, 277, 276,
890 275, 273, 271, 270, 269, 268, 267, 266, 265, 264,
891 263, 262, 261, 260, 259, 258, 257, 255, 254, 253,
892 250, 248, 247, 246, 245, 244, 243, 242, 241, 240,
893 239, 238, 237, 236, 235, 233, 232, 223, 215, 214,
894
895 213, 212, 211, 210, 209, 208, 207, 206, 205, 203,
896 200, 199, 187, 186, 185, 184, 183, 181, 180, 179,
897 178, 176, 174, 173, 172, 171, 170, 168, 166, 165,
898 164, 163, 162, 160, 159, 158, 157, 156, 154, 152,
899 149, 148, 146, 145, 142, 140, 138, 137, 134, 132,
900 130, 107, 106, 105, 104, 103, 102, 101, 99, 93,
901 91, 86, 73, 67, 66, 65, 61, 58, 49, 48,
902 46, 45, 43, 42, 38, 31, 26, 23, 15, 6,
903 5, 645, 645, 645, 645, 645, 645, 645, 645, 645,
904 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
905
906 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
907 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
908 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
909 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
910 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
911 645, 645, 645, 645, 645, 645, 645, 645, 645
912 } ;
913
914 /* Table of booleans, true if rule could match eol. */
915 static yyconst flex_int32_t yy_rule_can_match_eol[154] =
916 { 0,
917 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0,
918 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
919 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
920 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
921 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
922 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
923 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
924 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, };
925
926 /* The intent behind this definition is that it'll catch
927 * any uses of REJECT which flex missed.
928 */
929 #define REJECT reject_used_but_not_detected
930 #define yymore() yymore_used_but_not_detected
931 #define YY_MORE_ADJ 0
932 #define YY_RESTORE_YY_MORE_OFFSET
933 //
934 //====================--------------------------------------------------------------
935 // Eran Ifrah 2014 (c)
936 //====================--------------------------------------------------------------
937 //
938 // To generate a source file from this .l file, you will need
939 // a flex version 2.5.34 and later
940 // Under Windows, you will need to run the following command
941 // from within *MSYS* terminal (or run codelite from an MSYS shell):
942 // /usr/bin/flex -Pphp --noline --batch --outfile=PhpLexer.cpp PhpLexer.l
943 //
944 //====================--------------------------------------------------------------
945 //
946 extern "C" int phpwrap(void*) { return 1; }
947
948 #include <wx/string.h>
949 #include <wx/filename.h>
950 #include "PhpLexerAPI.h"
951 #include "PHPScannerTokens.h"
952 #include "StdToWX.h" // Conversion methods from wxString -> std::string
953
954 #define YYSTYPE std::string
955 #define ECHO
956
957 #define YY_NO_UNISTD_H
958
959 #define RETURN_WHITESPACE() \
960 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r; \
961 if(userData->IsCollectingWhitespace()) { \
962 return kPHP_T_WHITESPACE; \
963 }
964 #define RETURN_NEWLINE() \
965 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r; \
966 if(userData->IsCollectingWhitespace()) { \
967 return kPHP_T_NEWLINE; \
968 }
969
970 #define LEX_RETURN(x) {\
971 return x;\
972 }
973
974 /* regex and modes */
975 /* options */
976
977 #define INITIAL 0
978 #define PHP 1
979 #define CPP_COMMENT 2
980 #define DOC_COMMENT 3
981 #define HEREDOC 4
982 #define DSTRING 5
983 #define SINGLE_STRING 6
984
985 #ifndef YY_NO_UNISTD_H
986 /* Special case for "unistd.h", since it is non-ANSI. We include it way
987 * down here because we want the user's section 1 to have been scanned first.
988 * The user has a chance to override it with an option.
989 */
990 #include <unistd.h>
991 #endif
992
993 #ifndef YY_EXTRA_TYPE
994 #define YY_EXTRA_TYPE void *
995 #endif
996
997 /* Holds the entire state of the reentrant scanner. */
998 struct yyguts_t
999 {
1000
1001 /* User-defined. Not touched by flex. */
1002 YY_EXTRA_TYPE yyextra_r;
1003
1004 /* The rest are the same as the globals declared in the non-reentrant scanner. */
1005 FILE *yyin_r, *yyout_r;
1006 size_t yy_buffer_stack_top; /**< index of top of stack. */
1007 size_t yy_buffer_stack_max; /**< capacity of stack. */
1008 YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
1009 char yy_hold_char;
1010 int yy_n_chars;
1011 int yyleng_r;
1012 char *yy_c_buf_p;
1013 int yy_init;
1014 int yy_start;
1015 int yy_did_buffer_switch_on_eof;
1016 int yy_start_stack_ptr;
1017 int yy_start_stack_depth;
1018 int *yy_start_stack;
1019 yy_state_type yy_last_accepting_state;
1020 char* yy_last_accepting_cpos;
1021
1022 int yylineno_r;
1023 int yy_flex_debug_r;
1024
1025 char *yytext_r;
1026 int yy_more_flag;
1027 int yy_more_len;
1028
1029 }; /* end struct yyguts_t */
1030
1031 static int yy_init_globals (yyscan_t yyscanner );
1032
1033 int phplex_init (yyscan_t* scanner);
1034
1035 int phplex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
1036
1037 /* Accessor methods to globals.
1038 These are made visible to non-reentrant scanners for convenience. */
1039
1040 int phplex_destroy (yyscan_t yyscanner );
1041
1042 int phpget_debug (yyscan_t yyscanner );
1043
1044 void phpset_debug (int debug_flag ,yyscan_t yyscanner );
1045
1046 YY_EXTRA_TYPE phpget_extra (yyscan_t yyscanner );
1047
1048 void phpset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
1049
1050 FILE *phpget_in (yyscan_t yyscanner );
1051
1052 void phpset_in (FILE * in_str ,yyscan_t yyscanner );
1053
1054 FILE *phpget_out (yyscan_t yyscanner );
1055
1056 void phpset_out (FILE * out_str ,yyscan_t yyscanner );
1057
1058 int phpget_leng (yyscan_t yyscanner );
1059
1060 char *phpget_text (yyscan_t yyscanner );
1061
1062 int phpget_lineno (yyscan_t yyscanner );
1063
1064 void phpset_lineno (int line_number ,yyscan_t yyscanner );
1065
1066 /* Macros after this point can all be overridden by user definitions in
1067 * section 1.
1068 */
1069
1070 #ifndef YY_SKIP_YYWRAP
1071 #ifdef __cplusplus
1072 extern "C" int phpwrap (yyscan_t yyscanner );
1073 #else
1074 extern int phpwrap (yyscan_t yyscanner );
1075 #endif
1076 #endif
1077
1078 static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner);
1079
1080 #ifndef yytext_ptr
1081 static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
1082 #endif
1083
1084 #ifdef YY_NEED_STRLEN
1085 static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
1086 #endif
1087
1088 #ifndef YY_NO_INPUT
1089
1090 #ifdef __cplusplus
1091 static int yyinput (yyscan_t yyscanner );
1092 #else
1093 static int input (yyscan_t yyscanner );
1094 #endif
1095
1096 #endif
1097
1098 /* Amount of stuff to slurp up with each read. */
1099 #ifndef YY_READ_BUF_SIZE
1100 #ifdef __ia64__
1101 /* On IA-64, the buffer size is 16k, not 8k */
1102 #define YY_READ_BUF_SIZE 16384
1103 #else
1104 #define YY_READ_BUF_SIZE 8192
1105 #endif /* __ia64__ */
1106 #endif
1107
1108 /* Copy whatever the last rule matched to the standard output. */
1109 #ifndef ECHO
1110 /* This used to be an fputs(), but since the string might contain NUL's,
1111 * we now use fwrite().
1112 */
1113 #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
1114 #endif
1115
1116 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
1117 * is returned in "result".
1118 */
1119 #ifndef YY_INPUT
1120 #define YY_INPUT(buf,result,max_size) \
1121 if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
1122 { \
1123 int c = '*'; \
1124 size_t n; \
1125 for ( n = 0; n < max_size && \
1126 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
1127 buf[n] = (char) c; \
1128 if ( c == '\n' ) \
1129 buf[n++] = (char) c; \
1130 if ( c == EOF && ferror( yyin ) ) \
1131 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1132 result = n; \
1133 } \
1134 else \
1135 { \
1136 errno=0; \
1137 while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
1138 { \
1139 if( errno != EINTR) \
1140 { \
1141 YY_FATAL_ERROR( "input in flex scanner failed" ); \
1142 break; \
1143 } \
1144 errno=0; \
1145 clearerr(yyin); \
1146 } \
1147 }\
1148 \
1149
1150 #endif
1151
1152 /* No semi-colon after return; correct usage is to write "yyterminate();" -
1153 * we don't want an extra ';' after the "return" because that will cause
1154 * some compilers to complain about unreachable statements.
1155 */
1156 #ifndef yyterminate
1157 #define yyterminate() return YY_NULL
1158 #endif
1159
1160 /* Number of entries by which start-condition stack grows. */
1161 #ifndef YY_START_STACK_INCR
1162 #define YY_START_STACK_INCR 25
1163 #endif
1164
1165 /* Report a fatal error. */
1166 #ifndef YY_FATAL_ERROR
1167 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
1168 #endif
1169
1170 /* end tables serialization structures and prototypes */
1171
1172 /* Default declaration of generated scanner - a define so the user can
1173 * easily add parameters.
1174 */
1175 #ifndef YY_DECL
1176 #define YY_DECL_IS_OURS 1
1177
1178 extern int phplex (yyscan_t yyscanner);
1179
1180 #define YY_DECL int phplex (yyscan_t yyscanner)
1181 #endif /* !YY_DECL */
1182
1183 /* Code executed at the beginning of each rule, after yytext and yyleng
1184 * have been set up.
1185 */
1186 #ifndef YY_USER_ACTION
1187 #define YY_USER_ACTION
1188 #endif
1189
1190 /* Code executed at the end of each rule. */
1191 #ifndef YY_BREAK
1192 #define YY_BREAK break;
1193 #endif
1194
1195 #define YY_RULE_SETUP \
1196 YY_USER_ACTION
1197
1198 /** The main scanner function which does all the work.
1199 */
1200 YY_DECL
1201 {
1202 register yy_state_type yy_current_state;
1203 register char *yy_cp, *yy_bp;
1204 register int yy_act;
1205 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
1206
1207 if ( !yyg->yy_init )
1208 {
1209 yyg->yy_init = 1;
1210
1211 #ifdef YY_USER_INIT
1212 YY_USER_INIT;
1213 #endif
1214
1215 if ( ! yyg->yy_start )
1216 yyg->yy_start = 1; /* first start state */
1217
1218 if ( ! yyin )
1219 yyin = stdin;
1220
1221 if ( ! yyout )
1222 yyout = stdout;
1223
1224 if ( ! YY_CURRENT_BUFFER ) {
1225 phpensure_buffer_stack (yyscanner);
1226 YY_CURRENT_BUFFER_LVALUE =
1227 php_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
1228 }
1229
1230 php_load_buffer_state(yyscanner );
1231 }
1232
1233 while ( 1 ) /* loops until end-of-file is reached */
1234 {
1235 yy_cp = yyg->yy_c_buf_p;
1236
1237 /* Support of yytext. */
1238 *yy_cp = yyg->yy_hold_char;
1239
1240 /* yy_bp points to the position in yy_ch_buf of the start of
1241 * the current run.
1242 */
1243 yy_bp = yy_cp;
1244
1245 yy_current_state = yyg->yy_start;
1246 yy_match:
1247 do
1248 {
1249 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
1250 if ( yy_accept[yy_current_state] )
1251 {
1252 yyg->yy_last_accepting_state = yy_current_state;
1253 yyg->yy_last_accepting_cpos = yy_cp;
1254 }
1255 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1256 {
1257 yy_current_state = (int) yy_def[yy_current_state];
1258 if ( yy_current_state >= 646 )
1259 yy_c = yy_meta[(unsigned int) yy_c];
1260 }
1261 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1262 ++yy_cp;
1263 }
1264 while ( yy_current_state != 645 );
1265 yy_cp = yyg->yy_last_accepting_cpos;
1266 yy_current_state = yyg->yy_last_accepting_state;
1267
1268 yy_find_action:
1269 yy_act = yy_accept[yy_current_state];
1270
1271 YY_DO_BEFORE_ACTION;
1272
1273 if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
1274 {
1275 int yyl;
1276 for ( yyl = 0; yyl < yyleng; ++yyl )
1277 if ( yytext[yyl] == '\n' )
1278
1279 do{ yylineno++;
1280 yycolumn=0;
1281 }while(0)
1282 ;
1283 }
1284
1285 do_action: /* This label is used only to access EOF actions. */
1286
1287 switch ( yy_act )
1288 { /* beginning of action switch */
1289 case 0: /* must back up */
1290 /* undo the effects of YY_DO_BEFORE_ACTION */
1291 *yy_cp = yyg->yy_hold_char;
1292 yy_cp = yyg->yy_last_accepting_cpos;
1293 yy_current_state = yyg->yy_last_accepting_state;
1294 goto yy_find_action;
1295
1296 case 1:
1297 YY_RULE_SETUP
1298 {
1299 BEGIN(PHP);
1300 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
1301 userData->SetInsidePhp(true);
1302 return kPHP_T_OPEN_TAG;
1303 }
1304 YY_BREAK
1305 case 2:
1306 YY_RULE_SETUP
1307 {
1308 BEGIN(PHP);
1309 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
1310 userData->SetInsidePhp(true);
1311 return kPHP_T_OPEN_TAG_WITH_ECHO;
1312 }
1313 YY_BREAK
1314 case 3:
1315 YY_RULE_SETUP
1316 {
1317 BEGIN(PHP);
1318 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
1319 userData->SetInsidePhp(true);
1320 return kPHP_T_OPEN_TAG;
1321 }
1322 YY_BREAK
1323 case 4:
1324 YY_RULE_SETUP
1325 {
1326 BEGIN(PHP);
1327 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
1328 userData->SetInsidePhp(true);
1329 return kPHP_T_OPEN_TAG;
1330 }
1331 YY_BREAK
1332 case 5:
1333 /* rule 5 can match eol */
1334 YY_RULE_SETUP
1335 {
1336 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
1337 if(userData->IsCollectingAllNonPhp()) {
1338 return yytext[0];
1339 }
1340 }
1341 YY_BREAK
1342 case 6:
1343 YY_RULE_SETUP
1344 {
1345 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
1346 if(userData->IsCollectingAllNonPhp()) {
1347 return yytext[0];
1348 }
1349 }
1350 YY_BREAK
1351 case 7:
1352 YY_RULE_SETUP
1353 { RETURN_WHITESPACE(); }
1354 YY_BREAK
1355 case 8:
1356 /* rule 8 can match eol */
1357 YY_RULE_SETUP
1358 { RETURN_NEWLINE();}
1359 YY_BREAK
1360 case 9:
1361 YY_RULE_SETUP
1362 {RETURN_WHITESPACE();}
1363 YY_BREAK
1364 case 10:
1365 YY_RULE_SETUP
1366 {LEX_RETURN(kPHP_T_THIS);}
1367 YY_BREAK
1368 case 11:
1369 YY_RULE_SETUP
1370 {LEX_RETURN(kPHP_T_SELF);}
1371 YY_BREAK
1372 case 12:
1373 YY_RULE_SETUP
1374 {LEX_RETURN(kPHP_T_PARENT);}
1375 YY_BREAK
1376 case 13:
1377 YY_RULE_SETUP
1378 {LEX_RETURN(kPHP_T_VARIABLE);}
1379 YY_BREAK
1380 case 14:
1381 /* rule 14 can match eol */
1382 YY_RULE_SETUP
1383 {
1384 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
1385 std::string label = yytext;
1386 StdToWX::Remove(label, 0, 3);
1387 StdToWX::Trim(label);
1388
1389 if(StdToWX::StartsWith(label, "'")) StdToWX::Remove(label, 0, 1);
1390 if(StdToWX::EndsWith(label, "'")) StdToWX::RemoveLast(label, 1);
1391
1392 userData->SetRawStringLabel(label);
1393 userData->GetString().append(yytext);
1394 BEGIN(HEREDOC);
1395 return kPHP_T_START_HEREDOC;
1396 }
1397 YY_BREAK
1398 case 15:
1399 YY_RULE_SETUP
1400 {
1401 // anything else
1402 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
1403 userData->GetString().append(yytext);
1404 if(yytext == userData->GetRawStringLabel()) {
1405 // end of HEREDOC
1406 BEGIN(PHP);
1407 return kPHP_T_END_HEREDOC;
1408 }
1409 }
1410 YY_BREAK
1411 case 16:
1412 /* rule 16 can match eol */
1413 YY_RULE_SETUP
1414 {
1415 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
1416 userData->GetString().append(yytext);
1417 }
1418 YY_BREAK
1419 case 17:
1420 YY_RULE_SETUP
1421 {
1422 // anything else
1423 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
1424 userData->GetString().append(yytext);
1425 }
1426 YY_BREAK
1427 case 18:
1428 YY_RULE_SETUP
1429 {
1430 // Clear the comment collected
1431 BEGIN(DOC_COMMENT);
1432 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
1433 if(userData->IsCollectingComments()) {
1434 userData->ClearComment();
1435 userData->AppendToComment("/*");
1436 userData->SetCommentStartLine(yylineno);
1437 }
1438 }
1439 YY_BREAK
1440 case 19:
1441 YY_RULE_SETUP
1442 {
1443 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
1444 if(userData->IsCollectingComments()) {
1445 userData->AppendToComment("*/");
1446 userData->SetCommentEndLine(yylineno);
1447 }
1448 BEGIN(PHP);
1449 if(userData->IsCollectingComments()) {
1450 return kPHP_T_C_COMMENT;
1451 }
1452 }
1453 YY_BREAK
1454 case 20:
1455 /* rule 20 can match eol */
1456 YY_RULE_SETUP
1457 {
1458 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
1459 if(userData->IsCollectingComments()) {
1460 userData->AppendToComment("\n");
1461 }
1462 }
1463 YY_BREAK
1464 case 21:
1465 YY_RULE_SETUP
1466 {
1467 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
1468 if(userData->IsCollectingComments()) {
1469 userData->AppendToComment(yytext[0]);
1470 }
1471 }
1472 YY_BREAK
1473 case 22:
1474 YY_RULE_SETUP
1475 {
1476 BEGIN(CPP_COMMENT);
1477 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
1478 if(userData->IsCollectingComments()) {
1479 userData->ClearComment();
1480 userData->AppendToComment(yytext);
1481 userData->SetCommentStartLine(yylineno);
1482 }
1483 }
1484 YY_BREAK
1485 case 23:
1486 /* rule 23 can match eol */
1487 YY_RULE_SETUP
1488 {
1489 BEGIN(PHP);
1490 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
1491 if(userData->IsCollectingWhitespace()) {
1492 userData->AppendToComment("\n");
1493 }
1494 if(userData->IsCollectingComments()) {
1495 return kPHP_T_CXX_COMMENT;
1496 }
1497 }
1498 YY_BREAK
1499 case 24:
1500 YY_RULE_SETUP
1501 {
1502 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
1503 if(userData->IsCollectingComments()) {
1504 userData->AppendToComment(yytext[0]);
1505 }
1506 }
1507 YY_BREAK
1508 case 25:
1509 YY_RULE_SETUP
1510 {LEX_RETURN(kPHP_T_DNUMBER);}
1511 YY_BREAK
1512 case 26:
1513 YY_RULE_SETUP
1514 {LEX_RETURN(kPHP_T_LNUMBER);}
1515 YY_BREAK
1516 case 27:
1517 YY_RULE_SETUP
1518 {LEX_RETURN(kPHP_T_LNUMBER);}
1519 YY_BREAK
1520 case 28:
1521 YY_RULE_SETUP
1522 {LEX_RETURN(kPHP_T_DNUMBER);}
1523 YY_BREAK
1524 case 29:
1525 YY_RULE_SETUP
1526 {LEX_RETURN(kPHP_T_DEFINE);}
1527 YY_BREAK
1528 case 30:
1529 YY_RULE_SETUP
1530 {LEX_RETURN(kPHP_T_EXIT);}
1531 YY_BREAK
1532 case 31:
1533 YY_RULE_SETUP
1534 {LEX_RETURN(kPHP_T_EXIT);}
1535 YY_BREAK
1536 case 32:
1537 YY_RULE_SETUP
1538 {LEX_RETURN(kPHP_T_FUNCTION);}
1539 YY_BREAK
1540 case 33:
1541 YY_RULE_SETUP
1542 {LEX_RETURN(kPHP_T_CONST);}
1543 YY_BREAK
1544 case 34:
1545 YY_RULE_SETUP
1546 {LEX_RETURN(kPHP_T_RETURN);}
1547 YY_BREAK
1548 case 35:
1549 YY_RULE_SETUP
1550 {LEX_RETURN(kPHP_T_TRY);}
1551 YY_BREAK
1552 case 36:
1553 YY_RULE_SETUP
1554 {LEX_RETURN(kPHP_T_CATCH);}
1555 YY_BREAK
1556 case 37:
1557 YY_RULE_SETUP
1558 {LEX_RETURN(kPHP_T_THROW);}
1559 YY_BREAK
1560 case 38:
1561 YY_RULE_SETUP
1562 {LEX_RETURN(kPHP_T_IF);}
1563 YY_BREAK
1564 case 39:
1565 YY_RULE_SETUP
1566 {LEX_RETURN(kPHP_T_ELSEIF);}
1567 YY_BREAK
1568 case 40:
1569 YY_RULE_SETUP
1570 {LEX_RETURN(kPHP_T_ENDIF);}
1571 YY_BREAK
1572 case 41:
1573 YY_RULE_SETUP
1574 {LEX_RETURN(kPHP_T_ELSE);}
1575 YY_BREAK
1576 case 42:
1577 YY_RULE_SETUP
1578 {LEX_RETURN(kPHP_T_WHILE);}
1579 YY_BREAK
1580 case 43:
1581 YY_RULE_SETUP
1582 {LEX_RETURN(kPHP_T_ENDWHILE);}
1583 YY_BREAK
1584 case 44:
1585 YY_RULE_SETUP
1586 {LEX_RETURN(kPHP_T_DO);}
1587 YY_BREAK
1588 case 45:
1589 YY_RULE_SETUP
1590 {LEX_RETURN(kPHP_T_FOR);}
1591 YY_BREAK
1592 case 46:
1593 YY_RULE_SETUP
1594 {LEX_RETURN(kPHP_T_ENDFOR);}
1595 YY_BREAK
1596 case 47:
1597 YY_RULE_SETUP
1598 {LEX_RETURN(kPHP_T_FOREACH);}
1599 YY_BREAK
1600 case 48:
1601 YY_RULE_SETUP
1602 {LEX_RETURN(kPHP_T_ENDFOREACH);}
1603 YY_BREAK
1604 case 49:
1605 YY_RULE_SETUP
1606 {LEX_RETURN(kPHP_T_DECLARE);}
1607 YY_BREAK
1608 case 50:
1609 YY_RULE_SETUP
1610 {LEX_RETURN(kPHP_T_ENDDECLARE);}
1611 YY_BREAK
1612 case 51:
1613 YY_RULE_SETUP
1614 {LEX_RETURN(kPHP_T_INSTANCEOF);}
1615 YY_BREAK
1616 case 52:
1617 YY_RULE_SETUP
1618 {LEX_RETURN(kPHP_T_AS);}
1619 YY_BREAK
1620 case 53:
1621 YY_RULE_SETUP
1622 {LEX_RETURN(kPHP_T_SWITCH);}
1623 YY_BREAK
1624 case 54:
1625 YY_RULE_SETUP
1626 {LEX_RETURN(kPHP_T_ENDSWITCH);}
1627 YY_BREAK
1628 case 55:
1629 YY_RULE_SETUP
1630 {LEX_RETURN(kPHP_T_CASE);}
1631 YY_BREAK
1632 case 56:
1633 YY_RULE_SETUP
1634 {LEX_RETURN(kPHP_T_DEFAULT);}
1635 YY_BREAK
1636 case 57:
1637 YY_RULE_SETUP
1638 {LEX_RETURN(kPHP_T_BREAK);}
1639 YY_BREAK
1640 case 58:
1641 YY_RULE_SETUP
1642 {LEX_RETURN(kPHP_T_CONTINUE);}
1643 YY_BREAK
1644 case 59:
1645 YY_RULE_SETUP
1646 {LEX_RETURN(kPHP_T_GOTO);}
1647 YY_BREAK
1648 case 60:
1649 YY_RULE_SETUP
1650 {LEX_RETURN(kPHP_T_ECHO);}
1651 YY_BREAK
1652 case 61:
1653 YY_RULE_SETUP
1654 {LEX_RETURN(kPHP_T_PRINT);}
1655 YY_BREAK
1656 case 62:
1657 YY_RULE_SETUP
1658 {LEX_RETURN(kPHP_T_CLASS);}
1659 YY_BREAK
1660 case 63:
1661 YY_RULE_SETUP
1662 {LEX_RETURN(kPHP_T_INTERFACE);}
1663 YY_BREAK
1664 case 64:
1665 YY_RULE_SETUP
1666 {LEX_RETURN(kPHP_T_TRAIT);}
1667 YY_BREAK
1668 case 65:
1669 YY_RULE_SETUP
1670 {LEX_RETURN(kPHP_T_EXTENDS);}
1671 YY_BREAK
1672 case 66:
1673 YY_RULE_SETUP
1674 {LEX_RETURN(kPHP_T_IMPLEMENTS);}
1675 YY_BREAK
1676 case 67:
1677 YY_RULE_SETUP
1678 {LEX_RETURN(kPHP_T_OBJECT_OPERATOR);}
1679 YY_BREAK
1680 case 68:
1681 YY_RULE_SETUP
1682 {LEX_RETURN(kPHP_T_PAAMAYIM_NEKUDOTAYIM);}
1683 YY_BREAK
1684 case 69:
1685 YY_RULE_SETUP
1686 {LEX_RETURN(kPHP_T_NS_SEPARATOR);}
1687 YY_BREAK
1688 case 70:
1689 YY_RULE_SETUP
1690 {LEX_RETURN(kPHP_T_NEW);}
1691 YY_BREAK
1692 case 71:
1693 YY_RULE_SETUP
1694 {LEX_RETURN(kPHP_T_CLONE);}
1695 YY_BREAK
1696 case 72:
1697 YY_RULE_SETUP
1698 {LEX_RETURN(kPHP_T_VAR);}
1699 YY_BREAK
1700 case 73:
1701 YY_RULE_SETUP
1702 {LEX_RETURN(kPHP_T_EVAL);}
1703 YY_BREAK
1704 case 74:
1705 YY_RULE_SETUP
1706 {LEX_RETURN(kPHP_T_INCLUDE);}
1707 YY_BREAK
1708 case 75:
1709 YY_RULE_SETUP
1710 {LEX_RETURN(kPHP_T_INCLUDE_ONCE);}
1711 YY_BREAK
1712 case 76:
1713 YY_RULE_SETUP
1714 {LEX_RETURN(kPHP_T_REQUIRE);}
1715 YY_BREAK
1716 case 77:
1717 YY_RULE_SETUP
1718 {LEX_RETURN(kPHP_T_REQUIRE_ONCE);}
1719 YY_BREAK
1720 case 78:
1721 YY_RULE_SETUP
1722 {LEX_RETURN(kPHP_T_NAMESPACE);}
1723 YY_BREAK
1724 case 79:
1725 YY_RULE_SETUP
1726 {LEX_RETURN(kPHP_T_USE);}
1727 YY_BREAK
1728 case 80:
1729 YY_RULE_SETUP
1730 {LEX_RETURN(kPHP_T_INSTEADOF);}
1731 YY_BREAK
1732 case 81:
1733 YY_RULE_SETUP
1734 {LEX_RETURN(kPHP_T_GLOBAL);}
1735 YY_BREAK
1736 case 82:
1737 YY_RULE_SETUP
1738 {LEX_RETURN(kPHP_T_ISSET);}
1739 YY_BREAK
1740 case 83:
1741 YY_RULE_SETUP
1742 {LEX_RETURN(kPHP_T_EMPTY);}
1743 YY_BREAK
1744 case 84:
1745 YY_RULE_SETUP
1746 {LEX_RETURN(kPHP_T_STATIC);}
1747 YY_BREAK
1748 case 85:
1749 YY_RULE_SETUP
1750 {LEX_RETURN(kPHP_T_ABSTRACT);}
1751 YY_BREAK
1752 case 86:
1753 YY_RULE_SETUP
1754 {LEX_RETURN(kPHP_T_ABSTRACT);}
1755 YY_BREAK
1756 case 87:
1757 YY_RULE_SETUP
1758 {LEX_RETURN(kPHP_T_FINAL);}
1759 YY_BREAK
1760 case 88:
1761 YY_RULE_SETUP
1762 {LEX_RETURN(kPHP_T_PRIVATE);}
1763 YY_BREAK
1764 case 89:
1765 YY_RULE_SETUP
1766 {LEX_RETURN(kPHP_T_PROTECTED);}
1767 YY_BREAK
1768 case 90:
1769 YY_RULE_SETUP
1770 {LEX_RETURN(kPHP_T_PUBLIC);}
1771 YY_BREAK
1772 case 91:
1773 YY_RULE_SETUP
1774 {LEX_RETURN(kPHP_T_UNSET);}
1775 YY_BREAK
1776 case 92:
1777 YY_RULE_SETUP
1778 {LEX_RETURN(kPHP_T_DOUBLE_ARROW);}
1779 YY_BREAK
1780 case 93:
1781 YY_RULE_SETUP
1782 {LEX_RETURN(kPHP_T_SPACE_SHIP_OPERATPR);}
1783 YY_BREAK
1784 case 94:
1785 YY_RULE_SETUP
1786 {LEX_RETURN(kPHP_T_LIST);}
1787 YY_BREAK
1788 case 95:
1789 YY_RULE_SETUP
1790 {LEX_RETURN(kPHP_T_ARRAY);}
1791 YY_BREAK
1792 case 96:
1793 YY_RULE_SETUP
1794 {LEX_RETURN(kPHP_T_CALLABLE);}
1795 YY_BREAK
1796 case 97:
1797 YY_RULE_SETUP
1798 {LEX_RETURN(kPHP_T_INC);}
1799 YY_BREAK
1800 case 98:
1801 YY_RULE_SETUP
1802 {LEX_RETURN(kPHP_T_DEC);}
1803 YY_BREAK
1804 case 99:
1805 YY_RULE_SETUP
1806 {LEX_RETURN(kPHP_T_IS_IDENTICAL);}
1807 YY_BREAK
1808 case 100:
1809 YY_RULE_SETUP
1810 {LEX_RETURN(kPHP_T_IS_NOT_IDENTICAL);}
1811 YY_BREAK
1812 case 101:
1813 YY_RULE_SETUP
1814 {LEX_RETURN(kPHP_T_IS_EQUAL);}
1815 YY_BREAK
1816 case 102:
1817 YY_RULE_SETUP
1818 {LEX_RETURN(kPHP_T_IS_NOT_EQUAL);}
1819 YY_BREAK
1820 case 103:
1821 YY_RULE_SETUP
1822 {LEX_RETURN(kPHP_T_IS_SMALLER_OR_EQUAL);}
1823 YY_BREAK
1824 case 104:
1825 YY_RULE_SETUP
1826 {LEX_RETURN(kPHP_T_IS_GREATER_OR_EQUAL);}
1827 YY_BREAK
1828 case 105:
1829 YY_RULE_SETUP
1830 {LEX_RETURN(kPHP_T_PLUS_EQUAL);}
1831 YY_BREAK
1832 case 106:
1833 YY_RULE_SETUP
1834 {LEX_RETURN(kPHP_T_MINUS_EQUAL);}
1835 YY_BREAK
1836 case 107:
1837 YY_RULE_SETUP
1838 {LEX_RETURN(kPHP_T_MUL_EQUAL);}
1839 YY_BREAK
1840 case 108:
1841 YY_RULE_SETUP
1842 {LEX_RETURN(kPHP_T_DIV_EQUAL);}
1843 YY_BREAK
1844 case 109:
1845 YY_RULE_SETUP
1846 {LEX_RETURN(kPHP_T_CONCAT_EQUAL);}
1847 YY_BREAK
1848 case 110:
1849 YY_RULE_SETUP
1850 {LEX_RETURN(kPHP_T_MOD_EQUAL);}
1851 YY_BREAK
1852 case 111:
1853 YY_RULE_SETUP
1854 {LEX_RETURN(kPHP_T_SL_EQUAL);}
1855 YY_BREAK
1856 case 112:
1857 YY_RULE_SETUP
1858 {LEX_RETURN(kPHP_T_SR_EQUAL);}
1859 YY_BREAK
1860 case 113:
1861 YY_RULE_SETUP
1862 {LEX_RETURN(kPHP_T_AND_EQUAL);}
1863 YY_BREAK
1864 case 114:
1865 YY_RULE_SETUP
1866 {LEX_RETURN(kPHP_T_OR_EQUAL);}
1867 YY_BREAK
1868 case 115:
1869 YY_RULE_SETUP
1870 {LEX_RETURN(kPHP_T_XOR_EQUAL);}
1871 YY_BREAK
1872 case 116:
1873 YY_RULE_SETUP
1874 {LEX_RETURN(kPHP_T_BOOLEAN_OR);}
1875 YY_BREAK
1876 case 117:
1877 YY_RULE_SETUP
1878 {LEX_RETURN(kPHP_T_BOOLEAN_AND);}
1879 YY_BREAK
1880 case 118:
1881 YY_RULE_SETUP
1882 {LEX_RETURN(kPHP_T_LOGICAL_OR);}
1883 YY_BREAK
1884 case 119:
1885 YY_RULE_SETUP
1886 {LEX_RETURN(kPHP_T_LOGICAL_AND);}
1887 YY_BREAK
1888 case 120:
1889 YY_RULE_SETUP
1890 {LEX_RETURN(kPHP_T_LOGICAL_XOR);}
1891 YY_BREAK
1892 case 121:
1893 YY_RULE_SETUP
1894 {LEX_RETURN(kPHP_T_SL);}
1895 YY_BREAK
1896 case 122:
1897 YY_RULE_SETUP
1898 {LEX_RETURN(kPHP_T_SR);}
1899 YY_BREAK
1900 case 123:
1901 YY_RULE_SETUP
1902 {LEX_RETURN(kPHP_T_CLASS_C);}
1903 YY_BREAK
1904 case 124:
1905 YY_RULE_SETUP
1906 {LEX_RETURN(kPHP_T_TRAIT_C);}
1907 YY_BREAK
1908 case 125:
1909 YY_RULE_SETUP
1910 {LEX_RETURN(kPHP_T_FUNC_C);}
1911 YY_BREAK
1912 case 126:
1913 YY_RULE_SETUP
1914 {LEX_RETURN(kPHP_T_METHOD_C);}
1915 YY_BREAK
1916 case 127:
1917 YY_RULE_SETUP
1918 {LEX_RETURN(kPHP_T_LINE);}
1919 YY_BREAK
1920 case 128:
1921 YY_RULE_SETUP
1922 {LEX_RETURN(kPHP_T_FILE);}
1923 YY_BREAK
1924 case 129:
1925 YY_RULE_SETUP
1926 {LEX_RETURN(kPHP_T_DIR);}
1927 YY_BREAK
1928 case 130:
1929 YY_RULE_SETUP
1930 {LEX_RETURN(kPHP_T_NS_C);}
1931 YY_BREAK
1932 case 131:
1933 YY_RULE_SETUP
1934 {LEX_RETURN(kPHP_T_YIELD);}
1935 YY_BREAK
1936 case 132:
1937 YY_RULE_SETUP
1938 {
1939 LEX_RETURN(kPHP_T_INT_CAST);
1940 }
1941 YY_BREAK
1942 case 133:
1943 YY_RULE_SETUP
1944 {
1945 LEX_RETURN(kPHP_T_DOUBLE_CAST);
1946 }
1947 YY_BREAK
1948 case 134:
1949 YY_RULE_SETUP
1950 {
1951 LEX_RETURN(kPHP_T_STRING_CAST);
1952 }
1953 YY_BREAK
1954 case 135:
1955 YY_RULE_SETUP
1956 {
1957 LEX_RETURN(kPHP_T_ARRAY_CAST);
1958 }
1959 YY_BREAK
1960 case 136:
1961 YY_RULE_SETUP
1962 {
1963 LEX_RETURN(kPHP_T_OBJECT_CAST);
1964 }
1965 YY_BREAK
1966 case 137:
1967 YY_RULE_SETUP
1968 {
1969 return kPHP_T_BOOL_CAST;
1970 }
1971 YY_BREAK
1972 case 138:
1973 YY_RULE_SETUP
1974 {
1975 return kPHP_T_UNSET_CAST;
1976 }
1977 YY_BREAK
1978 case 139:
1979 YY_RULE_SETUP
1980 {LEX_RETURN(kPHP_T_IDENTIFIER);}
1981 YY_BREAK
1982 case 140:
1983 /* rule 140 can match eol */
1984 YY_RULE_SETUP
1985 {
1986 BEGIN(INITIAL);
1987 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
1988 userData->SetInsidePhp(false);
1989 return kPHP_T_CLOSE_TAG;
1990 }
1991 YY_BREAK
1992 case 141:
1993 /* rule 141 can match eol */
1994 YY_RULE_SETUP
1995 {
1996 BEGIN(INITIAL);
1997 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
1998 userData->SetInsidePhp(false);
1999 return kPHP_T_CLOSE_TAG;
2000 }
2001 YY_BREAK
2002 case 142:
2003 YY_RULE_SETUP
2004 {
2005 BEGIN(SINGLE_STRING);
2006 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
2007 userData->SetString("'");
2008 }
2009 YY_BREAK
2010 case 143:
2011 YY_RULE_SETUP
2012 {
2013 BEGIN(DSTRING);
2014 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
2015 userData->SetString("\"");
2016 }
2017 YY_BREAK
2018 case YY_STATE_EOF(PHP):
2019 {
2020 yyterminate();
2021 return 0;
2022 }
2023 YY_BREAK
2024 case 144:
2025 YY_RULE_SETUP
2026 {
2027 LEX_RETURN(yytext[0]);
2028 }
2029 YY_BREAK
2030 case 145:
2031 /* rule 145 can match eol */
2032 YY_RULE_SETUP
2033 {
2034 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
2035 userData->GetString().append("\n");
2036 }
2037 YY_BREAK
2038 case 146:
2039 YY_RULE_SETUP
2040 {
2041 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
2042 userData->GetString().append(yytext);
2043 }
2044 YY_BREAK
2045 case 147:
2046 YY_RULE_SETUP
2047 {
2048 BEGIN(PHP);
2049 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
2050 userData->GetString().append("'");
2051 return kPHP_T_CONSTANT_ENCAPSED_STRING;
2052 }
2053 YY_BREAK
2054 case 148:
2055 YY_RULE_SETUP
2056 {
2057 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
2058 userData->GetString().append(std::string(1, yytext[0]));
2059 }
2060 YY_BREAK
2061 case 149:
2062 /* rule 149 can match eol */
2063 YY_RULE_SETUP
2064 {
2065 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
2066 userData->GetString().append("\n");
2067 }
2068 YY_BREAK
2069 case 150:
2070 YY_RULE_SETUP
2071 {
2072 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
2073 userData->GetString().append(yytext);
2074 }
2075 YY_BREAK
2076 case 151:
2077 YY_RULE_SETUP
2078 {
2079 BEGIN(PHP);
2080 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
2081 userData->GetString().append("\"");
2082 return kPHP_T_CONSTANT_ENCAPSED_STRING;
2083 }
2084 YY_BREAK
2085 case 152:
2086 YY_RULE_SETUP
2087 {
2088 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
2089 userData->GetString().append(std::string(1, yytext[0]));
2090 }
2091 YY_BREAK
2092 case 153:
2093 YY_RULE_SETUP
2094 ECHO;
2095 YY_BREAK
2096 case YY_STATE_EOF(INITIAL):
2097 case YY_STATE_EOF(CPP_COMMENT):
2098 case YY_STATE_EOF(DOC_COMMENT):
2099 case YY_STATE_EOF(HEREDOC):
2100 case YY_STATE_EOF(DSTRING):
2101 case YY_STATE_EOF(SINGLE_STRING):
2102 yyterminate();
2103
2104 case YY_END_OF_BUFFER:
2105 {
2106 /* Amount of text matched not including the EOB char. */
2107 int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
2108
2109 /* Undo the effects of YY_DO_BEFORE_ACTION. */
2110 *yy_cp = yyg->yy_hold_char;
2111 YY_RESTORE_YY_MORE_OFFSET
2112
2113 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
2114 {
2115 /* We're scanning a new file or input source. It's
2116 * possible that this happened because the user
2117 * just pointed yyin at a new source and called
2118 * phplex(). If so, then we have to assure
2119 * consistency between YY_CURRENT_BUFFER and our
2120 * globals. Here is the right place to do so, because
2121 * this is the first action (other than possibly a
2122 * back-up) that will match for the new input source.
2123 */
2124 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2125 YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
2126 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
2127 }
2128
2129 /* Note that here we test for yy_c_buf_p "<=" to the position
2130 * of the first EOB in the buffer, since yy_c_buf_p will
2131 * already have been incremented past the NUL character
2132 * (since all states make transitions on EOB to the
2133 * end-of-buffer state). Contrast this with the test
2134 * in input().
2135 */
2136 if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2137 { /* This was really a NUL. */
2138 yy_state_type yy_next_state;
2139
2140 yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
2141
2142 yy_current_state = yy_get_previous_state( yyscanner );
2143
2144 /* Okay, we're now positioned to make the NUL
2145 * transition. We couldn't have
2146 * yy_get_previous_state() go ahead and do it
2147 * for us because it doesn't know how to deal
2148 * with the possibility of jamming (and we don't
2149 * want to build jamming into it because then it
2150 * will run more slowly).
2151 */
2152
2153 yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
2154
2155 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2156
2157 if ( yy_next_state )
2158 {
2159 /* Consume the NUL. */
2160 yy_cp = ++yyg->yy_c_buf_p;
2161 yy_current_state = yy_next_state;
2162 goto yy_match;
2163 }
2164
2165 else
2166 {
2167 yy_cp = yyg->yy_last_accepting_cpos;
2168 yy_current_state = yyg->yy_last_accepting_state;
2169 goto yy_find_action;
2170 }
2171 }
2172
2173 else switch ( yy_get_next_buffer( yyscanner ) )
2174 {
2175 case EOB_ACT_END_OF_FILE:
2176 {
2177 yyg->yy_did_buffer_switch_on_eof = 0;
2178
2179 if ( phpwrap(yyscanner ) )
2180 {
2181 /* Note: because we've taken care in
2182 * yy_get_next_buffer() to have set up
2183 * yytext, we can now set up
2184 * yy_c_buf_p so that if some total
2185 * hoser (like flex itself) wants to
2186 * call the scanner after we return the
2187 * YY_NULL, it'll still work - another
2188 * YY_NULL will get returned.
2189 */
2190 yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
2191
2192 yy_act = YY_STATE_EOF(YY_START);
2193 goto do_action;
2194 }
2195
2196 else
2197 {
2198 if ( ! yyg->yy_did_buffer_switch_on_eof )
2199 YY_NEW_FILE;
2200 }
2201 break;
2202 }
2203
2204 case EOB_ACT_CONTINUE_SCAN:
2205 yyg->yy_c_buf_p =
2206 yyg->yytext_ptr + yy_amount_of_matched_text;
2207
2208 yy_current_state = yy_get_previous_state( yyscanner );
2209
2210 yy_cp = yyg->yy_c_buf_p;
2211 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2212 goto yy_match;
2213
2214 case EOB_ACT_LAST_MATCH:
2215 yyg->yy_c_buf_p =
2216 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
2217
2218 yy_current_state = yy_get_previous_state( yyscanner );
2219
2220 yy_cp = yyg->yy_c_buf_p;
2221 yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
2222 goto yy_find_action;
2223 }
2224 break;
2225 }
2226
2227 default:
2228 YY_FATAL_ERROR(
2229 "fatal flex scanner internal error--no action found" );
2230 } /* end of action switch */
2231 } /* end of scanning one token */
2232 } /* end of phplex */
2233
2234 /* yy_get_next_buffer - try to read in a new buffer
2235 *
2236 * Returns a code representing an action:
2237 * EOB_ACT_LAST_MATCH -
2238 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
2239 * EOB_ACT_END_OF_FILE - end of file
2240 */
2241 static int yy_get_next_buffer (yyscan_t yyscanner)
2242 {
2243 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2244 register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
2245 register char *source = yyg->yytext_ptr;
2246 register int number_to_move, i;
2247 int ret_val;
2248
2249 if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
2250 YY_FATAL_ERROR(
2251 "fatal flex scanner internal error--end of buffer missed" );
2252
2253 if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
2254 { /* Don't try to fill the buffer, so this is an EOF. */
2255 if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
2256 {
2257 /* We matched a single character, the EOB, so
2258 * treat this as a final EOF.
2259 */
2260 return EOB_ACT_END_OF_FILE;
2261 }
2262
2263 else
2264 {
2265 /* We matched some text prior to the EOB, first
2266 * process it.
2267 */
2268 return EOB_ACT_LAST_MATCH;
2269 }
2270 }
2271
2272 /* Try to read more data. */
2273
2274 /* First move last chars to start of buffer. */
2275 number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
2276
2277 for ( i = 0; i < number_to_move; ++i )
2278 *(dest++) = *(source++);
2279
2280 if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
2281 /* don't do the read, it's not guaranteed to return an EOF,
2282 * just force an EOF
2283 */
2284 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
2285
2286 else
2287 {
2288 int num_to_read =
2289 YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
2290
2291 while ( num_to_read <= 0 )
2292 { /* Not enough room in the buffer - grow it. */
2293
2294 /* just a shorter name for the current buffer */
2295 YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
2296
2297 int yy_c_buf_p_offset =
2298 (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
2299
2300 if ( b->yy_is_our_buffer )
2301 {
2302 int new_size = b->yy_buf_size * 2;
2303
2304 if ( new_size <= 0 )
2305 b->yy_buf_size += b->yy_buf_size / 8;
2306 else
2307 b->yy_buf_size *= 2;
2308
2309 b->yy_ch_buf = (char *)
2310 /* Include room in for 2 EOB chars. */
2311 phprealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
2312 }
2313 else
2314 /* Can't grow it, we don't own it. */
2315 b->yy_ch_buf = 0;
2316
2317 if ( ! b->yy_ch_buf )
2318 YY_FATAL_ERROR(
2319 "fatal error - scanner input buffer overflow" );
2320
2321 yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
2322
2323 num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
2324 number_to_move - 1;
2325
2326 }
2327
2328 if ( num_to_read > YY_READ_BUF_SIZE )
2329 num_to_read = YY_READ_BUF_SIZE;
2330
2331 /* Read in more data. */
2332 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
2333 yyg->yy_n_chars, (size_t) num_to_read );
2334
2335 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2336 }
2337
2338 if ( yyg->yy_n_chars == 0 )
2339 {
2340 if ( number_to_move == YY_MORE_ADJ )
2341 {
2342 ret_val = EOB_ACT_END_OF_FILE;
2343 phprestart(yyin ,yyscanner);
2344 }
2345
2346 else
2347 {
2348 ret_val = EOB_ACT_LAST_MATCH;
2349 YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
2350 YY_BUFFER_EOF_PENDING;
2351 }
2352 }
2353
2354 else
2355 ret_val = EOB_ACT_CONTINUE_SCAN;
2356
2357 if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
2358 /* Extend the array by 50%, plus the number we really need. */
2359 yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
2360 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) phprealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
2361 if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2362 YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
2363 }
2364
2365 yyg->yy_n_chars += number_to_move;
2366 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
2367 YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
2368
2369 yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
2370
2371 return ret_val;
2372 }
2373
2374 /* yy_get_previous_state - get the state just before the EOB char was reached */
2375
2376 static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
2377 {
2378 register yy_state_type yy_current_state;
2379 register char *yy_cp;
2380 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2381
2382 yy_current_state = yyg->yy_start;
2383
2384 for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
2385 {
2386 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
2387 if ( yy_accept[yy_current_state] )
2388 {
2389 yyg->yy_last_accepting_state = yy_current_state;
2390 yyg->yy_last_accepting_cpos = yy_cp;
2391 }
2392 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2393 {
2394 yy_current_state = (int) yy_def[yy_current_state];
2395 if ( yy_current_state >= 646 )
2396 yy_c = yy_meta[(unsigned int) yy_c];
2397 }
2398 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2399 }
2400
2401 return yy_current_state;
2402 }
2403
2404 /* yy_try_NUL_trans - try to make a transition on the NUL character
2405 *
2406 * synopsis
2407 * next_state = yy_try_NUL_trans( current_state );
2408 */
2409 static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
2410 {
2411 register int yy_is_jam;
2412 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
2413 register char *yy_cp = yyg->yy_c_buf_p;
2414
2415 register YY_CHAR yy_c = 1;
2416 if ( yy_accept[yy_current_state] )
2417 {
2418 yyg->yy_last_accepting_state = yy_current_state;
2419 yyg->yy_last_accepting_cpos = yy_cp;
2420 }
2421 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
2422 {
2423 yy_current_state = (int) yy_def[yy_current_state];
2424 if ( yy_current_state >= 646 )
2425 yy_c = yy_meta[(unsigned int) yy_c];
2426 }
2427 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
2428 yy_is_jam = (yy_current_state == 645);
2429
2430 return yy_is_jam ? 0 : yy_current_state;
2431 }
2432
2433 static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner)
2434 {
2435 register char *yy_cp;
2436 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2437
2438 yy_cp = yyg->yy_c_buf_p;
2439
2440 /* undo effects of setting up yytext */
2441 *yy_cp = yyg->yy_hold_char;
2442
2443 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2444 { /* need to shift things up to make room */
2445 /* +2 for EOB chars. */
2446 register int number_to_move = yyg->yy_n_chars + 2;
2447 register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
2448 YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
2449 register char *source =
2450 &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
2451
2452 while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
2453 *--dest = *--source;
2454
2455 yy_cp += (int) (dest - source);
2456 yy_bp += (int) (dest - source);
2457 YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
2458 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
2459
2460 if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
2461 YY_FATAL_ERROR( "flex scanner push-back overflow" );
2462 }
2463
2464 *--yy_cp = (char) c;
2465
2466 if ( c == '\n' ){
2467 --yylineno;
2468 }
2469
2470 yyg->yytext_ptr = yy_bp;
2471 yyg->yy_hold_char = *yy_cp;
2472 yyg->yy_c_buf_p = yy_cp;
2473 }
2474
2475 #ifndef YY_NO_INPUT
2476 #ifdef __cplusplus
2477 static int yyinput (yyscan_t yyscanner)
2478 #else
2479 static int input (yyscan_t yyscanner)
2480 #endif
2481
2482 {
2483 int c;
2484 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2485
2486 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2487
2488 if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
2489 {
2490 /* yy_c_buf_p now points to the character we want to return.
2491 * If this occurs *before* the EOB characters, then it's a
2492 * valid NUL; if not, then we've hit the end of the buffer.
2493 */
2494 if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
2495 /* This was really a NUL. */
2496 *yyg->yy_c_buf_p = '\0';
2497
2498 else
2499 { /* need more input */
2500 int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
2501 ++yyg->yy_c_buf_p;
2502
2503 switch ( yy_get_next_buffer( yyscanner ) )
2504 {
2505 case EOB_ACT_LAST_MATCH:
2506 /* This happens because yy_g_n_b()
2507 * sees that we've accumulated a
2508 * token and flags that we need to
2509 * try matching the token before
2510 * proceeding. But for input(),
2511 * there's no matching to consider.
2512 * So convert the EOB_ACT_LAST_MATCH
2513 * to EOB_ACT_END_OF_FILE.
2514 */
2515
2516 /* Reset buffer status. */
2517 phprestart(yyin ,yyscanner);
2518
2519 /*FALLTHROUGH*/
2520
2521 case EOB_ACT_END_OF_FILE:
2522 {
2523 if ( phpwrap(yyscanner ) )
2524 return EOF;
2525
2526 if ( ! yyg->yy_did_buffer_switch_on_eof )
2527 YY_NEW_FILE;
2528 #ifdef __cplusplus
2529 return yyinput(yyscanner);
2530 #else
2531 return input(yyscanner);
2532 #endif
2533 }
2534
2535 case EOB_ACT_CONTINUE_SCAN:
2536 yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
2537 break;
2538 }
2539 }
2540 }
2541
2542 c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
2543 *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
2544 yyg->yy_hold_char = *++yyg->yy_c_buf_p;
2545
2546 if ( c == '\n' )
2547
2548 do{ yylineno++;
2549 yycolumn=0;
2550 }while(0)
2551 ;
2552
2553 return c;
2554 }
2555 #endif /* ifndef YY_NO_INPUT */
2556
2557 /** Immediately switch to a different input stream.
2558 * @param input_file A readable stream.
2559 * @param yyscanner The scanner object.
2560 * @note This function does not reset the start condition to @c INITIAL .
2561 */
2562 void phprestart (FILE * input_file , yyscan_t yyscanner)
2563 {
2564 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2565
2566 if ( ! YY_CURRENT_BUFFER ){
2567 phpensure_buffer_stack (yyscanner);
2568 YY_CURRENT_BUFFER_LVALUE =
2569 php_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
2570 }
2571
2572 php_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
2573 php_load_buffer_state(yyscanner );
2574 }
2575
2576 /** Switch to a different input buffer.
2577 * @param new_buffer The new input buffer.
2578 * @param yyscanner The scanner object.
2579 */
2580 void php_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2581 {
2582 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2583
2584 /* TODO. We should be able to replace this entire function body
2585 * with
2586 * phppop_buffer_state();
2587 * phppush_buffer_state(new_buffer);
2588 */
2589 phpensure_buffer_stack (yyscanner);
2590 if ( YY_CURRENT_BUFFER == new_buffer )
2591 return;
2592
2593 if ( YY_CURRENT_BUFFER )
2594 {
2595 /* Flush out information for old buffer. */
2596 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2597 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2598 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2599 }
2600
2601 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2602 php_load_buffer_state(yyscanner );
2603
2604 /* We don't actually know whether we did this switch during
2605 * EOF (phpwrap()) processing, but the only time this flag
2606 * is looked at is after phpwrap() is called, so it's safe
2607 * to go ahead and always set it.
2608 */
2609 yyg->yy_did_buffer_switch_on_eof = 1;
2610 }
2611
2612 static void php_load_buffer_state (yyscan_t yyscanner)
2613 {
2614 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2615 yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
2616 yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
2617 yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
2618 yyg->yy_hold_char = *yyg->yy_c_buf_p;
2619 }
2620
2621 /** Allocate and initialize an input buffer state.
2622 * @param file A readable stream.
2623 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
2624 * @param yyscanner The scanner object.
2625 * @return the allocated buffer state.
2626 */
2627 YY_BUFFER_STATE php_create_buffer (FILE * file, int size , yyscan_t yyscanner)
2628 {
2629 YY_BUFFER_STATE b;
2630
2631 b = (YY_BUFFER_STATE) phpalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
2632 if ( ! b )
2633 YY_FATAL_ERROR( "out of dynamic memory in php_create_buffer()" );
2634
2635 b->yy_buf_size = size;
2636
2637 /* yy_ch_buf has to be 2 characters longer than the size given because
2638 * we need to put in 2 end-of-buffer characters.
2639 */
2640 b->yy_ch_buf = (char *) phpalloc(b->yy_buf_size + 2 ,yyscanner );
2641 if ( ! b->yy_ch_buf )
2642 YY_FATAL_ERROR( "out of dynamic memory in php_create_buffer()" );
2643
2644 b->yy_is_our_buffer = 1;
2645
2646 php_init_buffer(b,file ,yyscanner);
2647
2648 return b;
2649 }
2650
2651 /** Destroy the buffer.
2652 * @param b a buffer created with php_create_buffer()
2653 * @param yyscanner The scanner object.
2654 */
2655 void php_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2656 {
2657 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2658
2659 if ( ! b )
2660 return;
2661
2662 if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
2663 YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
2664
2665 if ( b->yy_is_our_buffer )
2666 phpfree((void *) b->yy_ch_buf ,yyscanner );
2667
2668 phpfree((void *) b ,yyscanner );
2669 }
2670
2671 #ifndef __cplusplus
2672 extern int isatty (int );
2673 #endif /* __cplusplus */
2674
2675 /* Initializes or reinitializes a buffer.
2676 * This function is sometimes called more than once on the same buffer,
2677 * such as during a phprestart() or at EOF.
2678 */
2679 static void php_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
2680
2681 {
2682 int oerrno = errno;
2683 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2684
2685 php_flush_buffer(b ,yyscanner);
2686
2687 b->yy_input_file = file;
2688 b->yy_fill_buffer = 1;
2689
2690 /* If b is the current buffer, then php_init_buffer was _probably_
2691 * called from phprestart() or through yy_get_next_buffer.
2692 * In that case, we don't want to reset the lineno or column.
2693 */
2694 if (b != YY_CURRENT_BUFFER){
2695 b->yy_bs_lineno = 1;
2696 b->yy_bs_column = 0;
2697 }
2698
2699 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
2700
2701 errno = oerrno;
2702 }
2703
2704 /** Discard all buffered characters. On the next scan, YY_INPUT will be called.
2705 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
2706 * @param yyscanner The scanner object.
2707 */
2708 void php_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
2709 {
2710 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2711 if ( ! b )
2712 return;
2713
2714 b->yy_n_chars = 0;
2715
2716 /* We always need two end-of-buffer characters. The first causes
2717 * a transition to the end-of-buffer state. The second causes
2718 * a jam in that state.
2719 */
2720 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
2721 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
2722
2723 b->yy_buf_pos = &b->yy_ch_buf[0];
2724
2725 b->yy_at_bol = 1;
2726 b->yy_buffer_status = YY_BUFFER_NEW;
2727
2728 if ( b == YY_CURRENT_BUFFER )
2729 php_load_buffer_state(yyscanner );
2730 }
2731
2732 /** Pushes the new state onto the stack. The new state becomes
2733 * the current state. This function will allocate the stack
2734 * if necessary.
2735 * @param new_buffer The new state.
2736 * @param yyscanner The scanner object.
2737 */
2738 void phppush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
2739 {
2740 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2741 if (new_buffer == NULL)
2742 return;
2743
2744 phpensure_buffer_stack(yyscanner);
2745
2746 /* This block is copied from php_switch_to_buffer. */
2747 if ( YY_CURRENT_BUFFER )
2748 {
2749 /* Flush out information for old buffer. */
2750 *yyg->yy_c_buf_p = yyg->yy_hold_char;
2751 YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
2752 YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
2753 }
2754
2755 /* Only push if top exists. Otherwise, replace top. */
2756 if (YY_CURRENT_BUFFER)
2757 yyg->yy_buffer_stack_top++;
2758 YY_CURRENT_BUFFER_LVALUE = new_buffer;
2759
2760 /* copied from php_switch_to_buffer. */
2761 php_load_buffer_state(yyscanner );
2762 yyg->yy_did_buffer_switch_on_eof = 1;
2763 }
2764
2765 /** Removes and deletes the top of the stack, if present.
2766 * The next element becomes the new top.
2767 * @param yyscanner The scanner object.
2768 */
2769 void phppop_buffer_state (yyscan_t yyscanner)
2770 {
2771 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2772 if (!YY_CURRENT_BUFFER)
2773 return;
2774
2775 php_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
2776 YY_CURRENT_BUFFER_LVALUE = NULL;
2777 if (yyg->yy_buffer_stack_top > 0)
2778 --yyg->yy_buffer_stack_top;
2779
2780 if (YY_CURRENT_BUFFER) {
2781 php_load_buffer_state(yyscanner );
2782 yyg->yy_did_buffer_switch_on_eof = 1;
2783 }
2784 }
2785
2786 /* Allocates the stack if it does not exist.
2787 * Guarantees space for at least one push.
2788 */
2789 static void phpensure_buffer_stack (yyscan_t yyscanner)
2790 {
2791 int num_to_alloc;
2792 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2793
2794 if (!yyg->yy_buffer_stack) {
2795
2796 /* First allocation is just for 2 elements, since we don't know if this
2797 * scanner will even need a stack. We use 2 instead of 1 to avoid an
2798 * immediate realloc on the next call.
2799 */
2800 num_to_alloc = 1;
2801 yyg->yy_buffer_stack = (struct yy_buffer_state**)phpalloc
2802 (num_to_alloc * sizeof(struct yy_buffer_state*)
2803 , yyscanner);
2804 if ( ! yyg->yy_buffer_stack )
2805 YY_FATAL_ERROR( "out of dynamic memory in phpensure_buffer_stack()" );
2806
2807 memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
2808
2809 yyg->yy_buffer_stack_max = num_to_alloc;
2810 yyg->yy_buffer_stack_top = 0;
2811 return;
2812 }
2813
2814 if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
2815
2816 /* Increase the buffer to prepare for a possible push. */
2817 int grow_size = 8 /* arbitrary grow size */;
2818
2819 num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
2820 yyg->yy_buffer_stack = (struct yy_buffer_state**)phprealloc
2821 (yyg->yy_buffer_stack,
2822 num_to_alloc * sizeof(struct yy_buffer_state*)
2823 , yyscanner);
2824 if ( ! yyg->yy_buffer_stack )
2825 YY_FATAL_ERROR( "out of dynamic memory in phpensure_buffer_stack()" );
2826
2827 /* zero only the new slots.*/
2828 memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
2829 yyg->yy_buffer_stack_max = num_to_alloc;
2830 }
2831 }
2832
2833 /** Setup the input buffer state to scan directly from a user-specified character buffer.
2834 * @param base the character buffer
2835 * @param size the size in bytes of the character buffer
2836 * @param yyscanner The scanner object.
2837 * @return the newly allocated buffer state object.
2838 */
2839 YY_BUFFER_STATE php_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
2840 {
2841 YY_BUFFER_STATE b;
2842
2843 if ( size < 2 ||
2844 base[size-2] != YY_END_OF_BUFFER_CHAR ||
2845 base[size-1] != YY_END_OF_BUFFER_CHAR )
2846 /* They forgot to leave room for the EOB's. */
2847 return 0;
2848
2849 b = (YY_BUFFER_STATE) phpalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
2850 if ( ! b )
2851 YY_FATAL_ERROR( "out of dynamic memory in php_scan_buffer()" );
2852
2853 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
2854 b->yy_buf_pos = b->yy_ch_buf = base;
2855 b->yy_is_our_buffer = 0;
2856 b->yy_input_file = 0;
2857 b->yy_n_chars = b->yy_buf_size;
2858 b->yy_is_interactive = 0;
2859 b->yy_at_bol = 1;
2860 b->yy_fill_buffer = 0;
2861 b->yy_buffer_status = YY_BUFFER_NEW;
2862
2863 php_switch_to_buffer(b ,yyscanner );
2864
2865 return b;
2866 }
2867
2868 /** Setup the input buffer state to scan a string. The next call to phplex() will
2869 * scan from a @e copy of @a str.
2870 * @param yystr a NUL-terminated string to scan
2871 * @param yyscanner The scanner object.
2872 * @return the newly allocated buffer state object.
2873 * @note If you want to scan bytes that may contain NUL values, then use
2874 * php_scan_bytes() instead.
2875 */
2876 YY_BUFFER_STATE php_scan_string (yyconst char * yystr , yyscan_t yyscanner)
2877 {
2878
2879 return php_scan_bytes(yystr,strlen(yystr) ,yyscanner);
2880 }
2881
2882 /** Setup the input buffer state to scan the given bytes. The next call to phplex() will
2883 * scan from a @e copy of @a bytes.
2884 * @param yybytes the byte buffer to scan
2885 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2886 * @param yyscanner The scanner object.
2887 * @return the newly allocated buffer state object.
2888 */
2889 YY_BUFFER_STATE php_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
2890 {
2891 YY_BUFFER_STATE b;
2892 char *buf;
2893 yy_size_t n;
2894 int i;
2895
2896 /* Get memory for full buffer, including space for trailing EOB's. */
2897 n = _yybytes_len + 2;
2898 buf = (char *) phpalloc(n ,yyscanner );
2899 if ( ! buf )
2900 YY_FATAL_ERROR( "out of dynamic memory in php_scan_bytes()" );
2901
2902 for ( i = 0; i < _yybytes_len; ++i )
2903 buf[i] = yybytes[i];
2904
2905 buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
2906
2907 b = php_scan_buffer(buf,n ,yyscanner);
2908 if ( ! b )
2909 YY_FATAL_ERROR( "bad buffer in php_scan_bytes()" );
2910
2911 /* It's okay to grow etc. this buffer, and we should throw it
2912 * away when we're done.
2913 */
2914 b->yy_is_our_buffer = 1;
2915
2916 return b;
2917 }
2918
2919 #ifndef YY_EXIT_FAILURE
2920 #define YY_EXIT_FAILURE 2
2921 #endif
2922
2923 static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
2924 {
2925 (void) fprintf( stderr, "%s\n", msg );
2926
2927 }
2928
2929 /* Redefine yyless() so it works in section 3 code. */
2930
2931 #undef yyless
2932 #define yyless(n) \
2933 do \
2934 { \
2935 /* Undo effects of setting up yytext. */ \
2936 int yyless_macro_arg = (n); \
2937 YY_LESS_LINENO(yyless_macro_arg);\
2938 yytext[yyleng] = yyg->yy_hold_char; \
2939 yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
2940 yyg->yy_hold_char = *yyg->yy_c_buf_p; \
2941 *yyg->yy_c_buf_p = '\0'; \
2942 yyleng = yyless_macro_arg; \
2943 } \
2944 while ( 0 )
2945
2946 /* Accessor methods (get/set functions) to struct members. */
2947
2948 /** Get the user-defined data for this scanner.
2949 * @param yyscanner The scanner object.
2950 */
2951 YY_EXTRA_TYPE phpget_extra (yyscan_t yyscanner)
2952 {
2953 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2954 return yyextra;
2955 }
2956
2957 /** Get the current line number.
2958 * @param yyscanner The scanner object.
2959 */
2960 int phpget_lineno (yyscan_t yyscanner)
2961 {
2962 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2963
2964 if (! YY_CURRENT_BUFFER)
2965 return 0;
2966
2967 return yylineno;
2968 }
2969
2970 /** Get the current column number.
2971 * @param yyscanner The scanner object.
2972 */
2973 int phpget_column (yyscan_t yyscanner)
2974 {
2975 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2976
2977 if (! YY_CURRENT_BUFFER)
2978 return 0;
2979
2980 return yycolumn;
2981 }
2982
2983 /** Get the input stream.
2984 * @param yyscanner The scanner object.
2985 */
2986 FILE *phpget_in (yyscan_t yyscanner)
2987 {
2988 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2989 return yyin;
2990 }
2991
2992 /** Get the output stream.
2993 * @param yyscanner The scanner object.
2994 */
2995 FILE *phpget_out (yyscan_t yyscanner)
2996 {
2997 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
2998 return yyout;
2999 }
3000
3001 /** Get the length of the current token.
3002 * @param yyscanner The scanner object.
3003 */
3004 int phpget_leng (yyscan_t yyscanner)
3005 {
3006 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3007 return yyleng;
3008 }
3009
3010 /** Get the current token.
3011 * @param yyscanner The scanner object.
3012 */
3013
3014 char *phpget_text (yyscan_t yyscanner)
3015 {
3016 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3017 return yytext;
3018 }
3019
3020 /** Set the user-defined data. This data is never touched by the scanner.
3021 * @param user_defined The data to be associated with this scanner.
3022 * @param yyscanner The scanner object.
3023 */
3024 void phpset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
3025 {
3026 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3027 yyextra = user_defined ;
3028 }
3029
3030 /** Set the current line number.
3031 * @param line_number
3032 * @param yyscanner The scanner object.
3033 */
3034 void phpset_lineno (int line_number , yyscan_t yyscanner)
3035 {
3036 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3037
3038 /* lineno is only valid if an input buffer exists. */
3039 if (! YY_CURRENT_BUFFER )
3040 yy_fatal_error( "phpset_lineno called with no buffer" , yyscanner);
3041
3042 yylineno = line_number;
3043 }
3044
3045 /** Set the current column.
3046 * @param line_number
3047 * @param yyscanner The scanner object.
3048 */
3049 void phpset_column (int column_no , yyscan_t yyscanner)
3050 {
3051 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3052
3053 /* column is only valid if an input buffer exists. */
3054 if (! YY_CURRENT_BUFFER )
3055 yy_fatal_error( "phpset_column called with no buffer" , yyscanner);
3056
3057 yycolumn = column_no;
3058 }
3059
3060 /** Set the input stream. This does not discard the current
3061 * input buffer.
3062 * @param in_str A readable stream.
3063 * @param yyscanner The scanner object.
3064 * @see php_switch_to_buffer
3065 */
3066 void phpset_in (FILE * in_str , yyscan_t yyscanner)
3067 {
3068 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3069 yyin = in_str ;
3070 }
3071
3072 void phpset_out (FILE * out_str , yyscan_t yyscanner)
3073 {
3074 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3075 yyout = out_str ;
3076 }
3077
3078 int phpget_debug (yyscan_t yyscanner)
3079 {
3080 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3081 return yy_flex_debug;
3082 }
3083
3084 void phpset_debug (int bdebug , yyscan_t yyscanner)
3085 {
3086 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3087 yy_flex_debug = bdebug ;
3088 }
3089
3090 /* Accessor methods for yylval and yylloc */
3091
3092 /* User-visible API */
3093
3094 /* phplex_init is special because it creates the scanner itself, so it is
3095 * the ONLY reentrant function that doesn't take the scanner as the last argument.
3096 * That's why we explicitly handle the declaration, instead of using our macros.
3097 */
3098
3099 int phplex_init(yyscan_t* ptr_yy_globals)
3100
3101 {
3102 if (ptr_yy_globals == NULL){
3103 errno = EINVAL;
3104 return 1;
3105 }
3106
3107 *ptr_yy_globals = (yyscan_t) phpalloc ( sizeof( struct yyguts_t ), NULL );
3108
3109 if (*ptr_yy_globals == NULL){
3110 errno = ENOMEM;
3111 return 1;
3112 }
3113
3114 /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
3115 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3116
3117 return yy_init_globals ( *ptr_yy_globals );
3118 }
3119
3120 /* phplex_init_extra has the same functionality as phplex_init, but follows the
3121 * convention of taking the scanner as the last argument. Note however, that
3122 * this is a *pointer* to a scanner, as it will be allocated by this call (and
3123 * is the reason, too, why this function also must handle its own declaration).
3124 * The user defined value in the first argument will be available to phpalloc in
3125 * the yyextra field.
3126 */
3127
3128 int phplex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
3129
3130 {
3131 struct yyguts_t dummy_yyguts;
3132
3133 phpset_extra (yy_user_defined, &dummy_yyguts);
3134
3135 if (ptr_yy_globals == NULL){
3136 errno = EINVAL;
3137 return 1;
3138 }
3139
3140 *ptr_yy_globals = (yyscan_t) phpalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
3141
3142 if (*ptr_yy_globals == NULL){
3143 errno = ENOMEM;
3144 return 1;
3145 }
3146
3147 /* By setting to 0xAA, we expose bugs in
3148 yy_init_globals. Leave at 0x00 for releases. */
3149 memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
3150
3151 phpset_extra (yy_user_defined, *ptr_yy_globals);
3152
3153 return yy_init_globals ( *ptr_yy_globals );
3154 }
3155
3156 static int yy_init_globals (yyscan_t yyscanner)
3157 {
3158 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3159 /* Initialization is the same as for the non-reentrant scanner.
3160 * This function is called from phplex_destroy(), so don't allocate here.
3161 */
3162
3163 yyg->yy_buffer_stack = 0;
3164 yyg->yy_buffer_stack_top = 0;
3165 yyg->yy_buffer_stack_max = 0;
3166 yyg->yy_c_buf_p = (char *) 0;
3167 yyg->yy_init = 0;
3168 yyg->yy_start = 0;
3169
3170 yyg->yy_start_stack_ptr = 0;
3171 yyg->yy_start_stack_depth = 0;
3172 yyg->yy_start_stack = NULL;
3173
3174 /* Defined in main.c */
3175 #ifdef YY_STDINIT
3176 yyin = stdin;
3177 yyout = stdout;
3178 #else
3179 yyin = (FILE *) 0;
3180 yyout = (FILE *) 0;
3181 #endif
3182
3183 /* For future reference: Set errno on error, since we are called by
3184 * phplex_init()
3185 */
3186 return 0;
3187 }
3188
3189 /* phplex_destroy is for both reentrant and non-reentrant scanners. */
3190 int phplex_destroy (yyscan_t yyscanner)
3191 {
3192 struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
3193
3194 /* Pop the buffer stack, destroying each element. */
3195 while(YY_CURRENT_BUFFER){
3196 php_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
3197 YY_CURRENT_BUFFER_LVALUE = NULL;
3198 phppop_buffer_state(yyscanner);
3199 }
3200
3201 /* Destroy the stack itself. */
3202 phpfree(yyg->yy_buffer_stack ,yyscanner);
3203 yyg->yy_buffer_stack = NULL;
3204
3205 /* Destroy the start condition stack. */
3206 phpfree(yyg->yy_start_stack ,yyscanner );
3207 yyg->yy_start_stack = NULL;
3208
3209 /* Reset the globals. This is important in a non-reentrant scanner so the next time
3210 * phplex() is called, initialization will occur. */
3211 yy_init_globals( yyscanner);
3212
3213 /* Destroy the main struct (reentrant only). */
3214 phpfree ( yyscanner , yyscanner );
3215 yyscanner = NULL;
3216 return 0;
3217 }
3218
3219 /*
3220 * Internal utility routines.
3221 */
3222
3223 #ifndef yytext_ptr
3224 static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
3225 {
3226 register int i;
3227 for ( i = 0; i < n; ++i )
3228 s1[i] = s2[i];
3229 }
3230 #endif
3231
3232 #ifdef YY_NEED_STRLEN
3233 static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
3234 {
3235 register int n;
3236 for ( n = 0; s[n]; ++n )
3237 ;
3238
3239 return n;
3240 }
3241 #endif
3242
3243 void *phpalloc (yy_size_t size , yyscan_t yyscanner)
3244 {
3245 return (void *) malloc( size );
3246 }
3247
3248 void *phprealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
3249 {
3250 /* The cast to (char *) in the following accommodates both
3251 * implementations that use char* generic pointers, and those
3252 * that use void* generic pointers. It works with the latter
3253 * because both ANSI C and C++ allow castless assignment from
3254 * any pointer type to void*, and deal with argument conversions
3255 * as though doing an assignment.
3256 */
3257 return (void *) realloc( (char *) ptr, size );
3258 }
3259
3260 void phpfree (void * ptr , yyscan_t yyscanner)
3261 {
3262 free( (char *) ptr ); /* see phprealloc() for (char *) cast */
3263 }
3264
3265 #define YYTABLES_NAME "yytables"
3266
3267 //=============-------------------------------
3268 // API methods implementation
3269 //=============-------------------------------
3270
3271 phpLexerUserData* phpLexerGetUserData(void* scanner)
3272 {
3273 struct yyguts_t * yyg = (struct yyguts_t*)scanner;
3274 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
3275 return userData;
3276 }
3277
3278 bool phpLexerIsPHPCode(void* scanner)
3279 {
3280 struct yyguts_t * yyg = (struct yyguts_t*)scanner;
3281 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
3282 return userData->IsInsidePhp();
3283 }
3284
3285 void* phpLexerNew(const wxFileName& filename, size_t options )
3286 {
3287 wxFileName fn(filename);
3288 if(fn.IsRelative()) {
3289 fn.MakeAbsolute();
3290 }
3291
3292 FILE* fp = ::fopen(fn.GetFullPath().mb_str().data(), "rb");
3293 if(!fp) {
3294 return NULL;
3295 }
3296 yyscan_t scanner;
3297 phplex_init(&scanner);
3298 struct yyguts_t * yyg = (struct yyguts_t*)scanner;
3299 yyg->yyextra_r = new phpLexerUserData(options);
3300 ((phpLexerUserData*)yyg->yyextra_r)->SetFp(fp);
3301 php_switch_to_buffer(php_create_buffer(fp, YY_BUF_SIZE, scanner), scanner);
3302 yylineno = 0;
3303 return scanner;
3304 }
3305
3306 void* phpLexerNew(const wxString& content, size_t options )
3307 {
3308 yyscan_t scanner;
3309 phplex_init(&scanner);
3310 wxCharBuffer cb = content.mb_str(wxConvUTF8);
3311 struct yyguts_t * yyg = (struct yyguts_t*)scanner;
3312 yyg->yyextra_r = new phpLexerUserData(options);
3313 php_switch_to_buffer(php_scan_string(cb.data(), scanner), scanner);
3314 yylineno = 0;
3315 return scanner;
3316 }
3317
3318 void phpLexerDestroy(void** scanner)
3319 {
3320 struct yyguts_t * yyg = (struct yyguts_t*)(*scanner);
3321 delete (phpLexerUserData*)yyg->yyextra_r;
3322 php_delete_buffer(YY_CURRENT_BUFFER, *scanner);
3323
3324 phplex_destroy(*scanner);
3325 *scanner = NULL;
3326 }
3327
3328 void phpLexerUnget(void* scanner)
3329 {
3330 struct yyguts_t * yyg = (struct yyguts_t*)scanner;
3331 yyless(0);
3332 }
3333
3334 bool phpLexerNext(void* scanner, phpLexerToken& token)
3335 {
3336 token.endLineNumber = -1;
3337 token.type = phplex(scanner);
3338 if(token.type != 0) {
3339 struct yyguts_t * yyg = (struct yyguts_t*)scanner;
3340 phpLexerUserData* userData = (phpLexerUserData*)yyg->yyextra_r;
3341 switch(token.type) {
3342 case kPHP_T_END_HEREDOC:
3343 token.lineNumber = yylineno;
3344 token.SetText(userData->GetString());
3345 userData->GetString().clear();
3346 break;
3347 case kPHP_T_START_HEREDOC:
3348 token.lineNumber = yylineno;
3349 token.SetText("");
3350 break;
3351 case kPHP_T_CONSTANT_ENCAPSED_STRING:
3352 token.lineNumber = yylineno;
3353 token.SetText(userData->GetString());
3354 userData->GetString().clear();
3355 break;
3356 case kPHP_T_CXX_COMMENT:
3357 // One line up for CXX comments
3358 token.lineNumber = userData->GetCommentStartLine();
3359 token.SetText(userData->GetComment());
3360 userData->ClearComment();
3361 break;
3362 case kPHP_T_C_COMMENT:
3363 token.SetText(userData->GetComment());
3364 token.lineNumber = userData->GetCommentStartLine();
3365 token.endLineNumber = userData->GetCommentEndLine();
3366 userData->ClearComment();
3367 break;
3368 default:
3369 token.lineNumber = yylineno;
3370 token.SetText(phpget_text(scanner));
3371 break;
3372 }
3373
3374 } else {
3375 token.ClearText();
3376 token.lineNumber = 0;
3377 }
3378 return token.type != 0;
3379 }
3380