lex.c_shipped 62.7 KB
Newer Older
L
Linus Torvalds 已提交
1 2
#line 2 "scripts/genksyms/lex.c"

S
Sam Ravnborg 已提交
3 4 5 6 7
#line 4 "scripts/genksyms/lex.c"

#define  YY_INT_ALIGNED short int

/* A lexical scanner generated by flex */
L
Linus Torvalds 已提交
8

9 10 11 12 13 14 15 16 17
/* %not-for-header */

/* %if-c-only */
/* %if-not-reentrant */

/* %endif */
/* %endif */
/* %ok-for-header */

L
Linus Torvalds 已提交
18 19 20
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
21
#define YY_FLEX_SUBMINOR_VERSION 35
S
Sam Ravnborg 已提交
22 23 24 25 26 27
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif

/* %if-c++-only */
/* %endif */
L
Linus Torvalds 已提交
28

S
Sam Ravnborg 已提交
29 30 31 32 33 34 35 36 37 38 39 40
/* %if-c-only */
    
/* %endif */

/* %if-c-only */

/* %endif */

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

/* begin standard C headers. */
/* %if-c-only */
L
Linus Torvalds 已提交
41
#include <stdio.h>
S
Sam Ravnborg 已提交
42 43 44 45
#include <string.h>
#include <errno.h>
#include <stdlib.h>
/* %endif */
L
Linus Torvalds 已提交
46

S
Sam Ravnborg 已提交
47 48 49
/* %if-tables-serialization */
/* %endif */
/* end standard C headers. */
L
Linus Torvalds 已提交
50

S
Sam Ravnborg 已提交
51 52 53 54 55 56 57 58
/* %if-c-or-c++ */
/* flex integer type definitions */

#ifndef FLEXINT_H
#define FLEXINT_H

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

59
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
S
Sam Ravnborg 已提交
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81

/* 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;
82
#endif /* ! C99 */
S
Sam Ravnborg 已提交
83 84 85 86 87 88 89 90 91 92

/* 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)
L
Linus Torvalds 已提交
93
#endif
S
Sam Ravnborg 已提交
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
#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)
L
Linus Torvalds 已提交
111 112
#endif

S
Sam Ravnborg 已提交
113
#endif /* ! FLEXINT_H */
L
Linus Torvalds 已提交
114

S
Sam Ravnborg 已提交
115
/* %endif */
L
Linus Torvalds 已提交
116

S
Sam Ravnborg 已提交
117 118
/* %if-c++-only */
/* %endif */
L
Linus Torvalds 已提交
119

S
Sam Ravnborg 已提交
120
#ifdef __cplusplus
L
Linus Torvalds 已提交
121 122 123 124 125 126

/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST

#else	/* ! __cplusplus */

127 128
/* C99 requires __STDC__ to be defined as 1. */
#if defined (__STDC__)
L
Linus Torvalds 已提交
129 130 131

#define YY_USE_CONST

132
#endif	/* defined (__STDC__) */
L
Linus Torvalds 已提交
133 134 135 136 137 138 139 140
#endif	/* ! __cplusplus */

#ifdef YY_USE_CONST
#define yyconst const
#else
#define yyconst
#endif

S
Sam Ravnborg 已提交
141
/* %not-for-header */
L
Linus Torvalds 已提交
142 143 144

/* Returned upon end-of-file. */
#define YY_NULL 0
S
Sam Ravnborg 已提交
145 146 147
/* %ok-for-header */

/* %not-for-header */
L
Linus Torvalds 已提交
148 149 150 151 152 153 154

/* Promotes a possibly negative, possibly signed char to an unsigned
 * integer for use as an array index.  If the signed char is negative,
 * we want to instead treat it as an 8-bit unsigned char, hence the
 * double cast.
 */
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
S
Sam Ravnborg 已提交
155 156 157 158 159 160 161 162
/* %ok-for-header */

/* %if-reentrant */
/* %endif */

/* %if-not-reentrant */

/* %endif */
L
Linus Torvalds 已提交
163 164 165 166 167

/* 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.
 */
S
Sam Ravnborg 已提交
168
#define BEGIN (yy_start) = 1 + 2 *
L
Linus Torvalds 已提交
169 170 171 172 173

/* 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.
 */
S
Sam Ravnborg 已提交
174
#define YY_START (((yy_start) - 1) / 2)
L
Linus Torvalds 已提交
175 176 177 178 179 180
#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". */
S
Sam Ravnborg 已提交
181
#define YY_NEW_FILE yyrestart(yyin  )
L
Linus Torvalds 已提交
182 183 184 185

#define YY_END_OF_BUFFER_CHAR 0

/* Size of default input buffer. */
S
Sam Ravnborg 已提交
186
#ifndef YY_BUF_SIZE
L
Linus Torvalds 已提交
187
#define YY_BUF_SIZE 16384
S
Sam Ravnborg 已提交
188
#endif
L
Linus Torvalds 已提交
189

S
Sam Ravnborg 已提交
190 191 192 193 194 195
/* 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
L
Linus Torvalds 已提交
196
typedef struct yy_buffer_state *YY_BUFFER_STATE;
S
Sam Ravnborg 已提交
197
#endif
L
Linus Torvalds 已提交
198

S
Sam Ravnborg 已提交
199
/* %if-not-reentrant */
L
Linus Torvalds 已提交
200
extern int yyleng;
S
Sam Ravnborg 已提交
201 202 203 204
/* %endif */

/* %if-c-only */
/* %if-not-reentrant */
L
Linus Torvalds 已提交
205
extern FILE *yyin, *yyout;
S
Sam Ravnborg 已提交
206 207
/* %endif */
/* %endif */
L
Linus Torvalds 已提交
208 209 210 211 212

#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2

S
Sam Ravnborg 已提交
213 214 215
    #define YY_LESS_LINENO(n)
    
/* Return all but the first "n" matched characters back to the input stream. */
L
Linus Torvalds 已提交
216 217 218 219
#define yyless(n) \
	do \
		{ \
		/* Undo effects of setting up yytext. */ \
S
Sam Ravnborg 已提交
220 221 222
        int yyless_macro_arg = (n); \
        YY_LESS_LINENO(yyless_macro_arg);\
		*yy_cp = (yy_hold_char); \
L
Linus Torvalds 已提交
223
		YY_RESTORE_YY_MORE_OFFSET \
S
Sam Ravnborg 已提交
224
		(yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
L
Linus Torvalds 已提交
225 226 227 228
		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
		} \
	while ( 0 )

S
Sam Ravnborg 已提交
229
#define unput(c) yyunput( c, (yytext_ptr)  )
L
Linus Torvalds 已提交
230

S
Sam Ravnborg 已提交
231 232
#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
233
typedef size_t yy_size_t;
S
Sam Ravnborg 已提交
234
#endif
L
Linus Torvalds 已提交
235

S
Sam Ravnborg 已提交
236 237
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
L
Linus Torvalds 已提交
238 239
struct yy_buffer_state
	{
S
Sam Ravnborg 已提交
240
/* %if-c-only */
L
Linus Torvalds 已提交
241
	FILE *yy_input_file;
S
Sam Ravnborg 已提交
242 243 244 245
/* %endif */

/* %if-c++-only */
/* %endif */
L
Linus Torvalds 已提交
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278

	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.
	 */
	yy_size_t 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;

S
Sam Ravnborg 已提交
279 280 281
    int yy_bs_lineno; /**< The line count. */
    int yy_bs_column; /**< The column count. */
    
L
Linus Torvalds 已提交
282 283 284 285 286 287
	/* Whether to try to fill the input buffer when we reach the
	 * end of it.
	 */
	int yy_fill_buffer;

	int yy_buffer_status;
S
Sam Ravnborg 已提交
288

L
Linus Torvalds 已提交
289 290 291 292 293 294 295 296 297 298 299 300 301
#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
S
Sam Ravnborg 已提交
302

L
Linus Torvalds 已提交
303
	};
S
Sam Ravnborg 已提交
304 305 306 307
#endif /* !YY_STRUCT_YY_BUFFER_STATE */

/* %if-c-only Standard (non-C++) definition */
/* %not-for-header */
L
Linus Torvalds 已提交
308

S
Sam Ravnborg 已提交
309 310 311 312 313 314 315 316 317 318
/* %if-not-reentrant */

/* 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 = 0; /**< Stack as an array. */
/* %endif */
/* %ok-for-header */

/* %endif */
L
Linus Torvalds 已提交
319 320 321 322

/* 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".
S
Sam Ravnborg 已提交
323 324
 *
 * Returns the top of the stack, or NULL.
L
Linus Torvalds 已提交
325
 */
S
Sam Ravnborg 已提交
326 327 328
#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
                          : NULL)
L
Linus Torvalds 已提交
329

S
Sam Ravnborg 已提交
330 331 332 333 334 335 336 337 338
/* 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)]

/* %if-c-only Standard (non-C++) definition */

/* %if-not-reentrant */
/* %not-for-header */
L
Linus Torvalds 已提交
339 340 341 342 343 344 345 346

/* 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 = (char *) 0;
S
Sam Ravnborg 已提交
347
static int yy_init = 0;		/* whether we need to initialize */
L
Linus Torvalds 已提交
348 349 350 351 352 353
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;
S
Sam Ravnborg 已提交
354 355 356
/* %ok-for-header */

/* %endif */
L
Linus Torvalds 已提交
357

S
Sam Ravnborg 已提交
358 359 360 361 362 363 364
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 );
L
Linus Torvalds 已提交
365

S
Sam Ravnborg 已提交
366 367 368
static void yyensure_buffer_stack (void );
static void yy_load_buffer_state (void );
static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
L
Linus Torvalds 已提交
369

S
Sam Ravnborg 已提交
370
#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
L
Linus Torvalds 已提交
371

S
Sam Ravnborg 已提交
372 373 374 375 376 377 378 379 380
YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len  );

/* %endif */

void *yyalloc (yy_size_t  );
void *yyrealloc (void *,yy_size_t  );
void yyfree (void *  );
L
Linus Torvalds 已提交
381 382 383 384 385

#define yy_new_buffer yy_create_buffer

#define yy_set_interactive(is_interactive) \
	{ \
S
Sam Ravnborg 已提交
386 387 388 389 390 391
	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; \
L
Linus Torvalds 已提交
392 393 394 395
	}

