1 /* A lexical scanner generated by flex */
3 /* Scanner skeleton version:
4 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
8 #define YY_FLEX_MAJOR_VERSION 2
9 #define YY_FLEX_MINOR_VERSION 5
14 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
27 /* Use prototypes in function declarations. */
30 /* The "const" storage-class-modifier is valid. */
33 #else /* ! __cplusplus */
41 #endif /* ! __cplusplus */
60 #define YY_PROTO(proto) proto
62 #define YY_PROTO(proto) ()
65 /* Returned upon end-of-file. */
68 /* Promotes a possibly negative, possibly signed char to an unsigned
69 * integer for use as an array index. If the signed char is negative,
70 * we want to instead treat it as an 8-bit unsigned char, hence the
73 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
75 /* Enter a start condition. This macro really ought to take a parameter,
76 * but we do it the disgusting crufty way forced on us by the ()-less
77 * definition of BEGIN.
79 #define BEGIN yy_start = 1 + 2 *
81 /* Translate the current start state into a value that can be later handed
82 * to BEGIN to return to the state. The YYSTATE alias is for lex
85 #define YY_START ((yy_start - 1) / 2)
86 #define YYSTATE YY_START
88 /* Action number for EOF rule of a given start state. */
89 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
91 /* Special action meaning "start processing a new file". */
92 #define YY_NEW_FILE yyrestart( yyin )
94 #define YY_END_OF_BUFFER_CHAR 0
96 /* Size of default input buffer. */
97 #define YY_BUF_SIZE 16384
99 typedef struct yy_buffer_state
*YY_BUFFER_STATE
;
102 extern FILE *yyin
, *yyout
;
104 #define EOB_ACT_CONTINUE_SCAN 0
105 #define EOB_ACT_END_OF_FILE 1
106 #define EOB_ACT_LAST_MATCH 2
108 /* The funky do-while in the following #define is used to turn the definition
109 * int a single C statement (which needs a semi-colon terminator). This
110 * avoids problems with code like:
112 * if ( condition_holds )
115 * do_something_else();
117 * Prior to using the do-while the compiler would get upset at the
118 * "else" because it interpreted the "if" statement as being all
119 * done when it reached the ';' after the yyless() call.
122 /* Return all but the first 'n' matched characters back to the input stream. */
127 /* Undo effects of setting up yytext. */ \
128 *yy_cp = yy_hold_char; \
129 YY_RESTORE_YY_MORE_OFFSET \
130 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
131 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
135 #define unput(c) yyunput( c, yytext_ptr )
137 /* The following is because we cannot portably get our hands on size_t
138 * (without autoconf's help, which isn't available because we want
139 * flex-generated scanners to compile on their own).
141 typedef unsigned int yy_size_t
;
144 struct yy_buffer_state
148 char *yy_ch_buf
; /* input buffer */
149 char *yy_buf_pos
; /* current position in input buffer */
151 /* Size of input buffer in bytes, not including room for EOB
154 yy_size_t yy_buf_size
;
156 /* Number of characters read into yy_ch_buf, not including EOB
161 /* Whether we "own" the buffer - i.e., we know we created it,
162 * and can realloc() it to grow it, and should free() it to
165 int yy_is_our_buffer
;
167 /* Whether this is an "interactive" input source; if so, and
168 * if we're using stdio for input, then we want to use getc()
169 * instead of fread(), to make sure we stop fetching input after
172 int yy_is_interactive
;
174 /* Whether we're considered to be at the beginning of a line.
175 * If so, '^' rules will be active on the next match, otherwise
180 /* Whether to try to fill the input buffer when we reach the
185 int yy_buffer_status
;
186 #define YY_BUFFER_NEW 0
187 #define YY_BUFFER_NORMAL 1
188 /* When an EOF's been seen but there's still some text to process
189 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
190 * shouldn't try reading from the input source any more. We might
191 * still have a bunch of tokens to match, though, because of
192 * possible backing-up.
194 * When we actually see the EOF, we change the status to "new"
195 * (via yyrestart()), so that the user can continue scanning by
196 * just pointing yyin at a new input file.
198 #define YY_BUFFER_EOF_PENDING 2
201 static YY_BUFFER_STATE yy_current_buffer
= 0;
203 /* We provide macros for accessing buffer states in case in the
204 * future we want to put the buffer states in a more general
207 #define YY_CURRENT_BUFFER yy_current_buffer
210 /* yy_hold_char holds the character lost when yytext is formed. */
211 static char yy_hold_char
;
213 static int yy_n_chars
; /* number of characters read into yy_ch_buf */
218 /* Points to current character in buffer. */
219 static char *yy_c_buf_p
= (char *) 0;
220 static int yy_init
= 1; /* whether we need to initialize */
221 static int yy_start
= 0; /* start state number */
223 /* Flag which is used to allow yywrap()'s to do buffer switches
224 * instead of setting up a fresh yyin. A bit of a hack ...
226 static int yy_did_buffer_switch_on_eof
;
228 void yyrestart
YY_PROTO(( FILE *input_file
));
230 void yy_switch_to_buffer
YY_PROTO(( YY_BUFFER_STATE new_buffer
));
231 void yy_load_buffer_state
YY_PROTO(( void ));
232 YY_BUFFER_STATE yy_create_buffer
YY_PROTO(( FILE *file
, int size
));
233 void yy_delete_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
234 void yy_init_buffer
YY_PROTO(( YY_BUFFER_STATE b
, FILE *file
));
235 void yy_flush_buffer
YY_PROTO(( YY_BUFFER_STATE b
));
236 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
238 YY_BUFFER_STATE yy_scan_buffer
YY_PROTO(( char *base
, yy_size_t size
));
239 YY_BUFFER_STATE yy_scan_string
YY_PROTO(( yyconst
char *yy_str
));
240 YY_BUFFER_STATE yy_scan_bytes
YY_PROTO(( yyconst
char *bytes
, int len
));
242 static void *yy_flex_alloc
YY_PROTO(( yy_size_t
));
243 static void *yy_flex_realloc
YY_PROTO(( void *, yy_size_t
));
244 static void yy_flex_free
YY_PROTO(( void * ));
246 #define yy_new_buffer yy_create_buffer
248 #define yy_set_interactive(is_interactive) \
250 if ( ! yy_current_buffer ) \
251 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
252 yy_current_buffer->yy_is_interactive = is_interactive; \
255 #define yy_set_bol(at_bol) \
257 if ( ! yy_current_buffer ) \
258 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
259 yy_current_buffer->yy_at_bol = at_bol; \
262 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
264 typedef unsigned char YY_CHAR
;
265 FILE *yyin
= (FILE *) 0, *yyout
= (FILE *) 0;
266 typedef int yy_state_type
;
268 #define yytext_ptr yytext
270 static yy_state_type yy_get_previous_state
YY_PROTO(( void ));
271 static yy_state_type yy_try_NUL_trans
YY_PROTO(( yy_state_type current_state
));
272 static int yy_get_next_buffer
YY_PROTO(( void ));
273 static void yy_fatal_error
YY_PROTO(( yyconst
char msg
[] ));
275 /* Done after the current pattern has been matched and before the
276 * corresponding action - sets up yytext.
278 #define YY_DO_BEFORE_ACTION \
279 yytext_ptr = yy_bp; \
280 yyleng = (int) (yy_cp - yy_bp); \
281 yy_hold_char = *yy_cp; \
285 #define YY_NUM_RULES 14
286 #define YY_END_OF_BUFFER 15
287 static yyconst
short int yy_accept
[28] =
289 0, 0, 0, 0, 15, 13, 14, 12, 5, 6,
290 13, 1, 1, 3, 4, 10, 8, 9, 10, 7,
294 static yyconst
int yy_ec
[256] =
296 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
297 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
298 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
299 1, 3, 1, 4, 1, 1, 1, 1, 5, 1,
300 1, 1, 6, 1, 6, 1, 1, 7, 8, 8,
301 8, 8, 8, 8, 8, 8, 8, 1, 1, 1,
302 1, 1, 1, 1, 9, 9, 9, 9, 9, 9,
303 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
304 9, 9, 9, 9, 9, 9, 9, 10, 9, 9,
305 1, 11, 1, 1, 12, 13, 14, 14, 14, 14,
307 14, 14, 9, 9, 9, 9, 9, 9, 9, 9,
308 9, 9, 9, 9, 9, 9, 9, 9, 9, 10,
309 9, 9, 1, 1, 1, 1, 1, 1, 1, 1,
310 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
311 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
312 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
313 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
314 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
315 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
316 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
318 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
319 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
320 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
321 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
322 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
326 static yyconst
int yy_meta
[15] =
328 1, 2, 1, 1, 1, 1, 3, 3, 4, 5,
332 static yyconst
short int yy_base
[33] =
334 0, 0, 13, 25, 25, 62, 62, 62, 62, 62,
335 12, 13, 14, 0, 62, 62, 62, 62, 0, 62,
336 6, 24, 0, 0, 62, 0, 62, 38, 42, 45,
340 static yyconst
short int yy_def
[33] =
342 27, 1, 28, 28, 27, 27, 27, 27, 27, 27,
343 27, 29, 27, 30, 27, 27, 27, 27, 31, 27,
344 29, 27, 32, 30, 27, 32, 0, 27, 27, 27,
348 static yyconst
short int yy_nxt
[77] =
350 6, 7, 8, 9, 10, 11, 12, 13, 14, 14,
351 6, 6, 15, 14, 7, 23, 17, 18, 21, 22,
352 22, 22, 23, 19, 27, 20, 7, 27, 17, 18,
353 22, 22, 27, 27, 27, 19, 27, 20, 16, 16,
354 16, 16, 16, 16, 22, 27, 22, 24, 24, 24,
355 24, 25, 27, 25, 25, 25, 25, 26, 27, 27,
356 26, 5, 27, 27, 27, 27, 27, 27, 27, 27,
357 27, 27, 27, 27, 27, 27
360 static yyconst
short int yy_chk
[77] =
362 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
363 1, 1, 1, 1, 3, 21, 3, 3, 11, 11,
364 13, 13, 12, 3, 5, 3, 4, 0, 4, 4,
365 22, 22, 0, 0, 0, 4, 0, 4, 28, 28,
366 28, 28, 28, 28, 29, 0, 29, 30, 30, 30,
367 30, 31, 0, 31, 31, 31, 31, 32, 0, 0,
368 32, 27, 27, 27, 27, 27, 27, 27, 27, 27,
369 27, 27, 27, 27, 27, 27
372 static yy_state_type yy_last_accepting_state
;
373 static char *yy_last_accepting_cpos
;
375 /* The intent behind this definition is that it'll catch
376 * any uses of REJECT which flex missed.
378 #define REJECT reject_used_but_not_detected
379 #define yymore() yymore_used_but_not_detected
380 #define YY_MORE_ADJ 0
381 #define YY_RESTORE_YY_MORE_OFFSET
383 #line 1 "macro.lex.l"
385 #line 2 "macro.lex.l"
389 * Copyright 1996 Ulrich Schmid
390 * Copyright 2002,2008 Eric Pouech
392 * This library is free software; you can redistribute it and/or
393 * modify it under the terms of the GNU Lesser General Public
394 * License as published by the Free Software Foundation; either
395 * version 2.1 of the License, or (at your option) any later version.
397 * This library is distributed in the hope that it will be useful,
398 * but WITHOUT ANY WARRANTY; without even the implied warranty of
399 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
400 * Lesser General Public License for more details.
402 * You should have received a copy of the GNU Lesser General Public
403 * License along with this library; if not, write to the Free Software
404 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
406 #define YY_NO_INPUT 1
407 #define YY_NO_UNPUT 1
410 #line 26 "macro.lex.l"
414 #ifndef HAVE_UNISTD_H
415 #define YY_NO_UNISTD_H
420 #include "wine/debug.h"
422 WINE_DEFAULT_DEBUG_CHANNEL(winhelp
);
428 unsigned quote_stk_idx
;
429 LPSTR cache_string
[32];
432 static struct lex_data
* lex_data
= NULL
;
434 struct lexret yylval
;
436 #define YY_INPUT(buf,result,max_size)\
437 if ((result = *lex_data->macroptr ? 1 : 0)) buf[0] = *lex_data->macroptr++;
441 /* Macros after this point can all be overridden by user definitions in
445 #ifndef YY_SKIP_YYWRAP
447 extern "C" int yywrap
YY_PROTO(( void ));
449 extern int yywrap
YY_PROTO(( void ));
454 static void yyunput
YY_PROTO(( int c
, char *buf_ptr
));
458 static void yy_flex_strncpy
YY_PROTO(( char *, yyconst
char *, int ));
461 #ifdef YY_NEED_STRLEN
462 static int yy_flex_strlen
YY_PROTO(( yyconst
char * ));
467 static int yyinput
YY_PROTO(( void ));
469 static int input
YY_PROTO(( void ));
474 static int yy_start_stack_ptr
= 0;
475 static int yy_start_stack_depth
= 0;
476 static int *yy_start_stack
= 0;
477 #ifndef YY_NO_PUSH_STATE
478 static void yy_push_state
YY_PROTO(( int new_state
));
480 #ifndef YY_NO_POP_STATE
481 static void yy_pop_state
YY_PROTO(( void ));
483 #ifndef YY_NO_TOP_STATE
484 static int yy_top_state
YY_PROTO(( void ));
488 #define YY_NO_PUSH_STATE 1
489 #define YY_NO_POP_STATE 1
490 #define YY_NO_TOP_STATE 1
493 #ifdef YY_MALLOC_DECL
501 /* Just try to get by without declaring the routines. This will fail
502 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
503 * or sizeof(void*) != sizeof(int).
508 /* Amount of stuff to slurp up with each read. */
509 #ifndef YY_READ_BUF_SIZE
510 #define YY_READ_BUF_SIZE 8192
513 /* Copy whatever the last rule matched to the standard output. */
516 /* This used to be an fputs(), but since the string might contain NUL's,
517 * we now use fwrite().
519 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
522 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
523 * is returned in "result".
526 #define YY_INPUT(buf,result,max_size) \
527 if ( yy_current_buffer->yy_is_interactive ) \
530 for ( n = 0; n < max_size && \
531 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
534 buf[n++] = (char) c; \
535 if ( c == EOF && ferror( yyin ) ) \
536 YY_FATAL_ERROR( "input in flex scanner failed" ); \
539 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
540 && ferror( yyin ) ) \
541 YY_FATAL_ERROR( "input in flex scanner failed" );
544 /* No semi-colon after return; correct usage is to write "yyterminate();" -
545 * we don't want an extra ';' after the "return" because that will cause
546 * some compilers to complain about unreachable statements.
549 #define yyterminate() return YY_NULL
552 /* Number of entries by which start-condition stack grows. */
553 #ifndef YY_START_STACK_INCR
554 #define YY_START_STACK_INCR 25
557 /* Report a fatal error. */
558 #ifndef YY_FATAL_ERROR
559 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
562 /* Default declaration of generated scanner - a define so the user can
563 * easily add parameters.
566 #define YY_DECL int yylex YY_PROTO(( void ))
569 /* Code executed at the beginning of each rule, after yytext and yyleng
572 #ifndef YY_USER_ACTION
573 #define YY_USER_ACTION
576 /* Code executed at the end of each rule. */
578 #define YY_BREAK break;
581 #define YY_RULE_SETUP \
586 register yy_state_type yy_current_state
;
587 register char *yy_cp
, *yy_bp
;
590 #line 55 "macro.lex.l"
604 yy_start
= 1; /* first start state */
612 if ( ! yy_current_buffer
)
614 yy_create_buffer( yyin
, YY_BUF_SIZE
);
616 yy_load_buffer_state();
619 while ( 1 ) /* loops until end-of-file is reached */
623 /* Support of yytext. */
624 *yy_cp
= yy_hold_char
;
626 /* yy_bp points to the position in yy_ch_buf of the start of
631 yy_current_state
= yy_start
;
635 register YY_CHAR yy_c
= yy_ec
[YY_SC_TO_UI(*yy_cp
)];
636 if ( yy_accept
[yy_current_state
] )
638 yy_last_accepting_state
= yy_current_state
;
639 yy_last_accepting_cpos
= yy_cp
;
641 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
643 yy_current_state
= (int) yy_def
[yy_current_state
];
644 if ( yy_current_state
>= 28 )
645 yy_c
= yy_meta
[(unsigned int) yy_c
];
647 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
650 while ( yy_base
[yy_current_state
] != 62 );
653 yy_act
= yy_accept
[yy_current_state
];
655 { /* have to back up */
656 yy_cp
= yy_last_accepting_cpos
;
657 yy_current_state
= yy_last_accepting_state
;
658 yy_act
= yy_accept
[yy_current_state
];
664 do_action
: /* This label is used only to access EOF actions. */
668 { /* beginning of action switch */
669 case 0: /* must back up */
670 /* undo the effects of YY_DO_BEFORE_ACTION */
671 *yy_cp
= yy_hold_char
;
672 yy_cp
= yy_last_accepting_cpos
;
673 yy_current_state
= yy_last_accepting_state
;
678 #line 57 "macro.lex.l"
679 yylval
.integer
= strtol(yytext
, NULL
, 10); return INTEGER
;
683 #line 58 "macro.lex.l"
684 yylval
.integer
= strtol(yytext
, NULL
, 16); return INTEGER
;
688 #line 60 "macro.lex.l"
689 return MACRO_Lookup(yytext
, &yylval
);
692 #line 63 "macro.lex.l"
694 #line 64 "macro.lex.l"
696 #line 65 "macro.lex.l"
698 #line 66 "macro.lex.l"
700 #line 67 "macro.lex.l"
703 #line 67 "macro.lex.l"
705 if (lex_data
->quote_stk_idx
== 0 ||
706 (yytext
[0] == '\"' && lex_data
->quote_stack
[lex_data
->quote_stk_idx
- 1] != '\"') ||
709 /* opening a new one */
710 if (lex_data
->quote_stk_idx
== 0)
712 assert(lex_data
->cache_used
< sizeof(lex_data
->cache_string
) / sizeof(lex_data
->cache_string
[0]));
713 lex_data
->strptr
= lex_data
->cache_string
[lex_data
->cache_used
] = HeapAlloc(GetProcessHeap(), 0, strlen(lex_data
->macroptr
) + 1);
714 yylval
.string
= lex_data
->strptr
;
715 lex_data
->cache_used
++;
718 else *lex_data
->strptr
++ = yytext
[0];
719 lex_data
->quote_stack
[lex_data
->quote_stk_idx
++] = yytext
[0];
720 assert(lex_data
->quote_stk_idx
< sizeof(lex_data
->quote_stack
) / sizeof(lex_data
->quote_stack
[0]));
724 if (yytext
[0] == '`') assert(0);
725 /* close the current quote */
726 if (--lex_data
->quote_stk_idx
== 0)
729 *lex_data
->strptr
++ = '\0';
732 else *lex_data
->strptr
++ = yytext
[0];
738 #line 99 "macro.lex.l"
739 *lex_data
->strptr
++ = yytext
[0];
743 #line 100 "macro.lex.l"
744 *lex_data
->strptr
++ = yytext
[1];
746 case YY_STATE_EOF(quote
):
747 #line 101 "macro.lex.l"
752 #line 103 "macro.lex.l"
757 #line 104 "macro.lex.l"
762 #line 105 "macro.lex.l"
766 case YY_STATE_EOF(INITIAL
):
769 case YY_END_OF_BUFFER
:
771 /* Amount of text matched not including the EOB char. */
772 int yy_amount_of_matched_text
= (int) (yy_cp
- yytext_ptr
) - 1;
774 /* Undo the effects of YY_DO_BEFORE_ACTION. */
775 *yy_cp
= yy_hold_char
;
776 YY_RESTORE_YY_MORE_OFFSET
778 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_NEW
)
780 /* We're scanning a new file or input source. It's
781 * possible that this happened because the user
782 * just pointed yyin at a new source and called
783 * yylex(). If so, then we have to assure
784 * consistency between yy_current_buffer and our
785 * globals. Here is the right place to do so, because
786 * this is the first action (other than possibly a
787 * back-up) that will match for the new input source.
789 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
790 yy_current_buffer
->yy_input_file
= yyin
;
791 yy_current_buffer
->yy_buffer_status
= YY_BUFFER_NORMAL
;
794 /* Note that here we test for yy_c_buf_p "<=" to the position
795 * of the first EOB in the buffer, since yy_c_buf_p will
796 * already have been incremented past the NUL character
797 * (since all states make transitions on EOB to the
798 * end-of-buffer state). Contrast this with the test
801 if ( yy_c_buf_p
<= &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
802 { /* This was really a NUL. */
803 yy_state_type yy_next_state
;
805 yy_c_buf_p
= yytext_ptr
+ yy_amount_of_matched_text
;
807 yy_current_state
= yy_get_previous_state();
809 /* Okay, we're now positioned to make the NUL
810 * transition. We couldn't have
811 * yy_get_previous_state() go ahead and do it
812 * for us because it doesn't know how to deal
813 * with the possibility of jamming (and we don't
814 * want to build jamming into it because then it
815 * will run more slowly).
818 yy_next_state
= yy_try_NUL_trans( yy_current_state
);
820 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
824 /* Consume the NUL. */
825 yy_cp
= ++yy_c_buf_p
;
826 yy_current_state
= yy_next_state
;
837 else switch ( yy_get_next_buffer() )
839 case EOB_ACT_END_OF_FILE
:
841 yy_did_buffer_switch_on_eof
= 0;
845 /* Note: because we've taken care in
846 * yy_get_next_buffer() to have set up
847 * yytext, we can now set up
848 * yy_c_buf_p so that if some total
849 * hoser (like flex itself) wants to
850 * call the scanner after we return the
851 * YY_NULL, it'll still work - another
852 * YY_NULL will get returned.
854 yy_c_buf_p
= yytext_ptr
+ YY_MORE_ADJ
;
856 yy_act
= YY_STATE_EOF(YY_START
);
862 if ( ! yy_did_buffer_switch_on_eof
)
868 case EOB_ACT_CONTINUE_SCAN
:
870 yytext_ptr
+ yy_amount_of_matched_text
;
872 yy_current_state
= yy_get_previous_state();
875 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
878 case EOB_ACT_LAST_MATCH
:
880 &yy_current_buffer
->yy_ch_buf
[yy_n_chars
];
882 yy_current_state
= yy_get_previous_state();
885 yy_bp
= yytext_ptr
+ YY_MORE_ADJ
;
893 "fatal flex scanner internal error--no action found" );
894 } /* end of action switch */
895 } /* end of scanning one token */
899 /* yy_get_next_buffer - try to read in a new buffer
901 * Returns a code representing an action:
902 * EOB_ACT_LAST_MATCH -
903 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
904 * EOB_ACT_END_OF_FILE - end of file
907 static int yy_get_next_buffer()
909 register char *dest
= yy_current_buffer
->yy_ch_buf
;
910 register char *source
= yytext_ptr
;
911 register int number_to_move
, i
;
914 if ( yy_c_buf_p
> &yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] )
916 "fatal flex scanner internal error--end of buffer missed" );
918 if ( yy_current_buffer
->yy_fill_buffer
== 0 )
919 { /* Don't try to fill the buffer, so this is an EOF. */
920 if ( yy_c_buf_p
- yytext_ptr
- YY_MORE_ADJ
== 1 )
922 /* We matched a single character, the EOB, so
923 * treat this as a final EOF.
925 return EOB_ACT_END_OF_FILE
;
930 /* We matched some text prior to the EOB, first
933 return EOB_ACT_LAST_MATCH
;
937 /* Try to read more data. */
939 /* First move last chars to start of buffer. */
940 number_to_move
= (int) (yy_c_buf_p
- yytext_ptr
) - 1;
942 for ( i
= 0; i
< number_to_move
; ++i
)
943 *(dest
++) = *(source
++);
945 if ( yy_current_buffer
->yy_buffer_status
== YY_BUFFER_EOF_PENDING
)
946 /* don't do the read, it's not guaranteed to return an EOF,
949 yy_current_buffer
->yy_n_chars
= yy_n_chars
= 0;
954 yy_current_buffer
->yy_buf_size
- number_to_move
- 1;
956 while ( num_to_read
<= 0 )
957 { /* Not enough room in the buffer - grow it. */
958 #ifdef YY_USES_REJECT
960 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
963 /* just a shorter name for the current buffer */
964 YY_BUFFER_STATE b
= yy_current_buffer
;
966 int yy_c_buf_p_offset
=
967 (int) (yy_c_buf_p
- b
->yy_ch_buf
);
969 if ( b
->yy_is_our_buffer
)
971 int new_size
= b
->yy_buf_size
* 2;
974 b
->yy_buf_size
+= b
->yy_buf_size
/ 8;
978 b
->yy_ch_buf
= (char *)
979 /* Include room in for 2 EOB chars. */
980 yy_flex_realloc( (void *) b
->yy_ch_buf
,
981 b
->yy_buf_size
+ 2 );
984 /* Can't grow it, we don't own it. */
987 if ( ! b
->yy_ch_buf
)
989 "fatal error - scanner input buffer overflow" );
991 yy_c_buf_p
= &b
->yy_ch_buf
[yy_c_buf_p_offset
];
993 num_to_read
= yy_current_buffer
->yy_buf_size
-
998 if ( num_to_read
> YY_READ_BUF_SIZE
)
999 num_to_read
= YY_READ_BUF_SIZE
;
1001 /* Read in more data. */
1002 YY_INPUT( (&yy_current_buffer
->yy_ch_buf
[number_to_move
]),
1003 yy_n_chars
, num_to_read
);
1005 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
1008 if ( yy_n_chars
== 0 )
1010 if ( number_to_move
== YY_MORE_ADJ
)
1012 ret_val
= EOB_ACT_END_OF_FILE
;
1018 ret_val
= EOB_ACT_LAST_MATCH
;
1019 yy_current_buffer
->yy_buffer_status
=
1020 YY_BUFFER_EOF_PENDING
;
1025 ret_val
= EOB_ACT_CONTINUE_SCAN
;
1027 yy_n_chars
+= number_to_move
;
1028 yy_current_buffer
->yy_ch_buf
[yy_n_chars
] = YY_END_OF_BUFFER_CHAR
;
1029 yy_current_buffer
->yy_ch_buf
[yy_n_chars
+ 1] = YY_END_OF_BUFFER_CHAR
;
1031 yytext_ptr
= &yy_current_buffer
->yy_ch_buf
[0];
1037 /* yy_get_previous_state - get the state just before the EOB char was reached */
1039 static yy_state_type
yy_get_previous_state()
1041 register yy_state_type yy_current_state
;
1042 register char *yy_cp
;
1044 yy_current_state
= yy_start
;
1046 for ( yy_cp
= yytext_ptr
+ YY_MORE_ADJ
; yy_cp
< yy_c_buf_p
; ++yy_cp
)
1048 register YY_CHAR yy_c
= (*yy_cp
? yy_ec
[YY_SC_TO_UI(*yy_cp
)] : 1);
1049 if ( yy_accept
[yy_current_state
] )
1051 yy_last_accepting_state
= yy_current_state
;
1052 yy_last_accepting_cpos
= yy_cp
;
1054 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1056 yy_current_state
= (int) yy_def
[yy_current_state
];
1057 if ( yy_current_state
>= 28 )
1058 yy_c
= yy_meta
[(unsigned int) yy_c
];
1060 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1063 return yy_current_state
;
1067 /* yy_try_NUL_trans - try to make a transition on the NUL character
1070 * next_state = yy_try_NUL_trans( current_state );
1073 #ifdef YY_USE_PROTOS
1074 static yy_state_type
yy_try_NUL_trans( yy_state_type yy_current_state
)
1076 static yy_state_type
yy_try_NUL_trans( yy_current_state
)
1077 yy_state_type yy_current_state
;
1080 register int yy_is_jam
;
1081 register char *yy_cp
= yy_c_buf_p
;
1083 register YY_CHAR yy_c
= 1;
1084 if ( yy_accept
[yy_current_state
] )
1086 yy_last_accepting_state
= yy_current_state
;
1087 yy_last_accepting_cpos
= yy_cp
;
1089 while ( yy_chk
[yy_base
[yy_current_state
] + yy_c
] != yy_current_state
)
1091 yy_current_state
= (int) yy_def
[yy_current_state
];
1092 if ( yy_current_state
>= 28 )
1093 yy_c
= yy_meta
[(unsigned int) yy_c
];
1095 yy_current_state
= yy_nxt
[yy_base
[yy_current_state
] + (unsigned int) yy_c
];
1096 yy_is_jam
= (yy_current_state
== 27);
1098 return yy_is_jam
? 0 : yy_current_state
;
1103 #ifdef YY_USE_PROTOS
1104 static void yyunput( int c
, register char *yy_bp
)
1106 static void yyunput( c
, yy_bp
)
1108 register char *yy_bp
;
1111 register char *yy_cp
= yy_c_buf_p
;
1113 /* undo effects of setting up yytext */
1114 *yy_cp
= yy_hold_char
;
1116 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
1117 { /* need to shift things up to make room */
1118 /* +2 for EOB chars. */
1119 register int number_to_move
= yy_n_chars
+ 2;
1120 register char *dest
= &yy_current_buffer
->yy_ch_buf
[
1121 yy_current_buffer
->yy_buf_size
+ 2];
1122 register char *source
=
1123 &yy_current_buffer
->yy_ch_buf
[number_to_move
];
1125 while ( source
> yy_current_buffer
->yy_ch_buf
)
1126 *--dest
= *--source
;
1128 yy_cp
+= (int) (dest
- source
);
1129 yy_bp
+= (int) (dest
- source
);
1130 yy_current_buffer
->yy_n_chars
=
1131 yy_n_chars
= yy_current_buffer
->yy_buf_size
;
1133 if ( yy_cp
< yy_current_buffer
->yy_ch_buf
+ 2 )
1134 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1137 *--yy_cp
= (char) c
;
1141 yy_hold_char
= *yy_cp
;
1144 #endif /* ifndef YY_NO_UNPUT */
1148 static int yyinput()
1155 *yy_c_buf_p
= yy_hold_char
;
1157 if ( *yy_c_buf_p
== YY_END_OF_BUFFER_CHAR
)
1159 /* yy_c_buf_p now points to the character we want to return.
1160 * If this occurs *before* the EOB characters, then it's a
1161 * valid NUL; if not, then we've hit the end of the buffer.
1163 if ( yy_c_buf_p
< &yy_current_buffer
->yy_ch_buf
[yy_n_chars
] )
1164 /* This was really a NUL. */
1168 { /* need more input */
1169 int offset
= yy_c_buf_p
- yytext_ptr
;
1172 switch ( yy_get_next_buffer() )
1174 case EOB_ACT_LAST_MATCH
:
1175 /* This happens because yy_g_n_b()
1176 * sees that we've accumulated a
1177 * token and flags that we need to
1178 * try matching the token before
1179 * proceeding. But for input(),
1180 * there's no matching to consider.
1181 * So convert the EOB_ACT_LAST_MATCH
1182 * to EOB_ACT_END_OF_FILE.
1185 /* Reset buffer status. */
1190 case EOB_ACT_END_OF_FILE
:
1195 if ( ! yy_did_buffer_switch_on_eof
)
1204 case EOB_ACT_CONTINUE_SCAN
:
1205 yy_c_buf_p
= yytext_ptr
+ offset
;
1211 c
= *(unsigned char *) yy_c_buf_p
; /* cast for 8-bit char's */
1212 *yy_c_buf_p
= '\0'; /* preserve yytext */
1213 yy_hold_char
= *++yy_c_buf_p
;
1220 #ifdef YY_USE_PROTOS
1221 void yyrestart( FILE *input_file
)
1223 void yyrestart( input_file
)
1227 if ( ! yy_current_buffer
)
1228 yy_current_buffer
= yy_create_buffer( yyin
, YY_BUF_SIZE
);
1230 yy_init_buffer( yy_current_buffer
, input_file
);
1231 yy_load_buffer_state();
1235 #ifdef YY_USE_PROTOS
1236 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer
)
1238 void yy_switch_to_buffer( new_buffer
)
1239 YY_BUFFER_STATE new_buffer
;
1242 if ( yy_current_buffer
== new_buffer
)
1245 if ( yy_current_buffer
)
1247 /* Flush out information for old buffer. */
1248 *yy_c_buf_p
= yy_hold_char
;
1249 yy_current_buffer
->yy_buf_pos
= yy_c_buf_p
;
1250 yy_current_buffer
->yy_n_chars
= yy_n_chars
;
1253 yy_current_buffer
= new_buffer
;
1254 yy_load_buffer_state();
1256 /* We don't actually know whether we did this switch during
1257 * EOF (yywrap()) processing, but the only time this flag
1258 * is looked at is after yywrap() is called, so it's safe
1259 * to go ahead and always set it.
1261 yy_did_buffer_switch_on_eof
= 1;
1265 #ifdef YY_USE_PROTOS
1266 void yy_load_buffer_state( void )
1268 void yy_load_buffer_state()
1271 yy_n_chars
= yy_current_buffer
->yy_n_chars
;
1272 yytext_ptr
= yy_c_buf_p
= yy_current_buffer
->yy_buf_pos
;
1273 yyin
= yy_current_buffer
->yy_input_file
;
1274 yy_hold_char
= *yy_c_buf_p
;
1278 #ifdef YY_USE_PROTOS
1279 YY_BUFFER_STATE
yy_create_buffer( FILE *file
, int size
)
1281 YY_BUFFER_STATE
yy_create_buffer( file
, size
)
1288 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
1290 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1292 b
->yy_buf_size
= size
;
1294 /* yy_ch_buf has to be 2 characters longer than the size given because
1295 * we need to put in 2 end-of-buffer characters.
1297 b
->yy_ch_buf
= (char *) yy_flex_alloc( b
->yy_buf_size
+ 2 );
1298 if ( ! b
->yy_ch_buf
)
1299 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1301 b
->yy_is_our_buffer
= 1;
1303 yy_init_buffer( b
, file
);
1309 #ifdef YY_USE_PROTOS
1310 void yy_delete_buffer( YY_BUFFER_STATE b
)
1312 void yy_delete_buffer( b
)
1319 if ( b
== yy_current_buffer
)
1320 yy_current_buffer
= (YY_BUFFER_STATE
) 0;
1322 if ( b
->yy_is_our_buffer
)
1323 yy_flex_free( (void *) b
->yy_ch_buf
);
1325 yy_flex_free( (void *) b
);
1329 #ifndef YY_ALWAYS_INTERACTIVE
1330 #ifndef YY_NEVER_INTERACTIVE
1331 extern int isatty
YY_PROTO(( int ));
1335 #ifdef YY_USE_PROTOS
1336 void yy_init_buffer( YY_BUFFER_STATE b
, FILE *file
)
1338 void yy_init_buffer( b
, file
)
1345 yy_flush_buffer( b
);
1347 b
->yy_input_file
= file
;
1348 b
->yy_fill_buffer
= 1;
1350 #if YY_ALWAYS_INTERACTIVE
1351 b
->yy_is_interactive
= 1;
1353 #if YY_NEVER_INTERACTIVE
1354 b
->yy_is_interactive
= 0;
1356 b
->yy_is_interactive
= file
? (isatty( fileno(file
) ) > 0) : 0;
1362 #ifdef YY_USE_PROTOS
1363 void yy_flush_buffer( YY_BUFFER_STATE b
)
1365 void yy_flush_buffer( b
)
1375 /* We always need two end-of-buffer characters. The first causes
1376 * a transition to the end-of-buffer state. The second causes
1377 * a jam in that state.
1379 b
->yy_ch_buf
[0] = YY_END_OF_BUFFER_CHAR
;
1380 b
->yy_ch_buf
[1] = YY_END_OF_BUFFER_CHAR
;
1382 b
->yy_buf_pos
= &b
->yy_ch_buf
[0];
1385 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1387 if ( b
== yy_current_buffer
)
1388 yy_load_buffer_state();
1392 #ifndef YY_NO_SCAN_BUFFER
1393 #ifdef YY_USE_PROTOS
1394 YY_BUFFER_STATE
yy_scan_buffer( char *base
, yy_size_t size
)
1396 YY_BUFFER_STATE
yy_scan_buffer( base
, size
)
1404 base
[size
-2] != YY_END_OF_BUFFER_CHAR
||
1405 base
[size
-1] != YY_END_OF_BUFFER_CHAR
)
1406 /* They forgot to leave room for the EOB's. */
1409 b
= (YY_BUFFER_STATE
) yy_flex_alloc( sizeof( struct yy_buffer_state
) );
1411 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1413 b
->yy_buf_size
= size
- 2; /* "- 2" to take care of EOB's */
1414 b
->yy_buf_pos
= b
->yy_ch_buf
= base
;
1415 b
->yy_is_our_buffer
= 0;
1416 b
->yy_input_file
= 0;
1417 b
->yy_n_chars
= b
->yy_buf_size
;
1418 b
->yy_is_interactive
= 0;
1420 b
->yy_fill_buffer
= 0;
1421 b
->yy_buffer_status
= YY_BUFFER_NEW
;
1423 yy_switch_to_buffer( b
);
1430 #ifndef YY_NO_SCAN_STRING
1431 #ifdef YY_USE_PROTOS
1432 YY_BUFFER_STATE
yy_scan_string( yyconst
char *yy_str
)
1434 YY_BUFFER_STATE
yy_scan_string( yy_str
)
1435 yyconst
char *yy_str
;
1439 for ( len
= 0; yy_str
[len
]; ++len
)
1442 return yy_scan_bytes( yy_str
, len
);
1447 #ifndef YY_NO_SCAN_BYTES
1448 #ifdef YY_USE_PROTOS
1449 YY_BUFFER_STATE
yy_scan_bytes( yyconst
char *bytes
, int len
)
1451 YY_BUFFER_STATE
yy_scan_bytes( bytes
, len
)
1452 yyconst
char *bytes
;
1461 /* Get memory for full buffer, including space for trailing EOB's. */
1463 buf
= (char *) yy_flex_alloc( n
);
1465 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1467 for ( i
= 0; i
< len
; ++i
)
1470 buf
[len
] = buf
[len
+1] = YY_END_OF_BUFFER_CHAR
;
1472 b
= yy_scan_buffer( buf
, n
);
1474 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1476 /* It's okay to grow etc. this buffer, and we should throw it
1477 * away when we're done.
1479 b
->yy_is_our_buffer
= 1;
1486 #ifndef YY_NO_PUSH_STATE
1487 #ifdef YY_USE_PROTOS
1488 static void yy_push_state( int new_state
)
1490 static void yy_push_state( new_state
)
1494 if ( yy_start_stack_ptr
>= yy_start_stack_depth
)
1498 yy_start_stack_depth
+= YY_START_STACK_INCR
;
1499 new_size
= yy_start_stack_depth
* sizeof( int );
1501 if ( ! yy_start_stack
)
1502 yy_start_stack
= (int *) yy_flex_alloc( new_size
);
1505 yy_start_stack
= (int *) yy_flex_realloc(
1506 (void *) yy_start_stack
, new_size
);
1508 if ( ! yy_start_stack
)
1510 "out of memory expanding start-condition stack" );
1513 yy_start_stack
[yy_start_stack_ptr
++] = YY_START
;
1520 #ifndef YY_NO_POP_STATE
1521 static void yy_pop_state()
1523 if ( --yy_start_stack_ptr
< 0 )
1524 YY_FATAL_ERROR( "start-condition stack underflow" );
1526 BEGIN(yy_start_stack
[yy_start_stack_ptr
]);
1531 #ifndef YY_NO_TOP_STATE
1532 static int yy_top_state()
1534 return yy_start_stack
[yy_start_stack_ptr
- 1];
1538 #ifndef YY_EXIT_FAILURE
1539 #define YY_EXIT_FAILURE 2
1542 #ifdef YY_USE_PROTOS
1543 static void yy_fatal_error( yyconst
char msg
[] )
1545 static void yy_fatal_error( msg
)
1549 (void) fprintf( stderr
, "%s\n", msg
);
1550 exit( YY_EXIT_FAILURE
);
1555 /* Redefine yyless() so it works in section 3 code. */
1561 /* Undo effects of setting up yytext. */ \
1562 yytext[yyleng] = yy_hold_char; \
1563 yy_c_buf_p = yytext + n; \
1564 yy_hold_char = *yy_c_buf_p; \
1565 *yy_c_buf_p = '\0'; \
1571 /* Internal utility routines. */
1574 #ifdef YY_USE_PROTOS
1575 static void yy_flex_strncpy( char *s1
, yyconst
char *s2
, int n
)
1577 static void yy_flex_strncpy( s1
, s2
, n
)
1584 for ( i
= 0; i
< n
; ++i
)
1589 #ifdef YY_NEED_STRLEN
1590 #ifdef YY_USE_PROTOS
1591 static int yy_flex_strlen( yyconst
char *s
)
1593 static int yy_flex_strlen( s
)
1598 for ( n
= 0; s
[n
]; ++n
)
1606 #ifdef YY_USE_PROTOS
1607 static void *yy_flex_alloc( yy_size_t size
)
1609 static void *yy_flex_alloc( size
)
1613 return (void *) malloc( size
);
1616 #ifdef YY_USE_PROTOS
1617 static void *yy_flex_realloc( void *ptr
, yy_size_t size
)
1619 static void *yy_flex_realloc( ptr
, size
)
1624 /* The cast to (char *) in the following accommodates both
1625 * implementations that use char* generic pointers, and those
1626 * that use void* generic pointers. It works with the latter
1627 * because both ANSI C and C++ allow castless assignment from
1628 * any pointer type to void*, and deal with argument conversions
1629 * as though doing an assignment.
1631 return (void *) realloc( (char *) ptr
, size
);
1634 #ifdef YY_USE_PROTOS
1635 static void yy_flex_free( void *ptr
)
1637 static void yy_flex_free( ptr
)
1651 #line 105 "macro.lex.l"
1655 /* all code for testing macros */
1656 #include "winhelp.h"
1657 static CHAR szTestMacro
[256];
1659 static LRESULT CALLBACK
MACRO_TestDialogProc(HWND hDlg
, UINT msg
, WPARAM wParam
, LPARAM lParam
)
1661 if (msg
== WM_COMMAND
&& wParam
== IDOK
)
1663 GetDlgItemText(hDlg
, 99, szTestMacro
, sizeof(szTestMacro
));
1664 EndDialog(hDlg
, IDOK
);
1670 void macro_test(void)
1672 WNDPROC lpfnDlg
= MakeProcInstance(MACRO_TestDialogProc
, Globals
.hInstance
);
1673 DialogBox(Globals
.hInstance
, STRING_DIALOG_TEST
, Globals
.active_win
->hMainWnd
, lpfnDlg
);
1674 FreeProcInstance(lpfnDlg
);
1675 macro
= szTestMacro
;
1679 /* small helper function for debug messages */
1680 static const char* ts(int t
)
1682 static char c
[2] = {0,0};
1686 case EMPTY
: return "EMPTY";
1687 case VOID_FUNCTION
: return "VOID_FUNCTION";
1688 case BOOL_FUNCTION
: return "BOOL_FUNCTION";
1689 case INTEGER
: return "INTEGER";
1690 case STRING
: return "STRING";
1691 case IDENTIFIER
: return "IDENTIFIER";
1692 default: c
[0] = (char)t
; return c
;
1696 static int MACRO_CallBoolFunc(FARPROC fn
, const char* args
, void** ret
);
1698 /******************************************************************
1701 * checks number of arguments against prototype, and stores arguments on
1702 * stack pa for later call
1703 * returns -1 on error, otherwise the number of pushed parameters
1705 static int MACRO_CheckArgs(void* pa
[], unsigned max
, const char* args
)
1708 unsigned int len
= 0, idx
= 0;
1710 WINE_TRACE("Checking %s\n", args
);
1712 if (yylex() != '(') {WINE_WARN("missing (\n");return -1;}
1720 WINE_TRACE("Got %s <=> %c\n", ts(t
), *args
);
1726 {WINE_WARN("missing S\n");return -1;}
1727 pa
[idx
] = (void*)yylval
.string
;
1732 {WINE_WARN("missing U\n");return -1;}
1733 pa
[idx
] = LongToPtr(yylval
.integer
);
1736 if (t
!= BOOL_FUNCTION
)
1737 {WINE_WARN("missing B\n");return -1;}
1738 if (MACRO_CallBoolFunc(yylval
.function
, yylval
.proto
, &pa
[idx
]) == 0)
1742 WINE_WARN("unexpected %s while args is %c\n", ts(t
), *args
);
1746 if (*++args
== '\0') break;
1748 if (t
== ')') goto CheckArgs_end
;
1749 if (t
!= ',') {WINE_WARN("missing ,\n");return -1;}
1750 if (idx
>= max
) {WINE_FIXME("stack overflow (%d)\n", max
);return -1;}
1753 if (yylex() != ')') {WINE_WARN("missing )\n");return -1;}
1756 while (len
> idx
) pa
[--len
] = NULL
;
1760 /******************************************************************
1761 * MACRO_CallBoolFunc
1763 * Invokes boolean function fn, which arguments are defined by args
1764 * stores bool result into ret
1766 static int MACRO_CallBoolFunc(FARPROC fn
, const char* args
, void** ret
)
1769 int idx
= MACRO_CheckArgs(pa
, sizeof(pa
)/sizeof(pa
[0]), args
);
1771 if (idx
< 0) return 0;
1774 WINE_TRACE("calling with %u pmts\n", idx
);
1776 switch (strlen(args
))
1778 case 0: *ret
= (void*)(fn
)(); break;
1779 case 1: *ret
= (void*)(fn
)(pa
[0]); break;
1780 default: WINE_FIXME("NIY\n");
1786 /******************************************************************
1787 * MACRO_CallVoidFunc
1791 static int MACRO_CallVoidFunc(FARPROC fn
, const char* args
)
1794 int idx
= MACRO_CheckArgs(pa
, sizeof(pa
)/sizeof(pa
[0]), args
);
1796 if (idx
< 0) return 0;
1799 WINE_TRACE("calling %p with %u pmts\n", fn
, idx
);
1801 switch (strlen(args
))
1803 case 0: (fn
)(); break;
1804 case 1: (fn
)(pa
[0]); break;
1805 case 2: (fn
)(pa
[0],pa
[1]); break;
1806 case 3: (fn
)(pa
[0],pa
[1],pa
[2]); break;
1807 case 4: (fn
)(pa
[0],pa
[1],pa
[2],pa
[3]); break;
1808 case 5: (fn
)(pa
[0],pa
[1],pa
[2],pa
[3],pa
[4]); break;
1809 case 6: (fn
)(pa
[0],pa
[1],pa
[2],pa
[3],pa
[4],pa
[5]); break;
1810 default: WINE_FIXME("NIY\n");
1816 BOOL
MACRO_ExecuteMacro(LPCSTR macro
)
1818 struct lex_data curr_lex_data
, *prev_lex_data
;
1822 WINE_TRACE("%s\n", wine_dbgstr_a(macro
));
1824 prev_lex_data
= lex_data
;
1825 lex_data
= &curr_lex_data
;
1827 memset(lex_data
, 0, sizeof(*lex_data
));
1828 lex_data
->macroptr
= macro
;
1830 while ((t
= yylex()) != EMPTY
)
1835 WINE_TRACE("got type void func(%s)\n", yylval
.proto
);
1836 MACRO_CallVoidFunc(yylval
.function
, yylval
.proto
);
1839 WINE_WARN("got type bool func(%s)\n", yylval
.proto
);
1842 WINE_WARN("got unexpected type %s\n", ts(t
));
1845 switch (t
= yylex())
1847 case EMPTY
: goto done
;
1849 default: ret
= FALSE
; goto done
;
1854 for (t
= 0; t
< lex_data
->cache_used
; t
++)
1855 HeapFree(GetProcessHeap(), 0, lex_data
->cache_string
[t
]);
1856 lex_data
= prev_lex_data
;
1862 int yywrap(void) { return 1; }