nss: import at 3.0.1 beta 1
[mozilla-nss.git] / security / nss / cmd / modutil / lex.Pk11Install_yy.c
bloba651f1891d798e58af39f2b917dedb49b81a9772
1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 * The contents of this file are subject to the Mozilla Public License Version
5 * 1.1 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/MPL/
9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 * for the specific language governing rights and limitations under the
12 * License.
14 * The Original Code is the Netscape security libraries.
16 * The Initial Developer of the Original Code is
17 * Netscape Communications Corporation.
18 * Portions created by the Initial Developer are Copyright (C) 1994-2000
19 * the Initial Developer. All Rights Reserved.
21 * Contributor(s):
23 * Alternatively, the contents of this file may be used under the terms of
24 * either the GNU General Public License Version 2 or later (the "GPL"), or
25 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
26 * in which case the provisions of the GPL or the LGPL are applicable instead
27 * of those above. If you wish to allow use of your version of this file only
28 * under the terms of either the GPL or the LGPL, and not to allow others to
29 * use your version of this file under the terms of the MPL, indicate your
30 * decision by deleting the provisions above and replace them with the notice
31 * and other provisions required by the GPL or the LGPL. If you do not delete
32 * the provisions above, a recipient may use your version of this file under
33 * the terms of any one of the MPL, the GPL or the LGPL.
35 * ***** END LICENSE BLOCK ***** */
37 #define yy_create_buffer Pk11Install_yy_create_buffer
38 #define yy_delete_buffer Pk11Install_yy_delete_buffer
39 #define yy_scan_buffer Pk11Install_yy_scan_buffer
40 #define yy_scan_string Pk11Install_yy_scan_string
41 #define yy_scan_bytes Pk11Install_yy_scan_bytes
42 #define yy_flex_debug Pk11Install_yy_flex_debug
43 #define yy_init_buffer Pk11Install_yy_init_buffer
44 #define yy_flush_buffer Pk11Install_yy_flush_buffer
45 #define yy_load_buffer_state Pk11Install_yy_load_buffer_state
46 #define yy_switch_to_buffer Pk11Install_yy_switch_to_buffer
47 #define yyin Pk11Install_yyin
48 #define yyleng Pk11Install_yyleng
49 #define yylex Pk11Install_yylex
50 #define yyout Pk11Install_yyout
51 #define yyrestart Pk11Install_yyrestart
52 #define yytext Pk11Install_yytext
53 #define yywrap Pk11Install_yywrap
55 #line 20 "lex.Pk11Install_yy.c"
56 /* A lexical scanner generated by flex */
58 /* Scanner skeleton version:
59 * $Header: /cvsroot/mozilla/security/nss/cmd/modutil/lex.Pk11Install_yy.c,v 1.2 2004/04/25 15:02:47 gerv%gerv.net Exp $
62 #define FLEX_SCANNER
63 #define YY_FLEX_MAJOR_VERSION 2
64 #define YY_FLEX_MINOR_VERSION 5
66 #include <stdio.h>
69 /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
70 #ifdef c_plusplus
71 #ifndef __cplusplus
72 #define __cplusplus
73 #endif
74 #endif
77 #ifdef __cplusplus
79 #include <stdlib.h>
80 //#include <unistd.h>
82 /* Use prototypes in function declarations. */
83 #define YY_USE_PROTOS
85 /* The "const" storage-class-modifier is valid. */
86 #define YY_USE_CONST
88 #else /* ! __cplusplus */
90 #if __STDC__
92 #define YY_USE_PROTOS
93 #define YY_USE_CONST
95 #endif /* __STDC__ */
96 #endif /* ! __cplusplus */
98 #ifdef __TURBOC__
99 #pragma warn -rch
100 #pragma warn -use
101 #include <io.h>
102 #include <stdlib.h>
103 #define YY_USE_CONST
104 #define YY_USE_PROTOS
105 #endif
107 #ifdef YY_USE_CONST
108 #define yyconst const
109 #else
110 #define yyconst
111 #endif
114 #ifdef YY_USE_PROTOS
115 #define YY_PROTO(proto) proto
116 #else
117 #define YY_PROTO(proto) ()
118 #endif
120 /* Returned upon end-of-file. */
121 #define YY_NULL 0
123 /* Promotes a possibly negative, possibly signed char to an unsigned
124 * integer for use as an array index. If the signed char is negative,
125 * we want to instead treat it as an 8-bit unsigned char, hence the
126 * double cast.
128 #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
130 /* Enter a start condition. This macro really ought to take a parameter,
131 * but we do it the disgusting crufty way forced on us by the ()-less
132 * definition of BEGIN.
134 #define BEGIN yy_start = 1 + 2 *
136 /* Translate the current start state into a value that can be later handed
137 * to BEGIN to return to the state. The YYSTATE alias is for lex
138 * compatibility.
140 #define YY_START ((yy_start - 1) / 2)
141 #define YYSTATE YY_START
143 /* Action number for EOF rule of a given start state. */
144 #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
146 /* Special action meaning "start processing a new file". */
147 #define YY_NEW_FILE yyrestart( yyin )
149 #define YY_END_OF_BUFFER_CHAR 0
151 /* Size of default input buffer. */
152 #define YY_BUF_SIZE 16384
154 typedef struct yy_buffer_state *YY_BUFFER_STATE;
156 extern int yyleng;
157 extern FILE *yyin, *yyout;
159 #define EOB_ACT_CONTINUE_SCAN 0
160 #define EOB_ACT_END_OF_FILE 1
161 #define EOB_ACT_LAST_MATCH 2
163 /* The funky do-while in the following #define is used to turn the definition
164 * int a single C statement (which needs a semi-colon terminator). This
165 * avoids problems with code like:
167 * if ( condition_holds )
168 * yyless( 5 );
169 * else
170 * do_something_else();
172 * Prior to using the do-while the compiler would get upset at the
173 * "else" because it interpreted the "if" statement as being all
174 * done when it reached the ';' after the yyless() call.
177 /* Return all but the first 'n' matched characters back to the input stream. */
179 #define yyless(n) \
180 do \
182 /* Undo effects of setting up yytext. */ \
183 *yy_cp = yy_hold_char; \
184 YY_RESTORE_YY_MORE_OFFSET \
185 yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
186 YY_DO_BEFORE_ACTION; /* set up yytext again */ \
188 while ( 0 )
190 #define unput(c) yyunput( c, yytext_ptr )
192 /* The following is because we cannot portably get our hands on size_t
193 * (without autoconf's help, which isn't available because we want
194 * flex-generated scanners to compile on their own).
196 typedef unsigned int yy_size_t;
199 struct yy_buffer_state
201 FILE *yy_input_file;
203 char *yy_ch_buf; /* input buffer */
204 char *yy_buf_pos; /* current position in input buffer */
206 /* Size of input buffer in bytes, not including room for EOB
207 * characters.
209 yy_size_t yy_buf_size;
211 /* Number of characters read into yy_ch_buf, not including EOB
212 * characters.
214 int yy_n_chars;
216 /* Whether we "own" the buffer - i.e., we know we created it,
217 * and can realloc() it to grow it, and should free() it to
218 * delete it.
220 int yy_is_our_buffer;
222 /* Whether this is an "interactive" input source; if so, and
223 * if we're using stdio for input, then we want to use getc()
224 * instead of fread(), to make sure we stop fetching input after
225 * each newline.
227 int yy_is_interactive;
229 /* Whether we're considered to be at the beginning of a line.
230 * If so, '^' rules will be active on the next match, otherwise
231 * not.
233 int yy_at_bol;
235 /* Whether to try to fill the input buffer when we reach the
236 * end of it.
238 int yy_fill_buffer;
240 int yy_buffer_status;
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.
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.
253 #define YY_BUFFER_EOF_PENDING 2
256 static YY_BUFFER_STATE yy_current_buffer = 0;
258 /* We provide macros for accessing buffer states in case in the
259 * future we want to put the buffer states in a more general
260 * "scanner state".
262 #define YY_CURRENT_BUFFER yy_current_buffer
265 /* yy_hold_char holds the character lost when yytext is formed. */
266 static char yy_hold_char;
268 static int yy_n_chars; /* number of characters read into yy_ch_buf */
271 int yyleng;
273 /* Points to current character in buffer. */
274 static char *yy_c_buf_p = (char *) 0;
275 static int yy_init = 1; /* whether we need to initialize */
276 static int yy_start = 0; /* start state number */
278 /* Flag which is used to allow yywrap()'s to do buffer switches
279 * instead of setting up a fresh yyin. A bit of a hack ...
281 static int yy_did_buffer_switch_on_eof;
283 void yyrestart YY_PROTO(( FILE *input_file ));
285 void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
286 void yy_load_buffer_state YY_PROTO(( void ));
287 YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
288 void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
289 void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
290 void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
291 #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
293 YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
294 YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
295 YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
297 static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
298 static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
299 static void yy_flex_free YY_PROTO(( void * ));
301 #define yy_new_buffer yy_create_buffer
303 #define yy_set_interactive(is_interactive) \
305 if ( ! yy_current_buffer ) \
306 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
307 yy_current_buffer->yy_is_interactive = is_interactive; \
310 #define yy_set_bol(at_bol) \
312 if ( ! yy_current_buffer ) \
313 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
314 yy_current_buffer->yy_at_bol = at_bol; \
317 #define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
319 typedef unsigned char YY_CHAR;
320 FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
321 typedef int yy_state_type;
322 extern char *yytext;
323 #define yytext_ptr yytext
325 static yy_state_type yy_get_previous_state YY_PROTO(( void ));
326 static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
327 static int yy_get_next_buffer YY_PROTO(( void ));
328 static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
330 /* Done after the current pattern has been matched and before the
331 * corresponding action - sets up yytext.
333 #define YY_DO_BEFORE_ACTION \
334 yytext_ptr = yy_bp; \
335 yyleng = (int) (yy_cp - yy_bp); \
336 yy_hold_char = *yy_cp; \
337 *yy_cp = '\0'; \
338 yy_c_buf_p = yy_cp;
340 #define YY_NUM_RULES 8
341 #define YY_END_OF_BUFFER 9
342 static yyconst short int yy_accept[16] =
343 { 0,
344 0, 0, 9, 3, 6, 5, 7, 1, 2, 3,
345 6, 0, 0, 4, 0
348 static yyconst int yy_ec[256] =
349 { 0,
350 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
351 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
352 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
353 1, 2, 1, 5, 1, 1, 1, 1, 1, 1,
354 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
355 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
356 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
357 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
358 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
359 1, 6, 1, 1, 1, 1, 1, 1, 1, 1,
361 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
362 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
363 1, 1, 7, 1, 8, 1, 1, 1, 1, 1,
364 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
365 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
366 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
367 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
368 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
369 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
370 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
372 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
373 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
374 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
375 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
376 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
377 1, 1, 1, 1, 1
380 static yyconst int yy_meta[9] =
381 { 0,
382 1, 2, 3, 4, 3, 1, 5, 5
385 static yyconst short int yy_base[19] =
386 { 0,
387 0, 0, 19, 0, 0, 21, 12, 21, 21, 0,
388 0, 4, 6, 21, 21, 13, 11, 15
391 static yyconst short int yy_def[19] =
392 { 0,
393 15, 1, 15, 16, 17, 15, 18, 15, 15, 16,
394 17, 18, 15, 15, 0, 15, 15, 15
397 static yyconst short int yy_nxt[30] =
398 { 0,
399 4, 5, 6, 5, 7, 4, 8, 9, 14, 13,
400 12, 12, 11, 10, 11, 12, 12, 13, 15, 12,
401 3, 15, 15, 15, 15, 15, 15, 15, 15
404 static yyconst short int yy_chk[30] =
405 { 0,
406 1, 1, 1, 1, 1, 1, 1, 1, 12, 12,
407 13, 13, 17, 16, 17, 18, 18, 7, 3, 18,
408 15, 15, 15, 15, 15, 15, 15, 15, 15
411 static yy_state_type yy_last_accepting_state;
412 static char *yy_last_accepting_cpos;
414 /* The intent behind this definition is that it'll catch
415 * any uses of REJECT which flex missed.
417 #define REJECT reject_used_but_not_detected
418 #define yymore() yymore_used_but_not_detected
419 #define YY_MORE_ADJ 0
420 #define YY_RESTORE_YY_MORE_OFFSET
421 char *yytext;
422 #line 1 "installparse.l"
423 #define INITIAL 0
424 /* lex file for analyzing PKCS #11 Module installation instructions */
425 /*----------------------------- Definitions ---------------------------*/
426 #line 5 "installparse.l"
427 #include <string.h>
429 #include "install-ds.h" /* defines tokens and data structures */
430 #include "installparse.h" /* produced by yacc -d */
431 #include <prprf.h>
432 static char *putSimpleString(char*); /* return copy of string */
433 static char *putComplexString(char*); /* strip out quotes, deal with */
434 /* escaped characters */
436 void Pk11Install_yyerror(char *);
438 /* Overrides to use NSPR */
439 #define malloc PR_Malloc
440 #define realloc PR_Realloc
441 #define free PR_Free
443 int Pk11Install_yylinenum=1;
444 static char *err;
446 #define YY_NEVER_INTERACTIVE 1
447 #define yyunput Pkcs11Install_yyunput
449 /* This is the default YY_INPUT modified for NSPR */
450 #define YY_INPUT(buf,result,max_size) \
451 if ( yy_current_buffer->yy_is_interactive ) { \
452 char c; \
453 int n; \
454 for ( n = 0; n < max_size && \
455 PR_Read(Pk11Install_FD, &c, 1)==1 && c != '\n'; ++n ) { \
456 buf[n] = c; \
458 if ( c == '\n' ) { \
459 buf[n++] = c; \
461 result = n; \
462 } else { \
463 result = PR_Read(Pk11Install_FD, buf, max_size); \
466 /*** Regular expression definitions ***/
467 /* simple_string has no whitespace, quotes, or braces */
468 /* complex_string is enclosed in quotes. Inside the quotes, quotes and
469 backslashes must be backslash-escaped. Otherwise, anything goes. */
470 /* Standard whitespace */
471 /*---------------------------- Actions --------------------------------*/
472 #line 437 "lex.Pk11Install_yy.cpp"
474 /* Macros after this point can all be overridden by user definitions in
475 * section 1.
478 #ifndef YY_SKIP_YYWRAP
479 #ifdef __cplusplus
480 extern "C" int yywrap YY_PROTO(( void ));
481 #else
482 extern int yywrap YY_PROTO(( void ));
483 #endif
484 #endif
486 #ifndef YY_NO_UNPUT
487 static void yyunput YY_PROTO(( int c, char *buf_ptr ));
488 #endif
490 #ifndef yytext_ptr
491 static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
492 #endif
494 #ifdef YY_NEED_STRLEN
495 static int yy_flex_strlen YY_PROTO(( yyconst char * ));
496 #endif
498 #ifndef YY_NO_INPUT
499 #ifdef __cplusplus
500 static int yyinput YY_PROTO(( void ));
501 #else
502 static int input YY_PROTO(( void ));
503 #endif
504 #endif
506 #if YY_STACK_USED
507 static int yy_start_stack_ptr = 0;
508 static int yy_start_stack_depth = 0;
509 static int *yy_start_stack = 0;
510 #ifndef YY_NO_PUSH_STATE
511 static void yy_push_state YY_PROTO(( int new_state ));
512 #endif
513 #ifndef YY_NO_POP_STATE
514 static void yy_pop_state YY_PROTO(( void ));
515 #endif
516 #ifndef YY_NO_TOP_STATE
517 static int yy_top_state YY_PROTO(( void ));
518 #endif
520 #else
521 #define YY_NO_PUSH_STATE 1
522 #define YY_NO_POP_STATE 1
523 #define YY_NO_TOP_STATE 1
524 #endif
526 #ifdef YY_MALLOC_DECL
527 YY_MALLOC_DECL
528 #else
529 #if __STDC__
530 #ifndef __cplusplus
531 #include <stdlib.h>
532 #endif
533 #else
534 /* Just try to get by without declaring the routines. This will fail
535 * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
536 * or sizeof(void*) != sizeof(int).
538 #endif
539 #endif
541 /* Amount of stuff to slurp up with each read. */
542 #ifndef YY_READ_BUF_SIZE
543 #define YY_READ_BUF_SIZE 8192
544 #endif
546 /* Copy whatever the last rule matched to the standard output. */
548 #ifndef ECHO
549 /* This used to be an fputs(), but since the string might contain NUL's,
550 * we now use fwrite().
552 #define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
553 #endif
555 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
556 * is returned in "result".
558 #ifndef YY_INPUT
559 #define YY_INPUT(buf,result,max_size) \
560 if ( yy_current_buffer->yy_is_interactive ) \
562 int c = '*', n; \
563 for ( n = 0; n < max_size && \
564 (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
565 buf[n] = (char) c; \
566 if ( c == '\n' ) \
567 buf[n++] = (char) c; \
568 if ( c == EOF && ferror( yyin ) ) \
569 YY_FATAL_ERROR( "input in flex scanner failed" ); \
570 result = n; \
572 else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
573 && ferror( yyin ) ) \
574 YY_FATAL_ERROR( "input in flex scanner failed" );
575 #endif
577 /* No semi-colon after return; correct usage is to write "yyterminate();" -
578 * we don't want an extra ';' after the "return" because that will cause
579 * some compilers to complain about unreachable statements.
581 #ifndef yyterminate
582 #define yyterminate() return YY_NULL
583 #endif
585 /* Number of entries by which start-condition stack grows. */
586 #ifndef YY_START_STACK_INCR
587 #define YY_START_STACK_INCR 25
588 #endif
590 /* Report a fatal error. */
591 #ifndef YY_FATAL_ERROR
592 #define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
593 #endif
595 /* Default declaration of generated scanner - a define so the user can
596 * easily add parameters.
598 #ifndef YY_DECL
599 #define YY_DECL int yylex YY_PROTO(( void ))
600 #endif
602 /* Code executed at the beginning of each rule, after yytext and yyleng
603 * have been set up.
605 #ifndef YY_USER_ACTION
606 #define YY_USER_ACTION
607 #endif
609 /* Code executed at the end of each rule. */
610 #ifndef YY_BREAK
611 #define YY_BREAK break;
612 #endif
614 #define YY_RULE_SETUP \
615 YY_USER_ACTION
617 YY_DECL
619 register yy_state_type yy_current_state;
620 register char *yy_cp, *yy_bp;
621 register int yy_act;
623 #line 60 "installparse.l"
626 #line 591 "lex.Pk11Install_yy.cpp"
628 if ( yy_init )
630 yy_init = 0;
632 #ifdef YY_USER_INIT
633 YY_USER_INIT;
634 #endif
636 if ( ! yy_start )
637 yy_start = 1; /* first start state */
639 if ( ! yyin )
640 yyin = stdin;
642 if ( ! yyout )
643 yyout = stdout;
645 if ( ! yy_current_buffer )
646 yy_current_buffer =
647 yy_create_buffer( yyin, YY_BUF_SIZE );
649 yy_load_buffer_state();
652 while ( 1 ) /* loops until end-of-file is reached */
654 yy_cp = yy_c_buf_p;
656 /* Support of yytext. */
657 *yy_cp = yy_hold_char;
659 /* yy_bp points to the position in yy_ch_buf of the start of
660 * the current run.
662 yy_bp = yy_cp;
664 yy_current_state = yy_start;
665 yy_match:
668 register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
669 if ( yy_accept[yy_current_state] )
671 yy_last_accepting_state = yy_current_state;
672 yy_last_accepting_cpos = yy_cp;
674 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
676 yy_current_state = (int) yy_def[yy_current_state];
677 if ( yy_current_state >= 16 )
678 yy_c = yy_meta[(unsigned int) yy_c];
680 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
681 ++yy_cp;
683 while ( yy_base[yy_current_state] != 21 );
685 yy_find_action:
686 yy_act = yy_accept[yy_current_state];
687 if ( yy_act == 0 )
688 { /* have to back up */
689 yy_cp = yy_last_accepting_cpos;
690 yy_current_state = yy_last_accepting_state;
691 yy_act = yy_accept[yy_current_state];
694 YY_DO_BEFORE_ACTION;
697 do_action: /* This label is used only to access EOF actions. */
700 switch ( yy_act )
701 { /* beginning of action switch */
702 case 0: /* must back up */
703 /* undo the effects of YY_DO_BEFORE_ACTION */
704 *yy_cp = yy_hold_char;
705 yy_cp = yy_last_accepting_cpos;
706 yy_current_state = yy_last_accepting_state;
707 goto yy_find_action;
709 case 1:
710 YY_RULE_SETUP
711 #line 62 "installparse.l"
712 return OPENBRACE;
713 YY_BREAK
714 case 2:
715 YY_RULE_SETUP
716 #line 63 "installparse.l"
717 return CLOSEBRACE;
718 YY_BREAK
719 case 3:
720 YY_RULE_SETUP
721 #line 64 "installparse.l"
722 {Pk11Install_yylval.string =
723 putSimpleString(Pk11Install_yytext);
724 return STRING;}
725 YY_BREAK
726 case 4:
727 YY_RULE_SETUP
728 #line 67 "installparse.l"
729 {Pk11Install_yylval.string =
730 putComplexString(Pk11Install_yytext);
731 return STRING;}
732 YY_BREAK
733 case 5:
734 YY_RULE_SETUP
735 #line 71 "installparse.l"
736 Pk11Install_yylinenum++;
737 YY_BREAK
738 case 6:
739 YY_RULE_SETUP
740 #line 73 "installparse.l"
742 YY_BREAK
743 case 7:
744 YY_RULE_SETUP
745 #line 75 "installparse.l"
746 {err = PR_smprintf("Invalid lexeme: %s",Pk11Install_yytext);
747 Pk11Install_yyerror(err);
748 PR_smprintf_free(err);
749 return 1;
751 YY_BREAK
752 case 8:
753 YY_RULE_SETUP
754 #line 81 "installparse.l"
755 ECHO;
756 YY_BREAK
757 #line 722 "lex.Pk11Install_yy.cpp"
758 case YY_STATE_EOF(INITIAL):
759 yyterminate();
761 case YY_END_OF_BUFFER:
763 /* Amount of text matched not including the EOB char. */
764 int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
766 /* Undo the effects of YY_DO_BEFORE_ACTION. */
767 *yy_cp = yy_hold_char;
768 YY_RESTORE_YY_MORE_OFFSET
770 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
772 /* We're scanning a new file or input source. It's
773 * possible that this happened because the user
774 * just pointed yyin at a new source and called
775 * yylex(). If so, then we have to assure
776 * consistency between yy_current_buffer and our
777 * globals. Here is the right place to do so, because
778 * this is the first action (other than possibly a
779 * back-up) that will match for the new input source.
781 yy_n_chars = yy_current_buffer->yy_n_chars;
782 yy_current_buffer->yy_input_file = yyin;
783 yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
786 /* Note that here we test for yy_c_buf_p "<=" to the position
787 * of the first EOB in the buffer, since yy_c_buf_p will
788 * already have been incremented past the NUL character
789 * (since all states make transitions on EOB to the
790 * end-of-buffer state). Contrast this with the test
791 * in input().
793 if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
794 { /* This was really a NUL. */
795 yy_state_type yy_next_state;
797 yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
799 yy_current_state = yy_get_previous_state();
801 /* Okay, we're now positioned to make the NUL
802 * transition. We couldn't have
803 * yy_get_previous_state() go ahead and do it
804 * for us because it doesn't know how to deal
805 * with the possibility of jamming (and we don't
806 * want to build jamming into it because then it
807 * will run more slowly).
810 yy_next_state = yy_try_NUL_trans( yy_current_state );
812 yy_bp = yytext_ptr + YY_MORE_ADJ;
814 if ( yy_next_state )
816 /* Consume the NUL. */
817 yy_cp = ++yy_c_buf_p;
818 yy_current_state = yy_next_state;
819 goto yy_match;
822 else
824 yy_cp = yy_c_buf_p;
825 goto yy_find_action;
829 else switch ( yy_get_next_buffer() )
831 case EOB_ACT_END_OF_FILE:
833 yy_did_buffer_switch_on_eof = 0;
835 if ( yywrap() )
837 /* Note: because we've taken care in
838 * yy_get_next_buffer() to have set up
839 * yytext, we can now set up
840 * yy_c_buf_p so that if some total
841 * hoser (like flex itself) wants to
842 * call the scanner after we return the
843 * YY_NULL, it'll still work - another
844 * YY_NULL will get returned.
846 yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
848 yy_act = YY_STATE_EOF(YY_START);
849 goto do_action;
852 else
854 if ( ! yy_did_buffer_switch_on_eof )
855 YY_NEW_FILE;
857 break;
860 case EOB_ACT_CONTINUE_SCAN:
861 yy_c_buf_p =
862 yytext_ptr + yy_amount_of_matched_text;
864 yy_current_state = yy_get_previous_state();
866 yy_cp = yy_c_buf_p;
867 yy_bp = yytext_ptr + YY_MORE_ADJ;
868 goto yy_match;
870 case EOB_ACT_LAST_MATCH:
871 yy_c_buf_p =
872 &yy_current_buffer->yy_ch_buf[yy_n_chars];
874 yy_current_state = yy_get_previous_state();
876 yy_cp = yy_c_buf_p;
877 yy_bp = yytext_ptr + YY_MORE_ADJ;
878 goto yy_find_action;
880 break;
883 default:
884 YY_FATAL_ERROR(
885 "fatal flex scanner internal error--no action found" );
886 } /* end of action switch */
887 } /* end of scanning one token */
888 } /* end of yylex */
891 /* yy_get_next_buffer - try to read in a new buffer
893 * Returns a code representing an action:
894 * EOB_ACT_LAST_MATCH -
895 * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
896 * EOB_ACT_END_OF_FILE - end of file
899 static int yy_get_next_buffer()
901 register char *dest = yy_current_buffer->yy_ch_buf;
902 register char *source = yytext_ptr;
903 register int number_to_move, i;
904 int ret_val;
906 if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
907 YY_FATAL_ERROR(
908 "fatal flex scanner internal error--end of buffer missed" );
910 if ( yy_current_buffer->yy_fill_buffer == 0 )
911 { /* Don't try to fill the buffer, so this is an EOF. */
912 if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
914 /* We matched a single character, the EOB, so
915 * treat this as a final EOF.
917 return EOB_ACT_END_OF_FILE;
920 else
922 /* We matched some text prior to the EOB, first
923 * process it.
925 return EOB_ACT_LAST_MATCH;
929 /* Try to read more data. */
931 /* First move last chars to start of buffer. */
932 number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
934 for ( i = 0; i < number_to_move; ++i )
935 *(dest++) = *(source++);
937 if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
938 /* don't do the read, it's not guaranteed to return an EOF,
939 * just force an EOF
941 yy_current_buffer->yy_n_chars = yy_n_chars = 0;
943 else
945 int num_to_read =
946 yy_current_buffer->yy_buf_size - number_to_move - 1;
948 while ( num_to_read <= 0 )
949 { /* Not enough room in the buffer - grow it. */
950 #ifdef YY_USES_REJECT
951 YY_FATAL_ERROR(
952 "input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
953 #else
955 /* just a shorter name for the current buffer */
956 YY_BUFFER_STATE b = yy_current_buffer;
958 int yy_c_buf_p_offset =
959 (int) (yy_c_buf_p - b->yy_ch_buf);
961 if ( b->yy_is_our_buffer )
963 int new_size = b->yy_buf_size * 2;
965 if ( new_size <= 0 )
966 b->yy_buf_size += b->yy_buf_size / 8;
967 else
968 b->yy_buf_size *= 2;
970 b->yy_ch_buf = (char *)
971 /* Include room in for 2 EOB chars. */
972 yy_flex_realloc( (void *) b->yy_ch_buf,
973 b->yy_buf_size + 2 );
975 else
976 /* Can't grow it, we don't own it. */
977 b->yy_ch_buf = 0;
979 if ( ! b->yy_ch_buf )
980 YY_FATAL_ERROR(
981 "fatal error - scanner input buffer overflow" );
983 yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
985 num_to_read = yy_current_buffer->yy_buf_size -
986 number_to_move - 1;
987 #endif
990 if ( num_to_read > YY_READ_BUF_SIZE )
991 num_to_read = YY_READ_BUF_SIZE;
993 /* Read in more data. */
994 YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
995 yy_n_chars, num_to_read );
997 yy_current_buffer->yy_n_chars = yy_n_chars;
1000 if ( yy_n_chars == 0 )
1002 if ( number_to_move == YY_MORE_ADJ )
1004 ret_val = EOB_ACT_END_OF_FILE;
1005 yyrestart( yyin );
1008 else
1010 ret_val = EOB_ACT_LAST_MATCH;
1011 yy_current_buffer->yy_buffer_status =
1012 YY_BUFFER_EOF_PENDING;
1016 else
1017 ret_val = EOB_ACT_CONTINUE_SCAN;
1019 yy_n_chars += number_to_move;
1020 yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1021 yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1023 yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1025 return ret_val;
1029 /* yy_get_previous_state - get the state just before the EOB char was reached */
1031 static yy_state_type yy_get_previous_state()
1033 register yy_state_type yy_current_state;
1034 register char *yy_cp;
1036 yy_current_state = yy_start;
1038 for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1040 register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1041 if ( yy_accept[yy_current_state] )
1043 yy_last_accepting_state = yy_current_state;
1044 yy_last_accepting_cpos = yy_cp;
1046 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1048 yy_current_state = (int) yy_def[yy_current_state];
1049 if ( yy_current_state >= 16 )
1050 yy_c = yy_meta[(unsigned int) yy_c];
1052 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1055 return yy_current_state;
1059 /* yy_try_NUL_trans - try to make a transition on the NUL character
1061 * synopsis
1062 * next_state = yy_try_NUL_trans( current_state );
1065 #ifdef YY_USE_PROTOS
1066 static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1067 #else
1068 static yy_state_type yy_try_NUL_trans( yy_current_state )
1069 yy_state_type yy_current_state;
1070 #endif
1072 register int yy_is_jam;
1073 register char *yy_cp = yy_c_buf_p;
1075 register YY_CHAR yy_c = 1;
1076 if ( yy_accept[yy_current_state] )
1078 yy_last_accepting_state = yy_current_state;
1079 yy_last_accepting_cpos = yy_cp;
1081 while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1083 yy_current_state = (int) yy_def[yy_current_state];
1084 if ( yy_current_state >= 16 )
1085 yy_c = yy_meta[(unsigned int) yy_c];
1087 yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1088 yy_is_jam = (yy_current_state == 15);
1090 return yy_is_jam ? 0 : yy_current_state;
1094 #ifndef YY_NO_UNPUT
1095 #ifdef YY_USE_PROTOS
1096 static void yyunput( int c, register char *yy_bp )
1097 #else
1098 static void yyunput( c, yy_bp )
1099 int c;
1100 register char *yy_bp;
1101 #endif
1103 register char *yy_cp = yy_c_buf_p;
1105 /* undo effects of setting up yytext */
1106 *yy_cp = yy_hold_char;
1108 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1109 { /* need to shift things up to make room */
1110 /* +2 for EOB chars. */
1111 register int number_to_move = yy_n_chars + 2;
1112 register char *dest = &yy_current_buffer->yy_ch_buf[
1113 yy_current_buffer->yy_buf_size + 2];
1114 register char *source =
1115 &yy_current_buffer->yy_ch_buf[number_to_move];
1117 while ( source > yy_current_buffer->yy_ch_buf )
1118 *--dest = *--source;
1120 yy_cp += (int) (dest - source);
1121 yy_bp += (int) (dest - source);
1122 yy_current_buffer->yy_n_chars =
1123 yy_n_chars = yy_current_buffer->yy_buf_size;
1125 if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1126 YY_FATAL_ERROR( "flex scanner push-back overflow" );
1129 *--yy_cp = (char) c;
1132 yytext_ptr = yy_bp;
1133 yy_hold_char = *yy_cp;
1134 yy_c_buf_p = yy_cp;
1136 #endif /* ifndef YY_NO_UNPUT */
1139 #ifdef __cplusplus
1140 static int yyinput()
1141 #else
1142 static int input()
1143 #endif
1145 int c;
1147 *yy_c_buf_p = yy_hold_char;
1149 if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1151 /* yy_c_buf_p now points to the character we want to return.
1152 * If this occurs *before* the EOB characters, then it's a
1153 * valid NUL; if not, then we've hit the end of the buffer.
1155 if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1156 /* This was really a NUL. */
1157 *yy_c_buf_p = '\0';
1159 else
1160 { /* need more input */
1161 int offset = yy_c_buf_p - yytext_ptr;
1162 ++yy_c_buf_p;
1164 switch ( yy_get_next_buffer() )
1166 case EOB_ACT_LAST_MATCH:
1167 /* This happens because yy_g_n_b()
1168 * sees that we've accumulated a
1169 * token and flags that we need to
1170 * try matching the token before
1171 * proceeding. But for input(),
1172 * there's no matching to consider.
1173 * So convert the EOB_ACT_LAST_MATCH
1174 * to EOB_ACT_END_OF_FILE.
1177 /* Reset buffer status. */
1178 yyrestart( yyin );
1180 /* fall through */
1182 case EOB_ACT_END_OF_FILE:
1184 if ( yywrap() )
1185 return EOF;
1187 if ( ! yy_did_buffer_switch_on_eof )
1188 YY_NEW_FILE;
1189 #ifdef __cplusplus
1190 return yyinput();
1191 #else
1192 return input();
1193 #endif
1196 case EOB_ACT_CONTINUE_SCAN:
1197 yy_c_buf_p = yytext_ptr + offset;
1198 break;
1203 c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1204 *yy_c_buf_p = '\0'; /* preserve yytext */
1205 yy_hold_char = *++yy_c_buf_p;
1208 return c;
1212 #ifdef YY_USE_PROTOS
1213 void yyrestart( FILE *input_file )
1214 #else
1215 void yyrestart( input_file )
1216 FILE *input_file;
1217 #endif
1219 if ( ! yy_current_buffer )
1220 yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1222 yy_init_buffer( yy_current_buffer, input_file );
1223 yy_load_buffer_state();
1227 #ifdef YY_USE_PROTOS
1228 void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1229 #else
1230 void yy_switch_to_buffer( new_buffer )
1231 YY_BUFFER_STATE new_buffer;
1232 #endif
1234 if ( yy_current_buffer == new_buffer )
1235 return;
1237 if ( yy_current_buffer )
1239 /* Flush out information for old buffer. */
1240 *yy_c_buf_p = yy_hold_char;
1241 yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1242 yy_current_buffer->yy_n_chars = yy_n_chars;
1245 yy_current_buffer = new_buffer;
1246 yy_load_buffer_state();
1248 /* We don't actually know whether we did this switch during
1249 * EOF (yywrap()) processing, but the only time this flag
1250 * is looked at is after yywrap() is called, so it's safe
1251 * to go ahead and always set it.
1253 yy_did_buffer_switch_on_eof = 1;
1257 #ifdef YY_USE_PROTOS
1258 void yy_load_buffer_state( void )
1259 #else
1260 void yy_load_buffer_state()
1261 #endif
1263 yy_n_chars = yy_current_buffer->yy_n_chars;
1264 yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1265 yyin = yy_current_buffer->yy_input_file;
1266 yy_hold_char = *yy_c_buf_p;
1270 #ifdef YY_USE_PROTOS
1271 YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1272 #else
1273 YY_BUFFER_STATE yy_create_buffer( file, size )
1274 FILE *file;
1275 int size;
1276 #endif
1278 YY_BUFFER_STATE b;
1280 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1281 if ( ! b )
1282 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1284 b->yy_buf_size = size;
1286 /* yy_ch_buf has to be 2 characters longer than the size given because
1287 * we need to put in 2 end-of-buffer characters.
1289 b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1290 if ( ! b->yy_ch_buf )
1291 YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1293 b->yy_is_our_buffer = 1;
1295 yy_init_buffer( b, file );
1297 return b;
1301 #ifdef YY_USE_PROTOS
1302 void yy_delete_buffer( YY_BUFFER_STATE b )
1303 #else
1304 void yy_delete_buffer( b )
1305 YY_BUFFER_STATE b;
1306 #endif
1308 if ( ! b )
1309 return;
1311 if ( b == yy_current_buffer )
1312 yy_current_buffer = (YY_BUFFER_STATE) 0;
1314 if ( b->yy_is_our_buffer )
1315 yy_flex_free( (void *) b->yy_ch_buf );
1317 yy_flex_free( (void *) b );
1321 #ifndef YY_ALWAYS_INTERACTIVE
1322 #ifndef YY_NEVER_INTERACTIVE
1323 extern int isatty YY_PROTO(( int ));
1324 #endif
1325 #endif
1327 #ifdef YY_USE_PROTOS
1328 void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1329 #else
1330 void yy_init_buffer( b, file )
1331 YY_BUFFER_STATE b;
1332 FILE *file;
1333 #endif
1337 yy_flush_buffer( b );
1339 b->yy_input_file = file;
1340 b->yy_fill_buffer = 1;
1342 #if YY_ALWAYS_INTERACTIVE
1343 b->yy_is_interactive = 1;
1344 #else
1345 #if YY_NEVER_INTERACTIVE
1346 b->yy_is_interactive = 0;
1347 #else
1348 b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1349 #endif
1350 #endif
1354 #ifdef YY_USE_PROTOS
1355 void yy_flush_buffer( YY_BUFFER_STATE b )
1356 #else
1357 void yy_flush_buffer( b )
1358 YY_BUFFER_STATE b;
1359 #endif
1362 if ( ! b )
1363 return;
1365 b->yy_n_chars = 0;
1367 /* We always need two end-of-buffer characters. The first causes
1368 * a transition to the end-of-buffer state. The second causes
1369 * a jam in that state.
1371 b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1372 b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1374 b->yy_buf_pos = &b->yy_ch_buf[0];
1376 b->yy_at_bol = 1;
1377 b->yy_buffer_status = YY_BUFFER_NEW;
1379 if ( b == yy_current_buffer )
1380 yy_load_buffer_state();
1384 #ifndef YY_NO_SCAN_BUFFER
1385 #ifdef YY_USE_PROTOS
1386 YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1387 #else
1388 YY_BUFFER_STATE yy_scan_buffer( base, size )
1389 char *base;
1390 yy_size_t size;
1391 #endif
1393 YY_BUFFER_STATE b;
1395 if ( size < 2 ||
1396 base[size-2] != YY_END_OF_BUFFER_CHAR ||
1397 base[size-1] != YY_END_OF_BUFFER_CHAR )
1398 /* They forgot to leave room for the EOB's. */
1399 return 0;
1401 b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1402 if ( ! b )
1403 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1405 b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1406 b->yy_buf_pos = b->yy_ch_buf = base;
1407 b->yy_is_our_buffer = 0;
1408 b->yy_input_file = 0;
1409 b->yy_n_chars = b->yy_buf_size;
1410 b->yy_is_interactive = 0;
1411 b->yy_at_bol = 1;
1412 b->yy_fill_buffer = 0;
1413 b->yy_buffer_status = YY_BUFFER_NEW;
1415 yy_switch_to_buffer( b );
1417 return b;
1419 #endif
1422 #ifndef YY_NO_SCAN_STRING
1423 #ifdef YY_USE_PROTOS
1424 YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1425 #else
1426 YY_BUFFER_STATE yy_scan_string( yy_str )
1427 yyconst char *yy_str;
1428 #endif
1430 int len;
1431 for ( len = 0; yy_str[len]; ++len )
1434 return yy_scan_bytes( yy_str, len );
1436 #endif
1439 #ifndef YY_NO_SCAN_BYTES
1440 #ifdef YY_USE_PROTOS
1441 YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1442 #else
1443 YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1444 yyconst char *bytes;
1445 int len;
1446 #endif
1448 YY_BUFFER_STATE b;
1449 char *buf;
1450 yy_size_t n;
1451 int i;
1453 /* Get memory for full buffer, including space for trailing EOB's. */
1454 n = len + 2;
1455 buf = (char *) yy_flex_alloc( n );
1456 if ( ! buf )
1457 YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1459 for ( i = 0; i < len; ++i )
1460 buf[i] = bytes[i];
1462 buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1464 b = yy_scan_buffer( buf, n );
1465 if ( ! b )
1466 YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1468 /* It's okay to grow etc. this buffer, and we should throw it
1469 * away when we're done.
1471 b->yy_is_our_buffer = 1;
1473 return b;
1475 #endif
1478 #ifndef YY_NO_PUSH_STATE
1479 #ifdef YY_USE_PROTOS
1480 static void yy_push_state( int new_state )
1481 #else
1482 static void yy_push_state( new_state )
1483 int new_state;
1484 #endif
1486 if ( yy_start_stack_ptr >= yy_start_stack_depth )
1488 yy_size_t new_size;
1490 yy_start_stack_depth += YY_START_STACK_INCR;
1491 new_size = yy_start_stack_depth * sizeof( int );
1493 if ( ! yy_start_stack )
1494 yy_start_stack = (int *) yy_flex_alloc( new_size );
1496 else
1497 yy_start_stack = (int *) yy_flex_realloc(
1498 (void *) yy_start_stack, new_size );
1500 if ( ! yy_start_stack )
1501 YY_FATAL_ERROR(
1502 "out of memory expanding start-condition stack" );
1505 yy_start_stack[yy_start_stack_ptr++] = YY_START;
1507 BEGIN(new_state);
1509 #endif
1512 #ifndef YY_NO_POP_STATE
1513 static void yy_pop_state()
1515 if ( --yy_start_stack_ptr < 0 )
1516 YY_FATAL_ERROR( "start-condition stack underflow" );
1518 BEGIN(yy_start_stack[yy_start_stack_ptr]);
1520 #endif
1523 #ifndef YY_NO_TOP_STATE
1524 static int yy_top_state()
1526 return yy_start_stack[yy_start_stack_ptr - 1];
1528 #endif
1530 #ifndef YY_EXIT_FAILURE
1531 #define YY_EXIT_FAILURE 2
1532 #endif
1534 #ifdef YY_USE_PROTOS
1535 static void yy_fatal_error( yyconst char msg[] )
1536 #else
1537 static void yy_fatal_error( msg )
1538 char msg[];
1539 #endif
1541 (void) fprintf( stderr, "%s\n", msg );
1542 exit( YY_EXIT_FAILURE );
1547 /* Redefine yyless() so it works in section 3 code. */
1549 #undef yyless
1550 #define yyless(n) \
1551 do \
1553 /* Undo effects of setting up yytext. */ \
1554 yytext[yyleng] = yy_hold_char; \
1555 yy_c_buf_p = yytext + n; \
1556 yy_hold_char = *yy_c_buf_p; \
1557 *yy_c_buf_p = '\0'; \
1558 yyleng = n; \
1560 while ( 0 )
1563 /* Internal utility routines. */
1565 #ifndef yytext_ptr
1566 #ifdef YY_USE_PROTOS
1567 static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1568 #else
1569 static void yy_flex_strncpy( s1, s2, n )
1570 char *s1;
1571 yyconst char *s2;
1572 int n;
1573 #endif
1575 register int i;
1576 for ( i = 0; i < n; ++i )
1577 s1[i] = s2[i];
1579 #endif
1581 #ifdef YY_NEED_STRLEN
1582 #ifdef YY_USE_PROTOS
1583 static int yy_flex_strlen( yyconst char *s )
1584 #else
1585 static int yy_flex_strlen( s )
1586 yyconst char *s;
1587 #endif
1589 register int n;
1590 for ( n = 0; s[n]; ++n )
1593 return n;
1595 #endif
1598 #ifdef YY_USE_PROTOS
1599 static void *yy_flex_alloc( yy_size_t size )
1600 #else
1601 static void *yy_flex_alloc( size )
1602 yy_size_t size;
1603 #endif
1605 return (void *) malloc( size );
1608 #ifdef YY_USE_PROTOS
1609 static void *yy_flex_realloc( void *ptr, yy_size_t size )
1610 #else
1611 static void *yy_flex_realloc( ptr, size )
1612 void *ptr;
1613 yy_size_t size;
1614 #endif
1616 /* The cast to (char *) in the following accommodates both
1617 * implementations that use char* generic pointers, and those
1618 * that use void* generic pointers. It works with the latter
1619 * because both ANSI C and C++ allow castless assignment from
1620 * any pointer type to void*, and deal with argument conversions
1621 * as though doing an assignment.
1623 return (void *) realloc( (char *) ptr, size );
1626 #ifdef YY_USE_PROTOS
1627 static void yy_flex_free( void *ptr )
1628 #else
1629 static void yy_flex_free( ptr )
1630 void *ptr;
1631 #endif
1633 free( ptr );
1636 #if YY_MAIN
1637 int main()
1639 yylex();
1640 return 0;
1642 #endif
1643 #line 81 "installparse.l"
1645 /*------------------------ Program Section ----------------------------*/
1647 PRFileDesc *Pk11Install_FD=NULL;
1649 /*************************************************************************/
1650 /* dummy function required by lex */
1651 int Pk11Install_yywrap(void) { return 1;}
1653 /*************************************************************************/
1654 /* Return a copy of the given string */
1655 static char*
1656 putSimpleString(char *str)
1658 char *tmp = (char*) PR_Malloc(strlen(str)+1);
1659 strcpy(tmp, str);
1660 return tmp;
1663 /*************************************************************************/
1664 /* Strip out quotes, replace escaped characters with what they stand for.
1665 This function assumes that what is passed in is actually a complex
1666 string, so error checking is lax. */
1667 static char*
1668 putComplexString(char *str)
1670 int size, i,j;
1671 char *tmp;
1673 if(!str) {
1674 return NULL;
1676 size = strlen(str);
1678 /* Allocate the new space. This string will actually be too big,
1679 since quotes and backslashes will be stripped out. But that's ok. */
1680 tmp = (char*) PR_Malloc(size+1);
1682 /* Copy it over */
1683 for(i=0, j=0; i < size; i++) {
1684 if(str[i]=='\"') {
1685 continue; /* skip un-escaped quotes */
1686 } else if(str[i]=='\\') {
1687 ++i; /* escaped character. skip the backslash */
1689 tmp[j++] = str[i];
1691 tmp[j] = '\0';
1693 return tmp;