#define yy_set_bol(at_bol) \
	{ \
S
Sam Ravnborg 已提交
396 397 398 399 400 401
	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; \
L
Linus Torvalds 已提交
402 403
	}

S
Sam Ravnborg 已提交
404
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
L
Linus Torvalds 已提交
405

S
Sam Ravnborg 已提交
406 407
/* %% [1.0] yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here */
/* Begin user sect3 */
L
Linus Torvalds 已提交
408

409
#define yywrap(n) 1
L
Linus Torvalds 已提交
410 411 412
#define YY_SKIP_YYWRAP

#define FLEX_DEBUG
S
Sam Ravnborg 已提交
413

L
Linus Torvalds 已提交
414
typedef unsigned char YY_CHAR;
S
Sam Ravnborg 已提交
415

L
Linus Torvalds 已提交
416
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
S
Sam Ravnborg 已提交
417

L
Linus Torvalds 已提交
418 419
typedef int yy_state_type;

S
Sam Ravnborg 已提交
420 421 422 423
extern int yylineno;

int yylineno = 1;

L
Linus Torvalds 已提交
424 425 426
extern char *yytext;
#define yytext_ptr yytext

S
Sam Ravnborg 已提交
427 428 429 430 431 432 433 434
/* %if-c-only Standard (non-C++) definition */

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 yy_fatal_error (yyconst char msg[]  );

/* %endif */
L
Linus Torvalds 已提交
435 436 437 438 439

/* Done after the current pattern has been matched and before the
 * corresponding action - sets up yytext.
 */
#define YY_DO_BEFORE_ACTION \
S
Sam Ravnborg 已提交
440 441 442 443
	(yytext_ptr) = yy_bp; \
/* %% [2.0] code to fiddle yytext and yyleng for yymore() goes here \ */\
	yyleng = (size_t) (yy_cp - yy_bp); \
	(yy_hold_char) = *yy_cp; \
L
Linus Torvalds 已提交
444
	*yy_cp = '\0'; \
S
Sam Ravnborg 已提交
445 446
/* %% [3.0] code to copy yytext_ptr to yytext[] goes here, if %array \ */\
	(yy_c_buf_p) = yy_cp;
L
Linus Torvalds 已提交
447

S
Sam Ravnborg 已提交
448
/* %% [4.0] data tables for the DFA and the user's section 1 definitions go here */
L
Linus Torvalds 已提交
449 450
#define YY_NUM_RULES 13
#define YY_END_OF_BUFFER 14
S
Sam Ravnborg 已提交
451 452 453 454 455 456 457
/* 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;
	};
M
Michal Marek 已提交
458
static yyconst flex_int16_t yy_accept[73] =
L
Linus Torvalds 已提交
459
    {   0,
M
Michal Marek 已提交
460 461 462 463 464 465 466 467
        0,    0,   14,   12,    4,    3,   12,    7,   12,   12,
       12,   12,   12,    9,    9,   12,   12,    7,   12,   12,
        4,    0,    5,    0,    7,    8,    0,    6,    0,    0,
       10,   10,    9,    0,    0,    9,    9,    0,    9,    0,
        0,    0,    0,    2,    0,    0,   11,    0,   10,    0,
       10,    9,    9,    0,    0,    0,   10,   10,    0,    0,
        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
        1,    0
L
Linus Torvalds 已提交
468 469
    } ;

S
Sam Ravnborg 已提交
470
static yyconst flex_int32_t yy_ec[256] =
L
Linus Torvalds 已提交
471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
        4,    4,    4,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    2,    1,    5,    6,    7,    8,    9,   10,    1,
        1,    8,   11,    1,   12,   13,    8,   14,   15,   15,
       15,   15,   15,   15,   15,   16,   16,    1,    1,   17,
       18,   19,    1,    1,   20,   20,   20,   20,   21,   22,
        7,    7,    7,    7,    7,   23,    7,    7,    7,    7,
        7,    7,    7,    7,   24,    7,    7,   25,    7,    7,
        1,   26,    1,    8,    7,    1,   20,   20,   20,   20,

       21,   22,    7,    7,    7,    7,    7,   27,    7,    7,
        7,    7,    7,    7,    7,    7,   24,    7,    7,   25,
        7,    7,    1,   28,    1,    8,    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
    } ;

S
Sam Ravnborg 已提交
502
static yyconst flex_int32_t yy_meta[29] =
L
Linus Torvalds 已提交
503 504 505 506 507 508
    {   0,
        1,    1,    2,    1,    1,    1,    3,    1,    1,    1,
        4,    4,    5,    6,    6,    6,    1,    1,    1,    7,
        8,    7,    3,    3,    3,    1,    3,    1
    } ;

M
Michal Marek 已提交
509
static yyconst flex_int16_t yy_base[85] =
L
Linus Torvalds 已提交
510
    {   0,
M
Michal Marek 已提交
511 512 513 514 515 516 517 518 519
        0,  145,  150,  266,   27,  266,   25,    0,  131,   23,
       23,   16,   23,   39,   31,   25,   39,   60,   22,   65,
       57,   43,  266,    0,    0,  266,   61,  266,    0,  128,
       74,    0,  113,   59,   62,  113,   52,    0,    0,   72,
       66,  110,  100,  266,   73,   74,  266,   70,  266,   90,
      103,  266,   84,  129,  108,  113,  143,  266,  107,   66,
      118,  137,  168,  120,   80,   91,  145,  143,   83,   41,
      266,  266,  190,  196,  204,  212,  220,  228,  232,  237,
      238,  243,  249,  257
L
Linus Torvalds 已提交
520 521
    } ;

M
Michal Marek 已提交
522
static yyconst flex_int16_t yy_def[85] =
L
Linus Torvalds 已提交
523
    {   0,
M
Michal Marek 已提交
524 525 526 527 528 529 530 531 532
       72,    1,   72,   72,   72,   72,   73,   74,   72,   72,
       75,   72,   72,   72,   14,   72,   72,   74,   72,   76,
       72,   73,   72,   77,   74,   72,   75,   72,   78,   72,
       72,   31,   14,   79,   80,   72,   72,   81,   15,   73,
       75,   76,   76,   72,   73,   75,   72,   82,   72,   72,
       72,   72,   81,   76,   54,   72,   72,   72,   76,   54,
       76,   76,   76,   54,   83,   76,   63,   83,   84,   84,
       72,    0,   72,   72,   72,   72,   72,   72,   72,   72,
       72,   72,   72,   72
L
Linus Torvalds 已提交
533 534
    } ;

M
Michal Marek 已提交
535
static yyconst flex_int16_t yy_nxt[295] =
L
Linus Torvalds 已提交
536
    {   0,
M
Michal Marek 已提交
537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569
        4,    5,    6,    5,    7,    4,    8,    9,   10,   11,
        9,   12,   13,   14,   15,   15,   16,    9,   17,    8,
        8,    8,   18,    8,    8,    4,    8,   19,   21,   23,
       21,   26,   28,   26,   26,   30,   31,   31,   31,   26,
       26,   26,   26,   71,   39,   39,   39,   23,   29,   26,
       24,   32,   33,   33,   34,   72,   26,   26,   21,   35,
       21,   36,   37,   38,   40,   36,   43,   44,   24,   41,
       28,   32,   50,   50,   52,   28,   23,   23,   52,   35,
       56,   56,   44,   28,   42,   71,   29,   31,   31,   31,
       42,   29,   59,   44,   48,   49,   49,   24,   24,   29,

       49,   43,   44,   51,   51,   51,   36,   37,   59,   44,
       36,   65,   44,   54,   55,   55,   51,   51,   51,   59,
       44,   64,   64,   64,   58,   58,   57,   57,   57,   58,
       59,   44,   42,   64,   64,   64,   52,   72,   59,   44,
       47,   66,   60,   60,   42,   44,   59,   69,   26,   72,
       20,   61,   62,   63,   72,   61,   57,   57,   57,   66,
       72,   72,   72,   66,   49,   49,   72,   61,   62,   49,
       44,   61,   72,   72,   72,   72,   72,   72,   72,   72,
       72,   67,   67,   67,   72,   72,   72,   67,   67,   67,
       22,   22,   22,   22,   22,   22,   22,   22,   25,   72,

       72,   25,   25,   25,   27,   27,   27,   27,   27,   27,
       27,   27,   42,   42,   42,   42,   42,   42,   42,   42,
       45,   72,   45,   45,   45,   45,   45,   45,   46,   72,
       46,   46,   46,   46,   46,   46,   34,   34,   72,   34,
       51,   72,   51,   53,   53,   53,   57,   72,   57,   68,
       68,   68,   68,   68,   68,   68,   68,   70,   70,   70,
       70,   70,   70,   70,   70,    3,   72,   72,   72,   72,
       72,   72,   72,   72,   72,   72,   72,   72,   72,   72,
       72,   72,   72,   72,   72,   72,   72,   72,   72,   72,
       72,   72,   72,   72

L
Linus Torvalds 已提交
570 571
    } ;

M
Michal Marek 已提交
572
static yyconst flex_int16_t yy_chk[295] =
L
Linus Torvalds 已提交
573 574 575
    {   0,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
M
Michal Marek 已提交
576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606
        1,    1,    1,    1,    1,    1,    1,    1,    5,    7,
        5,   10,   11,   12,   12,   13,   13,   13,   13,   19,
       10,   16,   16,   70,   15,   15,   15,   22,   11,   19,
        7,   14,   14,   14,   14,   15,   17,   17,   21,   14,
       21,   14,   14,   14,   18,   14,   20,   20,   22,   18,
       27,   34,   35,   35,   37,   41,   40,   45,   37,   34,
       48,   48,   65,   46,   65,   69,   27,   31,   31,   31,
       60,   41,   66,   66,   31,   31,   31,   40,   45,   46,

       31,   43,   43,   50,   50,   50,   53,   53,   59,   59,
       53,   59,   42,   43,   43,   43,   51,   51,   51,   61,
       61,   55,   55,   55,   51,   51,   56,   56,   56,   51,
       54,   54,   55,   64,   64,   64,   36,   33,   62,   62,
       30,   61,   54,   54,   64,   68,   67,   68,    9,    3,
        2,   54,   54,   54,    0,   54,   57,   57,   57,   62,
        0,    0,    0,   62,   57,   57,    0,   67,   67,   57,
       63,   67,    0,    0,    0,    0,    0,    0,    0,    0,
        0,   63,   63,   63,    0,    0,    0,   63,   63,   63,
       73,   73,   73,   73,   73,   73,   73,   73,   74,    0,

        0,   74,   74,   74,   75,   75,   75,   75,   75,   75,
       75,   75,   76,   76,   76,   76,   76,   76,   76,   76,
       77,    0,   77,   77,   77,   77,   77,   77,   78,    0,
       78,   78,   78,   78,   78,   78,   79,   79,    0,   79,
       80,    0,   80,   81,   81,   81,   82,    0,   82,   83,
       83,   83,   83,   83,   83,   83,   83,   84,   84,   84,
       84,   84,   84,   84,   84,   72,   72,   72,   72,   72,
       72,   72,   72,   72,   72,   72,   72,   72,   72,   72,
       72,   72,   72,   72,   72,   72,   72,   72,   72,   72,
       72,   72,   72,   72

L
Linus Torvalds 已提交
607 608 609 610 611 612 613 614
    } ;

static yy_state_type yy_last_accepting_state;
static char *yy_last_accepting_cpos;

extern int yy_flex_debug;
int yy_flex_debug = 1;

S
Sam Ravnborg 已提交
615
static yyconst flex_int16_t yy_rule_linenum[13] =
L
Linus Torvalds 已提交
616
    {   0,
M
Michal Marek 已提交
617 618
       67,   68,   69,   72,   75,   76,   77,   83,   84,   85,
       87,   90
L
Linus Torvalds 已提交
619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665
    } ;

/* 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 "scripts/genksyms/lex.l"
/* Lexical analysis for genksyms.
   Copyright 1996, 1997 Linux International.

   New implementation contributed by Richard Henderson <rth@tamu.edu>
   Based on original work by Bjorn Ekwall <bj0rn@blox.se>

   Taken from Linux modutils 2.4.22.

   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
   Free Software Foundation; either version 2 of the License, or (at your
   option) any later version.

   This program 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
   General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software Foundation,
   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
#line 25 "scripts/genksyms/lex.l"

#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

#include "genksyms.h"
#include "parse.h"

/* We've got a two-level lexer here.  We let flex do basic tokenization
   and then we categorize those basic tokens in the second stage.  */
