#line 1 "tools/wrc/parser.yy.c"

#line 3 "tools/wrc/parser.yy.c"

#define  YY_INT_ALIGNED short int

/* A lexical scanner generated by flex */

#define yy_create_buffer parser__create_buffer
#define yy_delete_buffer parser__delete_buffer
#define yy_scan_buffer parser__scan_buffer
#define yy_scan_string parser__scan_string
#define yy_scan_bytes parser__scan_bytes
#define yy_init_buffer parser__init_buffer
#define yy_flush_buffer parser__flush_buffer
#define yy_load_buffer_state parser__load_buffer_state
#define yy_switch_to_buffer parser__switch_to_buffer
#define yypush_buffer_state parser_push_buffer_state
#define yypop_buffer_state parser_pop_buffer_state
#define yyensure_buffer_stack parser_ensure_buffer_stack
#define yy_flex_debug parser__flex_debug
#define yyin parser_in
#define yyleng parser_leng
#define yylex parser_lex
#define yylineno parser_lineno
#define yyout parser_out
#define yyrestart parser_restart
#define yytext parser_text
#define yywrap parser_wrap
#define yyalloc parser_alloc
#define yyrealloc parser_realloc
#define yyfree parser_free

#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6
#define YY_FLEX_SUBMINOR_VERSION 4
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif

#ifdef yy_create_buffer
#define parser__create_buffer_ALREADY_DEFINED
#else
#define yy_create_buffer parser__create_buffer
#endif

#ifdef yy_delete_buffer
#define parser__delete_buffer_ALREADY_DEFINED
#else
#define yy_delete_buffer parser__delete_buffer
#endif

#ifdef yy_scan_buffer
#define parser__scan_buffer_ALREADY_DEFINED
#else
#define yy_scan_buffer parser__scan_buffer
#endif

#ifdef yy_scan_string
#define parser__scan_string_ALREADY_DEFINED
#else
#define yy_scan_string parser__scan_string
#endif

#ifdef yy_scan_bytes
#define parser__scan_bytes_ALREADY_DEFINED
#else
#define yy_scan_bytes parser__scan_bytes
#endif

#ifdef yy_init_buffer
#define parser__init_buffer_ALREADY_DEFINED
#else
#define yy_init_buffer parser__init_buffer
#endif

#ifdef yy_flush_buffer
#define parser__flush_buffer_ALREADY_DEFINED
#else
#define yy_flush_buffer parser__flush_buffer
#endif

#ifdef yy_load_buffer_state
#define parser__load_buffer_state_ALREADY_DEFINED
#else
#define yy_load_buffer_state parser__load_buffer_state
#endif

#ifdef yy_switch_to_buffer
#define parser__switch_to_buffer_ALREADY_DEFINED
#else
#define yy_switch_to_buffer parser__switch_to_buffer
#endif

#ifdef yypush_buffer_state
#define parser_push_buffer_state_ALREADY_DEFINED
#else
#define yypush_buffer_state parser_push_buffer_state
#endif

#ifdef yypop_buffer_state
#define parser_pop_buffer_state_ALREADY_DEFINED
#else
#define yypop_buffer_state parser_pop_buffer_state
#endif

#ifdef yyensure_buffer_stack
#define parser_ensure_buffer_stack_ALREADY_DEFINED
#else
#define yyensure_buffer_stack parser_ensure_buffer_stack
#endif

#ifdef yylex
#define parser_lex_ALREADY_DEFINED
#else
#define yylex parser_lex
#endif

#ifdef yyrestart
#define parser_restart_ALREADY_DEFINED
#else
#define yyrestart parser_restart
#endif

#ifdef yylex_init
#define parser_lex_init_ALREADY_DEFINED
#else
#define yylex_init parser_lex_init
#endif

#ifdef yylex_init_extra
#define parser_lex_init_extra_ALREADY_DEFINED
#else
#define yylex_init_extra parser_lex_init_extra
#endif

#ifdef yylex_destroy
#define parser_lex_destroy_ALREADY_DEFINED
#else
#define yylex_destroy parser_lex_destroy
#endif

#ifdef yyget_debug
#define parser_get_debug_ALREADY_DEFINED
#else
#define yyget_debug parser_get_debug
#endif

#ifdef yyset_debug
#define parser_set_debug_ALREADY_DEFINED
#else
#define yyset_debug parser_set_debug
#endif

#ifdef yyget_extra
#define parser_get_extra_ALREADY_DEFINED
#else
#define yyget_extra parser_get_extra
#endif

#ifdef yyset_extra
#define parser_set_extra_ALREADY_DEFINED
#else
#define yyset_extra parser_set_extra
#endif

#ifdef yyget_in
#define parser_get_in_ALREADY_DEFINED
#else
#define yyget_in parser_get_in
#endif

#ifdef yyset_in
#define parser_set_in_ALREADY_DEFINED
#else
#define yyset_in parser_set_in
#endif

#ifdef yyget_out
#define parser_get_out_ALREADY_DEFINED
#else
#define yyget_out parser_get_out
#endif

#ifdef yyset_out
#define parser_set_out_ALREADY_DEFINED
#else
#define yyset_out parser_set_out
#endif

#ifdef yyget_leng
#define parser_get_leng_ALREADY_DEFINED
#else
#define yyget_leng parser_get_leng
#endif

#ifdef yyget_text
#define parser_get_text_ALREADY_DEFINED
#else
#define yyget_text parser_get_text
#endif

#ifdef yyget_lineno
#define parser_get_lineno_ALREADY_DEFINED
#else
#define yyget_lineno parser_get_lineno
#endif

#ifdef yyset_lineno
#define parser_set_lineno_ALREADY_DEFINED
#else
#define yyset_lineno parser_set_lineno
#endif

#ifdef yywrap
#define parser_wrap_ALREADY_DEFINED
#else
#define yywrap parser_wrap
#endif

#ifdef yyalloc
#define parser_alloc_ALREADY_DEFINED
#else
#define yyalloc parser_alloc
#endif

#ifdef yyrealloc
#define parser_realloc_ALREADY_DEFINED
#else
#define yyrealloc parser_realloc
#endif

#ifdef yyfree
#define parser_free_ALREADY_DEFINED
#else
#define yyfree parser_free
#endif

#ifdef yytext
#define parser_text_ALREADY_DEFINED
#else
#define yytext parser_text
#endif

#ifdef yyleng
#define parser_leng_ALREADY_DEFINED
#else
#define yyleng parser_leng
#endif

#ifdef yyin
#define parser_in_ALREADY_DEFINED
#else
#define yyin parser_in
#endif

#ifdef yyout
#define parser_out_ALREADY_DEFINED
#else
#define yyout parser_out
#endif

#ifdef yy_flex_debug
#define parser__flex_debug_ALREADY_DEFINED
#else
#define yy_flex_debug parser__flex_debug
#endif

#ifdef yylineno
#define parser_lineno_ALREADY_DEFINED
#else
#define yylineno parser_lineno
#endif

/* First, we deal with  platform-specific or compiler-specific issues. */

/* begin standard C headers. */
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>

/* end standard C headers. */

/* flex integer type definitions */

#ifndef FLEXINT_H
#define FLEXINT_H

/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */

#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L

/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
 * if you want the limit (max/min) macros for int types. 
 */
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS 1
#endif

#include <inttypes.h>
typedef int8_t flex_int8_t;
typedef uint8_t flex_uint8_t;
typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
typedef int flex_int32_t;
typedef unsigned char flex_uint8_t; 
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;

/* Limits of integral types. */
#ifndef INT8_MIN
#define INT8_MIN               (-128)
#endif
#ifndef INT16_MIN
#define INT16_MIN              (-32767-1)
#endif
#ifndef INT32_MIN
#define INT32_MIN              (-2147483647-1)
#endif
#ifndef INT8_MAX
#define INT8_MAX               (127)
#endif
#ifndef INT16_MAX
#define INT16_MAX              (32767)
#endif
#ifndef INT32_MAX
#define INT32_MAX              (2147483647)
#endif
#ifndef UINT8_MAX
#define UINT8_MAX              (255U)
#endif
#ifndef UINT16_MAX
#define UINT16_MAX             (65535U)
#endif
#ifndef UINT32_MAX
#define UINT32_MAX             (4294967295U)
#endif

#ifndef SIZE_MAX
#define SIZE_MAX               (~(size_t)0)
#endif

#endif /* ! C99 */

#endif /* ! FLEXINT_H */

/* begin standard C++ headers. */

/* TODO: this is always defined, so inline it */
#define yyconst const

#if defined(__GNUC__) && __GNUC__ >= 3
#define yynoreturn __attribute__((__noreturn__))
#else
#define yynoreturn
#endif

/* Returned upon end-of-file. */
#define YY_NULL 0

/* Promotes a possibly negative, possibly signed char to an
 *   integer in range [0..255] for use as an array index.
 */
#define YY_SC_TO_UI(c) ((YY_CHAR) (c))

/* Enter a start condition.  This macro really ought to take a parameter,
 * but we do it the disgusting crufty way forced on us by the ()-less
 * definition of BEGIN.
 */
#define BEGIN (yy_start) = 1 + 2 *
/* Translate the current start state into a value that can be later handed
 * to BEGIN to return to the state.  The YYSTATE alias is for lex
 * compatibility.
 */
#define YY_START (((yy_start) - 1) / 2)
#define YYSTATE YY_START
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* Special action meaning "start processing a new file". */
#define YY_NEW_FILE yyrestart( yyin  )
#define YY_END_OF_BUFFER_CHAR 0

/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
 * Ditto for the __ia64__ case accordingly.
 */
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#endif

/* The state buf must be large enough to hold one state per character in the main buffer.
 */
#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))

#ifndef YY_TYPEDEF_YY_BUFFER_STATE
#define YY_TYPEDEF_YY_BUFFER_STATE
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif

#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif

extern int yyleng;

extern FILE *yyin, *yyout;

#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
    
    #define YY_LESS_LINENO(n)
    #define YY_LINENO_REWIND_TO(ptr)
    
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
	do \
		{ \
		/* Undo effects of setting up yytext. */ \
        int yyless_macro_arg = (n); \
        YY_LESS_LINENO(yyless_macro_arg);\
		*yy_cp = (yy_hold_char); \
		YY_RESTORE_YY_MORE_OFFSET \
		(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
		} \
	while ( 0 )
#define unput(c) yyunput( c, (yytext_ptr)  )

#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
	{
	FILE *yy_input_file;

	char *yy_ch_buf;		/* input buffer */
	char *yy_buf_pos;		/* current position in input buffer */

	/* Size of input buffer in bytes, not including room for EOB
	 * characters.
	 */
	int yy_buf_size;

	/* Number of characters read into yy_ch_buf, not including EOB
	 * characters.
	 */
	int yy_n_chars;

	/* Whether we "own" the buffer - i.e., we know we created it,
	 * and can realloc() it to grow it, and should free() it to
	 * delete it.
	 */
	int yy_is_our_buffer;

	/* Whether this is an "interactive" input source; if so, and
	 * if we're using stdio for input, then we want to use getc()
	 * instead of fread(), to make sure we stop fetching input after
	 * each newline.
	 */
	int yy_is_interactive;

	/* Whether we're considered to be at the beginning of a line.
	 * If so, '^' rules will be active on the next match, otherwise
	 * not.
	 */
	int yy_at_bol;

    int yy_bs_lineno; /**< The line count. */
    int yy_bs_column; /**< The column count. */

	/* Whether to try to fill the input buffer when we reach the
	 * end of it.
	 */
	int yy_fill_buffer;

	int yy_buffer_status;

#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
	/* When an EOF's been seen but there's still some text to process
	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
	 * shouldn't try reading from the input source any more.  We might
	 * still have a bunch of tokens to match, though, because of
	 * possible backing-up.
	 *
	 * When we actually see the EOF, we change the status to "new"
	 * (via yyrestart()), so that the user can continue scanning by
	 * just pointing yyin at a new input file.
	 */
#define YY_BUFFER_EOF_PENDING 2

	};
#endif /* !YY_STRUCT_YY_BUFFER_STATE */

/* Stack of input buffers. */
static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */

/* We provide macros for accessing buffer states in case in the
 * future we want to put the buffer states in a more general
 * "scanner state".
 *
 * Returns the top of the stack, or NULL.
 */
#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
                          : NULL)
