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