#define YY_DECL		static int yylex1(void)

/* We don't do multiple input files.  */
666
#define YY_NO_INPUT 1
M
Michal Marek 已提交
667
#line 668 "scripts/genksyms/lex.c"
S
Sam Ravnborg 已提交
668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695

#define INITIAL 0

#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.
 */
/* %if-c-only */
#include <unistd.h>
/* %endif */
/* %if-c++-only */
/* %endif */
#endif

#ifndef YY_EXTRA_TYPE
#define YY_EXTRA_TYPE void *
#endif

/* %if-c-only Reentrant structure and macros (non-C++). */
/* %if-reentrant */
/* %if-c-only */

static int yy_init_globals (void );

/* %endif */
/* %if-reentrant */
/* %endif */
696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726
/* %endif End reentrant structures and macros. */

/* 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  );

S
Sam Ravnborg 已提交
727 728
/* %if-bison-bridge */
/* %endif */
L
Linus Torvalds 已提交
729 730 731 732 733 734 735

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

#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
S
Sam Ravnborg 已提交
736
extern "C" int yywrap (void );
L
Linus Torvalds 已提交
737
#else
S
Sam Ravnborg 已提交
738
extern int yywrap (void );
L
Linus Torvalds 已提交
739 740 741
#endif
#endif

S
Sam Ravnborg 已提交
742 743 744 745 746 747 748
/* %not-for-header */

    static void yyunput (int c,char *buf_ptr  );
    
/* %ok-for-header */

/* %endif */
L
Linus Torvalds 已提交
749 750

#ifndef yytext_ptr
S
Sam Ravnborg 已提交
751
static void yy_flex_strncpy (char *,yyconst char *,int );
L
Linus Torvalds 已提交
752 753 754
#endif

#ifdef YY_NEED_STRLEN
S
Sam Ravnborg 已提交
755
static int yy_flex_strlen (yyconst char * );
L
Linus Torvalds 已提交
756 757 758
#endif

#ifndef YY_NO_INPUT
S
Sam Ravnborg 已提交
759 760 761
/* %if-c-only Standard (non-C++) definition */
/* %not-for-header */

L
Linus Torvalds 已提交
762
#ifdef __cplusplus
S
Sam Ravnborg 已提交
763
static int yyinput (void );
L
Linus Torvalds 已提交
764
#else
S
Sam Ravnborg 已提交
765
static int input (void );
L
Linus Torvalds 已提交
766
#endif
S
Sam Ravnborg 已提交
767
/* %ok-for-header */
L
Linus Torvalds 已提交
768

S
Sam Ravnborg 已提交
769
/* %endif */
L
Linus Torvalds 已提交
770 771
#endif

S
Sam Ravnborg 已提交
772
/* %if-c-only */
L
Linus Torvalds 已提交
773

S
Sam Ravnborg 已提交
774
/* %endif */
L
Linus Torvalds 已提交
775 776 777 778 779 780 781 782

/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#define YY_READ_BUF_SIZE 8192
#endif

/* Copy whatever the last rule matched to the standard output. */
#ifndef ECHO
S
Sam Ravnborg 已提交
783
/* %if-c-only Standard (non-C++) definition */
L
Linus Torvalds 已提交
784 785 786
/* This used to be an fputs(), but since the string might contain NUL's,
 * we now use fwrite().
 */
787
#define ECHO fwrite( yytext, yyleng, 1, yyout )
S
Sam Ravnborg 已提交
788 789 790
/* %endif */
/* %if-c++-only C++ definition */
/* %endif */
L
Linus Torvalds 已提交
791 792 793 794 795 796 797
#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) \
S
Sam Ravnborg 已提交
798 799
/* %% [5.0] fread()/read() definition of YY_INPUT goes here unless we're doing C++ \ */\
	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
L
Linus Torvalds 已提交
800
		{ \
S
Sam Ravnborg 已提交
801
		int c = '*'; \
802
		int n; \
L
Linus Torvalds 已提交
803 804 805 806 807 808 809 810 811
		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; \
		} \
S
Sam Ravnborg 已提交
812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829
	else \
		{ \
		errno=0; \
		while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
			{ \
			if( errno != EINTR) \
				{ \
				YY_FATAL_ERROR( "input in flex scanner failed" ); \
				break; \
				} \
			errno=0; \
			clearerr(yyin); \
			} \
		}\
\
/* %if-c++-only C++ definition \ */\
/* %endif */

L
Linus Torvalds 已提交
830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846
#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
S
Sam Ravnborg 已提交
847
/* %if-c-only */
L
Linus Torvalds 已提交
848
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
S
Sam Ravnborg 已提交
849 850 851
/* %endif */
/* %if-c++-only */
/* %endif */
L
Linus Torvalds 已提交
852 853
#endif

S
Sam Ravnborg 已提交
854 855 856 857 858 859 860 861 862 863 864 865 866
/* %if-tables-serialization structures and prototypes */
/* %not-for-header */

/* %ok-for-header */

/* %not-for-header */

/* %tables-yydmap generated elements */
/* %endif */
/* end tables serialization structures and prototypes */

/* %ok-for-header */

L
Linus Torvalds 已提交
867 868 869 870
/* Default declaration of generated scanner - a define so the user can
 * easily add parameters.
 */
#ifndef YY_DECL
S
Sam Ravnborg 已提交
871 872 873 874 875 876 877 878 879 880
#define YY_DECL_IS_OURS 1
/* %if-c-only Standard (non-C++) definition */

extern int yylex (void);

#define YY_DECL int yylex (void)
/* %endif */
/* %if-c++-only C++ definition */
/* %endif */
#endif /* !YY_DECL */
L
Linus Torvalds 已提交
881 882 883 884 885 886 887 888 889 890 891 892 893

/* 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 break;
#endif

S
Sam Ravnborg 已提交
894
/* %% [6.0] YY_RULE_SETUP definition goes here */
L
Linus Torvalds 已提交
895 896
#define YY_RULE_SETUP \
	if ( yyleng > 0 ) \
S
Sam Ravnborg 已提交
897
		YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
L
Linus Torvalds 已提交
898 899 900
				(yytext[yyleng - 1] == '\n'); \
	YY_USER_ACTION

S
Sam Ravnborg 已提交
901 902 903 904
/* %not-for-header */

/** The main scanner function which does all the work.
 */