/* Same as previous macro, but useful when we know that the buffer stack is not
 * NULL or when we need an lvalue. For internal use only.
 */
#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]

/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;
static int yy_n_chars;		/* number of characters read into yy_ch_buf */
int yyleng;

/* Points to current character in buffer. */
static char *yy_c_buf_p = NULL;
static int yy_init = 0;		/* whether we need to initialize */
static int yy_start = 0;	/* start state number */

/* Flag which is used to allow yywrap()'s to do buffer switches
 * instead of setting up a fresh yyin.  A bit of a hack ...
 */
static int yy_did_buffer_switch_on_eof;

void yyrestart ( FILE *input_file  );
void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer  );
YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size  );
void yy_delete_buffer ( YY_BUFFER_STATE b  );
void yy_flush_buffer ( YY_BUFFER_STATE b  );
void yypush_buffer_state ( YY_BUFFER_STATE new_buffer  );
void yypop_buffer_state ( void );

static void yyensure_buffer_stack ( void );
static void yy_load_buffer_state ( void );
static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file  );
#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER )

YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size  );
YY_BUFFER_STATE yy_scan_string ( const char *yy_str  );
YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len  );

void *yyalloc ( yy_size_t  );
void *yyrealloc ( void *, yy_size_t  );
void yyfree ( void *  );

#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
	{ \
	if ( ! YY_CURRENT_BUFFER ){ \
        yyensure_buffer_stack (); \
		YY_CURRENT_BUFFER_LVALUE =    \
            yy_create_buffer( yyin, YY_BUF_SIZE ); \
	} \
	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
	}
#define yy_set_bol(at_bol) \
	{ \
	if ( ! YY_CURRENT_BUFFER ){\
        yyensure_buffer_stack (); \
		YY_CURRENT_BUFFER_LVALUE =    \
            yy_create_buffer( yyin, YY_BUF_SIZE ); \
	} \
	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
	}
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)

/* Begin user sect3 */

#define parser_wrap() (/*CONSTCOND*/1)
#define YY_SKIP_YYWRAP
typedef flex_uint8_t YY_CHAR;

FILE *yyin = NULL, *yyout = NULL;

typedef int yy_state_type;

extern int yylineno;
int yylineno = 1;

extern char *yytext;
#ifdef yytext_ptr
#undef yytext_ptr
#endif
#define yytext_ptr yytext

static yy_state_type yy_get_previous_state ( void );
static yy_state_type yy_try_NUL_trans ( yy_state_type current_state  );
static int yy_get_next_buffer ( void );
static void yynoreturn yy_fatal_error ( const char* msg  );

/* Done after the current pattern has been matched and before the
 * corresponding action - sets up yytext.
 */
#define YY_DO_BEFORE_ACTION \
	(yytext_ptr) = yy_bp; \
	yyleng = (int) (yy_cp - yy_bp); \
	(yy_hold_char) = *yy_cp; \
	*yy_cp = '\0'; \
	(yy_c_buf_p) = yy_cp;
#define YY_NUM_RULES 79
#define YY_END_OF_BUFFER 80
/* This struct is not used in this scanner,
   but its presence is necessary. */
struct yy_trans_info
	{
	flex_int32_t yy_verify;
	flex_int32_t yy_nxt;
	};
static const flex_int16_t yy_accept[189] =
    {   0,
        0,    0,    0,    0,    0,    0,    0,    0,   69,   69,
        0,    0,    3,    3,    5,    5,    9,    9,   80,   78,
       76,   75,   76,   77,   40,   62,   17,   17,   14,   14,
       73,   17,   12,   13,   76,   76,    2,   57,   61,   42,
       78,   38,   39,   20,   78,   67,   65,   66,   63,   67,
       69,   71,   70,   11,   10,   11,   11,    2,    3,    5,
        5,    9,    9,   76,   17,   68,   17,   14,   14,   17,
       17,   73,   18,   76,    2,    2,    0,   57,   41,   58,
       55,   47,   55,   55,   43,   46,   48,   49,   50,   51,
       52,   53,   54,   55,   38,   19,   35,   33,   25,   33,

       33,   21,   24,   26,   27,   28,   29,   30,   31,   32,
       33,   65,   64,   69,   70,   70,   72,    0,    3,    5,
        5,    9,    9,    9,    9,    9,   74,   17,   16,   15,
        0,   60,   47,   56,   59,   43,   46,   45,   37,   25,
       34,   36,   21,   24,   23,    5,    9,    8,    9,    9,
       16,   15,    0,   43,   44,   21,   23,    5,    8,    9,
        9,    0,   21,   23,    5,    9,    9,    0,   21,   22,
        5,    9,    9,    7,    0,   21,    5,    9,    7,    1,
        5,    9,    4,    9,    6,    4,    6,    0
    } ;

static const YY_CHAR yy_ec[256] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
        1,    2,    4,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    5,    6,    7,    8,    6,    6,    6,    9,   10,
       11,   12,    6,    6,   13,   14,   15,   16,   17,   17,
       17,   17,   17,   17,   17,   18,   19,    6,   20,    6,
        6,    6,    6,    6,   21,   21,   21,   21,   21,   21,
       14,   14,   14,   14,   14,   22,   14,   14,   23,   14,
       14,   14,   14,   14,   14,   14,   14,   24,   14,   14,
        6,   25,    6,    6,   26,    6,   27,   28,   29,   30,

       31,   32,   33,   14,   14,   14,   14,   34,   35,   36,
       37,   38,   14,   39,   14,   40,   41,   42,   14,   43,
       14,   14,   44,    6,   45,    6,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,

        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1
    } ;

static const YY_CHAR yy_meta[46] =
    {   0,
        1,    1,    2,    1,    1,    1,    3,    1,    1,    1,
        1,    4,    5,    5,    5,    6,    6,    6,    6,    1,
        6,    5,    5,    5,    7,    5,    6,    6,    6,    6,
        6,    6,    5,    5,    5,    5,    5,    5,    5,    5,
        5,    5,    5,    1,    1
    } ;

static const flex_int16_t yy_base[221] =
    {   0,
        0,   44,   44,   47,   50,   52,   76,  107,   53,   55,
       58,  138,  291,  288,   57,   59,   60,   61,  283,  619,
       85,  619,   94,  619,  619,  619,    0,  102,  138,   78,
        0,  261,  619,  619,  125,  143,  161,    0,  619,  166,
      197,    0,  619,  172,  238,  619,  178,  619,  619,    0,
        0,  619,  107,  619,  619,  255,  182,  189,    0,    0,
      226,    0,  280,  193,    0,  619,  321,  165,    0,   66,
      351,    0,  619,  201,  215,  226,  223,    0,  242,  619,
      619,  230,  249,  236,  242,  270,  619,  619,  619,  619,
      619,  619,  619,    0,    0,  288,  619,  619,  246,  235,

      219,  284,  288,  619,  619,  619,  619,  619,  619,  619,
        0,  267,  619,    0,  137,  152,  619,  271,    0,    0,
      193,    0,    0,  307,  191,  181,    0,  383,  318,   98,
      191,  619,  311,  619,  619,  326,  337,    0,  619,  315,
      619,  619,  341,  345,    0,  181,  394,    0,  179,  178,
        0,    0,  174,  357,  619,  390,    0,  170,    0,  165,
      167,  143,  394,    0,  131,  118,  412,  131,  402,  619,
      123,  110,  420,    0,  334,  416,   98,   78,    0,  345,
       82,  434,    0,  438,    0,    0,    0,  619,  449,  456,
      463,  470,  477,  484,  491,  498,  501,  508,  515,  521,

      528,  534,   94,  541,  548,  555,  562,  569,  576,   85,
       78,  583,   70,   68,  590,   62,   60,  597,  604,  611
    } ;

static const flex_int16_t yy_def[221] =
    {   0,
      188,    1,  189,  189,  190,  190,  191,  191,  192,  192,
      193,  193,  194,  194,  195,  195,  196,  196,  188,  188,
      188,  188,  188,  188,  188,  188,  197,  197,  197,   29,
      198,  197,  188,  188,  188,  188,  188,  199,  188,  188,
      200,  201,  188,  188,  202,  188,  188,  188,  188,  203,
      204,  188,  205,  188,  188,  188,  188,  188,  206,  207,
      207,  208,  208,  188,  197,  188,  209,   29,  197,  197,
      197,  198,  188,  188,  188,  188,  188,  199,  188,  188,
      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
      188,  188,  188,  210,  201,  188,  188,  188,  188,  188,

      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
      211,  188,  188,  204,  205,  205,  188,  188,  206,  207,
      207,  208,   63,   63,  208,  208,  212,  209,  197,   71,
      188,  188,  188,  188,  188,  188,  188,  213,  188,  188,
      188,  188,  188,  188,  214,  207,  208,  215,  208,  208,
      197,  197,  188,  188,  188,  188,  216,  207,  215,  208,
      208,  188,  188,  217,  207,  208,  208,  188,  188,  188,
      207,  208,  208,  218,  188,  188,  207,  208,  218,  188,
      207,  208,  219,  208,  220,  219,  220,    0,  188,  188,
      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,

      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
      188,  188,  188,  188,  188,  188,  188,  188,  188,  188
    } ;

