1 #line 2 "cfg.yy.c"
2 /* A lexical scanner generated by flex */
3
4 /* Scanner skeleton version:
5 * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
6 */
7
8 #define FLEX_SCANNER
9 #define YY_FLEX_MAJOR_VERSION 2
10 #define YY_FLEX_MINOR_VERSION 5
11
12 #include <stdio.h>
13
14
15 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
16 #ifdef c_plusplus
17 #ifndef __cplusplus
18 #define __cplusplus
19 #endif
20 #endif
21
22
23 #ifdef __cplusplus
24
25 #include <stdlib.h>
26 #include <unistd.h>
27
28 /* Use prototypes in function declarations. */
29 #define YY_USE_PROTOS
30
31 /* The "const" storage-class-modifier is valid. */
32 #define YY_USE_CONST
33
34 #else /* ! __cplusplus */
35
36 #if __STDC__
37
38 #define YY_USE_PROTOS
39 #define YY_USE_CONST
40
41 #endif /* __STDC__ */
42 #endif /* ! __cplusplus */
43
44 #ifdef __TURBOC__
45 #pragma warn -rch
46 #pragma warn -use
47 #include <io.h>
48 #include <stdlib.h>
49 #define YY_USE_CONST
50 #define YY_USE_PROTOS
51 #endif
52
53 #ifdef YY_USE_CONST
54 #define yyconst const
55 #else
56 #define yyconst
57 #endif
58
59
60 #ifdef YY_USE_PROTOS
61 #define YY_PROTO(proto) proto
62 #else
63 #define YY_PROTO(proto) ()
64 #endif
65
66 /* Returned upon end-of-file. */
67 #define YY_NULL 0
68
69 /* Promotes a possibly negative, possibly signed char to an unsigned
70 * integer for use as an array index. If the signed char is negative,
71 * we want to instead treat it as an 8-bit unsigned char, hence the
72 * double cast.
73 */
74 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
75
76 /* Enter a start condition. This macro really ought to take a parameter,
77 * but we do it the disgusting crufty way forced on us by the ()-less
78 * definition of BEGIN.
79 */
80 #define BEGIN yy_start = 1 + 2 *
81
82 /* Translate the current start state into a value that can be later handed
83 * to BEGIN to return to the state. The YYSTATE alias is for lex
84 * compatibility.
85 */
86 #define YY_START ((yy_start - 1) / 2)
87 #define YYSTATE YY_START
88
89 /* Action number for EOF rule of a given start state. */
90 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
91
92 /* Special action meaning "start processing a new file". */
93 #define YY_NEW_FILE yyrestart( yyin )
94
95 #define YY_END_OF_BUFFER_CHAR 0
96
97 /* Size of default input buffer. */
98 #define YY_BUF_SIZE 16384
99
100 typedef struct yy_buffer_state *YY_BUFFER_STATE;
101
102 extern int yyleng;
103 extern FILE *yyin, *yyout;
104
105 #define EOB_ACT_CONTINUE_SCAN 0
106 #define EOB_ACT_END_OF_FILE 1
107 #define EOB_ACT_LAST_MATCH 2
108
109 /* The funky do-while in the following #define is used to turn the definition
110 * int a single C statement (which needs a semi-colon terminator). This
111 * avoids problems with code like:
112 *
113 * if ( condition_holds )
114 * yyless( 5 );
115 * else
116 * do_something_else();
117 *
118 * Prior to using the do-while the compiler would get upset at the
119 * "else" because it interpreted the "if" statement as being all
120 * done when it reached the ';' after the yyless() call.
121 */
122
123 /* Return all but the first 'n' matched characters back to the input stream. */
124
125 #define yyless(n) \
126 do \
127 { \
128 /* Undo effects of setting up yytext. */ \
129 *yy_cp = yy_hold_char; \
130 YY_RESTORE_YY_MORE_OFFSET \
131 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
132 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
133 } \
134 while ( 0 )
135
136 #define unput(c) yyunput( c, yytext_ptr )
137
138 /* The following is because we cannot portably get our hands on size_t
139 * (without autoconf's help, which isn't available because we want
140 * flex-generated scanners to compile on their own).
141 */
142 typedef unsigned int yy_size_t;
143
144
145 struct yy_buffer_state
146 {
147 FILE *yy_input_file;
148
149 char *yy_ch_buf; /* input buffer */
150 char *yy_buf_pos; /* current position in input buffer */
151
152 /* Size of input buffer in bytes, not including room for EOB
153 * characters.
154 */
155 yy_size_t yy_buf_size;
156
157 /* Number of characters read into yy_ch_buf, not including EOB
158 * characters.
159 */
160 int yy_n_chars;
161
162 /* Whether we "own" the buffer - i.e., we know we created it,
163 * and can realloc() it to grow it, and should free() it to
164 * delete it.
165 */
166 int yy_is_our_buffer;
167
168 /* Whether this is an "interactive" input source; if so, and
169 * if we're using stdio for input, then we want to use getc()
170 * instead of fread(), to make sure we stop fetching input after
171 * each newline.
172 */
173 int yy_is_interactive;
174
175 /* Whether we're considered to be at the beginning of a line.
176 * If so, '^' rules will be active on the next match, otherwise
177 * not.
178 */
179 int yy_at_bol;
180
181 /* Whether to try to fill the input buffer when we reach the
182 * end of it.
183 */
184 int yy_fill_buffer;
185
186 int yy_buffer_status;
187 #define YY_BUFFER_NEW 0
188 #define YY_BUFFER_NORMAL 1
189 /* When an EOF's been seen but there's still some text to process
190 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
191 * shouldn't try reading from the input source any more. We might
192 * still have a bunch of tokens to match, though, because of
193 * possible backing-up.
194 *
195 * When we actually see the EOF, we change the status to "new"
196 * (via yyrestart()), so that the user can continue scanning by
197 * just pointing yyin at a new input file.
198 */
199 #define YY_BUFFER_EOF_PENDING 2
200 };
201
202 static YY_BUFFER_STATE yy_current_buffer = 0;
203
204 /* We provide macros for accessing buffer states in case in the
205 * future we want to put the buffer states in a more general
206 * "scanner state".
207 */
208 #define YY_CURRENT_BUFFER yy_current_buffer
209
210
211 /* yy_hold_char holds the character lost when yytext is formed. */
212 static char yy_hold_char;
213
214 static int yy_n_chars; /* number of characters read into yy_ch_buf */
215
216
217 int yyleng;
218
219 /* Points to current character in buffer. */
220 static char *yy_c_buf_p = (char *) 0;
221 static int yy_init = 1; /* whether we need to initialize */
222 static int yy_start = 0; /* start state number */
223
224 /* Flag which is used to allow yywrap()'s to do buffer switches
225 * instead of setting up a fresh yyin. A bit of a hack ...
226 */
227 static int yy_did_buffer_switch_on_eof;
228
229 void yyrestart YY_PROTO(( FILE *input_file ));
230
231 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
232 void yy_load_buffer_state YY_PROTO(( void ));
233 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
234 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
235 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
236 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
237 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
238
239 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
240 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
241 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
242
243 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
244 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
245 static void yy_flex_free YY_PROTO(( void * ));
246
247 #define yy_new_buffer yy_create_buffer
248
249 #define yy_set_interactive(is_interactive) \
250 { \
251 if ( ! yy_current_buffer ) \
252 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
253 yy_current_buffer->yy_is_interactive = is_interactive; \
254 }
255
256 #define yy_set_bol(at_bol) \
257 { \
258 if ( ! yy_current_buffer ) \
259 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
260 yy_current_buffer->yy_at_bol = at_bol; \
261 }
262
263 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
264
265
266 #define yywrap() 1
267 #define YY_SKIP_YYWRAP
268 typedef unsigned char YY_CHAR;
269 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
270 typedef int yy_state_type;
271 extern char *yytext;
272 #define yytext_ptr yytext
273
274 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
275 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
276 static int yy_get_next_buffer YY_PROTO(( void ));
277 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
278
279 /* Done after the current pattern has been matched and before the
280 * corresponding action - sets up yytext.
281 */
282 #define YY_DO_BEFORE_ACTION \
283 yytext_ptr = yy_bp; \
284 yyleng = (int) (yy_cp - yy_bp); \
285 yy_hold_char = *yy_cp; \
286 *yy_cp = '\0'; \
287 yy_c_buf_p = yy_cp;
288
289 #define YY_NUM_RULES 28
290 #define YY_END_OF_BUFFER 29
291 static yyconst short int yy_accept[125] =
292 { 0,
293 0, 0, 29, 27, 25, 23, 24, 3, 22, 1,
294 27, 27, 27, 27, 5, 27, 27, 26, 4, 25,
295 24, 0, 3, 0, 0, 0, 0, 0, 0, 0,
296 0, 5, 0, 0, 4, 0, 0, 0, 0, 0,
297 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,
298 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
299 0, 0, 0, 9, 0, 0, 0, 0, 0, 0,
300 0, 7, 0, 0, 18, 0, 0, 0, 0, 0,
301 0, 0, 0, 21, 0, 0, 0, 0, 0, 0,
302 0, 0, 8, 0, 0, 0, 0, 0, 17, 16,
303
304 0, 0, 0, 0, 20, 6, 19, 0, 0, 14,
305 0, 0, 0, 15, 0, 0, 11, 12, 0, 10,
306 0, 0, 13, 0
307 } ;
308
309 static yyconst int yy_ec[256] =
310 { 0,
311 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
312 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
313 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
314 1, 2, 1, 1, 4, 1, 1, 1, 1, 1,
315 1, 1, 1, 1, 1, 5, 1, 6, 6, 6,
316 6, 6, 6, 6, 6, 6, 6, 1, 7, 1,
317 8, 1, 1, 1, 10, 11, 12, 13, 14, 15,
318 1, 16, 17, 1, 18, 19, 20, 21, 22, 23,
319 24, 25, 26, 27, 1, 28, 1, 29, 30, 1,
320 1, 1, 1, 1, 9, 1, 10, 11, 12, 13,
321
322 14, 15, 1, 16, 17, 1, 18, 19, 20, 21,
323 22, 23, 24, 25, 26, 27, 1, 28, 1, 29,
324 30, 1, 1, 1, 1, 1, 1, 1, 1, 1,
325 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
326 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
327 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
328 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
329 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
330 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
331 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
332
333 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
334 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
335 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
336 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
337 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
338 1, 1, 1, 1, 1
339 } ;
340
341 static yyconst int yy_meta[31] =
342 { 0,
343 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
344 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
345 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
346 } ;
347
348 static yyconst short int yy_base[126] =
349 { 0,
350 0, 0, 141, 142, 138, 142, 0, 26, 142, 142,
351 125, 127, 22, 24, 13, 21, 40, 142, 123, 134,
352 0, 129, 33, 108, 107, 109, 108, 100, 112, 99,
353 114, 142, 109, 110, 142, 101, 98, 99, 91, 103,
354 93, 112, 100, 102, 93, 92, 92, 86, 102, 96,
355 96, 86, 96, 84, 84, 78, 78, 75, 76, 75,
356 87, 81, 31, 142, 80, 71, 73, 69, 81, 75,
357 77, 142, 78, 77, 142, 77, 65, 71, 70, 74,
358 71, 56, 69, 142, 69, 66, 62, 61, 57, 48,
359 49, 48, 142, 56, 57, 54, 50, 58, 142, 142,
360
361 51, 52, 49, 48, 142, 142, 142, 47, 32, 142,
362 39, 33, 32, 142, 38, 34, 142, 142, 24, 142,
363 31, 19, 142, 142, 39
364 } ;
365
366 static yyconst short int yy_def[126] =
367 { 0,
368 124, 1, 124, 124, 124, 124, 125, 124, 124, 124,
369 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
370 125, 124, 124, 124, 124, 124, 124, 124, 124, 124,
371 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
372 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
373 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
374 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
375 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
376 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
377 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
378
379 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
380 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
381 124, 124, 124, 0, 124
382 } ;
383
384 static yyconst short int yy_nxt[173] =
385 { 0,
386 4, 5, 6, 7, 4, 8, 9, 10, 4, 4,
387 4, 4, 11, 4, 12, 13, 4, 4, 4, 14,
388 15, 16, 4, 4, 4, 4, 4, 17, 18, 19,
389 22, 23, 26, 30, 32, 34, 27, 22, 23, 21,
390 33, 35, 123, 77, 122, 31, 78, 28, 121, 29,
391 36, 120, 119, 37, 38, 118, 117, 116, 79, 115,
392 114, 113, 112, 111, 110, 39, 109, 40, 108, 107,
393 106, 105, 104, 103, 102, 101, 100, 99, 98, 97,
394 96, 95, 94, 93, 92, 91, 90, 89, 88, 87,
395 86, 85, 84, 83, 82, 81, 80, 76, 75, 74,
396
397 73, 72, 71, 70, 69, 68, 67, 66, 65, 64,
398 63, 62, 61, 60, 59, 58, 57, 42, 35, 56,
399 55, 54, 53, 52, 32, 51, 50, 49, 48, 47,
400 46, 45, 44, 43, 42, 20, 41, 25, 24, 20,
401 124, 3, 124, 124, 124, 124, 124, 124, 124, 124,
402 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
403 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
404 124, 124
405 } ;
406
407 static yyconst short int yy_chk[173] =
408 { 0,
409 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
410 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
411 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
412 8, 8, 13, 14, 15, 16, 13, 23, 23, 125,
413 15, 16, 122, 63, 121, 14, 63, 13, 119, 13,
414 17, 116, 115, 17, 17, 113, 112, 111, 63, 109,
415 108, 104, 103, 102, 101, 17, 98, 17, 97, 96,
416 95, 94, 92, 91, 90, 89, 88, 87, 86, 85,
417 83, 82, 81, 80, 79, 78, 77, 76, 74, 73,
418 71, 70, 69, 68, 67, 66, 65, 62, 61, 60,
419
420 59, 58, 57, 56, 55, 54, 53, 52, 51, 50,
421 49, 48, 47, 46, 45, 44, 43, 42, 41, 40,
422 39, 38, 37, 36, 34, 33, 31, 30, 29, 28,
423 27, 26, 25, 24, 22, 20, 19, 12, 11, 5,
424 3, 124, 124, 124, 124, 124, 124, 124, 124, 124,
425 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
426 124, 124, 124, 124, 124, 124, 124, 124, 124, 124,
427 124, 124
428 } ;
429
430 static yy_state_type yy_last_accepting_state;
431 static char *yy_last_accepting_cpos;
432
433 /* The intent behind this definition is that it'll catch
434 * any uses of REJECT which flex missed.
435 */
436 #define REJECT reject_used_but_not_detected
437 #define yymore() yymore_used_but_not_detected
438 #define YY_MORE_ADJ 0
439 #define YY_RESTORE_YY_MORE_OFFSET
440 char *yytext;
441 #line 1 "cfg.l"
442 #define INITIAL 0
443 #line 2 "cfg.l"
444
445 /*
446 * +-------------------------------------------------------+
447 * | |
448 * | videogen |
449 * | |
450 * | a simple XFree86 Modeline calculator |
451 * | (c) 1997-2003, Szabolcs Rumi |
452 * | |
453 * | http://www.dynaweb.hu/opensource/videogen |
454 * | |
455 * | the videogen package is distributed under the |
456 * | GNU General Public License Version 2 (GPLv2) |
457 * | |
458 * +-------------------------------------------------------+
459 */
460
461
462
463
464
465 /* this should be generated as a case insensitive lexer */
466
467
468 #include <stdlib.h>
469
470 #include "config.h"
471 #include "videogen.h"
472 #include "cfg.tab.h"
473
474
475
476 unsigned int lexer_num_lines = 1; /* start line counting from 1 */
477
478
479
480 #line 481 "cfg.yy.c"
481
482 /* Macros after this point can all be overridden by user definitions in
483 * section 1.
484 */
485
486 #ifndef YY_SKIP_YYWRAP
487 #ifdef __cplusplus
488 extern "C" int yywrap YY_PROTO(( void ));
489 #else
490 extern int yywrap YY_PROTO(( void ));
491 #endif
492 #endif
493
494 #ifndef YY_NO_UNPUT
495 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
496 #endif
497
498 #ifndef yytext_ptr
499 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
500 #endif
501
502 #ifdef YY_NEED_STRLEN
503 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
504 #endif
505
506 #ifndef YY_NO_INPUT
507 #ifdef __cplusplus
508 static int yyinput YY_PROTO(( void ));
509 #else
510 static int input YY_PROTO(( void ));
511 #endif
512 #endif
513
514 #if YY_STACK_USED
515 static int yy_start_stack_ptr = 0;
516 static int yy_start_stack_depth = 0;
517 static int *yy_start_stack = 0;
518 #ifndef YY_NO_PUSH_STATE
519 static void yy_push_state YY_PROTO(( int new_state ));
520 #endif
521 #ifndef YY_NO_POP_STATE
522 static void yy_pop_state YY_PROTO(( void ));
523 #endif
524 #ifndef YY_NO_TOP_STATE
525 static int yy_top_state YY_PROTO(( void ));
526 #endif
527
528 #else
529 #define YY_NO_PUSH_STATE 1
530 #define YY_NO_POP_STATE 1
531 #define YY_NO_TOP_STATE 1
532 #endif
533
534 #ifdef YY_MALLOC_DECL
535 YY_MALLOC_DECL
536 #else
537 #if __STDC__
538 #ifndef __cplusplus
539 #include <stdlib.h>
540 #endif
541 #else
542 /* Just try to get by without declaring the routines. This will fail
543 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
544 * or sizeof(void*) != sizeof(int).
545 */
546 #endif
547 #endif
548
549 /* Amount of stuff to slurp up with each read. */
550 #ifndef YY_READ_BUF_SIZE
551 #define YY_READ_BUF_SIZE 8192
552 #endif
553
554 /* Copy whatever the last rule matched to the standard output. */
555
556 #ifndef ECHO
557 /* This used to be an fputs(), but since the string might contain NUL's,
558 * we now use fwrite().
559 */
560 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
561 #endif
562
563 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
564 * is returned in "result".
565 */
566 #ifndef YY_INPUT
567 #define YY_INPUT(buf,result,max_size) \
568 if ( yy_current_buffer->yy_is_interactive ) \
569 { \
570 int c = '*', n; \
571 for ( n = 0; n < max_size && \
572 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
573 buf[n] = (char) c; \
574 if ( c == '\n' ) \
575 buf[n++] = (char) c; \
576 if ( c == EOF && ferror( yyin ) ) \
577 YY_FATAL_ERROR( "input in flex scanner failed" ); \
578 result = n; \
579 } \
580 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
581 && ferror( yyin ) ) \
582 YY_FATAL_ERROR( "input in flex scanner failed" );
583 #endif
584
585 /* No semi-colon after return; correct usage is to write "yyterminate();" -
586 * we don't want an extra ';' after the "return" because that will cause
587 * some compilers to complain about unreachable statements.
588 */
589 #ifndef yyterminate
590 #define yyterminate() return YY_NULL
591 #endif
592
593 /* Number of entries by which start-condition stack grows. */
594 #ifndef YY_START_STACK_INCR
595 #define YY_START_STACK_INCR 25
596 #endif
597
598 /* Report a fatal error. */
599 #ifndef YY_FATAL_ERROR
600 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
601 #endif
602
603 /* Default declaration of generated scanner - a define so the user can
604 * easily add parameters.
605 */
606 #ifndef YY_DECL
607 #define YY_DECL int yylex YY_PROTO(( void ))
608 #endif
609
610 /* Code executed at the beginning of each rule, after yytext and yyleng
611 * have been set up.
612 */
613 #ifndef YY_USER_ACTION
614 #define YY_USER_ACTION
615 #endif
616
617 /* Code executed at the end of each rule. */
618 #ifndef YY_BREAK
619 #define YY_BREAK break;
620 #endif
621
622 #define YY_RULE_SETUP \
623 YY_USER_ACTION
624
625 YY_DECL
626 {
627 register yy_state_type yy_current_state;
628 register char *yy_cp, *yy_bp;
629 register int yy_act;
630
631 #line 47 "cfg.l"
632
633
634
635
636 #line 637 "cfg.yy.c"
637
638 if ( yy_init )
639 {
640 yy_init = 0;
641
642 #ifdef YY_USER_INIT
643 YY_USER_INIT;
644 #endif
645
646 if ( ! yy_start )
647 yy_start = 1; /* first start state */
648
649 if ( ! yyin )
650 yyin = stdin;
651
652 if ( ! yyout )
653 yyout = stdout;
654
655 if ( ! yy_current_buffer )
656 yy_current_buffer =
657 yy_create_buffer( yyin, YY_BUF_SIZE );
658
659 yy_load_buffer_state();
660 }
661
662 while ( 1 ) /* loops until end-of-file is reached */
663 {
664 yy_cp = yy_c_buf_p;
665
666 /* Support of yytext. */
667 *yy_cp = yy_hold_char;
668
669 /* yy_bp points to the position in yy_ch_buf of the start of
670 * the current run.
671 */
672 yy_bp = yy_cp;
673
674 yy_current_state = yy_start;
675 yy_match:
676 do
677 {
678 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
679 if ( yy_accept[yy_current_state] )
680 {
681 yy_last_accepting_state = yy_current_state;
682 yy_last_accepting_cpos = yy_cp;
683 }
684 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
685 {
686 yy_current_state = (int) yy_def[yy_current_state];
687 if ( yy_current_state >= 125 )
688 yy_c = yy_meta[(unsigned int) yy_c];
689 }
690 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
691 ++yy_cp;
692 }
693 while ( yy_base[yy_current_state] != 142 );
694
695 yy_find_action:
696 yy_act = yy_accept[yy_current_state];
697 if ( yy_act == 0 )
698 { /* have to back up */
699 yy_cp = yy_last_accepting_cpos;
700 yy_current_state = yy_last_accepting_state;
701 yy_act = yy_accept[yy_current_state];
702 }
703
704 YY_DO_BEFORE_ACTION;
705
706
707 do_action: /* This label is used only to access EOF actions. */
708
709
710 switch ( yy_act )
711 { /* beginning of action switch */
712 case 0: /* must back up */
713 /* undo the effects of YY_DO_BEFORE_ACTION */
714 *yy_cp = yy_hold_char;
715 yy_cp = yy_last_accepting_cpos;
716 yy_current_state = yy_last_accepting_state;
717 goto yy_find_action;
718
719 case 1:
720 YY_RULE_SETUP
721 #line 51 "cfg.l"
722 { return ('='); }
723 YY_BREAK
724 case 2:
725 YY_RULE_SETUP
726 #line 53 "cfg.l"
727 { yylval.fval = atof (yytext);
728 return (T_FLOAT); }
729 YY_BREAK
730 case 3:
731 YY_RULE_SETUP
732 #line 56 "cfg.l"
733 { yylval.ival = atol (yytext);
734 return (T_INTEGER); }
735 YY_BREAK
736 case 4:
737 YY_RULE_SETUP
738 #line 59 "cfg.l"
739 { yylval.bval = 1;
740 return (T_BOOLEAN); }
741 YY_BREAK
742 case 5:
743 YY_RULE_SETUP
744 #line 62 "cfg.l"
745 { yylval.bval = 0;
746 return (T_BOOLEAN); }
747 YY_BREAK
748 case 6:
749 YY_RULE_SETUP
750 #line 65 "cfg.l"
751 { return (T_VERBOSE); }
752 YY_BREAK
753 case 7:
754 YY_RULE_SETUP
755 #line 67 "cfg.l"
756 { return (T_FBSET); }
757 YY_BREAK
758 case 8:
759 YY_RULE_SETUP
760 #line 69 "cfg.l"
761 { return (T_NVIDIA); }
762 YY_BREAK
763 case 9:
764 YY_RULE_SETUP
765 #line 71 "cfg.l"
766 { return (T_MODE); }
767 YY_BREAK
768 case 10:
769 YY_RULE_SETUP
770 #line 73 "cfg.l"
771 { return (T_MAX_DOTCLK); }
772 YY_BREAK
773 case 11:
774 YY_RULE_SETUP
775 #line 75 "cfg.l"
776 { return (T_MAX_HFREQ); }
777 YY_BREAK
778 case 12:
779 YY_RULE_SETUP
780 #line 77 "cfg.l"
781 { return (T_MAX_VFREQ); }
782 YY_BREAK
783 case 13:
784 YY_RULE_SETUP
785 #line 79 "cfg.l"
786 { return (T_DESIRED_VFREQ); }
787 YY_BREAK
788 case 14:
789 YY_RULE_SETUP
790 #line 81 "cfg.l"
791 { return (T_HVISIBLE); }
792 YY_BREAK
793 case 15:
794 YY_RULE_SETUP
795 #line 83 "cfg.l"
796 { return (T_VVISIBLE); }
797 YY_BREAK
798 case 16:
799 YY_RULE_SETUP
800 #line 85 "cfg.l"
801 { return (T_HFPORCH); }
802 YY_BREAK
803 case 17:
804 YY_RULE_SETUP
805 #line 87 "cfg.l"
806 { return (T_HBPORCH); }
807 YY_BREAK
808 case 18:
809 YY_RULE_SETUP
810 #line 89 "cfg.l"
811 { return (T_HSYNC); }
812 YY_BREAK
813 case 19:
814 YY_RULE_SETUP
815 #line 91 "cfg.l"
816 { return (T_VFPORCH); }
817 YY_BREAK
818 case 20:
819 YY_RULE_SETUP
820 #line 93 "cfg.l"
821 { return (T_VBPORCH); }
822 YY_BREAK
823 case 21:
824 YY_RULE_SETUP
825 #line 95 "cfg.l"
826 { return (T_VSYNC); }
827 YY_BREAK
828 case 22:
829 YY_RULE_SETUP
830 #line 97 "cfg.l"
831 { return (';'); }
832 YY_BREAK
833 case 23:
834 YY_RULE_SETUP
835 #line 99 "cfg.l"
836 { lexer_num_lines++;
837 return ('\n'); }
838 YY_BREAK
839 case 24:
840 YY_RULE_SETUP
841 #line 102 "cfg.l"
842 /* eat up shell-style comments */
843 YY_BREAK
844 case 25:
845 YY_RULE_SETUP
846 #line 104 "cfg.l"
847 /* eat up blanks */
848 YY_BREAK
849 case 26:
850 YY_RULE_SETUP
851 #line 106 "cfg.l"
852 { return ('x'); }
853 YY_BREAK
854 case 27:
855 YY_RULE_SETUP
856 #line 108 "cfg.l"
857 {
858 pmsg(VL_DEBUG, "[lexer] unrecognized character: %s\n", yytext );
859 }
860 YY_BREAK
861 case 28:
862 YY_RULE_SETUP
863 #line 114 "cfg.l"
864 ECHO;
865 YY_BREAK
866 #line 867 "cfg.yy.c"
867 case YY_STATE_EOF(INITIAL):
868 yyterminate();
869
870 case YY_END_OF_BUFFER:
871 {
872 /* Amount of text matched not including the EOB char. */
873 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
874
875 /* Undo the effects of YY_DO_BEFORE_ACTION. */
876 *yy_cp = yy_hold_char;
877 YY_RESTORE_YY_MORE_OFFSET
878
879 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
880 {
881 /* We're scanning a new file or input source. It's
882 * possible that this happened because the user
883 * just pointed yyin at a new source and called
884 * yylex(). If so, then we have to assure
885 * consistency between yy_current_buffer and our
886 * globals. Here is the right place to do so, because
887 * this is the first action (other than possibly a
888 * back-up) that will match for the new input source.
889 */
890 yy_n_chars = yy_current_buffer->yy_n_chars;
891 yy_current_buffer->yy_input_file = yyin;
892 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
893 }
894
895 /* Note that here we test for yy_c_buf_p "<=" to the position
896 * of the first EOB in the buffer, since yy_c_buf_p will
897 * already have been incremented past the NUL character
898 * (since all states make transitions on EOB to the
899 * end-of-buffer state). Contrast this with the test
900 * in input().
901 */
902 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
903 { /* This was really a NUL. */
904 yy_state_type yy_next_state;
905
906 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
907
908 yy_current_state = yy_get_previous_state();
909
910 /* Okay, we're now positioned to make the NUL
911 * transition. We couldn't have
912 * yy_get_previous_state() go ahead and do it
913 * for us because it doesn't know how to deal
914 * with the possibility of jamming (and we don't
915 * want to build jamming into it because then it
916 * will run more slowly).
917 */
918
919 yy_next_state = yy_try_NUL_trans( yy_current_state );
920
921 yy_bp = yytext_ptr + YY_MORE_ADJ;
922
923 if ( yy_next_state )
924 {
925 /* Consume the NUL. */
926 yy_cp = ++yy_c_buf_p;
927 yy_current_state = yy_next_state;
928 goto yy_match;
929 }
930
931 else
932 {
933 yy_cp = yy_c_buf_p;
934 goto yy_find_action;
935 }
936 }
937
938 else switch ( yy_get_next_buffer() )
939 {
940 case EOB_ACT_END_OF_FILE:
941 {
942 yy_did_buffer_switch_on_eof = 0;
943
944 if ( yywrap() )
945 {
946 /* Note: because we've taken care in
947 * yy_get_next_buffer() to have set up
948 * yytext, we can now set up
949 * yy_c_buf_p so that if some total
950 * hoser (like flex itself) wants to
951 * call the scanner after we return the
952 * YY_NULL, it'll still work - another
953 * YY_NULL will get returned.
954 */
955 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
956
957 yy_act = YY_STATE_EOF(YY_START);
958 goto do_action;
959 }
960
961 else
962 {
963 if ( ! yy_did_buffer_switch_on_eof )
964 YY_NEW_FILE;
965 }
966 break;
967 }
968
969 case EOB_ACT_CONTINUE_SCAN:
970 yy_c_buf_p =
971 yytext_ptr + yy_amount_of_matched_text;
972
973 yy_current_state = yy_get_previous_state();
974
975 yy_cp = yy_c_buf_p;
976 yy_bp = yytext_ptr + YY_MORE_ADJ;
977 goto yy_match;
978
979 case EOB_ACT_LAST_MATCH:
980 yy_c_buf_p =
981 &yy_current_buffer->yy_ch_buf[yy_n_chars];
982
983 yy_current_state = yy_get_previous_state();
984
985 yy_cp = yy_c_buf_p;
986 yy_bp = yytext_ptr + YY_MORE_ADJ;
987 goto yy_find_action;
988 }
989 break;
990 }
991
992 default:
993 YY_FATAL_ERROR(
994 "fatal flex scanner internal error--no action found" );
995 } /* end of action switch */
996 } /* end of scanning one token */
997 } /* end of yylex */
998
999
1000 /* yy_get_next_buffer - try to read in a new buffer
1001 *
1002 * Returns a code representing an action:
1003 * EOB_ACT_LAST_MATCH -
1004 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
1005 * EOB_ACT_END_OF_FILE - end of file
1006 */
1007
yy_get_next_buffer()1008 static int yy_get_next_buffer()
1009 {
1010 register char *dest = yy_current_buffer->yy_ch_buf;
1011 register char *source = yytext_ptr;
1012 register int number_to_move, i;
1013 int ret_val;
1014
1015 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
1016 YY_FATAL_ERROR(
1017 "fatal flex scanner internal error--end of buffer missed" );
1018
1019 if ( yy_current_buffer->yy_fill_buffer == 0 )
1020 { /* Don't try to fill the buffer, so this is an EOF. */
1021 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
1022 {
1023 /* We matched a single character, the EOB, so
1024 * treat this as a final EOF.
1025 */
1026 return EOB_ACT_END_OF_FILE;
1027 }
1028
1029 else
1030 {
1031 /* We matched some text prior to the EOB, first
1032 * process it.
1033 */
1034 return EOB_ACT_LAST_MATCH;
1035 }
1036 }
1037
1038 /* Try to read more data. */
1039
1040 /* First move last chars to start of buffer. */
1041 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
1042
1043 for ( i = 0; i < number_to_move; ++i )
1044 *(dest++) = *(source++);
1045
1046 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
1047 /* don't do the read, it's not guaranteed to return an EOF,
1048 * just force an EOF
1049 */
1050 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
1051
1052 else
1053 {
1054 int num_to_read =
1055 yy_current_buffer->yy_buf_size - number_to_move - 1;
1056
1057 while ( num_to_read <= 0 )
1058 { /* Not enough room in the buffer - grow it. */
1059 #ifdef YY_USES_REJECT
1060 YY_FATAL_ERROR(
1061 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
1062 #else
1063
1064 /* just a shorter name for the current buffer */
1065 YY_BUFFER_STATE b = yy_current_buffer;
1066
1067 int yy_c_buf_p_offset =
1068 (int) (yy_c_buf_p - b->yy_ch_buf);
1069
1070 if ( b->yy_is_our_buffer )
1071 {
1072 int new_size = b->yy_buf_size * 2;
1073
1074 if ( new_size <= 0 )
1075 b->yy_buf_size += b->yy_buf_size / 8;
1076 else
1077 b->yy_buf_size *= 2;
1078
1079 b->yy_ch_buf = (char *)
1080 /* Include room in for 2 EOB chars. */
1081 yy_flex_realloc( (void *) b->yy_ch_buf,
1082 b->yy_buf_size + 2 );
1083 }
1084 else
1085 /* Can't grow it, we don't own it. */
1086 b->yy_ch_buf = 0;
1087
1088 if ( ! b->yy_ch_buf )
1089 YY_FATAL_ERROR(
1090 "fatal error - scanner input buffer overflow" );
1091
1092 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
1093
1094 num_to_read = yy_current_buffer->yy_buf_size -
1095 number_to_move - 1;
1096 #endif
1097 }
1098
1099 if ( num_to_read > YY_READ_BUF_SIZE )
1100 num_to_read = YY_READ_BUF_SIZE;
1101
1102 /* Read in more data. */
1103 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
1104 yy_n_chars, num_to_read );
1105
1106 yy_current_buffer->yy_n_chars = yy_n_chars;
1107 }
1108
1109 if ( yy_n_chars == 0 )
1110 {
1111 if ( number_to_move == YY_MORE_ADJ )
1112 {
1113 ret_val = EOB_ACT_END_OF_FILE;
1114 yyrestart( yyin );
1115 }
1116
1117 else
1118 {
1119 ret_val = EOB_ACT_LAST_MATCH;
1120 yy_current_buffer->yy_buffer_status =
1121 YY_BUFFER_EOF_PENDING;
1122 }
1123 }
1124
1125 else
1126 ret_val = EOB_ACT_CONTINUE_SCAN;
1127
1128 yy_n_chars += number_to_move;
1129 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1130 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1131
1132 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1133
1134 return ret_val;
1135 }
1136
1137
1138 /* yy_get_previous_state - get the state just before the EOB char was reached */
1139
yy_get_previous_state()1140 static yy_state_type yy_get_previous_state()
1141 {
1142 register yy_state_type yy_current_state;
1143 register char *yy_cp;
1144
1145 yy_current_state = yy_start;
1146
1147 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1148 {
1149 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1150 if ( yy_accept[yy_current_state] )
1151 {
1152 yy_last_accepting_state = yy_current_state;
1153 yy_last_accepting_cpos = yy_cp;
1154 }
1155 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1156 {
1157 yy_current_state = (int) yy_def[yy_current_state];
1158 if ( yy_current_state >= 125 )
1159 yy_c = yy_meta[(unsigned int) yy_c];
1160 }
1161 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1162 }
1163
1164 return yy_current_state;
1165 }
1166
1167
1168 /* yy_try_NUL_trans - try to make a transition on the NUL character
1169 *
1170 * synopsis
1171 * next_state = yy_try_NUL_trans( current_state );
1172 */
1173
1174 #ifdef YY_USE_PROTOS
yy_try_NUL_trans(yy_state_type yy_current_state)1175 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1176 #else
1177 static yy_state_type yy_try_NUL_trans( yy_current_state )
1178 yy_state_type yy_current_state;
1179 #endif
1180 {
1181 register int yy_is_jam;
1182 register char *yy_cp = yy_c_buf_p;
1183
1184 register YY_CHAR yy_c = 1;
1185 if ( yy_accept[yy_current_state] )
1186 {
1187 yy_last_accepting_state = yy_current_state;
1188 yy_last_accepting_cpos = yy_cp;
1189 }
1190 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1191 {
1192 yy_current_state = (int) yy_def[yy_current_state];
1193 if ( yy_current_state >= 125 )
1194 yy_c = yy_meta[(unsigned int) yy_c];
1195 }
1196 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1197 yy_is_jam = (yy_current_state == 124);
1198
1199 return yy_is_jam ? 0 : yy_current_state;
1200 }
1201
1202
1203 #ifndef YY_NO_UNPUT
1204 #ifdef YY_USE_PROTOS
yyunput(int c,register char * yy_bp)1205 static void yyunput( int c, register char *yy_bp )
1206 #else
1207 static void yyunput( c, yy_bp )
1208 int c;
1209 register char *yy_bp;
1210 #endif
1211 {
1212 register char *yy_cp = yy_c_buf_p;
1213
1214 /* undo effects of setting up yytext */
1215 *yy_cp = yy_hold_char;
1216
1217 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1218 { /* need to shift things up to make room */
1219 /* +2 for EOB chars. */
1220 register int number_to_move = yy_n_chars + 2;
1221 register char *dest = &yy_current_buffer->yy_ch_buf[
1222 yy_current_buffer->yy_buf_size + 2];
1223 register char *source =
1224 &yy_current_buffer->yy_ch_buf[number_to_move];
1225
1226 while ( source > yy_current_buffer->yy_ch_buf )
1227 *--dest = *--source;
1228
1229 yy_cp += (int) (dest - source);
1230 yy_bp += (int) (dest - source);
1231 yy_current_buffer->yy_n_chars =
1232 yy_n_chars = yy_current_buffer->yy_buf_size;
1233
1234 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1235 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1236 }
1237
1238 *--yy_cp = (char) c;
1239
1240
1241 yytext_ptr = yy_bp;
1242 yy_hold_char = *yy_cp;
1243 yy_c_buf_p = yy_cp;
1244 }
1245 #endif /* ifndef YY_NO_UNPUT */
1246
1247
1248 #ifdef __cplusplus
yyinput()1249 static int yyinput()
1250 #else
1251 static int input()
1252 #endif
1253 {
1254 int c;
1255
1256 *yy_c_buf_p = yy_hold_char;
1257
1258 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1259 {
1260 /* yy_c_buf_p now points to the character we want to return.
1261 * If this occurs *before* the EOB characters, then it's a
1262 * valid NUL; if not, then we've hit the end of the buffer.
1263 */
1264 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1265 /* This was really a NUL. */
1266 *yy_c_buf_p = '\0';
1267
1268 else
1269 { /* need more input */
1270 int offset = yy_c_buf_p - yytext_ptr;
1271 ++yy_c_buf_p;
1272
1273 switch ( yy_get_next_buffer() )
1274 {
1275 case EOB_ACT_LAST_MATCH:
1276 /* This happens because yy_g_n_b()
1277 * sees that we've accumulated a
1278 * token and flags that we need to
1279 * try matching the token before
1280 * proceeding. But for input(),
1281 * there's no matching to consider.
1282 * So convert the EOB_ACT_LAST_MATCH
1283 * to EOB_ACT_END_OF_FILE.
1284 */
1285
1286 /* Reset buffer status. */
1287 yyrestart( yyin );
1288
1289 /* fall through */
1290
1291 case EOB_ACT_END_OF_FILE:
1292 {
1293 if ( yywrap() )
1294 return EOF;
1295
1296 if ( ! yy_did_buffer_switch_on_eof )
1297 YY_NEW_FILE;
1298 #ifdef __cplusplus
1299 return yyinput();
1300 #else
1301 return input();
1302 #endif
1303 }
1304
1305 case EOB_ACT_CONTINUE_SCAN:
1306 yy_c_buf_p = yytext_ptr + offset;
1307 break;
1308 }
1309 }
1310 }
1311
1312 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1313 *yy_c_buf_p = '\0'; /* preserve yytext */
1314 yy_hold_char = *++yy_c_buf_p;
1315
1316
1317 return c;
1318 }
1319
1320
1321 #ifdef YY_USE_PROTOS
yyrestart(FILE * input_file)1322 void yyrestart( FILE *input_file )
1323 #else
1324 void yyrestart( input_file )
1325 FILE *input_file;
1326 #endif
1327 {
1328 if ( ! yy_current_buffer )
1329 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1330
1331 yy_init_buffer( yy_current_buffer, input_file );
1332 yy_load_buffer_state();
1333 }
1334
1335
1336 #ifdef YY_USE_PROTOS
yy_switch_to_buffer(YY_BUFFER_STATE new_buffer)1337 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1338 #else
1339 void yy_switch_to_buffer( new_buffer )
1340 YY_BUFFER_STATE new_buffer;
1341 #endif
1342 {
1343 if ( yy_current_buffer == new_buffer )
1344 return;
1345
1346 if ( yy_current_buffer )
1347 {
1348 /* Flush out information for old buffer. */
1349 *yy_c_buf_p = yy_hold_char;
1350 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1351 yy_current_buffer->yy_n_chars = yy_n_chars;
1352 }
1353
1354 yy_current_buffer = new_buffer;
1355 yy_load_buffer_state();
1356
1357 /* We don't actually know whether we did this switch during
1358 * EOF (yywrap()) processing, but the only time this flag
1359 * is looked at is after yywrap() is called, so it's safe
1360 * to go ahead and always set it.
1361 */
1362 yy_did_buffer_switch_on_eof = 1;
1363 }
1364
1365
1366 #ifdef YY_USE_PROTOS
yy_load_buffer_state(void)1367 void yy_load_buffer_state( void )
1368 #else
1369 void yy_load_buffer_state()
1370 #endif
1371 {
1372 yy_n_chars = yy_current_buffer->yy_n_chars;
1373 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1374 yyin = yy_current_buffer->yy_input_file;
1375 yy_hold_char = *yy_c_buf_p;
1376 }
1377
1378
1379 #ifdef YY_USE_PROTOS
yy_create_buffer(FILE * file,int size)1380 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1381 #else
1382 YY_BUFFER_STATE yy_create_buffer( file, size )
1383 FILE *file;
1384 int size;
1385 #endif
1386 {
1387 YY_BUFFER_STATE b;
1388
1389 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1390 if ( ! b )
1391 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1392
1393 b->yy_buf_size = size;
1394
1395 /* yy_ch_buf has to be 2 characters longer than the size given because
1396 * we need to put in 2 end-of-buffer characters.
1397 */
1398 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1399 if ( ! b->yy_ch_buf )
1400 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1401
1402 b->yy_is_our_buffer = 1;
1403
1404 yy_init_buffer( b, file );
1405
1406 return b;
1407 }
1408
1409
1410 #ifdef YY_USE_PROTOS
yy_delete_buffer(YY_BUFFER_STATE b)1411 void yy_delete_buffer( YY_BUFFER_STATE b )
1412 #else
1413 void yy_delete_buffer( b )
1414 YY_BUFFER_STATE b;
1415 #endif
1416 {
1417 if ( ! b )
1418 return;
1419
1420 if ( b == yy_current_buffer )
1421 yy_current_buffer = (YY_BUFFER_STATE) 0;
1422
1423 if ( b->yy_is_our_buffer )
1424 yy_flex_free( (void *) b->yy_ch_buf );
1425
1426 yy_flex_free( (void *) b );
1427 }
1428
1429
1430 #ifndef YY_ALWAYS_INTERACTIVE
1431 #ifndef YY_NEVER_INTERACTIVE
1432 extern int isatty YY_PROTO(( int ));
1433 #endif
1434 #endif
1435
1436 #ifdef YY_USE_PROTOS
yy_init_buffer(YY_BUFFER_STATE b,FILE * file)1437 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1438 #else
1439 void yy_init_buffer( b, file )
1440 YY_BUFFER_STATE b;
1441 FILE *file;
1442 #endif
1443
1444
1445 {
1446 yy_flush_buffer( b );
1447
1448 b->yy_input_file = file;
1449 b->yy_fill_buffer = 1;
1450
1451 #if YY_ALWAYS_INTERACTIVE
1452 b->yy_is_interactive = 1;
1453 #else
1454 #if YY_NEVER_INTERACTIVE
1455 b->yy_is_interactive = 0;
1456 #else
1457 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1458 #endif
1459 #endif
1460 }
1461
1462
1463 #ifdef YY_USE_PROTOS
yy_flush_buffer(YY_BUFFER_STATE b)1464 void yy_flush_buffer( YY_BUFFER_STATE b )
1465 #else
1466 void yy_flush_buffer( b )
1467 YY_BUFFER_STATE b;
1468 #endif
1469
1470 {
1471 if ( ! b )
1472 return;
1473
1474 b->yy_n_chars = 0;
1475
1476 /* We always need two end-of-buffer characters. The first causes
1477 * a transition to the end-of-buffer state. The second causes
1478 * a jam in that state.
1479 */
1480 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1481 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1482
1483 b->yy_buf_pos = &b->yy_ch_buf[0];
1484
1485 b->yy_at_bol = 1;
1486 b->yy_buffer_status = YY_BUFFER_NEW;
1487
1488 if ( b == yy_current_buffer )
1489 yy_load_buffer_state();
1490 }
1491
1492
1493 #ifndef YY_NO_SCAN_BUFFER
1494 #ifdef YY_USE_PROTOS
yy_scan_buffer(char * base,yy_size_t size)1495 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1496 #else
1497 YY_BUFFER_STATE yy_scan_buffer( base, size )
1498 char *base;
1499 yy_size_t size;
1500 #endif
1501 {
1502 YY_BUFFER_STATE b;
1503
1504 if ( size < 2 ||
1505 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1506 base[size-1] != YY_END_OF_BUFFER_CHAR )
1507 /* They forgot to leave room for the EOB's. */
1508 return 0;
1509
1510 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1511 if ( ! b )
1512 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1513
1514 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1515 b->yy_buf_pos = b->yy_ch_buf = base;
1516 b->yy_is_our_buffer = 0;
1517 b->yy_input_file = 0;
1518 b->yy_n_chars = b->yy_buf_size;
1519 b->yy_is_interactive = 0;
1520 b->yy_at_bol = 1;
1521 b->yy_fill_buffer = 0;
1522 b->yy_buffer_status = YY_BUFFER_NEW;
1523
1524 yy_switch_to_buffer( b );
1525
1526 return b;
1527 }
1528 #endif
1529
1530
1531 #ifndef YY_NO_SCAN_STRING
1532 #ifdef YY_USE_PROTOS
yy_scan_string(yyconst char * yy_str)1533 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1534 #else
1535 YY_BUFFER_STATE yy_scan_string( yy_str )
1536 yyconst char *yy_str;
1537 #endif
1538 {
1539 int len;
1540 for ( len = 0; yy_str[len]; ++len )
1541 ;
1542
1543 return yy_scan_bytes( yy_str, len );
1544 }
1545 #endif
1546
1547
1548 #ifndef YY_NO_SCAN_BYTES
1549 #ifdef YY_USE_PROTOS
yy_scan_bytes(yyconst char * bytes,int len)1550 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1551 #else
1552 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1553 yyconst char *bytes;
1554 int len;
1555 #endif
1556 {
1557 YY_BUFFER_STATE b;
1558 char *buf;
1559 yy_size_t n;
1560 int i;
1561
1562 /* Get memory for full buffer, including space for trailing EOB's. */
1563 n = len + 2;
1564 buf = (char *) yy_flex_alloc( n );
1565 if ( ! buf )
1566 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1567
1568 for ( i = 0; i < len; ++i )
1569 buf[i] = bytes[i];
1570
1571 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1572
1573 b = yy_scan_buffer( buf, n );
1574 if ( ! b )
1575 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1576
1577 /* It's okay to grow etc. this buffer, and we should throw it
1578 * away when we're done.
1579 */
1580 b->yy_is_our_buffer = 1;
1581
1582 return b;
1583 }
1584 #endif
1585
1586
1587 #ifndef YY_NO_PUSH_STATE
1588 #ifdef YY_USE_PROTOS
yy_push_state(int new_state)1589 static void yy_push_state( int new_state )
1590 #else
1591 static void yy_push_state( new_state )
1592 int new_state;
1593 #endif
1594 {
1595 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1596 {
1597 yy_size_t new_size;
1598
1599 yy_start_stack_depth += YY_START_STACK_INCR;
1600 new_size = yy_start_stack_depth * sizeof( int );
1601
1602 if ( ! yy_start_stack )
1603 yy_start_stack = (int *) yy_flex_alloc( new_size );
1604
1605 else
1606 yy_start_stack = (int *) yy_flex_realloc(
1607 (void *) yy_start_stack, new_size );
1608
1609 if ( ! yy_start_stack )
1610 YY_FATAL_ERROR(
1611 "out of memory expanding start-condition stack" );
1612 }
1613
1614 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1615
1616 BEGIN(new_state);
1617 }
1618 #endif
1619
1620
1621 #ifndef YY_NO_POP_STATE
yy_pop_state()1622 static void yy_pop_state()
1623 {
1624 if ( --yy_start_stack_ptr < 0 )
1625 YY_FATAL_ERROR( "start-condition stack underflow" );
1626
1627 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1628 }
1629 #endif
1630
1631
1632 #ifndef YY_NO_TOP_STATE
yy_top_state()1633 static int yy_top_state()
1634 {
1635 return yy_start_stack[yy_start_stack_ptr - 1];
1636 }
1637 #endif
1638
1639 #ifndef YY_EXIT_FAILURE
1640 #define YY_EXIT_FAILURE 2
1641 #endif
1642
1643 #ifdef YY_USE_PROTOS
yy_fatal_error(yyconst char msg[])1644 static void yy_fatal_error( yyconst char msg[] )
1645 #else
1646 static void yy_fatal_error( msg )
1647 char msg[];
1648 #endif
1649 {
1650 (void) fprintf( stderr, "%s\n", msg );
1651 exit( YY_EXIT_FAILURE );
1652 }
1653
1654
1655
1656 /* Redefine yyless() so it works in section 3 code. */
1657
1658 #undef yyless
1659 #define yyless(n) \
1660 do \
1661 { \
1662 /* Undo effects of setting up yytext. */ \
1663 yytext[yyleng] = yy_hold_char; \
1664 yy_c_buf_p = yytext + n; \
1665 yy_hold_char = *yy_c_buf_p; \
1666 *yy_c_buf_p = '\0'; \
1667 yyleng = n; \
1668 } \
1669 while ( 0 )
1670
1671
1672 /* Internal utility routines. */
1673
1674 #ifndef yytext_ptr
1675 #ifdef YY_USE_PROTOS
yy_flex_strncpy(char * s1,yyconst char * s2,int n)1676 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1677 #else
1678 static void yy_flex_strncpy( s1, s2, n )
1679 char *s1;
1680 yyconst char *s2;
1681 int n;
1682 #endif
1683 {
1684 register int i;
1685 for ( i = 0; i < n; ++i )
1686 s1[i] = s2[i];
1687 }
1688 #endif
1689
1690 #ifdef YY_NEED_STRLEN
1691 #ifdef YY_USE_PROTOS
yy_flex_strlen(yyconst char * s)1692 static int yy_flex_strlen( yyconst char *s )
1693 #else
1694 static int yy_flex_strlen( s )
1695 yyconst char *s;
1696 #endif
1697 {
1698 register int n;
1699 for ( n = 0; s[n]; ++n )
1700 ;
1701
1702 return n;
1703 }
1704 #endif
1705
1706
1707 #ifdef YY_USE_PROTOS
yy_flex_alloc(yy_size_t size)1708 static void *yy_flex_alloc( yy_size_t size )
1709 #else
1710 static void *yy_flex_alloc( size )
1711 yy_size_t size;
1712 #endif
1713 {
1714 return (void *) malloc( size );
1715 }
1716
1717 #ifdef YY_USE_PROTOS
yy_flex_realloc(void * ptr,yy_size_t size)1718 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1719 #else
1720 static void *yy_flex_realloc( ptr, size )
1721 void *ptr;
1722 yy_size_t size;
1723 #endif
1724 {
1725 /* The cast to (char *) in the following accommodates both
1726 * implementations that use char* generic pointers, and those
1727 * that use void* generic pointers. It works with the latter
1728 * because both ANSI C and C++ allow castless assignment from
1729 * any pointer type to void*, and deal with argument conversions
1730 * as though doing an assignment.
1731 */
1732 return (void *) realloc( (char *) ptr, size );
1733 }
1734
1735 #ifdef YY_USE_PROTOS
yy_flex_free(void * ptr)1736 static void yy_flex_free( void *ptr )
1737 #else
1738 static void yy_flex_free( ptr )
1739 void *ptr;
1740 #endif
1741 {
1742 free( ptr );
1743 }
1744
1745 #if YY_MAIN
main()1746 int main()
1747 {
1748 yylex();
1749 return 0;
1750 }
1751 #endif
1752 #line 114 "cfg.l"
1753
1754
1755
1756
1757 /* EOF */
1758