L
Linus Torvalds 已提交
905
YY_DECL
S
Sam Ravnborg 已提交
906
{
L
Linus Torvalds 已提交
907
	register yy_state_type yy_current_state;
S
Sam Ravnborg 已提交
908
	register char *yy_cp, *yy_bp;
L
Linus Torvalds 已提交
909
	register int yy_act;
S
Sam Ravnborg 已提交
910 911
    
/* %% [7.0] user's declarations go here */
M
Michal Marek 已提交
912
#line 63 "scripts/genksyms/lex.l"
L
Linus Torvalds 已提交
913 914 915 916



 /* Keep track of our location in the original source files.  */
M
Michal Marek 已提交
917
#line 918 "scripts/genksyms/lex.c"
L
Linus Torvalds 已提交
918

S
Sam Ravnborg 已提交
919
	if ( !(yy_init) )
L
Linus Torvalds 已提交
920
		{
S
Sam Ravnborg 已提交
921
		(yy_init) = 1;
L
Linus Torvalds 已提交
922 923 924 925 926

#ifdef YY_USER_INIT
		YY_USER_INIT;
#endif

S
Sam Ravnborg 已提交
927 928
		if ( ! (yy_start) )
			(yy_start) = 1;	/* first start state */
L
Linus Torvalds 已提交
929 930

		if ( ! yyin )
S
Sam Ravnborg 已提交
931
/* %if-c-only */
L
Linus Torvalds 已提交
932
			yyin = stdin;
S
Sam Ravnborg 已提交
933 934 935
/* %endif */
/* %if-c++-only */
/* %endif */
L
Linus Torvalds 已提交
936 937

		if ( ! yyout )
S
Sam Ravnborg 已提交
938
/* %if-c-only */
L
Linus Torvalds 已提交
939
			yyout = stdout;
S
Sam Ravnborg 已提交
940 941 942 943 944 945 946 947 948
/* %endif */
/* %if-c++-only */
/* %endif */

		if ( ! YY_CURRENT_BUFFER ) {
			yyensure_buffer_stack ();
			YY_CURRENT_BUFFER_LVALUE =
				yy_create_buffer(yyin,YY_BUF_SIZE );
		}
L
Linus Torvalds 已提交
949

S
Sam Ravnborg 已提交
950
		yy_load_buffer_state( );
L
Linus Torvalds 已提交
951 952 953 954
		}

	while ( 1 )		/* loops until end-of-file is reached */
		{
S
Sam Ravnborg 已提交
955 956
/* %% [8.0] yymore()-related code goes here */
		yy_cp = (yy_c_buf_p);
L
Linus Torvalds 已提交
957 958

		/* Support of yytext. */
S
Sam Ravnborg 已提交
959
		*yy_cp = (yy_hold_char);
L
Linus Torvalds 已提交
960 961 962 963 964 965

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

S
Sam Ravnborg 已提交
966 967
/* %% [9.0] code to set up and find next match goes here */
		yy_current_state = (yy_start);
L
Linus Torvalds 已提交
968 969 970 971 972 973 974
		yy_current_state += YY_AT_BOL();
yy_match:
		do
			{
			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
			if ( yy_accept[yy_current_state] )
				{
S
Sam Ravnborg 已提交
975 976
				(yy_last_accepting_state) = yy_current_state;
				(yy_last_accepting_cpos) = yy_cp;
L
Linus Torvalds 已提交
977 978 979 980
				}
			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
				{
				yy_current_state = (int) yy_def[yy_current_state];
M
Michal Marek 已提交
981
				if ( yy_current_state >= 73 )
L
Linus Torvalds 已提交
982 983 984 985 986
					yy_c = yy_meta[(unsigned int) yy_c];
				}
			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
			++yy_cp;
			}
M
Michal Marek 已提交
987
		while ( yy_base[yy_current_state] != 266 );
L
Linus Torvalds 已提交
988 989

yy_find_action:
S
Sam Ravnborg 已提交
990
/* %% [10.0] code to find the action number goes here */
L
Linus Torvalds 已提交
991 992 993
		yy_act = yy_accept[yy_current_state];
		if ( yy_act == 0 )
			{ /* have to back up */
S
Sam Ravnborg 已提交
994 995
			yy_cp = (yy_last_accepting_cpos);
			yy_current_state = (yy_last_accepting_state);
L
Linus Torvalds 已提交
996 997 998 999 1000
			yy_act = yy_accept[yy_current_state];
			}

		YY_DO_BEFORE_ACTION;

S
Sam Ravnborg 已提交
1001
/* %% [11.0] code for yylineno update goes here */
L
Linus Torvalds 已提交
1002 1003 1004

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

S
Sam Ravnborg 已提交
1005
/* %% [12.0] debug code goes here */
L
Linus Torvalds 已提交
1006 1007 1008 1009 1010
		if ( yy_flex_debug )
			{
			if ( yy_act == 0 )
				fprintf( stderr, "--scanner backing up\n" );
			else if ( yy_act < 13 )
S
Sam Ravnborg 已提交
1011 1012
				fprintf( stderr, "--accepting rule at line %ld (\"%s\")\n",
				         (long)yy_rule_linenum[yy_act], yytext );
L
Linus Torvalds 已提交
1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023
			else if ( yy_act == 13 )
				fprintf( stderr, "--accepting default rule (\"%s\")\n",
				         yytext );
			else if ( yy_act == 14 )
				fprintf( stderr, "--(end of buffer or a NUL)\n" );
			else
				fprintf( stderr, "--EOF (start condition %d)\n", YY_START );
			}

		switch ( yy_act )
	{ /* beginning of action switch */
S
Sam Ravnborg 已提交
1024
/* %% [13.0] actions go here */
L
Linus Torvalds 已提交
1025 1026
			case 0: /* must back up */
			/* undo the effects of YY_DO_BEFORE_ACTION */
S
Sam Ravnborg 已提交
1027 1028 1029
			*yy_cp = (yy_hold_char);
			yy_cp = (yy_last_accepting_cpos);
			yy_current_state = (yy_last_accepting_state);
L
Linus Torvalds 已提交
1030 1031 1032
			goto yy_find_action;

case 1:
S
Sam Ravnborg 已提交
1033
/* rule 1 can match eol */
L
Linus Torvalds 已提交
1034
YY_RULE_SETUP
M
Michal Marek 已提交
1035
#line 67 "scripts/genksyms/lex.l"
L
Linus Torvalds 已提交
1036 1037 1038
return FILENAME;
	YY_BREAK
case 2:
S
Sam Ravnborg 已提交
1039
/* rule 2 can match eol */
L
Linus Torvalds 已提交
1040
YY_RULE_SETUP
M
Michal Marek 已提交
1041
#line 68 "scripts/genksyms/lex.l"
L
Linus Torvalds 已提交
1042 1043 1044
cur_line++;
	YY_BREAK
case 3:
S
Sam Ravnborg 已提交
1045
/* rule 3 can match eol */
L
Linus Torvalds 已提交
1046
YY_RULE_SETUP
M
Michal Marek 已提交
1047
#line 69 "scripts/genksyms/lex.l"
L
Linus Torvalds 已提交
1048 1049 1050 1051 1052
cur_line++;
	YY_BREAK
/* Ignore all other whitespace.  */
case 4:
YY_RULE_SETUP
M
Michal Marek 已提交
1053
#line 72 "scripts/genksyms/lex.l"
L
Linus Torvalds 已提交
1054 1055 1056
;
	YY_BREAK
case 5:
S
Sam Ravnborg 已提交
1057
/* rule 5 can match eol */
L
Linus Torvalds 已提交
1058
YY_RULE_SETUP
M
Michal Marek 已提交
1059
#line 75 "scripts/genksyms/lex.l"
L
Linus Torvalds 已提交
1060 1061 1062
return STRING;
	YY_BREAK
case 6:
S
Sam Ravnborg 已提交
1063
/* rule 6 can match eol */
L
Linus Torvalds 已提交
1064
YY_RULE_SETUP
M
Michal Marek 已提交
1065
#line 76 "scripts/genksyms/lex.l"
L
Linus Torvalds 已提交
1066 1067 1068 1069
return CHAR;
	YY_BREAK
case 7:
YY_RULE_SETUP
M
Michal Marek 已提交
1070
#line 77 "scripts/genksyms/lex.l"
L
Linus Torvalds 已提交
1071 1072 1073 1074 1075 1076 1077 1078
return IDENT;
	YY_BREAK
/* The Pedant requires that the other C multi-character tokens be
    recognized as tokens.  We don't actually use them since we don't
    parse expressions, but we do want whitespace to be arranged
    around them properly.  */
case 8:
YY_RULE_SETUP
M
Michal Marek 已提交
1079
#line 83 "scripts/genksyms/lex.l"
L
Linus Torvalds 已提交
1080 1081 1082 1083
return OTHER;
	YY_BREAK
case 9:
YY_RULE_SETUP
M
Michal Marek 已提交
1084
#line 84 "scripts/genksyms/lex.l"
L
Linus Torvalds 已提交
1085 1086 1087 1088
return INT;
	YY_BREAK
case 10:
YY_RULE_SETUP
M
Michal Marek 已提交
1089
#line 85 "scripts/genksyms/lex.l"
L
Linus Torvalds 已提交
1090 1091 1092 1093
return REAL;
	YY_BREAK
case 11:
YY_RULE_SETUP
M
Michal Marek 已提交
1094
#line 87 "scripts/genksyms/lex.l"
L
Linus Torvalds 已提交
1095 1096 1097 1098 1099
return DOTS;
	YY_BREAK
/* All other tokens are single characters.  */
case 12:
YY_RULE_SETUP
M
Michal Marek 已提交
1100
#line 90 "scripts/genksyms/lex.l"
L
Linus Torvalds 已提交
1101 1102 1103 1104
return yytext[0];
	YY_BREAK
case 13:
YY_RULE_SETUP
M
Michal Marek 已提交
1105
#line 93 "scripts/genksyms/lex.l"
L
Linus Torvalds 已提交
1106 1107
ECHO;
	YY_BREAK
M
Michal Marek 已提交
1108
#line 1109 "scripts/genksyms/lex.c"
L
Linus Torvalds 已提交
1109 1110 1111 1112 1113 1114
case YY_STATE_EOF(INITIAL):
	yyterminate();

	case YY_END_OF_BUFFER:
		{
		/* Amount of text matched not including the EOB char. */
S
Sam Ravnborg 已提交
1115
		int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
L
Linus Torvalds 已提交
1116 1117

		/* Undo the effects of YY_DO_BEFORE_ACTION. */
S
Sam Ravnborg 已提交
1118
		*yy_cp = (yy_hold_char);
L
Linus Torvalds 已提交
1119 1120
		YY_RESTORE_YY_MORE_OFFSET

S
Sam Ravnborg 已提交
1121
		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
L
Linus Torvalds 已提交
1122 1123 1124 1125 1126
			{
			/* 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
S
Sam Ravnborg 已提交
1127
			 * consistency between YY_CURRENT_BUFFER and our
L
Linus Torvalds 已提交
1128 1129 1130 1131
			 * 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.
			 */
S
Sam Ravnborg 已提交
1132 1133 1134
			(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;
L
Linus Torvalds 已提交
1135 1136 1137 1138 1139 1140 1141 1142 1143
			}

		/* 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().
		 */
S
Sam Ravnborg 已提交
1144
		if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
L
Linus Torvalds 已提交
1145 1146 1147
			{ /* This was really a NUL. */
			yy_state_type yy_next_state;

S
Sam Ravnborg 已提交
1148
			(yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
L
Linus Torvalds 已提交
1149

S
Sam Ravnborg 已提交
1150
			yy_current_state = yy_get_previous_state(  );
L
Linus Torvalds 已提交
1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162

			/* 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 );

S
Sam Ravnborg 已提交
1163
			yy_bp = (yytext_ptr) + YY_MORE_ADJ;
L
Linus Torvalds 已提交
1164 1165 1166 1167

			if ( yy_next_state )
				{
				/* Consume the NUL. */
S
Sam Ravnborg 已提交
1168
				yy_cp = ++(yy_c_buf_p);
L
Linus Torvalds 已提交
1169 1170 1171 1172 1173 1174
				yy_current_state = yy_next_state;
				goto yy_match;
				}

			else
				{
S
Sam Ravnborg 已提交
1175 1176
/* %% [14.0] code to do back-up for compressed tables and set up yy_cp goes here */
				yy_cp = (yy_c_buf_p);
L
Linus Torvalds 已提交
1177 1178 1179 1180
				goto yy_find_action;
				}
			}

S
Sam Ravnborg 已提交
1181
		else switch ( yy_get_next_buffer(  ) )
L
Linus Torvalds 已提交
1182 1183 1184
			{
			case EOB_ACT_END_OF_FILE:
				{
S
Sam Ravnborg 已提交
1185
				(yy_did_buffer_switch_on_eof) = 0;
L
Linus Torvalds 已提交
1186

S
Sam Ravnborg 已提交
1187
				if ( yywrap( ) )
L
Linus Torvalds 已提交
1188 1189 1190 1191 1192 1193 1194 1195 1196 1197
					{
					/* 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.
					 */
S
Sam Ravnborg 已提交
1198
					(yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
L
Linus Torvalds 已提交
1199 1200 1201 1202 1203 1204 1205

					yy_act = YY_STATE_EOF(YY_START);
					goto do_action;
					}

				else
					{
S
Sam Ravnborg 已提交
1206
					if ( ! (yy_did_buffer_switch_on_eof) )
L
Linus Torvalds 已提交
1207 1208 1209 1210 1211 1212
						YY_NEW_FILE;
					}
				break;
				}

			case EOB_ACT_CONTINUE_SCAN:
S
Sam Ravnborg 已提交
1213 1214
				(yy_c_buf_p) =
					(yytext_ptr) + yy_amount_of_matched_text;
L
Linus Torvalds 已提交
1215

S
Sam Ravnborg 已提交
1216
				yy_current_state = yy_get_previous_state(  );
L
Linus Torvalds 已提交
1217

S
Sam Ravnborg 已提交
1218 1219
				yy_cp = (yy_c_buf_p);
				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
L
Linus Torvalds 已提交
1220 1221 1222
				goto yy_match;

			case EOB_ACT_LAST_MATCH:
S
Sam Ravnborg 已提交
1223 1224
				(yy_c_buf_p) =
				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
L
Linus Torvalds 已提交
1225

S
Sam Ravnborg 已提交
1226
				yy_current_state = yy_get_previous_state(  );
L
Linus Torvalds 已提交
1227

S
Sam Ravnborg 已提交
1228 1229
				yy_cp = (yy_c_buf_p);
				yy_bp = (yytext_ptr) + YY_MORE_ADJ;
L
Linus Torvalds 已提交
1230 1231 1232 1233 1234 1235 1236 1237 1238 1239
				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 */
S
Sam Ravnborg 已提交
1240 1241
} /* end of yylex */
/* %ok-for-header */
L
Linus Torvalds 已提交
1242

S
Sam Ravnborg 已提交
1243 1244 1245 1246 1247 1248
/* %if-c++-only */
/* %not-for-header */

/* %ok-for-header */

/* %endif */
L
Linus Torvalds 已提交
1249 1250 1251 1252 1253 1254 1255 1256

/* 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
 */
S
Sam Ravnborg 已提交
1257 1258 1259 1260 1261 1262 1263 1264
/* %if-c-only */
static int yy_get_next_buffer (void)
/* %endif */
/* %if-c++-only */
/* %endif */
{
    	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
	register char *source = (yytext_ptr);
L
Linus Torvalds 已提交
1265 1266 1267
	register int number_to_move, i;
	int ret_val;

S
Sam Ravnborg 已提交
1268
	if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
L
Linus Torvalds 已提交
1269 1270 1271
		YY_FATAL_ERROR(
		"fatal flex scanner internal error--end of buffer missed" );

S
Sam Ravnborg 已提交
1272
	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
L
Linus Torvalds 已提交
1273
		{ /* Don't try to fill the buffer, so this is an EOF. */
S
Sam Ravnborg 已提交
1274
		if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
L
Linus Torvalds 已提交
1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293
			{
			/* 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. */
S
Sam Ravnborg 已提交
1294
	number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
L
Linus Torvalds 已提交
1295 1296 1297 1298

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

S
Sam Ravnborg 已提交
1299
	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
L
Linus Torvalds 已提交
1300 1301 1302
		/* don't do the read, it's not guaranteed to return an EOF,
		 * just force an EOF
		 */
S
Sam Ravnborg 已提交
1303
		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
L
Linus Torvalds 已提交
1304 1305 1306

	else
		{
S
Sam Ravnborg 已提交
1307 1308
			int num_to_read =
			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
L
Linus Torvalds 已提交
1309 1310 1311 1312 1313

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

			/* just a shorter name for the current buffer */
S
Sam Ravnborg 已提交
1314
			YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
L
Linus Torvalds 已提交
1315 1316

			int yy_c_buf_p_offset =
S
Sam Ravnborg 已提交
1317
				(int) ((yy_c_buf_p) - b->yy_ch_buf);
L
Linus Torvalds 已提交
1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329

			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. */
S
Sam Ravnborg 已提交
1330
					yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
L
Linus Torvalds 已提交
1331 1332 1333 1334 1335 1336 1337 1338 1339
				}
			else
				/* Can't grow it, we don't own it. */
				b->yy_ch_buf = 0;

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

S
Sam Ravnborg 已提交
1340
			(yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
L
Linus Torvalds 已提交
1341

S
Sam Ravnborg 已提交
1342
			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
L
Linus Torvalds 已提交
1343
						number_to_move - 1;
S
Sam Ravnborg 已提交
1344

L
Linus Torvalds 已提交
1345 1346 1347 1348 1349 1350
			}

		if ( num_to_read > YY_READ_BUF_SIZE )
			num_to_read = YY_READ_BUF_SIZE;

		/* Read in more data. */
S
Sam Ravnborg 已提交
1351 1352
		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
			(yy_n_chars), (size_t) num_to_read );
L
Linus Torvalds 已提交
1353

S
Sam Ravnborg 已提交
1354
		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
L
Linus Torvalds 已提交
1355 1356
		}

S
Sam Ravnborg 已提交
1357
	if ( (yy_n_chars) == 0 )
L
Linus Torvalds 已提交
1358 1359 1360 1361
		{
		if ( number_to_move == YY_MORE_ADJ )
			{
			ret_val = EOB_ACT_END_OF_FILE;
S
Sam Ravnborg 已提交
1362
			yyrestart(yyin  );
L
Linus Torvalds 已提交
1363 1364 1365 1366 1367
			}

		else
			{
			ret_val = EOB_ACT_LAST_MATCH;
S
Sam Ravnborg 已提交
1368
			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
L
Linus Torvalds 已提交
1369 1370 1371 1372 1373 1374 1375
				YY_BUFFER_EOF_PENDING;
			}
		}

	else
		ret_val = EOB_ACT_CONTINUE_SCAN;

1376 1377 1378 1379 1380 1381 1382 1383
	if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
		/* Extend the array by 50%, plus the number we really need. */
		yy_size_t 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,new_size  );
		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
	}

S
Sam Ravnborg 已提交
1384 1385 1386
	(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;
L
Linus Torvalds 已提交
1387

S
Sam Ravnborg 已提交
1388
	(yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
L
Linus Torvalds 已提交
1389 1390

	return ret_val;
S
Sam Ravnborg 已提交
1391
}
L
Linus Torvalds 已提交
1392 1393 1394

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

S
Sam Ravnborg 已提交
1395 1396 1397 1398 1399 1400 1401 1402
/* %if-c-only */
/* %not-for-header */

    static yy_state_type yy_get_previous_state (void)
/* %endif */
/* %if-c++-only */
/* %endif */
{
L
Linus Torvalds 已提交
1403 1404
	register yy_state_type yy_current_state;
	register char *yy_cp;
S
Sam Ravnborg 已提交
1405 1406 1407
    
/* %% [15.0] code to get the start state into yy_current_state goes here */
	yy_current_state = (yy_start);
L
Linus Torvalds 已提交
1408 1409
	yy_current_state += YY_AT_BOL();

S
Sam Ravnborg 已提交
1410
	for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
L
Linus Torvalds 已提交
1411
		{
S
Sam Ravnborg 已提交
1412
/* %% [16.0] code to find the next state goes here */
L
Linus Torvalds 已提交
1413 1414 1415
		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
		if ( yy_accept[yy_current_state] )
			{
S
Sam Ravnborg 已提交
1416 1417
			(yy_last_accepting_state) = yy_current_state;
			(yy_last_accepting_cpos) = yy_cp;
L
Linus Torvalds 已提交
1418 1419 1420 1421
			}
		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
			{
			yy_current_state = (int) yy_def[yy_current_state];
M
Michal Marek 已提交
1422
			if ( yy_current_state >= 73 )
L
Linus Torvalds 已提交
1423 1424 1425 1426 1427 1428
				yy_c = yy_meta[(unsigned int) yy_c];
			}
		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
		}

	return yy_current_state;
S
Sam Ravnborg 已提交
1429
}
L
Linus Torvalds 已提交
1430 1431 1432 1433 1434 1435

/* yy_try_NUL_trans - try to make a transition on the NUL character
 *
 * synopsis
 *	next_state = yy_try_NUL_trans( current_state );
 */
S
Sam Ravnborg 已提交
1436 1437 1438 1439 1440 1441
/* %if-c-only */
    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
/* %endif */
/* %if-c++-only */
/* %endif */
{
L
Linus Torvalds 已提交
1442
	register int yy_is_jam;
S
Sam Ravnborg 已提交
1443 1444
    /* %% [17.0] code to find the next state, and perhaps do backing up, goes here */
	register char *yy_cp = (yy_c_buf_p);
L
Linus Torvalds 已提交
1445 1446 1447 1448

	register YY_CHAR yy_c = 1;
	if ( yy_accept[yy_current_state] )
		{
S
Sam Ravnborg 已提交
1449 1450
		(yy_last_accepting_state) = yy_current_state;
		(yy_last_accepting_cpos) = yy_cp;
L
Linus Torvalds 已提交
1451 1452 1453 1454
		}
	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
		{
		yy_current_state = (int) yy_def[yy_current_state];
M
Michal Marek 已提交
1455
		if ( yy_current_state >= 73 )
L
Linus Torvalds 已提交
1456 1457 1458
			yy_c = yy_meta[(unsigned int) yy_c];
		}
	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
M
Michal Marek 已提交
1459
	yy_is_jam = (yy_current_state == 72);
L
Linus Torvalds 已提交
1460 1461

	return yy_is_jam ? 0 : yy_current_state;
S
Sam Ravnborg 已提交
1462
}
L
Linus Torvalds 已提交
1463

S
Sam Ravnborg 已提交
1464
/* %if-c-only */
L
Linus Torvalds 已提交
1465

S
Sam Ravnborg 已提交
1466 1467 1468 1469 1470 1471 1472 1473
    static void yyunput (int c, register char * yy_bp )
/* %endif */
/* %if-c++-only */
/* %endif */
{
	register char *yy_cp;
    
    yy_cp = (yy_c_buf_p);
L
Linus Torvalds 已提交
1474 1475

	/* undo effects of setting up yytext */
S
Sam Ravnborg 已提交
1476
	*yy_cp = (yy_hold_char);
L
Linus Torvalds 已提交
1477

S
Sam Ravnborg 已提交
1478
	if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
L
Linus Torvalds 已提交
1479 1480
		{ /* need to shift things up to make room */
		/* +2 for EOB chars. */
S
Sam Ravnborg 已提交
1481 1482 1483
		register int number_to_move = (yy_n_chars) + 2;
		register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
					YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
L
Linus Torvalds 已提交
1484
		register char *source =
S
Sam Ravnborg 已提交
1485
				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
L
Linus Torvalds 已提交
1486

S
Sam Ravnborg 已提交
1487
		while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
L
Linus Torvalds 已提交
1488 1489 1490 1491
			*--dest = *--source;

		yy_cp += (int) (dest - source);
		yy_bp += (int) (dest - source);
S
Sam Ravnborg 已提交
1492 1493
		YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
			(yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
L
Linus Torvalds 已提交
1494

S
Sam Ravnborg 已提交
1495
		if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
L
Linus Torvalds 已提交
1496 1497 1498 1499 1500
			YY_FATAL_ERROR( "flex scanner push-back overflow" );
		}

	*--yy_cp = (char) c;

S
Sam Ravnborg 已提交
1501
/* %% [18.0] update yylineno here */
L
Linus Torvalds 已提交
1502

S
Sam Ravnborg 已提交
1503 1504 1505 1506 1507
	(yytext_ptr) = yy_bp;
	(yy_hold_char) = *yy_cp;
	(yy_c_buf_p) = yy_cp;
}
/* %if-c-only */
L
Linus Torvalds 已提交
1508

S
Sam Ravnborg 已提交
1509
/* %endif */
L
Linus Torvalds 已提交
1510

S
Sam Ravnborg 已提交
1511 1512
/* %if-c-only */
#ifndef YY_NO_INPUT
L
Linus Torvalds 已提交
1513
#ifdef __cplusplus
S
Sam Ravnborg 已提交
1514
    static int yyinput (void)
L
Linus Torvalds 已提交
1515
#else
S
Sam Ravnborg 已提交
1516
    static int input  (void)
L
Linus Torvalds 已提交
1517 1518
#endif

S
Sam Ravnborg 已提交
1519 1520 1521 1522 1523 1524 1525
/* %endif */
/* %if-c++-only */
/* %endif */
{
	int c;
    
	*(yy_c_buf_p) = (yy_hold_char);
L
Linus Torvalds 已提交
1526

S
Sam Ravnborg 已提交
1527
	if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
L
Linus Torvalds 已提交
1528 1529 1530 1531 1532
		{
		/* 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.
		 */
S
Sam Ravnborg 已提交
1533
		if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
L
Linus Torvalds 已提交
1534
			/* This was really a NUL. */
S
Sam Ravnborg 已提交
1535
			*(yy_c_buf_p) = '\0';
L
Linus Torvalds 已提交
1536 1537 1538

		else
			{ /* need more input */
S
Sam Ravnborg 已提交
1539 1540
			int offset = (yy_c_buf_p) - (yytext_ptr);
			++(yy_c_buf_p);
L
Linus Torvalds 已提交
1541

S
Sam Ravnborg 已提交
1542
			switch ( yy_get_next_buffer(  ) )
L
Linus Torvalds 已提交
1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555
				{
				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. */
S
Sam Ravnborg 已提交
1556
					yyrestart(yyin );
L
Linus Torvalds 已提交
1557

S
Sam Ravnborg 已提交
1558
					/*FALLTHROUGH*/
L
Linus Torvalds 已提交
1559 1560 1561

				case EOB_ACT_END_OF_FILE:
					{
S
Sam Ravnborg 已提交
1562
					if ( yywrap( ) )
L
Linus Torvalds 已提交
1563 1564
						return EOF;

S
Sam Ravnborg 已提交
1565
					if ( ! (yy_did_buffer_switch_on_eof) )
L
Linus Torvalds 已提交
1566 1567 1568 1569 1570 1571 1572 1573 1574
						YY_NEW_FILE;
#ifdef __cplusplus
					return yyinput();
#else
					return input();
#endif
					}

				case EOB_ACT_CONTINUE_SCAN:
S
Sam Ravnborg 已提交
1575
					(yy_c_buf_p) = (yytext_ptr) + offset;
L
Linus Torvalds 已提交
1576 1577 1578 1579 1580
					break;
				}
			}
		}

S
Sam Ravnborg 已提交
1581 1582 1583
	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);
L
Linus Torvalds 已提交
1584

S
Sam Ravnborg 已提交
1585 1586
/* %% [19.0] update BOL and yylineno */
	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
L
Linus Torvalds 已提交
1587 1588

	return c;
S
Sam Ravnborg 已提交
1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609
}
/* %if-c-only */
#endif	/* ifndef YY_NO_INPUT */
/* %endif */

/** 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 .
 */
/* %if-c-only */
    void yyrestart  (FILE * input_file )
/* %endif */
/* %if-c++-only */
/* %endif */
{
    
	if ( ! YY_CURRENT_BUFFER ){
        yyensure_buffer_stack ();
		YY_CURRENT_BUFFER_LVALUE =
            yy_create_buffer(yyin,YY_BUF_SIZE );
L
Linus Torvalds 已提交
1610 1611
	}

S
Sam Ravnborg 已提交
1612 1613 1614
	yy_init_buffer(YY_CURRENT_BUFFER,input_file );
	yy_load_buffer_state( );
}
L
Linus Torvalds 已提交
1615

S
Sam Ravnborg 已提交
1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633
/** Switch to a different input buffer.
 * @param new_buffer The new input buffer.
 * 
 */
/* %if-c-only */
    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
/* %endif */
/* %if-c++-only */
/* %endif */
{
    
	/* 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 )
L
Linus Torvalds 已提交
1634 1635
		return;

S
Sam Ravnborg 已提交
1636
	if ( YY_CURRENT_BUFFER )
L
Linus Torvalds 已提交
1637 1638
		{
		/* Flush out information for old buffer. */
S
Sam Ravnborg 已提交
1639 1640 1641
		*(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);
L
Linus Torvalds 已提交
1642 1643
		}

S
Sam Ravnborg 已提交
1644 1645
	YY_CURRENT_BUFFER_LVALUE = new_buffer;
	yy_load_buffer_state( );
L
Linus Torvalds 已提交
1646 1647 1648 1649 1650 1651

	/* 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.
	 */
S
Sam Ravnborg 已提交
1652 1653
	(yy_did_buffer_switch_on_eof) = 1;
}
L
Linus Torvalds 已提交
1654

S
Sam Ravnborg 已提交
1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665
/* %if-c-only */
static void yy_load_buffer_state  (void)
/* %endif */
/* %if-c++-only */
/* %endif */
{
    	(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);
}
L
Linus Torvalds 已提交
1666

S
Sam Ravnborg 已提交
1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678
/** 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.
 */
/* %if-c-only */
    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
/* %endif */
/* %if-c++-only */
/* %endif */
{
L
Linus Torvalds 已提交
1679
	YY_BUFFER_STATE b;
S
Sam Ravnborg 已提交
1680 1681
    
	b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
L
Linus Torvalds 已提交
1682 1683 1684 1685 1686 1687 1688 1689
	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.
	 */
S
Sam Ravnborg 已提交
1690
	b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
L
Linus Torvalds 已提交
1691 1692 1693 1694 1695
	if ( ! b->yy_ch_buf )
		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

	b->yy_is_our_buffer = 1;

S
Sam Ravnborg 已提交
1696
	yy_init_buffer(b,file );
L
Linus Torvalds 已提交
1697 1698

	return b;
S
Sam Ravnborg 已提交
1699
}
L
Linus Torvalds 已提交
1700

S
Sam Ravnborg 已提交
1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711
/** Destroy the buffer.
 * @param b a buffer created with yy_create_buffer()
 * 
 */
/* %if-c-only */
    void yy_delete_buffer (YY_BUFFER_STATE  b )
/* %endif */
/* %if-c++-only */
/* %endif */
{
    
L
Linus Torvalds 已提交
1712 1713 1714
	if ( ! b )
		return;

S
Sam Ravnborg 已提交
1715 1716
	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
L
Linus Torvalds 已提交
1717 1718

	if ( b->yy_is_our_buffer )
S
Sam Ravnborg 已提交
1719
		yyfree((void *) b->yy_ch_buf  );
L
Linus Torvalds 已提交
1720

S
Sam Ravnborg 已提交
1721 1722
	yyfree((void *) b  );
}
L
Linus Torvalds 已提交
1723

S
Sam Ravnborg 已提交
1724
/* %if-c-only */
L
Linus Torvalds 已提交
1725

S
Sam Ravnborg 已提交
1726 1727 1728 1729 1730
#ifndef __cplusplus
extern int isatty (int );
#endif /* __cplusplus */
    
/* %endif */
L
Linus Torvalds 已提交
1731

S
Sam Ravnborg 已提交
1732 1733
/* %if-c++-only */
/* %endif */
L
Linus Torvalds 已提交
1734

S
Sam Ravnborg 已提交
1735 1736 1737 1738 1739 1740 1741 1742 1743
/* 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.
 */
/* %if-c-only */
    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
/* %endif */
/* %if-c++-only */
/* %endif */
L
Linus Torvalds 已提交
1744

S
Sam Ravnborg 已提交
1745 1746 1747 1748
{
	int oerrno = errno;
    
	yy_flush_buffer(b );
L
Linus Torvalds 已提交
1749 1750 1751 1752

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

S
Sam Ravnborg 已提交
1753 1754 1755 1756 1757 1758 1759 1760
    /* 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;
    }
L
Linus Torvalds 已提交
1761

S
Sam Ravnborg 已提交
1762
/* %if-c-only */
L
Linus Torvalds 已提交
1763

S
Sam Ravnborg 已提交
1764 1765 1766 1767 1768 1769 1770
        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
    
/* %endif */
/* %if-c++-only */
/* %endif */
	errno = oerrno;
}
L
Linus Torvalds 已提交
1771

S
Sam Ravnborg 已提交
1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782
/** 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.
 * 
 */
/* %if-c-only */
    void yy_flush_buffer (YY_BUFFER_STATE  b )
/* %endif */
/* %if-c++-only */
/* %endif */
{
    	if ( ! b )
L
Linus Torvalds 已提交
1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798
		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;

S
Sam Ravnborg 已提交
1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862
	if ( b == YY_CURRENT_BUFFER )
		yy_load_buffer_state( );
}

/* %if-c-or-c++ */
/** 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.
 *  
 */
/* %if-c-only */
void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
/* %endif */
/* %if-c++-only */
/* %endif */
{
    	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;
}
/* %endif */

/* %if-c-or-c++ */
/** Removes and deletes the top of the stack, if present.
 *  The next element becomes the new top.
 *  
 */
/* %if-c-only */
void yypop_buffer_state (void)
/* %endif */
/* %if-c++-only */
/* %endif */
{
    	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;
L
Linus Torvalds 已提交
1863
	}
S
Sam Ravnborg 已提交
1864 1865
}
/* %endif */
L
Linus Torvalds 已提交
1866

S
Sam Ravnborg 已提交
1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888
/* %if-c-or-c++ */
/* Allocates the stack if it does not exist.
 *  Guarantees space for at least one push.
 */
/* %if-c-only */
static void yyensure_buffer_stack (void)
/* %endif */
/* %if-c++-only */
/* %endif */
{
	int 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;
		(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
								(num_to_alloc * sizeof(struct yy_buffer_state*)
								);
1889 1890 1891
		if ( ! (yy_buffer_stack) )
			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
								  
S
Sam Ravnborg 已提交
1892 1893 1894 1895 1896 1897
		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;
	}
L
Linus Torvalds 已提交
1898

S
Sam Ravnborg 已提交
1899 1900 1901 1902
	if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){

		/* Increase the buffer to prepare for a possible push. */
		int grow_size = 8 /* arbitrary grow size */;
L
Linus Torvalds 已提交
1903

S
Sam Ravnborg 已提交
1904 1905 1906 1907 1908
		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*)
								);
1909 1910
		if ( ! (yy_buffer_stack) )
			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
S
Sam Ravnborg 已提交
1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929

		/* 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;
	}
}
/* %endif */

/* %if-c-only */
/** 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;
    
L
Linus Torvalds 已提交
1930 1931 1932 1933 1934 1935
	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 0;

S
Sam Ravnborg 已提交
1936
	b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
L
Linus Torvalds 已提交
1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949
	if ( ! b )
		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );

	b->yy_buf_size = 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 = 0;
	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;

S
Sam Ravnborg 已提交
1950
	yy_switch_to_buffer(b  );
L
Linus Torvalds 已提交
1951 1952

	return b;
S
Sam Ravnborg 已提交
1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981
}
/* %endif */

/* %if-c-only */
/** 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 (yyconst char * yystr )
{
    
	return yy_scan_bytes(yystr,strlen(yystr) );
}
/* %endif */

/* %if-c-only */
/** 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 bytes the byte buffer to scan
 * @param 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  (yyconst char * yybytes, int  _yybytes_len )
{
L
Linus Torvalds 已提交
1982 1983 1984 1985
	YY_BUFFER_STATE b;
	char *buf;
	yy_size_t n;
	int i;
S
Sam Ravnborg 已提交
1986
    
L
Linus Torvalds 已提交
1987
	/* Get memory for full buffer, including space for trailing EOB's. */
S
Sam Ravnborg 已提交
1988 1989
	n = _yybytes_len + 2;
	buf = (char *) yyalloc(n  );
L
Linus Torvalds 已提交
1990 1991 1992
	if ( ! buf )
		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );

S
Sam Ravnborg 已提交
1993 1994
	for ( i = 0; i < _yybytes_len; ++i )
		buf[i] = yybytes[i];
L
Linus Torvalds 已提交
1995

S
Sam Ravnborg 已提交
1996
	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
L
Linus Torvalds 已提交
1997

S
Sam Ravnborg 已提交
1998
	b = yy_scan_buffer(buf,n );
L
Linus Torvalds 已提交
1999 2000 2001 2002 2003 2004 2005 2006 2007
	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;
S
Sam Ravnborg 已提交
2008 2009 2010 2011 2012
}
/* %endif */

#ifndef YY_EXIT_FAILURE
#define YY_EXIT_FAILURE 2
L
Linus Torvalds 已提交
2013 2014
#endif

S
Sam Ravnborg 已提交
2015 2016 2017 2018 2019 2020 2021 2022 2023
/* %if-c-only */
static void yy_fatal_error (yyconst char* msg )
{
    	(void) fprintf( stderr, "%s\n", msg );
	exit( YY_EXIT_FAILURE );
}
/* %endif */
/* %if-c++-only */
/* %endif */
L
Linus Torvalds 已提交
2024

S
Sam Ravnborg 已提交
2025
/* Redefine yyless() so it works in section 3 code. */
L
Linus Torvalds 已提交
2026

S
Sam Ravnborg 已提交
2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040
#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 )
L
Linus Torvalds 已提交
2041

S
Sam Ravnborg 已提交
2042
/* Accessor  methods (get/set functions) to struct members. */
L
Linus Torvalds 已提交
2043

S
Sam Ravnborg 已提交
2044 2045 2046
/* %if-c-only */
/* %if-reentrant */
/* %endif */
L
Linus Torvalds 已提交
2047

S
Sam Ravnborg 已提交
2048 2049 2050 2051 2052 2053 2054 2055
/** Get the current line number.
 * 
 */
int yyget_lineno  (void)
{
        
    return yylineno;
}
L
Linus Torvalds 已提交
2056

S
Sam Ravnborg 已提交
2057 2058 2059 2060 2061 2062 2063
/** Get the input stream.
 * 
 */
FILE *yyget_in  (void)
{
        return yyin;
}
L
Linus Torvalds 已提交
2064

S
Sam Ravnborg 已提交
2065 2066 2067 2068 2069 2070 2071
/** Get the output stream.
 * 
 */
FILE *yyget_out  (void)
{
        return yyout;
}
L
Linus Torvalds 已提交
2072

S
Sam Ravnborg 已提交
2073 2074 2075 2076 2077 2078 2079
/** Get the length of the current token.
 * 
 */
int yyget_leng  (void)
{
        return yyleng;
}
L
Linus Torvalds 已提交
2080

S
Sam Ravnborg 已提交
2081 2082 2083
/** Get the current token.
 * 
 */
L
Linus Torvalds 已提交
2084

S
Sam Ravnborg 已提交
2085 2086 2087 2088
char *yyget_text  (void)
{
        return yytext;
}
L
Linus Torvalds 已提交
2089

S
Sam Ravnborg 已提交
2090 2091
/* %if-reentrant */
/* %endif */
L
Linus Torvalds 已提交
2092

S
Sam Ravnborg 已提交
2093 2094 2095 2096 2097 2098 2099 2100 2101
/** Set the current line number.
 * @param line_number
 * 
 */
void yyset_lineno (int  line_number )
{
    
    yylineno = line_number;
}
L
Linus Torvalds 已提交
2102

S
Sam Ravnborg 已提交
2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122
/** 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;
}
L
Linus Torvalds 已提交
2123

S
Sam Ravnborg 已提交
2124 2125 2126 2127 2128 2129 2130 2131 2132 2133
void yyset_debug (int  bdebug )
{
        yy_flex_debug = bdebug ;
}

/* %endif */

/* %if-reentrant */
/* %if-bison-bridge */
/* %endif */
2134
/* %endif if-c-only */
S
Sam Ravnborg 已提交
2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153

/* %if-c-only */
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) = 0;
    (yy_buffer_stack_top) = 0;
    (yy_buffer_stack_max) = 0;
    (yy_c_buf_p) = (char *) 0;
    (yy_init) = 0;
    (yy_start) = 0;