static const flex_int16_t yy_nxt[665] =
    {   0,
       20,   21,   22,   21,   23,   24,   25,   24,   26,   24,
       24,   24,   24,   27,   28,   29,   30,   30,   30,   31,
       27,   32,   27,   27,   27,   27,   27,   27,   27,   27,
       27,   27,   27,   27,   27,   27,   27,   27,   27,   27,
       27,   27,   27,   33,   34,   35,   39,   35,   36,   39,
       40,   37,   43,   40,   43,   52,   44,   52,   44,   20,
       55,   20,   20,   20,   53,  170,   53,  164,   41,   63,
       63,   41,   56,  157,   45,  155,   45,   47,   48,   47,
       47,  129,  129,  145,   49,   61,   64,   61,   64,   64,
      138,   50,   50,   50,   50,   64,   50,   64,   64,  113,

       65,   65,   50,   50,   50,   50,   50,   50,   47,   48,
       47,   47,  183,   66,   65,   49,   67,  182,  116,  152,
       65,  117,   50,   50,   50,   50,   74,   50,   74,   74,
      181,  152,   75,   50,   50,   50,   50,   50,   50,   57,
       55,   57,   57,  178,   74,   58,   74,   74,  188,  177,
       75,  188,   56,   68,   68,   68,   68,  175,  172,   69,
       70,   71,   76,  116,   76,   76,  117,   79,  171,   79,
       79,   69,   80,   96,   70,   96,   96,  168,   97,  112,
       71,  112,  112,  118,  167,  118,  118,   65,   65,   75,
       76,  166,   76,   76,   64,  165,   64,   64,   77,   82,

       83,   65,   74,   84,   74,   74,  162,   65,   75,  161,
      160,  158,   85,   85,   86,   86,   76,  153,   76,   76,
      150,  149,  146,   87,   88,  142,   77,   76,   89,   76,
       76,  133,   90,  133,  133,   91,   92,  141,   93,   94,
       99,  100,  135,   79,  101,   79,   79,  140,  132,  140,
      140,  134,   77,  102,  102,  103,  103,  136,  136,  137,
      137,  131,  121,   77,  104,  105,   66,   73,  112,  106,
      112,  112,  118,  107,  118,  118,  108,  109,   75,  110,
      111,  123,  188,  123,  123,  137,  137,  137,  137,   96,
       20,   96,   96,   20,  139,  124,  124,  124,  124,  143,

      143,  144,  144,  144,  144,  144,  144,  188,  147,  125,
      147,  147,  133,  188,  133,  133,  140,  148,  140,  140,
      126,  127,  127,  188,  127,  127,  127,  127,  127,  127,
      127,  127,  127,  129,  129,  180,  122,  180,  180,  151,
      127,  154,  154,  137,  137,  188,  180,  122,  180,  180,
      188,  151,  137,  137,  137,  137,  156,  156,  144,  144,
      144,  144,  144,  144,  127,  127,  130,  130,  130,  130,
      188,  130,  137,  137,  137,  137,  188,  130,  130,  130,
      130,  130,  130,  127,  127,  188,  127,  127,  127,  127,
      127,  127,  127,  127,  127,  147,  188,  147,  147,  188,

      188,  188,  127,  188,  148,  163,  163,  144,  144,  169,
      169,  144,  144,  173,  188,  173,  173,  176,  176,  144,
      144,  173,  174,  173,  173,  188,  127,  127,  188,  188,
      174,  144,  144,  144,  144,  184,  188,  184,  184,  184,
      188,  184,  184,  188,  185,  188,  188,  188,  185,   38,
       38,   38,   38,   38,   38,   38,   42,   42,   42,   42,
       42,   42,   42,   46,   46,   46,   46,   46,   46,   46,
       51,   51,   51,   51,   51,   51,   51,   54,   54,   54,
       54,   54,   54,   54,   59,   59,   59,   59,   59,   59,
       59,   60,   60,   60,   60,   60,   60,   60,   62,   62,

       62,   62,   62,   62,   62,   65,   65,   65,   72,  188,
       72,   72,   72,   72,   72,   78,  188,  188,   78,   78,
       78,   81,   81,   81,   81,   81,   81,   81,   95,  188,
      188,   95,   95,   95,   98,   98,   98,   98,   98,   98,
       98,  114,  188,  114,  188,  114,  114,  114,  115,  188,
      115,  115,  115,  115,  115,  119,  188,  119,  119,  119,
      119,  119,  120,  188,  120,  120,  120,  120,  120,  122,
      188,  122,  122,  122,  122,  122,  128,  188,  128,  128,
      128,  128,  128,  127,  188,  127,  127,  127,  127,  127,
      159,  188,  159,  159,  159,  159,  159,  179,  188,  179,

      179,  179,  179,  179,  186,  188,  186,  186,  186,  186,
      186,  187,  188,  187,  187,  187,  187,  187,   19,  188,
      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
      188,  188,  188,  188
    } ;

static const flex_int16_t yy_chk[665] =
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    2,    3,    2,    2,    4,
        3,    2,    5,    4,    6,    9,    5,   10,    6,   15,
       11,   16,   17,   18,    9,  217,   10,  216,    3,   17,
       18,    4,   11,  214,    5,  213,    6,    7,    7,    7,
        7,   70,   70,  211,    7,   15,   21,   16,   21,   21,
      210,    7,    7,    7,    7,   23,    7,   23,   23,  203,

       30,   30,    7,    7,    7,    7,    7,    7,    8,    8,
        8,    8,  181,   28,   30,    8,   28,  178,   53,  130,
       30,   53,    8,    8,    8,    8,   35,    8,   35,   35,
      177,  130,   35,    8,    8,    8,    8,    8,    8,   12,
       12,   12,   12,  172,   36,   12,   36,   36,  115,  171,
       36,  115,   12,   29,   29,   29,   29,  168,  166,   29,
       29,   29,   37,  116,   37,   37,  116,   40,  165,   40,
       40,   29,   40,   44,   29,   44,   44,  162,   44,   47,
       29,   47,   47,   57,  161,   57,   57,   68,   68,   57,
       58,  160,   58,   58,   64,  158,   64,   64,   37,   41,

       41,   68,   74,   41,   74,   74,  153,   68,   74,  150,
      149,  146,   41,   41,   41,   41,   75,  131,   75,   75,
      126,  125,  121,   41,   41,  101,   58,   76,   41,   76,
       76,   82,   41,   82,   82,   41,   41,  100,   41,   41,
       45,   45,   84,   79,   45,   79,   79,   99,   79,   99,
       99,   83,   75,   45,   45,   45,   45,   85,   85,   85,
       85,   77,   61,   76,   45,   45,   56,   32,  112,   45,
      112,  112,  118,   45,  118,  118,   45,   45,  118,   45,
       45,   63,   19,   63,   63,   86,   86,   86,   86,   96,
       14,   96,   96,   13,   96,   63,   63,   63,   63,  102,

      102,  102,  102,  103,  103,  103,  103,    0,  124,   63,
      124,  124,  133,    0,  133,  133,  140,  124,  140,  140,
       63,   67,   67,    0,   67,   67,   67,   67,   67,   67,
       67,   67,   67,  129,  129,  175,  124,  175,  175,  129,
       67,  136,  136,  136,  136,    0,  180,  124,  180,  180,
        0,  129,  137,  137,  137,  137,  143,  143,  143,  143,
      144,  144,  144,  144,   67,   67,   71,   71,   71,   71,
        0,   71,  154,  154,  154,  154,    0,   71,   71,   71,
       71,   71,   71,  128,  128,    0,  128,  128,  128,  128,
      128,  128,  128,  128,  128,  147,    0,  147,  147,    0,

        0,    0,  128,    0,  147,  156,  156,  156,  156,  163,
      163,  163,  163,  167,    0,  167,  167,  169,  169,  169,
      169,  173,  167,  173,  173,    0,  128,  128,    0,    0,
      173,  176,  176,  176,  176,  182,    0,  182,  182,  184,
        0,  184,  184,    0,  182,    0,    0,    0,  184,  189,
      189,  189,  189,  189,  189,  189,  190,  190,  190,  190,
      190,  190,  190,  191,  191,  191,  191,  191,  191,  191,
      192,  192,  192,  192,  192,  192,  192,  193,  193,  193,
      193,  193,  193,  193,  194,  194,  194,  194,  194,  194,
      194,  195,  195,  195,  195,  195,  195,  195,  196,  196,

      196,  196,  196,  196,  196,  197,  197,  197,  198,    0,
      198,  198,  198,  198,  198,  199,    0,    0,  199,  199,
      199,  200,  200,  200,  200,  200,  200,  200,  201,    0,
        0,  201,  201,  201,  202,  202,  202,  202,  202,  202,
      202,  204,    0,  204,    0,  204,  204,  204,  205,    0,
      205,  205,  205,  205,  205,  206,    0,  206,  206,  206,
      206,  206,  207,    0,  207,  207,  207,  207,  207,  208,
        0,  208,  208,  208,  208,  208,  209,    0,  209,  209,
      209,  209,  209,  212,    0,  212,  212,  212,  212,  212,
      215,    0,  215,  215,  215,  215,  215,  218,    0,  218,

      218,  218,  218,  218,  219,    0,  219,  219,  219,  219,
      219,  220,    0,  220,  220,  220,  220,  220,  188,  188,
      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
      188,  188,  188,  188,  188,  188,  188,  188,  188,  188,
      188,  188,  188,  188
    } ;

static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;

extern int yy_flex_debug;
int yy_flex_debug = 0;

/* The intent behind this definition is that it'll catch
 * any uses of REJECT which flex missed.
 */
#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
#line 1 "../wine/tools/wrc/parser.l"
/* -*-C-*-
 *
 * Copyright 1998-2000	Bertho A. Stultiens (BS)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 *
 * History:
 * 21-May-2000 BS	- Fixed the ident requirement of resource names
 *			  which can be keywords.
 * 30-Apr-2000 BS	- Reintegration into the wine-tree
 * 11-Jan-2000 BS	- Very drastic cleanup because we don't have a
 *			  preprocessor in here anymore.
 * 02-Jan-2000 BS	- Removed the preprocessor code
 * 23-Dec-1999 BS	- Removed the copyright for Martin von Loewis.
 *			  There is really nothing left of his code in
 *			  this parser.
 * 20-Jun-1998 BS	- Changed the filename conversion. Filenames are
 *			  case-sensitive inder *nix, but not under dos.
 *			  default behaviour is to convert to lower case.
 *			- All backslashes are converted to forward and
 *			  both single and double slash is recognized as
 *			  MS/Borland does.
 *			- Fixed a bug in 'yywf' case that prevented
 *			  double quoted names to be scanned properly.
 *
 * 19-May-1998 BS	- Started to build a preprocessor.
 *			- Changed keyword processing completely to
 *			  table-lookups.
 *
 * 20-Apr-1998 BS	- Added ';' comment stripping
 *
 * 17-Apr-1998 BS	- Made the win32 keywords optional when compiling in
 *			  16bit mode
 *
 * 15-Apr-1998 BS	- Changed string handling to include escapes
 *			- Added unicode string handling (no codepage
 *			  translation though).
 *			- 'Borrowed' the main idea of string scanning from
 *			  the flex manual pages.
 *			- Added conditional handling of scanning depending
 *			  on the state of the parser. This was mainly required
 *			  to distinguish a file to load or raw data that
 *			  follows. MS's definition of filenames is rather
 *			  complex... It can be unquoted or double quoted. If
 *			  double quoted, then the '\\' char is not automatically
 *			  escaped according to Borland's rc compiler, but it
 *			  accepts both "\\path\\file.rc" and "\path\file.rc".
 *			  This makes life very hard! I go for the escaped
 *			  version, as this seems to be the documented way...
 *			- Single quoted strings are now parsed and converted
 *			  here.
 *			- Added comment stripping. The implementation is
 *			  'borrowed' from the flex manpages.
 *			- Rebuild string processing so that it may contain
 *			  escaped '\0'.
 */
/* Exclusive string handling */

/* Exclusive unicode string handling */

/* Exclusive rcdata single quoted data handling */

/* Exclusive comment eating... */

/* Set when stripping c-junk */

/* Set when scanning #line style directives */

/* Set when scanning #pragma */


#define YY_NO_INPUT 1
/* Some shortcut definitions */
#line 95 "../wine/tools/wrc/parser.l"

/*#define LEX_DEBUG*/

#include "config.h"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include <errno.h>
#include <limits.h>
#define YY_NO_UNISTD_H

#include "../tools.h"
#include "wrc.h"
#include "utils.h"
#include "parser.h"
#include "newstruc.h"
#include "wpp_private.h"

#include "parser.tab.h"

/* Always update the current character position within a line */
#define YY_USER_ACTION	char_number+=yyleng; wanted_id = want_id; want_id = 0;

#define YY_USER_INIT current_codepage = utf8_input ? CP_UTF8 : -1;

static void addcchar(char c);
static void addwchar(WCHAR s);
static string_t *get_buffered_cstring(void);
static string_t *get_buffered_wstring(void);
static string_t *make_string(char *s);

static char *cbuffer;		/* Buffers for string collection */
static int cbufidx;
static int cbufalloc = 0;
static WCHAR *wbuffer;
static int wbufidx;
static int wbufalloc = 0;

static int current_codepage = -1;  /* use language default */

/*
 * This one is a bit tricky.
 * We set 'want_id' in the parser to get the first
 * identifier we get across in the scanner, but we
 * also want it to be reset at nearly any token we
 * see. Exceptions are:
 * - newlines
 * - comments
 * - whitespace
 *
 * The scanner will automatically reset 'want_id'
 * after *each* scanner reduction and puts is value
 * into the var below. In this way we can see the
 * state after the YY_RULE_SETUP (i.e. the user action;
 * see above) and don't have to worry too much when
 * it needs to be reset.
 */
static int wanted_id = 0;
static int save_wanted_id;	/* To save across comment reductions */

struct keyword {
	const char	*keyword;
	int		token;
	int		isextension;
	int		needcase;
	int		alwayskw;
};

