GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: sbin/wsconsctl/map_scan.c Lines: 0 319 0.0 %
Date: 2017-11-07 Branches: 0 229 0.0 %

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