/* Defined in main.c */
#ifdef YY_STDINIT
    yyin = stdin;
    yyout = stdout;
L
Linus Torvalds 已提交
2154
#else
S
Sam Ravnborg 已提交
2155 2156
    yyin = (FILE *) 0;
    yyout = (FILE *) 0;
L
Linus Torvalds 已提交
2157
#endif
S
Sam Ravnborg 已提交
2158 2159 2160 2161 2162 2163 2164 2165

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

2166
/* %if-c-only SNIP! this currently causes conflicts with the c++ scanner */
S
Sam Ravnborg 已提交
2167 2168 2169 2170 2171 2172 2173 2174 2175
/* 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();
L
Linus Torvalds 已提交
2176 2177
	}

S
Sam Ravnborg 已提交
2178 2179 2180
	/* Destroy the stack itself. */
	yyfree((yy_buffer_stack) );
	(yy_buffer_stack) = NULL;
L
Linus Torvalds 已提交
2181

S
Sam Ravnborg 已提交
2182 2183 2184
    /* Reset the globals. This is important in a non-reentrant scanner so the next time
     * yylex() is called, initialization will occur. */
    yy_init_globals( );
L
Linus Torvalds 已提交
2185

S
Sam Ravnborg 已提交
2186 2187 2188 2189 2190
/* %if-reentrant */
/* %endif */
    return 0;
}
/* %endif */
L
Linus Torvalds 已提交
2191