static struct keyword keywords[] = {
	{ "ACCELERATORS",	tACCELERATORS,		0, 0, 0},
	{ "ALT",		tALT,			0, 0, 0},
	{ "ASCII",		tASCII,			0, 0, 0},
	{ "AUTO3STATE",		tAUTO3STATE,		1, 0, 0},
	{ "AUTOCHECKBOX",	tAUTOCHECKBOX,		1, 0, 0},
	{ "AUTORADIOBUTTON",	tAUTORADIOBUTTON,	1, 0, 0},
	{ "BEGIN",		tBEGIN,			0, 0, 0},
	{ "BITMAP",		tBITMAP,		0, 0, 0},
	{ "BLOCK",		tBLOCK,			0, 0, 0},
	{ "BUTTON",		tBUTTON,		1, 0, 0},
	{ "CAPTION",		tCAPTION,		0, 0, 0},
	{ "CHARACTERISTICS",	tCHARACTERISTICS,	1, 0, 0},
	{ "CHECKBOX",		tCHECKBOX,		0, 0, 0},
	{ "CHECKED",		tCHECKED,		0, 0, 0},
	{ "CLASS",		tCLASS,			0, 0, 0},
	{ "COMBOBOX",		tCOMBOBOX,		0, 0, 0},
	{ "CONTROL",		tCONTROL,		0, 0, 0},
	{ "CTEXT",		tCTEXT,			0, 0, 0},
	{ "CURSOR",		tCURSOR,		0, 0, 0},
	{ "DEFPUSHBUTTON",	tDEFPUSHBUTTON,		0, 0, 0},
	{ "DIALOG",		tDIALOG,		0, 0, 0},
	{ "DIALOGEX",		tDIALOGEX,		1, 0, 0},
	{ "DISCARDABLE",	tDISCARDABLE,		0, 0, 0},
	{ "DLGINIT",		tDLGINIT,		0, 0, 0},
	{ "EDITTEXT",		tEDITTEXT,		0, 0, 0},
	{ "END",		tEND,			0, 0, 0},
	{ "EXSTYLE",		tEXSTYLE,		0, 0, 0},
	{ "FILEFLAGS",		tFILEFLAGS,		0, 0, 0},
	{ "FILEFLAGSMASK",	tFILEFLAGSMASK,		0, 0, 0},
	{ "FILEOS",		tFILEOS,		0, 0, 0},
	{ "FILESUBTYPE",	tFILESUBTYPE,		0, 0, 0},
	{ "FILETYPE",		tFILETYPE,		0, 0, 0},
	{ "FILEVERSION",	tFILEVERSION,		0, 0, 0},
	{ "FIXED",		tFIXED,			0, 0, 0},
	{ "FONT",		tFONT,			0, 0, 0},
	{ "FONTDIR",		tFONTDIR,		0, 0, 0},	/* This is a Borland BRC extension */
	{ "GRAYED",		tGRAYED,		0, 0, 0},
	{ "GROUPBOX",		tGROUPBOX,		0, 0, 0},
	{ "HELP",		tHELP,			0, 0, 0},
	{ "HTML",		tHTML,			0, 0, 0},
	{ "ICON",		tICON,			0, 0, 0},
	{ "IMPURE",		tIMPURE,		0, 0, 0},
	{ "INACTIVE",		tINACTIVE,		0, 0, 0},
	{ "LANGUAGE",		tLANGUAGE,		1, 0, 1},
	{ "LISTBOX",		tLISTBOX,		0, 0, 0},
	{ "LOADONCALL",		tLOADONCALL,		0, 0, 0},
	{ "LTEXT",		tLTEXT,			0, 0, 0},
	{ "MENU",		tMENU,			0, 0, 0},
	{ "MENUBARBREAK",	tMENUBARBREAK,		0, 0, 0},
	{ "MENUBREAK",		tMENUBREAK,		0, 0, 0},
	{ "MENUEX",		tMENUEX,		1, 0, 0},
	{ "MENUITEM",		tMENUITEM,		0, 0, 0},
	{ "MESSAGETABLE",	tMESSAGETABLE,		1, 0, 0},
	{ "MOVEABLE",		tMOVEABLE,		0, 0, 0},
	{ "NOINVERT",		tNOINVERT,		0, 0, 0},
	{ "NOT",		tNOT,			0, 0, 0},
	{ "POPUP",		tPOPUP,			0, 0, 0},
	{ "PRELOAD",		tPRELOAD,		0, 0, 0},
	{ "PRODUCTVERSION",	tPRODUCTVERSION,	0, 0, 0},
	{ "PURE",		tPURE,			0, 0, 0},
	{ "PUSHBUTTON",		tPUSHBUTTON,		0, 0, 0},
	{ "RADIOBUTTON",	tRADIOBUTTON,		0, 0, 0},
	{ "RCDATA",		tRCDATA,		0, 0, 0},
	{ "RTEXT",		tRTEXT,			0, 0, 0},
	{ "SCROLLBAR",		tSCROLLBAR,		0, 0, 0},
	{ "SEPARATOR",		tSEPARATOR,		0, 0, 0},
	{ "SHIFT",		tSHIFT,			0, 0, 0},
	{ "STATE3",		tSTATE3,		1, 0, 0},
	{ "STRING",		tSTRING,		0, 0, 0},
	{ "STRINGTABLE",	tSTRINGTABLE,		0, 0, 1},
	{ "STYLE",		tSTYLE,			0, 0, 0},
	{ "TOOLBAR",		tTOOLBAR,		1, 0, 0},
	{ "VALUE",		tVALUE,			0, 0, 0},
	{ "VERSION",		tVERSION,		1, 0, 0},
	{ "VERSIONINFO",	tVERSIONINFO,		0, 0, 0},
	{ "VIRTKEY",		tVIRTKEY,		0, 0, 0}
};

#define NKEYWORDS	(sizeof(keywords)/sizeof(keywords[0]))
#define KWP(p)		((const struct keyword *)(p))
static int kw_cmp_func(const void *s1, const void *s2)
{
	int ret;
	ret = compare_striA(KWP(s1)->keyword, KWP(s2)->keyword);
	if(!ret && (KWP(s1)->needcase || KWP(s2)->needcase))
		return strcmp(KWP(s1)->keyword, KWP(s2)->keyword);
	else
		return ret;
}

#define KW_BSEARCH
#define DO_SORT
static struct keyword *iskeyword(char *kw)
{
	struct keyword *kwp;
	struct keyword key;
	key.keyword = kw;
	key.needcase = 0;
#ifdef DO_SORT
	{
		/* Make sure that it is sorted for bsearsh */
		static int sorted = 0;
		if(!sorted)
		{
			qsort(keywords, NKEYWORDS, sizeof(keywords[0]), kw_cmp_func);
			sorted = 1;
		}
	}
#endif
#ifdef KW_BSEARCH
	kwp = bsearch(&key, keywords, NKEYWORDS, sizeof(keywords[0]), kw_cmp_func);
#else
	{
		int i;
		for(i = 0; i < NKEYWORDS; i++)
		{
			if(!kw_cmp_func(&key, &keywords[i]))
				break;
		}
		if(i < NKEYWORDS)
			kwp = &keywords[i];
		else
			kwp = NULL;
	}
#endif

	if(kwp == NULL || (kwp->isextension && !extensions))
		return NULL;
	else
		return kwp;
}

/* converts an integer in string form to an unsigned long and prints an error
 * on overflow */
static unsigned long xstrtoul(const char *nptr, char **endptr, int base)
{
    unsigned long l;

    errno = 0;
    l = strtoul(nptr, endptr, base);
    if (l == ULONG_MAX && errno == ERANGE)
        parser_error("integer constant %s is too large", nptr);
    return l;
}

#line 1219 "tools/wrc/parser.yy.c"
/*
 **************************************************************************
 * The flexer starts here
 **************************************************************************
 */
#line 1225 "tools/wrc/parser.yy.c"

#define INITIAL 0
#define tkstr 1
#define tklstr 2
#define tkrcd 3
#define comment 4
#define pp_cstrip 5
#define pp_line 6
#define pp_pragma 7
#define pp_code_page 8

#ifndef YY_NO_UNISTD_H
/* Special case for "unistd.h", since it is non-ANSI. We include it way
 * down here because we want the user's section 1 to have been scanned first.
 * The user has a chance to override it with an option.
 */
#include <unistd.h>
#endif

#ifndef YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#endif

static int yy_init_globals ( void );

/* Accessor methods to globals.
   These are made visible to non-reentrant scanners for convenience. */

int yylex_destroy ( void );

int yyget_debug ( void );

void yyset_debug ( int debug_flag  );

YY_EXTRA_TYPE yyget_extra ( void );

void yyset_extra ( YY_EXTRA_TYPE user_defined  );

FILE *yyget_in ( void );

void yyset_in  ( FILE * _in_str  );

FILE *yyget_out ( void );

void yyset_out  ( FILE * _out_str  );

			int yyget_leng ( void );

char *yyget_text ( void );

int yyget_lineno ( void );

void yyset_lineno ( int _line_number  );

/* Macros after this point can all be overridden by user definitions in
 * section 1.
 */

#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
extern "C" int yywrap ( void );
#else
extern int yywrap ( void );
#endif
#endif

#ifndef YY_NO_UNPUT
    
#endif

#ifndef yytext_ptr
static void yy_flex_strncpy ( char *, const char *, int );
#endif

#ifdef YY_NEED_STRLEN
static int yy_flex_strlen ( const char * );
#endif

#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput ( void );
#else
static int input ( void );
#endif

#endif

        static int yy_start_stack_ptr = 0;
        static int yy_start_stack_depth = 0;
        static int *yy_start_stack = NULL;
    
    static void yy_push_state ( int _new_state );
    
    static void yy_pop_state ( void );
    
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#endif

/* Copy whatever the last rule matched to the standard output. */
#ifndef ECHO
/* This used to be an fputs(), but since the string might contain NUL's,
 * we now use fwrite().
 */
#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
#endif

/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
 * is returned in "result".
 */
