source: heimdal/trunk/lib/hx509/sel-lex.c@ 4

Last change on this file since 4 was 4, checked in by Paul Smedley, 10 years ago

heimdal: applied os2 patches, added conf.cmd

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