S
Sam Ravnborg 已提交
2192 2193 2194
/*
 * Internal utility routines.
 */
L
Linus Torvalds 已提交
2195 2196

#ifndef yytext_ptr
S
Sam Ravnborg 已提交
2197 2198
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
{
L
Linus Torvalds 已提交
2199 2200 2201
	register int i;
	for ( i = 0; i < n; ++i )
		s1[i] = s2[i];
S
Sam Ravnborg 已提交
2202
}
L
Linus Torvalds 已提交
2203 2204 2205
#endif

#ifdef YY_NEED_STRLEN
S
Sam Ravnborg 已提交
2206 2207
static int yy_flex_strlen (yyconst char * s )
{
L
Linus Torvalds 已提交
2208 2209 2210 2211 2212
	register int n;
	for ( n = 0; s[n]; ++n )
		;

	return n;
S
Sam Ravnborg 已提交
2213
}
L
Linus Torvalds 已提交
2214 2215
#endif

S
Sam Ravnborg 已提交
2216 2217
void *yyalloc (yy_size_t  size )
{
L
Linus Torvalds 已提交
2218
	return (void *) malloc( size );
S
Sam Ravnborg 已提交
2219
}
L
Linus Torvalds 已提交
2220

S
Sam Ravnborg 已提交
2221 2222
void *yyrealloc  (void * ptr, yy_size_t  size )
{
L
Linus Torvalds 已提交
2223 2224 2225 2226 2227 2228 2229 2230
	/* 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 (void *) realloc( (char *) ptr, size );
S
Sam Ravnborg 已提交
2231
}
L
Linus Torvalds 已提交
2232

S
Sam Ravnborg 已提交
2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243
void yyfree (void * ptr )
{
	free( (char *) ptr );	/* see yyrealloc() for (char *) cast */
}