#ifndef YY_INPUT
#define YY_INPUT(buf,result,max_size) \
	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
		{ \
		int c = '*'; \
		int n; \
		for ( n = 0; n < max_size && \
			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
			buf[n] = (char) c; \
		if ( c == '\n' ) \
			buf[n++] = (char) c; \
		if ( c == EOF && ferror( yyin ) ) \
			YY_FATAL_ERROR( "input in flex scanner failed" ); \
		result = n; \
		} \
	else \
		{ \
		errno=0; \
		while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
			{ \
			if( errno != EINTR) \
				{ \
				YY_FATAL_ERROR( "input in flex scanner failed" ); \
				break; \
				} \
			errno=0; \
			clearerr(yyin); \
			} \
		}\
\

#endif

/* No semi-colon after return; correct usage is to write "yyterminate();" -
 * we don't want an extra ';' after the "return" because that will cause
 * some compilers to complain about unreachable statements.
 */
#ifndef yyterminate
#define yyterminate() return YY_NULL
#endif

/* Number of entries by which start-condition stack grows. */
#ifndef YY_START_STACK_INCR
#define YY_START_STACK_INCR 25
#endif

/* Report a fatal error. */
#ifndef YY_FATAL_ERROR
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
#endif

/* end tables serialization structures and prototypes */

/* Default declaration of generated scanner - a define so the user can
 * easily add parameters.
 */
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1

extern int yylex (void);

#define YY_DECL int yylex (void)
#endif /* !YY_DECL */

/* Code executed at the beginning of each rule, after yytext and yyleng
 * have been set up.
 */
#ifndef YY_USER_ACTION
#define YY_USER_ACTION
#endif

/* Code executed at the end of each rule. */
#ifndef YY_BREAK
#define YY_BREAK /*LINTED*/break;
#endif

#define YY_RULE_SETUP \
	if ( yyleng > 0 ) \
		YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
				(yytext[yyleng - 1] == '\n'); \
	YY_USER_ACTION

/** The main scanner function which does all the work.
 */
YY_DECL
{
	yy_state_type yy_current_state;
	char *yy_cp, *yy_bp;
	int yy_act;
    
	if ( !(yy_init) )
		{
		(yy_init) = 1;

#ifdef YY_USER_INIT
		YY_USER_INIT;
#endif

		if ( ! (yy_start) )
			(yy_start) = 1;	/* first start state */

		if ( ! yyin )
			yyin = stdin;

		if ( ! yyout )
			yyout = stdout;

		if ( ! YY_CURRENT_BUFFER ) {
			yyensure_buffer_stack ();
			YY_CURRENT_BUFFER_LVALUE =
				yy_create_buffer( yyin, YY_BUF_SIZE );
		}

		yy_load_buffer_state(  );
		}

	{
#line 319 "../wine/tools/wrc/parser.l"

#line 321 "../wine/tools/wrc/parser.l"
	/*
	 * Catch the GCC-style line statements here and parse them.
	 * This has the advantage that you can #include at any
	 * stage in the resource file.
	 * The preprocessor generates line directives in the format:
	 * # <linenum> "filename" <codes>
	 *
	 * Codes can be a sequence of:
	 * - 1 start of new file
	 * - 2 returning to previous
	 * - 3 system header
	 * - 4 interpret as C-code
	 *
	 * 4 is not used and 1 mutually excludes 2
	 * Anyhow, we are not really interested in these at all
	 * because we only want to know the linenumber and
	 * filename.
	 */
#line 1480 "tools/wrc/parser.yy.c"

	while ( /*CONSTCOND*/1 )		/* loops until end-of-file is reached */
		{
		yy_cp = (yy_c_buf_p);

		/* Support of yytext. */
		*yy_cp = (yy_hold_char);

		/* yy_bp points to the position in yy_ch_buf of the start of
		 * the current run.
		 */
		yy_bp = yy_cp;

		yy_current_state = (yy_start);
		yy_current_state += YY_AT_BOL();
yy_match:
		do
			{
			YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
			if ( yy_accept[yy_current_state] )
				{
				(yy_last_accepting_state) = yy_current_state;
				(yy_last_accepting_cpos) = yy_cp;
				}
			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
				{
				yy_current_state = (int) yy_def[yy_current_state];
				if ( yy_current_state >= 189 )
					yy_c = yy_meta[yy_c];
				}
			yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
			++yy_cp;
			}
		while ( yy_current_state != 188 );
		yy_cp = (yy_last_accepting_cpos);
		yy_current_state = (yy_last_accepting_state);

yy_find_action:
		yy_act = yy_accept[yy_current_state];

		YY_DO_BEFORE_ACTION;

do_action:	/* This label is used only to access EOF actions. */

		switch ( yy_act )
	{ /* beginning of action switch */
			case 0: /* must back up */
			/* undo the effects of YY_DO_BEFORE_ACTION */
			*yy_cp = (yy_hold_char);
			yy_cp = (yy_last_accepting_cpos);
			yy_current_state = (yy_last_accepting_state);
			goto yy_find_action;

case 1:
YY_RULE_SETUP
#line 339 "../wine/tools/wrc/parser.l"
yy_push_state(pp_pragma);
	YY_BREAK
case 2:
YY_RULE_SETUP
#line 340 "../wine/tools/wrc/parser.l"
yy_push_state(pp_line);
	YY_BREAK
case 3:
YY_RULE_SETUP
#line 341 "../wine/tools/wrc/parser.l"
{
		int lineno, len;
		char *cptr;
		char *fname;
		yy_pop_state();
		lineno = (int)strtol(yytext, &cptr, 10);
		if(!lineno)
			parser_error("Malformed '#...' line-directive; invalid linenumber");
		fname = strchr(cptr, '"');
		if(!fname)
			parser_error("Malformed '#...' line-directive; missing filename");
		fname++;
		cptr = strchr(fname, '"');
		if(!cptr)
			parser_error("Malformed '#...' line-directive; missing terminating \"");
		*cptr = '\0';
		line_number = lineno - 1;	/* We didn't read the newline */
		input_name = xstrdup(fname);
                /* ignore contents of C include files */
                len = strlen(input_name);
                if (len > 1 && !strcasecmp( input_name + len - 2, ".h" ))
                    BEGIN(pp_cstrip);
                else
                    BEGIN(INITIAL);
	}
	YY_BREAK
case 4:
YY_RULE_SETUP
#line 367 "../wine/tools/wrc/parser.l"
yyless(9); yy_pop_state(); yy_push_state(pp_code_page);
	YY_BREAK
case 5:
YY_RULE_SETUP
#line 368 "../wine/tools/wrc/parser.l"
yy_pop_state(); if (pedantic) parser_warning("Unrecognized #pragma directive '%s'\n",yytext);
	YY_BREAK
case 6:
YY_RULE_SETUP
#line 370 "../wine/tools/wrc/parser.l"
current_codepage = -1; yy_pop_state();
	YY_BREAK
case 7:
YY_RULE_SETUP
#line 371 "../wine/tools/wrc/parser.l"
current_codepage = CP_UTF8; yy_pop_state();
	YY_BREAK
case 8:
YY_RULE_SETUP
#line 372 "../wine/tools/wrc/parser.l"
{
        char *p = yytext;
        yy_pop_state();
        while (*p < '0' || *p > '9') p++;
        current_codepage = strtol( p, NULL, 10 );
        if (!is_valid_codepage( current_codepage ))
        {
            parser_error("Codepage %d not supported", current_codepage);
            current_codepage = 0;
        }
    }
	YY_BREAK
case 9:
YY_RULE_SETUP
#line 383 "../wine/tools/wrc/parser.l"
yy_pop_state(); parser_error("Malformed #pragma code_page directive");
	YY_BREAK
/*
	 * Strip everything until a ';' taking
	 * into account braces {} for structures,
	 * classes and enums.
	 */
case 10:
/* rule 10 can match eol */
YY_RULE_SETUP
#line 390 "../wine/tools/wrc/parser.l"
line_number++; char_number = 1;
	YY_BREAK
case 11:
YY_RULE_SETUP
#line 391 "../wine/tools/wrc/parser.l"
; /* ignore */
	YY_BREAK
case 12:
YY_RULE_SETUP
#line 393 "../wine/tools/wrc/parser.l"
return tBEGIN;
	YY_BREAK
case 13:
YY_RULE_SETUP
#line 394 "../wine/tools/wrc/parser.l"
return tEND;
	YY_BREAK
case 14:
YY_RULE_SETUP
#line 396 "../wine/tools/wrc/parser.l"
{ parser_lval.num = xstrtoul(yytext,  0, 10);
                          return (yytext[yyleng-1] == 'L' || yytext[yyleng-1] == 'l') ? tLNUMBER : tNUMBER; }
	YY_BREAK
case 15:
YY_RULE_SETUP
#line 398 "../wine/tools/wrc/parser.l"
{ parser_lval.num = xstrtoul(yytext,  0, 16);
                          return (yytext[yyleng-1] == 'L' || yytext[yyleng-1] == 'l') ? tLNUMBER : tNUMBER; }
	YY_BREAK
case 16:
YY_RULE_SETUP
#line 400 "../wine/tools/wrc/parser.l"
{ parser_lval.num = xstrtoul(yytext+2, 0, 8);
                          return (yytext[yyleng-1] == 'L' || yytext[yyleng-1] == 'l') ? tLNUMBER : tNUMBER; }
	YY_BREAK
case 17:
YY_RULE_SETUP
#line 403 "../wine/tools/wrc/parser.l"
{
				struct keyword *tok = iskeyword(yytext);

				if(tok)
				{
					if(wanted_id && !tok->alwayskw)
					{
						parser_lval.str = make_string(yytext);
						return tIDENT;
					}
					else
						return tok->token;
				}
				else
				{
					parser_lval.str = make_string(yytext);
					return tIDENT;
				}
			}
	YY_BREAK
/*
	 * Wide string scanning
	 */
case 18:
YY_RULE_SETUP
#line 426 "../wine/tools/wrc/parser.l"
{
				yy_push_state(tklstr);
				wbufidx = 0;
				if(!win32)
					parser_error("16bit resource contains unicode strings");
			}
	YY_BREAK
case 19:
#line 433 "../wine/tools/wrc/parser.l"
case 20:
YY_RULE_SETUP
#line 433 "../wine/tools/wrc/parser.l"
{
				yy_pop_state();
				parser_lval.str = get_buffered_wstring();
				return tSTRING;
			}
	YY_BREAK
case 21:
YY_RULE_SETUP
#line 438 "../wine/tools/wrc/parser.l"
{ /* octal escape sequence */
				unsigned int result;
				result = strtoul(yytext+1, 0, 8);
				if ( result > 0xffff )
					parser_error("Character constant out of range");
				addwchar((WCHAR)result);
			}
	YY_BREAK
case 22:
YY_RULE_SETUP
#line 445 "../wine/tools/wrc/parser.l"
{  /* hex escape sequence */
				unsigned int result;
				result = strtoul(yytext+2, 0, 16);
				addwchar((WCHAR)result);
			}
	YY_BREAK
case 23:
YY_RULE_SETUP
#line 450 "../wine/tools/wrc/parser.l"
{  parser_error("Invalid hex escape sequence '%s'", yytext); }
	YY_BREAK
case 24:
YY_RULE_SETUP
#line 452 "../wine/tools/wrc/parser.l"
parser_error("Bad escape sequence");
	YY_BREAK
case 25:
/* rule 25 can match eol */
YY_RULE_SETUP
#line 453 "../wine/tools/wrc/parser.l"
line_number++; char_number = 1; /* backslash at EOL continues string after leading whitespace on next line */
	YY_BREAK
case 26:
YY_RULE_SETUP
#line 454 "../wine/tools/wrc/parser.l"
addwchar('\a');
	YY_BREAK
case 27:
YY_RULE_SETUP
#line 455 "../wine/tools/wrc/parser.l"
addwchar('\b');
	YY_BREAK
case 28:
YY_RULE_SETUP
#line 456 "../wine/tools/wrc/parser.l"
addwchar('\f');
	YY_BREAK
case 29:
YY_RULE_SETUP
#line 457 "../wine/tools/wrc/parser.l"
addwchar('\n');
	YY_BREAK
case 30:
YY_RULE_SETUP
#line 458 "../wine/tools/wrc/parser.l"
addwchar('\r');
	YY_BREAK
case 31:
YY_RULE_SETUP
#line 459 "../wine/tools/wrc/parser.l"
addwchar('\t');
	YY_BREAK
case 32:
YY_RULE_SETUP
#line 460 "../wine/tools/wrc/parser.l"
addwchar('\v');
	YY_BREAK
case 33:
YY_RULE_SETUP
#line 461 "../wine/tools/wrc/parser.l"
{
			    if (yytext[1] & 0x80)
                                parser_error("Invalid char %u in wide string", (unsigned char)yytext[1]);
			    addwchar(yytext[1]);
			}
	YY_BREAK
case 34:
/* rule 34 can match eol */
YY_RULE_SETUP
#line 466 "../wine/tools/wrc/parser.l"
addwchar(yytext[2]); line_number++; char_number = 1;
	YY_BREAK
case 35:
YY_RULE_SETUP
#line 467 "../wine/tools/wrc/parser.l"
addwchar('\"');		/* "bla""bla"  -> "bla\"bla" */
	YY_BREAK
case 36:
YY_RULE_SETUP
#line 468 "../wine/tools/wrc/parser.l"
addwchar('\"');		/* "bla\""bla" -> "bla\"bla" */
	YY_BREAK
case 37:
YY_RULE_SETUP
#line 469 "../wine/tools/wrc/parser.l"
;			/* "bla" "bla" -> "blabla" */
	YY_BREAK
case 38:
YY_RULE_SETUP
#line 470 "../wine/tools/wrc/parser.l"
{
				char *yptr = yytext;
				while(*yptr)	/* FIXME: codepage translation */
                                {
                                    if (*yptr & 0x80)
                                        parser_error("Invalid char %u in wide string", (unsigned char)*yptr);
                                    addwchar(*yptr++ & 0xff);
                                }
			}
	YY_BREAK
case 39:
/* rule 39 can match eol */
YY_RULE_SETUP
#line 479 "../wine/tools/wrc/parser.l"
parser_error("Unterminated string");
	YY_BREAK
/*
	 * Normal string scanning
	 */
case 40:
YY_RULE_SETUP
#line 484 "../wine/tools/wrc/parser.l"
yy_push_state(tkstr); cbufidx = 0;
	YY_BREAK
case 41:
#line 486 "../wine/tools/wrc/parser.l"
case 42:
YY_RULE_SETUP
#line 486 "../wine/tools/wrc/parser.l"
{
				yy_pop_state();
				parser_lval.str = get_buffered_cstring();
				return tSTRING;
			}
	YY_BREAK
case 43:
YY_RULE_SETUP
#line 491 "../wine/tools/wrc/parser.l"
{ /* octal escape sequence */
				int result;
				result = strtol(yytext+1, 0, 8);
				if ( result > 0xff )
					parser_error("Character constant out of range");
				addcchar((char)result);
			}
	YY_BREAK
case 44:
YY_RULE_SETUP
#line 498 "../wine/tools/wrc/parser.l"
{  /* hex escape sequence */
				int result;
				result = strtol(yytext+2, 0, 16);
				addcchar((char)result);
			}
	YY_BREAK
case 45:
YY_RULE_SETUP
#line 503 "../wine/tools/wrc/parser.l"
{  parser_error("Invalid hex escape sequence '%s'", yytext); }
	YY_BREAK
case 46:
YY_RULE_SETUP
#line 505 "../wine/tools/wrc/parser.l"
parser_error("Bad escape sequence");
	YY_BREAK
case 47:
/* rule 47 can match eol */
YY_RULE_SETUP
#line 506 "../wine/tools/wrc/parser.l"
line_number++; char_number = 1; /* backslash at EOL continues string after leading whitespace on next line */
	YY_BREAK
case 48:
YY_RULE_SETUP
#line 507 "../wine/tools/wrc/parser.l"
addcchar('\a');
	YY_BREAK
case 49:
YY_RULE_SETUP
#line 508 "../wine/tools/wrc/parser.l"
addcchar('\b');
	YY_BREAK
case 50:
YY_RULE_SETUP
#line 509 "../wine/tools/wrc/parser.l"
addcchar('\f');
	YY_BREAK
case 51:
YY_RULE_SETUP
#line 510 "../wine/tools/wrc/parser.l"
addcchar('\n');
	YY_BREAK
case 52:
YY_RULE_SETUP
#line 511 "../wine/tools/wrc/parser.l"
addcchar('\r');
	YY_BREAK
case 53:
YY_RULE_SETUP
#line 512 "../wine/tools/wrc/parser.l"
addcchar('\t');
	YY_BREAK
case 54:
YY_RULE_SETUP
#line 513 "../wine/tools/wrc/parser.l"
addcchar('\v');
	YY_BREAK
case 55:
YY_RULE_SETUP
#line 514 "../wine/tools/wrc/parser.l"
addcchar(yytext[1]);
	YY_BREAK
case 56:
/* rule 56 can match eol */
YY_RULE_SETUP
#line 515 "../wine/tools/wrc/parser.l"
addcchar(yytext[2]); line_number++; char_number = 1;
	YY_BREAK
case 57:
YY_RULE_SETUP
#line 516 "../wine/tools/wrc/parser.l"
{
				char *yptr = yytext;
				while(*yptr)
					addcchar(*yptr++);
			}
	YY_BREAK
case 58:
YY_RULE_SETUP
#line 521 "../wine/tools/wrc/parser.l"
addcchar('\"');		/* "bla""bla"   -> "bla\"bla" */
	YY_BREAK
case 59:
YY_RULE_SETUP
#line 522 "../wine/tools/wrc/parser.l"
addcchar('\"');		/* "bla\""bla"  -> "bla\"bla" */
	YY_BREAK
case 60:
YY_RULE_SETUP
#line 523 "../wine/tools/wrc/parser.l"
;			/* "bla" "bla"  -> "blabla" */
	YY_BREAK
case 61:
/* rule 61 can match eol */
YY_RULE_SETUP
#line 524 "../wine/tools/wrc/parser.l"
parser_error("Unterminated string");
	YY_BREAK
/*
	 * Raw data scanning
	 */
case 62:
YY_RULE_SETUP
#line 529 "../wine/tools/wrc/parser.l"
yy_push_state(tkrcd); cbufidx = 0;
	YY_BREAK
case 63:
YY_RULE_SETUP
#line 530 "../wine/tools/wrc/parser.l"
{
				yy_pop_state();
				parser_lval.raw = new_raw_data();
				parser_lval.raw->size = cbufidx;
				parser_lval.raw->data = xmalloc(parser_lval.raw->size);
				memcpy(parser_lval.raw->data, cbuffer, parser_lval.raw->size);
				return tRAWDATA;
			}
	YY_BREAK
case 64:
YY_RULE_SETUP
#line 538 "../wine/tools/wrc/parser.l"
{
				int result;
				result = strtol(yytext, 0, 16);
				addcchar((char)result);
			}
	YY_BREAK
case 65:
YY_RULE_SETUP
#line 543 "../wine/tools/wrc/parser.l"
;	/* Ignore space */
	YY_BREAK
case 66:
/* rule 66 can match eol */
YY_RULE_SETUP
#line 544 "../wine/tools/wrc/parser.l"
line_number++; char_number = 1;
	YY_BREAK
case 67:
YY_RULE_SETUP
#line 545 "../wine/tools/wrc/parser.l"
parser_error("Malformed data-line");
	YY_BREAK
/*
	 * Comment stripping
	 * Should never occur after preprocessing
	 */
case 68:
YY_RULE_SETUP
#line 551 "../wine/tools/wrc/parser.l"
{
				yy_push_state(comment);
				save_wanted_id = wanted_id;
				if(!no_preprocess)
					parser_warning("Found comments after preprocessing, please report\n");
			}
	YY_BREAK
case 69:
YY_RULE_SETUP
#line 557 "../wine/tools/wrc/parser.l"
;
	YY_BREAK
case 70:
YY_RULE_SETUP
#line 558 "../wine/tools/wrc/parser.l"
;
	YY_BREAK
case 71:
/* rule 71 can match eol */
YY_RULE_SETUP
#line 559 "../wine/tools/wrc/parser.l"
line_number++; char_number = 1;
	YY_BREAK
case 72:
YY_RULE_SETUP
#line 560 "../wine/tools/wrc/parser.l"
yy_pop_state(); want_id = save_wanted_id;
	YY_BREAK
case 73:
YY_RULE_SETUP
#line 562 "../wine/tools/wrc/parser.l"
want_id = wanted_id; /* not really comment, but left-over c-junk */
	YY_BREAK
case 74:
YY_RULE_SETUP
#line 563 "../wine/tools/wrc/parser.l"
want_id = wanted_id; if(!no_preprocess) parser_warning("Found comments after preprocessing, please report\n");
	YY_BREAK
case 75:
/* rule 75 can match eol */
YY_RULE_SETUP
#line 565 "../wine/tools/wrc/parser.l"
{
				want_id = wanted_id;
				line_number++;
				char_number = 1;
				if(want_nl)
				{
					want_nl = 0;
					return tNL;
				}
			}
	YY_BREAK
case 76:
YY_RULE_SETUP
#line 575 "../wine/tools/wrc/parser.l"
want_id = wanted_id;	/* Eat whitespace */
	YY_BREAK
case 77:
YY_RULE_SETUP
#line 577 "../wine/tools/wrc/parser.l"
return yytext[0];
	YY_BREAK
case 78:
/* rule 78 can match eol */
YY_RULE_SETUP
#line 579 "../wine/tools/wrc/parser.l"
{
				/* Catch all rule to find any unmatched text */
				if(*yytext == '\n')
				{
					line_number++;
					char_number = 1;
				}
				parser_error("Unmatched text '%c' (0x%02x) YY_START=%d",
                                             isprint((unsigned char)*yytext) ? *yytext : '.', *yytext, YY_START);
			}
	YY_BREAK
case 79:
YY_RULE_SETUP
#line 590 "../wine/tools/wrc/parser.l"
ECHO;
	YY_BREAK
#line 2090 "tools/wrc/parser.yy.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(tkstr):
case YY_STATE_EOF(tklstr):
case YY_STATE_EOF(tkrcd):
case YY_STATE_EOF(comment):
case YY_STATE_EOF(pp_cstrip):
case YY_STATE_EOF(pp_line):
case YY_STATE_EOF(pp_pragma):
case YY_STATE_EOF(pp_code_page):
	yyterminate();

	case YY_END_OF_BUFFER:
		{
		/* Amount of text matched not including the EOB char. */
		int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;

		/* Undo the effects of YY_DO_BEFORE_ACTION. */
		*yy_cp = (yy_hold_char);
		YY_RESTORE_YY_MORE_OFFSET

		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
			{
			/* We're scanning a new file or input source.  It's
			 * possible that this happened because the user
			 * just pointed yyin at a new source and called
			 * yylex().  If so, then we have to assure
			 * consistency between YY_CURRENT_BUFFER and our
			 * globals.  Here is the right place to do so, because
			 * this is the first action (other than possibly a
			 * back-up) that will match for the new input source.
			 */
			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
			YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
			}

		/* Note that here we test for yy_c_buf_p "<=" to the position
		 * of the first EOB in the buffer, since yy_c_buf_p will
		 * already have been incremented past the NUL character
		 * (since all states make transitions on EOB to the
		 * end-of-buffer state).  Contrast this with the test
		 * in input().
		 */
		if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
			{ /* This was really a NUL. */
			yy_state_type yy_next_state;

			(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;

			yy_current_state = yy_get_previous_state(  );

			/* Okay, we're now positioned to make the NUL
			 * transition.  We couldn't have
			 * yy_get_previous_state() go ahead and do it
			 * for us because it doesn't know how to deal
			 * with the possibility of jamming (and we don't
			 * want to build jamming into it because then it
			 * will run more slowly).
			 */

			yy_next_state = yy_try_NUL_trans( yy_current_state );

			yy_bp = (yytext_ptr) + YY_MORE_ADJ;

			if ( yy_next_state )
				{
				/* Consume the NUL. */
				yy_cp = ++(yy_c_buf_p);
				yy_current_state = yy_next_state;
				goto yy_match;
				}

			else
				{
				yy_cp = (yy_last_accepting_cpos);
				yy_current_state = (yy_last_accepting_state);
				goto yy_find_action;
				}
			}

		else switch ( yy_get_next_buffer(  ) )
			{
			case EOB_ACT_END_OF_FILE:
				{
				(yy_did_buffer_switch_on_eof) = 0;

				if ( yywrap(  ) )
					{
					/* Note: because we've taken care in
					 * yy_get_next_buffer() to have set up
					 * yytext, we can now set up
					 * yy_c_buf_p so that if some total
					 * hoser (like flex itself) wants to
					 * call the scanner after we return the
					 * YY_NULL, it'll still work - another
					 * YY_NULL will get returned.
					 */
					(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;

					yy_act = YY_STATE_EOF(YY_START);
					goto do_action;
					}

				else
					{
					if ( ! (yy_did_buffer_switch_on_eof) )
						YY_NEW_FILE;
					}
				break;
				}

			case EOB_ACT_CONTINUE_SCAN:
				(yy_c_buf_p) =
					(yytext_ptr) + yy_amount_of_matched_text;

				yy_current_state = yy_get_previous_state(  );

				yy_cp = (yy_c_buf_p);
				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
				goto yy_match;

			case EOB_ACT_LAST_MATCH:
				(yy_c_buf_p) =
				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];

				yy_current_state = yy_get_previous_state(  );

				yy_cp = (yy_c_buf_p);
				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
				goto yy_find_action;
			}
		break;
		}

	default:
		YY_FATAL_ERROR(
			"fatal flex scanner internal error--no action found" );
	} /* end of action switch */
		} /* end of scanning one token */
	} /* end of user's declarations */
} /* end of yylex */

/* yy_get_next_buffer - try to read in a new buffer
 *
 * Returns a code representing an action:
 *	EOB_ACT_LAST_MATCH -
 *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
 *	EOB_ACT_END_OF_FILE - end of file
 */
static int yy_get_next_buffer (void)
{
    	char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
	char *source = (yytext_ptr);
	int number_to_move, i;
	int ret_val;

	if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
		YY_FATAL_ERROR(
		"fatal flex scanner internal error--end of buffer missed" );

	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
		{ /* Don't try to fill the buffer, so this is an EOF. */
		if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
			{
			/* We matched a single character, the EOB, so
			 * treat this as a final EOF.
			 */
			return EOB_ACT_END_OF_FILE;
			}

		else
			{
			/* We matched some text prior to the EOB, first
			 * process it.
			 */
			return EOB_ACT_LAST_MATCH;
			}
		}

	/* Try to read more data. */

	/* First move last chars to start of buffer. */
	number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1);

	for ( i = 0; i < number_to_move; ++i )
		*(dest++) = *(source++);

	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
		/* don't do the read, it's not guaranteed to return an EOF,
		 * just force an EOF
		 */
		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;

	else
		{
			int num_to_read =
			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;

		while ( num_to_read <= 0 )
			{ /* Not enough room in the buffer - grow it. */

			/* just a shorter name for the current buffer */
			YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;

			int yy_c_buf_p_offset =
				(int) ((yy_c_buf_p) - b->yy_ch_buf);

			if ( b->yy_is_our_buffer )
				{
				int new_size = b->yy_buf_size * 2;

				if ( new_size <= 0 )
					b->yy_buf_size += b->yy_buf_size / 8;
				else
					b->yy_buf_size *= 2;

				b->yy_ch_buf = (char *)
					/* Include room in for 2 EOB chars. */
					yyrealloc( (void *) b->yy_ch_buf,
							 (yy_size_t) (b->yy_buf_size + 2)  );
				}
			else
				/* Can't grow it, we don't own it. */
				b->yy_ch_buf = NULL;

			if ( ! b->yy_ch_buf )
				YY_FATAL_ERROR(
				"fatal error - scanner input buffer overflow" );

			(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];

			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
						number_to_move - 1;

			}

		if ( num_to_read > YY_READ_BUF_SIZE )
			num_to_read = YY_READ_BUF_SIZE;

		/* Read in more data. */
		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
			(yy_n_chars), num_to_read );

		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
		}

	if ( (yy_n_chars) == 0 )
		{
		if ( number_to_move == YY_MORE_ADJ )
			{
			ret_val = EOB_ACT_END_OF_FILE;
			yyrestart( yyin  );
			}

		else
			{
			ret_val = EOB_ACT_LAST_MATCH;
			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
				YY_BUFFER_EOF_PENDING;
			}
		}

	else
		ret_val = EOB_ACT_CONTINUE_SCAN;

	if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
		/* Extend the array by 50%, plus the number we really need. */
		int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1);
		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
			(void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size  );
		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
		/* "- 2" to take care of EOB's */
		YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
	}

	(yy_n_chars) += number_to_move;
	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;

	(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];

	return ret_val;
}

/* yy_get_previous_state - get the state just before the EOB char was reached */

    static yy_state_type yy_get_previous_state (void)
{
	yy_state_type yy_current_state;
	char *yy_cp;
    
	yy_current_state = (yy_start);
	yy_current_state += YY_AT_BOL();

	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
		{
		YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
		if ( yy_accept[yy_current_state] )
			{
			(yy_last_accepting_state) = yy_current_state;
			(yy_last_accepting_cpos) = yy_cp;
			}
		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
			{
			yy_current_state = (int) yy_def[yy_current_state];
			if ( yy_current_state >= 189 )
				yy_c = yy_meta[yy_c];
			}
		yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
		}

	return yy_current_state;
}

/* yy_try_NUL_trans - try to make a transition on the NUL character
 *
 * synopsis
 *	next_state = yy_try_NUL_trans( current_state );
 */
    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
{
	int yy_is_jam;
    	char *yy_cp = (yy_c_buf_p);

	YY_CHAR yy_c = 1;
	if ( yy_accept[yy_current_state] )
		{
		(yy_last_accepting_state) = yy_current_state;
		(yy_last_accepting_cpos) = yy_cp;
		}
	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
		{
		yy_current_state = (int) yy_def[yy_current_state];
		if ( yy_current_state >= 189 )
			yy_c = yy_meta[yy_c];
		}
	yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
	yy_is_jam = (yy_current_state == 188);

		return yy_is_jam ? 0 : yy_current_state;
}