/* %if-tables-serialization definitions */
/* %define-yytables   The name for this specific scanner's tables. */
#define YYTABLES_NAME "yytables"
/* %endif */

/* %ok-for-header */
L
Linus Torvalds 已提交
2244

M
Michal Marek 已提交
2245
#line 93 "scripts/genksyms/lex.l"
L
Linus Torvalds 已提交
2246 2247


S
Sam Ravnborg 已提交
2248

L
Linus Torvalds 已提交
2249 2250 2251 2252 2253 2254 2255
/* Bring in the keyword recognizer.  */

#include "keywords.c"


/* Macros to append to our phrase collection list.  */

2256 2257 2258 2259 2260 2261 2262 2263 2264
/*
 * We mark any token, that that equals to a known enumerator, as
 * SYM_ENUM_CONST. The parser will change this for struct and union tags later,
 * the only problem is struct and union members:
 *    enum e { a, b }; struct s { int a, b; }
 * but in this case, the only effect will be, that the ABI checksums become
 * more volatile, which is acceptable. Also, such collisions are quite rare,
 * so far it was only observed in include/linux/telephony.h.
 */
L
Linus Torvalds 已提交
2265 2266 2267 2268 2269
#define _APP(T,L)	do {						   \
			  cur_node = next_node;				   \
			  next_node = xmalloc(sizeof(*next_node));	   \
			  next_node->next = cur_node;			   \
			  cur_node->string = memcpy(xmalloc(L+1), T, L+1); \