#ifndef YY_NO_UNPUT

#endif

#ifndef YY_NO_INPUT
#ifdef __cplusplus
    static int yyinput (void)
#else
    static int input  (void)
#endif

{
	int c;
    
	*(yy_c_buf_p) = (yy_hold_char);

	if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
		{
		/* yy_c_buf_p now points to the character we want to return.
		 * If this occurs *before* the EOB characters, then it's a
		 * valid NUL; if not, then we've hit the end of the buffer.
		 */
		if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
			/* This was really a NUL. */
			*(yy_c_buf_p) = '\0';

		else
			{ /* need more input */
			int offset = (int) ((yy_c_buf_p) - (yytext_ptr));
			++(yy_c_buf_p);

			switch ( yy_get_next_buffer(  ) )
				{
				case EOB_ACT_LAST_MATCH:
					/* This happens because yy_g_n_b()
					 * sees that we've accumulated a
					 * token and flags that we need to
					 * try matching the token before
					 * proceeding.  But for input(),
					 * there's no matching to consider.
					 * So convert the EOB_ACT_LAST_MATCH
					 * to EOB_ACT_END_OF_FILE.
					 */

					/* Reset buffer status. */
					yyrestart( yyin );

					/*FALLTHROUGH*/

				case EOB_ACT_END_OF_FILE:
					{
					if ( yywrap(  ) )
						return 0;

					if ( ! (yy_did_buffer_switch_on_eof) )
						YY_NEW_FILE;
#ifdef __cplusplus
					return yyinput();
#else
					return input();
#endif
					}

				case EOB_ACT_CONTINUE_SCAN:
					(yy_c_buf_p) = (yytext_ptr) + offset;
					break;
				}
			}
		}

	c = *(unsigned char *) (yy_c_buf_p);	/* cast for 8-bit char's */
	*(yy_c_buf_p) = '\0';	/* preserve yytext */
	(yy_hold_char) = *++(yy_c_buf_p);

	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');

	return c;
}
#endif	/* ifndef YY_NO_INPUT */

/** Immediately switch to a different input stream.
 * @param input_file A readable stream.
 * 
 * @note This function does not reset the start condition to @c INITIAL .
 */
    void yyrestart  (FILE * input_file )
{
    
	if ( ! YY_CURRENT_BUFFER ){
        yyensure_buffer_stack ();
		YY_CURRENT_BUFFER_LVALUE =
            yy_create_buffer( yyin, YY_BUF_SIZE );
	}

	yy_init_buffer( YY_CURRENT_BUFFER, input_file );
	yy_load_buffer_state(  );
}

/** Switch to a different input buffer.
 * @param new_buffer The new input buffer.
 * 
 */
    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
{
    
	/* TODO. We should be able to replace this entire function body
	 * with
	 *		yypop_buffer_state();
	 *		yypush_buffer_state(new_buffer);
     */
	yyensure_buffer_stack ();
	if ( YY_CURRENT_BUFFER == new_buffer )
		return;

	if ( YY_CURRENT_BUFFER )
		{
		/* Flush out information for old buffer. */
		*(yy_c_buf_p) = (yy_hold_char);
		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
		}

	YY_CURRENT_BUFFER_LVALUE = new_buffer;
	yy_load_buffer_state(  );

	/* We don't actually know whether we did this switch during
	 * EOF (yywrap()) processing, but the only time this flag
	 * is looked at is after yywrap() is called, so it's safe
	 * to go ahead and always set it.
	 */
	(yy_did_buffer_switch_on_eof) = 1;
}

static void yy_load_buffer_state  (void)
{
    	(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
	(yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
	yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
	(yy_hold_char) = *(yy_c_buf_p);
}

/** Allocate and initialize an input buffer state.
 * @param file A readable stream.
 * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
 * 
 * @return the allocated buffer state.
 */
    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
{
	YY_BUFFER_STATE b;
    
	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state )  );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

	b->yy_buf_size = size;

	/* yy_ch_buf has to be 2 characters longer than the size given because
	 * we need to put in 2 end-of-buffer characters.
	 */
	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2)  );
	if ( ! b->yy_ch_buf )
		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

	b->yy_is_our_buffer = 1;

	yy_init_buffer( b, file );

	return b;
}

/** Destroy the buffer.
 * @param b a buffer created with yy_create_buffer()
 * 
 */
    void yy_delete_buffer (YY_BUFFER_STATE  b )
{
    
	if ( ! b )
		return;

	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;

	if ( b->yy_is_our_buffer )
		yyfree( (void *) b->yy_ch_buf  );

	yyfree( (void *) b  );
}

/* Initializes or reinitializes a buffer.
 * This function is sometimes called more than once on the same buffer,
 * such as during a yyrestart() or at EOF.
 */
    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )

{
	int oerrno = errno;
    
	yy_flush_buffer( b );

	b->yy_input_file = file;
	b->yy_fill_buffer = 1;

    /* If b is the current buffer, then yy_init_buffer was _probably_
     * called from yyrestart() or through yy_get_next_buffer.
     * In that case, we don't want to reset the lineno or column.
     */
    if (b != YY_CURRENT_BUFFER){
        b->yy_bs_lineno = 1;
        b->yy_bs_column = 0;
    }

        b->yy_is_interactive = 0;
    
	errno = oerrno;
}

/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
 * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
 * 
 */
    void yy_flush_buffer (YY_BUFFER_STATE  b )
{
    	if ( ! b )
		return;

	b->yy_n_chars = 0;

	/* We always need two end-of-buffer characters.  The first causes
	 * a transition to the end-of-buffer state.  The second causes
	 * a jam in that state.
	 */
	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;

	b->yy_buf_pos = &b->yy_ch_buf[0];

	b->yy_at_bol = 1;
	b->yy_buffer_status = YY_BUFFER_NEW;

	if ( b == YY_CURRENT_BUFFER )
		yy_load_buffer_state(  );
}

/** Pushes the new state onto the stack. The new state becomes
 *  the current state. This function will allocate the stack
 *  if necessary.
 *  @param new_buffer The new state.
 *  
 */
void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
{
    	if (new_buffer == NULL)
		return;

	yyensure_buffer_stack();

	/* This block is copied from yy_switch_to_buffer. */
	if ( YY_CURRENT_BUFFER )
		{
		/* Flush out information for old buffer. */
		*(yy_c_buf_p) = (yy_hold_char);
		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
		}

	/* Only push if top exists. Otherwise, replace top. */
	if (YY_CURRENT_BUFFER)
		(yy_buffer_stack_top)++;
	YY_CURRENT_BUFFER_LVALUE = new_buffer;

	/* copied from yy_switch_to_buffer. */
	yy_load_buffer_state(  );
	(yy_did_buffer_switch_on_eof) = 1;
}

/** Removes and deletes the top of the stack, if present.
 *  The next element becomes the new top.
 *  
 */
void yypop_buffer_state (void)
{
    	if (!YY_CURRENT_BUFFER)
		return;

	yy_delete_buffer(YY_CURRENT_BUFFER );
	YY_CURRENT_BUFFER_LVALUE = NULL;
	if ((yy_buffer_stack_top) > 0)
		--(yy_buffer_stack_top);

	if (YY_CURRENT_BUFFER) {
		yy_load_buffer_state(  );
		(yy_did_buffer_switch_on_eof) = 1;
	}
}

/* Allocates the stack if it does not exist.
 *  Guarantees space for at least one push.
 */
static void yyensure_buffer_stack (void)
{
	yy_size_t num_to_alloc;
    
	if (!(yy_buffer_stack)) {

		/* First allocation is just for 2 elements, since we don't know if this
		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
		 * immediate realloc on the next call.
         */
      num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
		(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
								(num_to_alloc * sizeof(struct yy_buffer_state*)
								);
		if ( ! (yy_buffer_stack) )
			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );

		memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));

		(yy_buffer_stack_max) = num_to_alloc;
		(yy_buffer_stack_top) = 0;
		return;
	}

	if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){

		/* Increase the buffer to prepare for a possible push. */
		yy_size_t grow_size = 8 /* arbitrary grow size */;

		num_to_alloc = (yy_buffer_stack_max) + grow_size;
		(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
								((yy_buffer_stack),
								num_to_alloc * sizeof(struct yy_buffer_state*)
								);
		if ( ! (yy_buffer_stack) )
			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );

		/* zero only the new slots.*/
		memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
		(yy_buffer_stack_max) = num_to_alloc;
	}
}

/** Setup the input buffer state to scan directly from a user-specified character buffer.
 * @param base the character buffer
 * @param size the size in bytes of the character buffer
 * 
 * @return the newly allocated buffer state object.
 */
YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
{
	YY_BUFFER_STATE b;
    
	if ( size < 2 ||
	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
	     base[size-1] != YY_END_OF_BUFFER_CHAR )
		/* They forgot to leave room for the EOB's. */
		return NULL;

	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state )  );
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );

	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
	b->yy_buf_pos = b->yy_ch_buf = base;
	b->yy_is_our_buffer = 0;
	b->yy_input_file = NULL;
	b->yy_n_chars = b->yy_buf_size;
	b->yy_is_interactive = 0;
	b->yy_at_bol = 1;
	b->yy_fill_buffer = 0;
	b->yy_buffer_status = YY_BUFFER_NEW;

	yy_switch_to_buffer( b  );

	return b;
}

/** Setup the input buffer state to scan a string. The next call to yylex() will
 * scan from a @e copy of @a str.
 * @param yystr a NUL-terminated string to scan
 * 
 * @return the newly allocated buffer state object.
 * @note If you want to scan bytes that may contain NUL values, then use
 *       yy_scan_bytes() instead.
 */
YY_BUFFER_STATE yy_scan_string (const char * yystr )
{
    
	return yy_scan_bytes( yystr, (int) strlen(yystr) );
}

/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
 * scan from a @e copy of @a bytes.
 * @param yybytes the byte buffer to scan
 * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
 * 
 * @return the newly allocated buffer state object.
 */
YY_BUFFER_STATE yy_scan_bytes  (const char * yybytes, int  _yybytes_len )
{
	YY_BUFFER_STATE b;
	char *buf;
	yy_size_t n;
	int i;
    
	/* Get memory for full buffer, including space for trailing EOB's. */
	n = (yy_size_t) (_yybytes_len + 2);
	buf = (char *) yyalloc( n  );
	if ( ! buf )
		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );

	for ( i = 0; i < _yybytes_len; ++i )
		buf[i] = yybytes[i];

	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;

	b = yy_scan_buffer( buf, n );
	if ( ! b )
		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );

	/* It's okay to grow etc. this buffer, and we should throw it
	 * away when we're done.
	 */
	b->yy_is_our_buffer = 1;

	return b;
}

    static void yy_push_state (int  _new_state )
{
    	if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) )
		{
		yy_size_t new_size;

		(yy_start_stack_depth) += YY_START_STACK_INCR;
		new_size = (yy_size_t) (yy_start_stack_depth) * sizeof( int );

		if ( ! (yy_start_stack) )
			(yy_start_stack) = (int *) yyalloc( new_size  );

		else
			(yy_start_stack) = (int *) yyrealloc(
					(void *) (yy_start_stack), new_size  );

		if ( ! (yy_start_stack) )
			YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
		}

	(yy_start_stack)[(yy_start_stack_ptr)++] = YY_START;

	BEGIN(_new_state);
}

    static void yy_pop_state  (void)
{
    	if ( --(yy_start_stack_ptr) < 0 )
		YY_FATAL_ERROR( "start-condition stack underflow" );

	BEGIN((yy_start_stack)[(yy_start_stack_ptr)]);
}

#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
#endif

static void yynoreturn yy_fatal_error (const char* msg )
{
			fprintf( stderr, "%s\n", msg );
	exit( YY_EXIT_FAILURE );
}

/* Redefine yyless() so it works in section 3 code. */

#undef yyless
#define yyless(n) \
	do \
		{ \
		/* Undo effects of setting up yytext. */ \
        int yyless_macro_arg = (n); \
        YY_LESS_LINENO(yyless_macro_arg);\
		yytext[yyleng] = (yy_hold_char); \
		(yy_c_buf_p) = yytext + yyless_macro_arg; \
		(yy_hold_char) = *(yy_c_buf_p); \
		*(yy_c_buf_p) = '\0'; \
		yyleng = yyless_macro_arg; \
		} \
	while ( 0 )

/* Accessor  methods (get/set functions) to struct members. */

/** Get the current line number.
 * 
 */
int yyget_lineno  (void)
{
    
    return yylineno;
}

/** Get the input stream.
 * 
 */
FILE *yyget_in  (void)
{
        return yyin;
}

/** Get the output stream.
 * 
 */
FILE *yyget_out  (void)
{
        return yyout;
}

/** Get the length of the current token.
 * 
 */
int yyget_leng  (void)
{
        return yyleng;
}

/** Get the current token.
 * 
 */

char *yyget_text  (void)
{
        return yytext;
}

/** Set the current line number.
 * @param _line_number line number
 * 
 */
void yyset_lineno (int  _line_number )
{
    
    yylineno = _line_number;
}

/** Set the input stream. This does not discard the current
 * input buffer.
 * @param _in_str A readable stream.
 * 
 * @see yy_switch_to_buffer
 */
void yyset_in (FILE *  _in_str )
{
        yyin = _in_str ;
}

void yyset_out (FILE *  _out_str )
{
        yyout = _out_str ;
}

int yyget_debug  (void)
{
        return yy_flex_debug;
}

void yyset_debug (int  _bdebug )
{
        yy_flex_debug = _bdebug ;
}

static int yy_init_globals (void)
{
        /* Initialization is the same as for the non-reentrant scanner.
     * This function is called from yylex_destroy(), so don't allocate here.
     */

    (yy_buffer_stack) = NULL;
    (yy_buffer_stack_top) = 0;
    (yy_buffer_stack_max) = 0;
    (yy_c_buf_p) = NULL;
    (yy_init) = 0;
    (yy_start) = 0;

    (yy_start_stack_ptr) = 0;
    (yy_start_stack_depth) = 0;
    (yy_start_stack) =  NULL;

/* Defined in main.c */
#ifdef YY_STDINIT
    yyin = stdin;
    yyout = stdout;
#else
    yyin = NULL;
    yyout = NULL;
#endif

    /* For future reference: Set errno on error, since we are called by
     * yylex_init()
     */
    return 0;
}

/* yylex_destroy is for both reentrant and non-reentrant scanners. */
int yylex_destroy  (void)
{
    
    /* Pop the buffer stack, destroying each element. */
	while(YY_CURRENT_BUFFER){
		yy_delete_buffer( YY_CURRENT_BUFFER  );
		YY_CURRENT_BUFFER_LVALUE = NULL;
		yypop_buffer_state();
	}

	/* Destroy the stack itself. */
	yyfree((yy_buffer_stack) );
	(yy_buffer_stack) = NULL;

    /* Destroy the start condition stack. */
        yyfree( (yy_start_stack)  );
        (yy_start_stack) = NULL;

    /* Reset the globals. This is important in a non-reentrant scanner so the next time
     * yylex() is called, initialization will occur. */
    yy_init_globals( );

    return 0;
}

/*
 * Internal utility routines.
 */

#ifndef yytext_ptr
static void yy_flex_strncpy (char* s1, const char * s2, int n )
{
		
	int i;
	for ( i = 0; i < n; ++i )
		s1[i] = s2[i];
}
#endif

#ifdef YY_NEED_STRLEN
static int yy_flex_strlen (const char * s )
{
	int n;
	for ( n = 0; s[n]; ++n )
		;

	return n;
}
#endif

void *yyalloc (yy_size_t  size )
{
			return malloc(size);
}

void *yyrealloc  (void * ptr, yy_size_t  size )
{
		
	/* The cast to (char *) in the following accommodates both
	 * implementations that use char* generic pointers, and those
	 * that use void* generic pointers.  It works with the latter
	 * because both ANSI C and C++ allow castless assignment from
	 * any pointer type to void*, and deal with argument conversions
	 * as though doing an assignment.
	 */
	return realloc(ptr, size);
}

void yyfree (void * ptr )
{
			free( (char *) ptr );	/* see yyrealloc() for (char *) cast */
}

#define YYTABLES_NAME "yytables"

#line 590 "../wine/tools/wrc/parser.l"


/* These dup functions copy the enclosed '\0' from
 * the resource string.
 */
static void addcchar(char c)
{
	if(cbufidx >= cbufalloc)
	{
		cbufalloc += 1024;
		cbuffer = xrealloc(cbuffer, cbufalloc * sizeof(cbuffer[0]));
		if(cbufalloc > 65536)
			parser_warning("Reallocating string buffer larger than 64kB\n");
	}
	cbuffer[cbufidx++] = c;
}

static void addwchar(WCHAR s)
{
	if(wbufidx >= wbufalloc)
	{
		wbufalloc += 1024;
		wbuffer = xrealloc(wbuffer, wbufalloc * sizeof(wbuffer[0]));
		if(wbufalloc > 65536)
			parser_warning("Reallocating wide string buffer larger than 64kB\n");
	}
	wbuffer[wbufidx++] = s;
}

static string_t *get_buffered_cstring(void)
{
    string_t *str = new_string();

    str->size = cbufidx;
    str->type = str_char;
    str->str.cstr = xmalloc(cbufidx+1);
    memcpy(str->str.cstr, cbuffer, cbufidx);
    str->str.cstr[cbufidx] = '\0';

    if (!current_codepage || current_codepage == -1 || !win32)  /* store as ANSI string */
    {
        if (!current_codepage) parser_error("Codepage set to Unicode only, cannot use ASCII string here");
        return str;
    }
    else  /* convert to Unicode before storing */
    {
        string_t *str_w = convert_string_unicode( str, current_codepage );
        if (check_valid_utf8( str, current_codepage ))
            parser_warning( "string \"%s\" seems to be UTF-8 but codepage %u is in use, maybe use --utf8?\n",
                            str->str.cstr, current_codepage );
        free_string( str );
        return str_w;
    }
}

static string_t *get_buffered_wstring(void)
{
	string_t *str = new_string();
	str->size = wbufidx;
	str->type = str_unicode;
	str->str.wstr = xmalloc((wbufidx+1)*sizeof(WCHAR));
	memcpy(str->str.wstr, wbuffer, wbufidx*sizeof(WCHAR));
	str->str.wstr[wbufidx] = 0;
	return str;
}

static string_t *make_string(char *s)
{
	string_t *ret, *str = new_string();
	str->size = strlen(s);
	str->type = str_char;
	str->str.cstr = xmalloc(str->size+1);
	memcpy(str->str.cstr, s, str->size+1);
        if (current_codepage <= 0 || !win32) return str;
	ret = convert_string_unicode( str, current_codepage );
	free_string( str );
	return ret;
}