2270 2271 2272
			  cur_node->tag =				   \
			    find_symbol(cur_node->string, SYM_ENUM_CONST, 1)?\
			    SYM_ENUM_CONST : SYM_NORMAL ;		   \
L
Linus Torvalds 已提交
2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350
			} while (0)

#define APP		_APP(yytext, yyleng)


/* The second stage lexer.  Here we incorporate knowledge of the state
   of the parser to tailor the tokens that are returned.  */

int
yylex(void)
{
  static enum {
    ST_NOTSTARTED, ST_NORMAL, ST_ATTRIBUTE, ST_ASM, ST_BRACKET, ST_BRACE,
    ST_EXPRESSION, ST_TABLE_1, ST_TABLE_2, ST_TABLE_3, ST_TABLE_4,
    ST_TABLE_5, ST_TABLE_6
  } lexstate = ST_NOTSTARTED;

  static int suppress_type_lookup, dont_want_brace_phrase;
  static struct string_list *next_node;

  int token, count = 0;
  struct string_list *cur_node;

  if (lexstate == ST_NOTSTARTED)
    {
      next_node = xmalloc(sizeof(*next_node));
      next_node->next = NULL;
      lexstate = ST_NORMAL;
    }

repeat:
  token = yylex1();

  if (token == 0)
    return 0;
  else if (token == FILENAME)
    {
      char *file, *e;

      /* Save the filename and line number for later error messages.  */

      if (cur_filename)
	free(cur_filename);

      file = strchr(yytext, '\"')+1;
      e = strchr(file, '\"');
      *e = '\0';
      cur_filename = memcpy(xmalloc(e-file+1), file, e-file+1);
      cur_line = atoi(yytext+2);

      goto repeat;
    }

  switch (lexstate)
    {
    case ST_NORMAL:
      switch (token)
	{
	case IDENT:
	  APP;
	  {
	    const struct resword *r = is_reserved_word(yytext, yyleng);
	    if (r)
	      {
		switch (token = r->token)
		  {
		  case ATTRIBUTE_KEYW:
		    lexstate = ST_ATTRIBUTE;
		    count = 0;
		    goto repeat;
		  case ASM_KEYW:
		    lexstate = ST_ASM;
		    count = 0;
		    goto repeat;

		  case STRUCT_KEYW:
		  case UNION_KEYW:
		  case ENUM_KEYW:
2351
		    dont_want_brace_phrase = 3;
L
Linus Torvalds 已提交
2352 2353 2354 2355 2356 2357 2358 2359 2360
		    suppress_type_lookup = 2;
		    goto fini;

		  case EXPORT_SYMBOL_KEYW:
		      goto fini;
		  }
	      }
	    if (!suppress_type_lookup)
	      {
2361
		if (find_symbol(yytext, SYM_TYPEDEF, 1))
L
Linus Torvalds 已提交
2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479
		  token = TYPE;
	      }
	  }
	  break;

	case '[':
	  APP;
	  lexstate = ST_BRACKET;
	  count = 1;
	  goto repeat;

	case '{':
	  APP;
	  if (dont_want_brace_phrase)
	    break;
	  lexstate = ST_BRACE;
	  count = 1;
	  goto repeat;

	case '=': case ':':
	  APP;
	  lexstate = ST_EXPRESSION;
	  break;

	case DOTS:
	default:
	  APP;
	  break;
	}
      break;

    case ST_ATTRIBUTE:
      APP;
      switch (token)
	{
	case '(':
	  ++count;
	  goto repeat;
	case ')':
	  if (--count == 0)
	    {
	      lexstate = ST_NORMAL;
	      token = ATTRIBUTE_PHRASE;
	      break;
	    }
	  goto repeat;
	default:
	  goto repeat;
	}
      break;

    case ST_ASM:
      APP;
      switch (token)
	{
	case '(':
	  ++count;
	  goto repeat;
	case ')':
	  if (--count == 0)
	    {
	      lexstate = ST_NORMAL;
	      token = ASM_PHRASE;
	      break;
	    }
	  goto repeat;
	default:
	  goto repeat;
	}
      break;

    case ST_BRACKET:
      APP;
      switch (token)
	{
	case '[':
	  ++count;
	  goto repeat;
	case ']':
	  if (--count == 0)
	    {
	      lexstate = ST_NORMAL;
	      token = BRACKET_PHRASE;
	      break;
	    }
	  goto repeat;
	default:
	  goto repeat;
	}
      break;

    case ST_BRACE:
      APP;
      switch (token)
	{
	case '{':
	  ++count;
	  goto repeat;
	case '}':
	  if (--count == 0)
	    {
	      lexstate = ST_NORMAL;
	      token = BRACE_PHRASE;
	      break;
	    }
	  goto repeat;
	default:
	  goto repeat;
	}
      break;

    case ST_EXPRESSION:
      switch (token)
	{
	case '(': case '[': case '{':
	  ++count;
	  APP;
	  goto repeat;
2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493
	case '}':
	  /* is this the last line of an enum declaration? */
	  if (count == 0)
	    {
	      /* Put back the token we just read so's we can find it again
		 after registering the expression.  */
	      unput(token);

	      lexstate = ST_NORMAL;
	      token = EXPRESSION_PHRASE;
	      break;
	    }
	  /* FALLTHRU */
	case ')': case ']':
L
Linus Torvalds 已提交
2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568
	  --count;
	  APP;
	  goto repeat;
	case ',': case ';':
	  if (count == 0)
	    {
	      /* Put back the token we just read so's we can find it again
		 after registering the expression.  */
	      unput(token);

	      lexstate = ST_NORMAL;
	      token = EXPRESSION_PHRASE;
	      break;
	    }
	  APP;
	  goto repeat;
	default:
	  APP;
	  goto repeat;
	}
      break;

    case ST_TABLE_1:
      goto repeat;

    case ST_TABLE_2:
      if (token == IDENT && yyleng == 1 && yytext[0] == 'X')
	{
	  token = EXPORT_SYMBOL_KEYW;
	  lexstate = ST_TABLE_5;
	  APP;
	  break;
	}
      lexstate = ST_TABLE_6;
      /* FALLTHRU */

    case ST_TABLE_6:
      switch (token)
	{
	case '{': case '[': case '(':
	  ++count;
	  break;
	case '}': case ']': case ')':
	  --count;
	  break;
	case ',':
	  if (count == 0)
	    lexstate = ST_TABLE_2;
	  break;
	};
      goto repeat;

    case ST_TABLE_3:
      goto repeat;

    case ST_TABLE_4:
      if (token == ';')
	lexstate = ST_NORMAL;
      goto repeat;

    case ST_TABLE_5:
      switch (token)
	{
	case ',':
	  token = ';';
	  lexstate = ST_TABLE_2;
	  APP;
	  break;
	default:
	  APP;
	  break;
	}
      break;

    default:
2569
      exit(1);
L
Linus Torvalds 已提交
2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581
    }
fini:

  if (suppress_type_lookup > 0)
    --suppress_type_lookup;
  if (dont_want_brace_phrase > 0)
    --dont_want_brace_phrase;

  yylval = &next_node->next;

  return token;
}
2582