2
* The contents of this file are subject to the Mozilla Public
3
* License Version 1.1 (the "License"); you may not use this file
4
* except in compliance with the License. You may obtain a copy of
5
* the License at http://www.mozilla.org/MPL/
7
* Software distributed under the License is distributed on an "AS
8
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9
* implied. See the License for the specific language governing
10
* rights and limitations under the License.
12
* The Original Code is the Netscape security libraries.
14
* The Initial Developer of the Original Code is Netscape
15
* Communications Corporation. Portions created by Netscape are
16
* Copyright (C) 1994-2000 Netscape Communications Corporation. All
21
* Alternatively, the contents of this file may be used under the
22
* terms of the GNU General Public License Version 2 or later (the
23
* "GPL"), in which case the provisions of the GPL are applicable
24
* instead of those above. If you wish to allow use of your
25
* version of this file only under the terms of the GPL and not to
26
* allow others to use your version of this file under the MPL,
27
* indicate your decision by deleting the provisions above and
28
* replace them with the notice and other provisions required by
29
* the GPL. If you do not delete the provisions above, a recipient
30
* may use your version of this file under either the MPL or the
34
#define yy_create_buffer Pk11Install_yy_create_buffer
35
#define yy_delete_buffer Pk11Install_yy_delete_buffer
36
#define yy_scan_buffer Pk11Install_yy_scan_buffer
37
#define yy_scan_string Pk11Install_yy_scan_string
38
#define yy_scan_bytes Pk11Install_yy_scan_bytes
39
#define yy_flex_debug Pk11Install_yy_flex_debug
40
#define yy_init_buffer Pk11Install_yy_init_buffer
41
#define yy_flush_buffer Pk11Install_yy_flush_buffer
42
#define yy_load_buffer_state Pk11Install_yy_load_buffer_state
43
#define yy_switch_to_buffer Pk11Install_yy_switch_to_buffer
44
#define yyin Pk11Install_yyin
45
#define yyleng Pk11Install_yyleng
46
#define yylex Pk11Install_yylex
47
#define yyout Pk11Install_yyout
48
#define yyrestart Pk11Install_yyrestart
49
#define yytext Pk11Install_yytext
50
#define yywrap Pk11Install_yywrap
52
#line 20 "lex.Pk11Install_yy.c"
53
/* A lexical scanner generated by flex */
55
/* Scanner skeleton version:
56
* $Header: /cvsroot/mozilla/security/nss/cmd/modutil/lex.Pk11Install_yy.c,v 1.1 2000/03/31 20:08:56 relyea%netscape.com Exp $
60
#define YY_FLEX_MAJOR_VERSION 2
61
#define YY_FLEX_MINOR_VERSION 5
66
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
79
/* Use prototypes in function declarations. */
82
/* The "const" storage-class-modifier is valid. */
85
#else /* ! __cplusplus */
93
#endif /* ! __cplusplus */
101
#define YY_USE_PROTOS
105
#define yyconst const
112
#define YY_PROTO(proto) proto
114
#define YY_PROTO(proto) ()
117
/* Returned upon end-of-file. */
120
/* Promotes a possibly negative, possibly signed char to an unsigned
121
* integer for use as an array index. If the signed char is negative,
122
* we want to instead treat it as an 8-bit unsigned char, hence the
125
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
127
/* Enter a start condition. This macro really ought to take a parameter,
128
* but we do it the disgusting crufty way forced on us by the ()-less
129
* definition of BEGIN.
131
#define BEGIN yy_start = 1 + 2 *
133
/* Translate the current start state into a value that can be later handed
134
* to BEGIN to return to the state. The YYSTATE alias is for lex
137
#define YY_START ((yy_start - 1) / 2)
138
#define YYSTATE YY_START
140
/* Action number for EOF rule of a given start state. */
141
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
143
/* Special action meaning "start processing a new file". */
144
#define YY_NEW_FILE yyrestart( yyin )
146
#define YY_END_OF_BUFFER_CHAR 0
148
/* Size of default input buffer. */
149
#define YY_BUF_SIZE 16384
151
typedef struct yy_buffer_state *YY_BUFFER_STATE;
154
extern FILE *yyin, *yyout;
156
#define EOB_ACT_CONTINUE_SCAN 0
157
#define EOB_ACT_END_OF_FILE 1
158
#define EOB_ACT_LAST_MATCH 2
160
/* The funky do-while in the following #define is used to turn the definition
161
* int a single C statement (which needs a semi-colon terminator). This
162
* avoids problems with code like:
164
* if ( condition_holds )
167
* do_something_else();
169
* Prior to using the do-while the compiler would get upset at the
170
* "else" because it interpreted the "if" statement as being all
171
* done when it reached the ';' after the yyless() call.
174
/* Return all but the first 'n' matched characters back to the input stream. */
179
/* Undo effects of setting up yytext. */ \
180
*yy_cp = yy_hold_char; \
181
YY_RESTORE_YY_MORE_OFFSET \
182
yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
183
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
187
#define unput(c) yyunput( c, yytext_ptr )
189
/* The following is because we cannot portably get our hands on size_t
190
* (without autoconf's help, which isn't available because we want
191
* flex-generated scanners to compile on their own).
193
typedef unsigned int yy_size_t;
196
struct yy_buffer_state
200
char *yy_ch_buf; /* input buffer */
201
char *yy_buf_pos; /* current position in input buffer */
203
/* Size of input buffer in bytes, not including room for EOB
206
yy_size_t yy_buf_size;
208
/* Number of characters read into yy_ch_buf, not including EOB
213
/* Whether we "own" the buffer - i.e., we know we created it,
214
* and can realloc() it to grow it, and should free() it to
217
int yy_is_our_buffer;
219
/* Whether this is an "interactive" input source; if so, and
220
* if we're using stdio for input, then we want to use getc()
221
* instead of fread(), to make sure we stop fetching input after
224
int yy_is_interactive;
226
/* Whether we're considered to be at the beginning of a line.
227
* If so, '^' rules will be active on the next match, otherwise
232
/* Whether to try to fill the input buffer when we reach the
237
int yy_buffer_status;
238
#define YY_BUFFER_NEW 0
239
#define YY_BUFFER_NORMAL 1
240
/* When an EOF's been seen but there's still some text to process
241
* then we mark the buffer as YY_EOF_PENDING, to indicate that we
242
* shouldn't try reading from the input source any more. We might
243
* still have a bunch of tokens to match, though, because of
244
* possible backing-up.
246
* When we actually see the EOF, we change the status to "new"
247
* (via yyrestart()), so that the user can continue scanning by
248
* just pointing yyin at a new input file.
250
#define YY_BUFFER_EOF_PENDING 2
253
static YY_BUFFER_STATE yy_current_buffer = 0;
255
/* We provide macros for accessing buffer states in case in the
256
* future we want to put the buffer states in a more general
259
#define YY_CURRENT_BUFFER yy_current_buffer
262
/* yy_hold_char holds the character lost when yytext is formed. */
263
static char yy_hold_char;
265
static int yy_n_chars; /* number of characters read into yy_ch_buf */
270
/* Points to current character in buffer. */
271
static char *yy_c_buf_p = (char *) 0;
272
static int yy_init = 1; /* whether we need to initialize */
273
static int yy_start = 0; /* start state number */
275
/* Flag which is used to allow yywrap()'s to do buffer switches
276
* instead of setting up a fresh yyin. A bit of a hack ...
278
static int yy_did_buffer_switch_on_eof;
280
void yyrestart YY_PROTO(( FILE *input_file ));
282
void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
283
void yy_load_buffer_state YY_PROTO(( void ));
284
YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
285
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
286
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
287
void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
288
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
290
YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
291
YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
292
YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
294
static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
295
static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t ));
296
static void yy_flex_free YY_PROTO(( void * ));
298
#define yy_new_buffer yy_create_buffer
300
#define yy_set_interactive(is_interactive) \
302
if ( ! yy_current_buffer ) \
303
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
304
yy_current_buffer->yy_is_interactive = is_interactive; \
307
#define yy_set_bol(at_bol) \
309
if ( ! yy_current_buffer ) \
310
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \
311
yy_current_buffer->yy_at_bol = at_bol; \
314
#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)
316
typedef unsigned char YY_CHAR;
317
FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
318
typedef int yy_state_type;
320
#define yytext_ptr yytext
322
static yy_state_type yy_get_previous_state YY_PROTO(( void ));
323
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
324
static int yy_get_next_buffer YY_PROTO(( void ));
325
static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
327
/* Done after the current pattern has been matched and before the
328
* corresponding action - sets up yytext.
330
#define YY_DO_BEFORE_ACTION \
331
yytext_ptr = yy_bp; \
332
yyleng = (int) (yy_cp - yy_bp); \
333
yy_hold_char = *yy_cp; \
337
#define YY_NUM_RULES 8
338
#define YY_END_OF_BUFFER 9
339
static yyconst short int yy_accept[16] =
341
0, 0, 9, 3, 6, 5, 7, 1, 2, 3,
345
static yyconst int yy_ec[256] =
347
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
348
1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
349
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
350
1, 2, 1, 5, 1, 1, 1, 1, 1, 1,
351
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
352
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
353
1, 1, 1, 1, 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, 6, 1, 1, 1, 1, 1, 1, 1, 1,
358
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
359
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
360
1, 1, 7, 1, 8, 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, 1, 1, 1, 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,
369
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
370
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
371
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,
377
static yyconst int yy_meta[9] =
379
1, 2, 3, 4, 3, 1, 5, 5
382
static yyconst short int yy_base[19] =
384
0, 0, 19, 0, 0, 21, 12, 21, 21, 0,
385
0, 4, 6, 21, 21, 13, 11, 15
388
static yyconst short int yy_def[19] =
390
15, 1, 15, 16, 17, 15, 18, 15, 15, 16,
391
17, 18, 15, 15, 0, 15, 15, 15
394
static yyconst short int yy_nxt[30] =
396
4, 5, 6, 5, 7, 4, 8, 9, 14, 13,
397
12, 12, 11, 10, 11, 12, 12, 13, 15, 12,
398
3, 15, 15, 15, 15, 15, 15, 15, 15
401
static yyconst short int yy_chk[30] =
403
1, 1, 1, 1, 1, 1, 1, 1, 12, 12,
404
13, 13, 17, 16, 17, 18, 18, 7, 3, 18,
405
15, 15, 15, 15, 15, 15, 15, 15, 15
408
static yy_state_type yy_last_accepting_state;
409
static char *yy_last_accepting_cpos;
411
/* The intent behind this definition is that it'll catch
412
* any uses of REJECT which flex missed.
414
#define REJECT reject_used_but_not_detected
415
#define yymore() yymore_used_but_not_detected
416
#define YY_MORE_ADJ 0
417
#define YY_RESTORE_YY_MORE_OFFSET
419
#line 1 "installparse.l"
421
/* lex file for analyzing PKCS #11 Module installation instructions */
422
/*----------------------------- Definitions ---------------------------*/
423
#line 5 "installparse.l"
426
#include "install-ds.h" /* defines tokens and data structures */
427
#include "installparse.h" /* produced by yacc -d */
429
static char *putSimpleString(char*); /* return copy of string */
430
static char *putComplexString(char*); /* strip out quotes, deal with */
431
/* escaped characters */
433
void Pk11Install_yyerror(char *);
435
/* Overrides to use NSPR */
436
#define malloc PR_Malloc
437
#define realloc PR_Realloc
440
int Pk11Install_yylinenum=1;
443
#define YY_NEVER_INTERACTIVE 1
444
#define yyunput Pkcs11Install_yyunput
446
/* This is the default YY_INPUT modified for NSPR */
447
#define YY_INPUT(buf,result,max_size) \
448
if ( yy_current_buffer->yy_is_interactive ) { \
451
for ( n = 0; n < max_size && \
452
PR_Read(Pk11Install_FD, &c, 1)==1 && c != '\n'; ++n ) { \
460
result = PR_Read(Pk11Install_FD, buf, max_size); \
463
/*** Regular expression definitions ***/
464
/* simple_string has no whitespace, quotes, or braces */
465
/* complex_string is enclosed in quotes. Inside the quotes, quotes and
466
backslashes must be backslash-escaped. Otherwise, anything goes. */
467
/* Standard whitespace */
468
/*---------------------------- Actions --------------------------------*/
469
#line 437 "lex.Pk11Install_yy.cpp"
471
/* Macros after this point can all be overridden by user definitions in
475
#ifndef YY_SKIP_YYWRAP
477
extern "C" int yywrap YY_PROTO(( void ));
479
extern int yywrap YY_PROTO(( void ));
484
static void yyunput YY_PROTO(( int c, char *buf_ptr ));
488
static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
491
#ifdef YY_NEED_STRLEN
492
static int yy_flex_strlen YY_PROTO(( yyconst char * ));
497
static int yyinput YY_PROTO(( void ));
499
static int input YY_PROTO(( void ));
504
static int yy_start_stack_ptr = 0;
505
static int yy_start_stack_depth = 0;
506
static int *yy_start_stack = 0;
507
#ifndef YY_NO_PUSH_STATE
508
static void yy_push_state YY_PROTO(( int new_state ));
510
#ifndef YY_NO_POP_STATE
511
static void yy_pop_state YY_PROTO(( void ));
513
#ifndef YY_NO_TOP_STATE
514
static int yy_top_state YY_PROTO(( void ));
518
#define YY_NO_PUSH_STATE 1
519
#define YY_NO_POP_STATE 1
520
#define YY_NO_TOP_STATE 1
523
#ifdef YY_MALLOC_DECL
531
/* Just try to get by without declaring the routines. This will fail
532
* miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
533
* or sizeof(void*) != sizeof(int).
538
/* Amount of stuff to slurp up with each read. */
539
#ifndef YY_READ_BUF_SIZE
540
#define YY_READ_BUF_SIZE 8192
543
/* Copy whatever the last rule matched to the standard output. */
546
/* This used to be an fputs(), but since the string might contain NUL's,
547
* we now use fwrite().
549
#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
552
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
553
* is returned in "result".
556
#define YY_INPUT(buf,result,max_size) \
557
if ( yy_current_buffer->yy_is_interactive ) \
560
for ( n = 0; n < max_size && \
561
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
564
buf[n++] = (char) c; \
565
if ( c == EOF && ferror( yyin ) ) \
566
YY_FATAL_ERROR( "input in flex scanner failed" ); \
569
else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
570
&& ferror( yyin ) ) \
571
YY_FATAL_ERROR( "input in flex scanner failed" );
574
/* No semi-colon after return; correct usage is to write "yyterminate();" -
575
* we don't want an extra ';' after the "return" because that will cause
576
* some compilers to complain about unreachable statements.
579
#define yyterminate() return YY_NULL
582
/* Number of entries by which start-condition stack grows. */
583
#ifndef YY_START_STACK_INCR
584
#define YY_START_STACK_INCR 25
587
/* Report a fatal error. */
588
#ifndef YY_FATAL_ERROR
589
#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
592
/* Default declaration of generated scanner - a define so the user can
593
* easily add parameters.
596
#define YY_DECL int yylex YY_PROTO(( void ))
599
/* Code executed at the beginning of each rule, after yytext and yyleng
602
#ifndef YY_USER_ACTION
603
#define YY_USER_ACTION
606
/* Code executed at the end of each rule. */
608
#define YY_BREAK break;
611
#define YY_RULE_SETUP \
616
register yy_state_type yy_current_state;
617
register char *yy_cp, *yy_bp;
620
#line 60 "installparse.l"
623
#line 591 "lex.Pk11Install_yy.cpp"
634
yy_start = 1; /* first start state */
642
if ( ! yy_current_buffer )
644
yy_create_buffer( yyin, YY_BUF_SIZE );
646
yy_load_buffer_state();
649
while ( 1 ) /* loops until end-of-file is reached */
653
/* Support of yytext. */
654
*yy_cp = yy_hold_char;
656
/* yy_bp points to the position in yy_ch_buf of the start of
661
yy_current_state = yy_start;
665
register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
666
if ( yy_accept[yy_current_state] )
668
yy_last_accepting_state = yy_current_state;
669
yy_last_accepting_cpos = yy_cp;
671
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
673
yy_current_state = (int) yy_def[yy_current_state];
674
if ( yy_current_state >= 16 )
675
yy_c = yy_meta[(unsigned int) yy_c];
677
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
680
while ( yy_base[yy_current_state] != 21 );
683
yy_act = yy_accept[yy_current_state];
685
{ /* have to back up */
686
yy_cp = yy_last_accepting_cpos;
687
yy_current_state = yy_last_accepting_state;
688
yy_act = yy_accept[yy_current_state];
694
do_action: /* This label is used only to access EOF actions. */
698
{ /* beginning of action switch */
699
case 0: /* must back up */
700
/* undo the effects of YY_DO_BEFORE_ACTION */
701
*yy_cp = yy_hold_char;
702
yy_cp = yy_last_accepting_cpos;
703
yy_current_state = yy_last_accepting_state;
708
#line 62 "installparse.l"
713
#line 63 "installparse.l"
718
#line 64 "installparse.l"
719
{Pk11Install_yylval.string =
720
putSimpleString(Pk11Install_yytext);
725
#line 67 "installparse.l"
726
{Pk11Install_yylval.string =
727
putComplexString(Pk11Install_yytext);
732
#line 71 "installparse.l"
733
Pk11Install_yylinenum++;
737
#line 73 "installparse.l"
742
#line 75 "installparse.l"
743
{err = PR_smprintf("Invalid lexeme: %s",Pk11Install_yytext);
744
Pk11Install_yyerror(err);
745
PR_smprintf_free(err);
751
#line 81 "installparse.l"
754
#line 722 "lex.Pk11Install_yy.cpp"
755
case YY_STATE_EOF(INITIAL):
758
case YY_END_OF_BUFFER:
760
/* Amount of text matched not including the EOB char. */
761
int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1;
763
/* Undo the effects of YY_DO_BEFORE_ACTION. */
764
*yy_cp = yy_hold_char;
765
YY_RESTORE_YY_MORE_OFFSET
767
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
769
/* We're scanning a new file or input source. It's
770
* possible that this happened because the user
771
* just pointed yyin at a new source and called
772
* yylex(). If so, then we have to assure
773
* consistency between yy_current_buffer and our
774
* globals. Here is the right place to do so, because
775
* this is the first action (other than possibly a
776
* back-up) that will match for the new input source.
778
yy_n_chars = yy_current_buffer->yy_n_chars;
779
yy_current_buffer->yy_input_file = yyin;
780
yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
783
/* Note that here we test for yy_c_buf_p "<=" to the position
784
* of the first EOB in the buffer, since yy_c_buf_p will
785
* already have been incremented past the NUL character
786
* (since all states make transitions on EOB to the
787
* end-of-buffer state). Contrast this with the test
790
if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
791
{ /* This was really a NUL. */
792
yy_state_type yy_next_state;
794
yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
796
yy_current_state = yy_get_previous_state();
798
/* Okay, we're now positioned to make the NUL
799
* transition. We couldn't have
800
* yy_get_previous_state() go ahead and do it
801
* for us because it doesn't know how to deal
802
* with the possibility of jamming (and we don't
803
* want to build jamming into it because then it
804
* will run more slowly).
807
yy_next_state = yy_try_NUL_trans( yy_current_state );
809
yy_bp = yytext_ptr + YY_MORE_ADJ;
813
/* Consume the NUL. */
814
yy_cp = ++yy_c_buf_p;
815
yy_current_state = yy_next_state;
826
else switch ( yy_get_next_buffer() )
828
case EOB_ACT_END_OF_FILE:
830
yy_did_buffer_switch_on_eof = 0;
834
/* Note: because we've taken care in
835
* yy_get_next_buffer() to have set up
836
* yytext, we can now set up
837
* yy_c_buf_p so that if some total
838
* hoser (like flex itself) wants to
839
* call the scanner after we return the
840
* YY_NULL, it'll still work - another
841
* YY_NULL will get returned.
843
yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
845
yy_act = YY_STATE_EOF(YY_START);
851
if ( ! yy_did_buffer_switch_on_eof )
857
case EOB_ACT_CONTINUE_SCAN:
859
yytext_ptr + yy_amount_of_matched_text;
861
yy_current_state = yy_get_previous_state();
864
yy_bp = yytext_ptr + YY_MORE_ADJ;
867
case EOB_ACT_LAST_MATCH:
869
&yy_current_buffer->yy_ch_buf[yy_n_chars];
871
yy_current_state = yy_get_previous_state();
874
yy_bp = yytext_ptr + YY_MORE_ADJ;
882
"fatal flex scanner internal error--no action found" );
883
} /* end of action switch */
884
} /* end of scanning one token */
888
/* yy_get_next_buffer - try to read in a new buffer
890
* Returns a code representing an action:
891
* EOB_ACT_LAST_MATCH -
892
* EOB_ACT_CONTINUE_SCAN - continue scanning from current position
893
* EOB_ACT_END_OF_FILE - end of file
896
static int yy_get_next_buffer()
898
register char *dest = yy_current_buffer->yy_ch_buf;
899
register char *source = yytext_ptr;
900
register int number_to_move, i;
903
if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
905
"fatal flex scanner internal error--end of buffer missed" );
907
if ( yy_current_buffer->yy_fill_buffer == 0 )
908
{ /* Don't try to fill the buffer, so this is an EOF. */
909
if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
911
/* We matched a single character, the EOB, so
912
* treat this as a final EOF.
914
return EOB_ACT_END_OF_FILE;
919
/* We matched some text prior to the EOB, first
922
return EOB_ACT_LAST_MATCH;
926
/* Try to read more data. */
928
/* First move last chars to start of buffer. */
929
number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1;
931
for ( i = 0; i < number_to_move; ++i )
932
*(dest++) = *(source++);
934
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
935
/* don't do the read, it's not guaranteed to return an EOF,
938
yy_current_buffer->yy_n_chars = yy_n_chars = 0;
943
yy_current_buffer->yy_buf_size - number_to_move - 1;
945
while ( num_to_read <= 0 )
946
{ /* Not enough room in the buffer - grow it. */
947
#ifdef YY_USES_REJECT
949
"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
952
/* just a shorter name for the current buffer */
953
YY_BUFFER_STATE b = yy_current_buffer;
955
int yy_c_buf_p_offset =
956
(int) (yy_c_buf_p - b->yy_ch_buf);
958
if ( b->yy_is_our_buffer )
960
int new_size = b->yy_buf_size * 2;
963
b->yy_buf_size += b->yy_buf_size / 8;
967
b->yy_ch_buf = (char *)
968
/* Include room in for 2 EOB chars. */
969
yy_flex_realloc( (void *) b->yy_ch_buf,
970
b->yy_buf_size + 2 );
973
/* Can't grow it, we don't own it. */
976
if ( ! b->yy_ch_buf )
978
"fatal error - scanner input buffer overflow" );
980
yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
982
num_to_read = yy_current_buffer->yy_buf_size -
987
if ( num_to_read > YY_READ_BUF_SIZE )
988
num_to_read = YY_READ_BUF_SIZE;
990
/* Read in more data. */
991
YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
992
yy_n_chars, num_to_read );
994
yy_current_buffer->yy_n_chars = yy_n_chars;
997
if ( yy_n_chars == 0 )
999
if ( number_to_move == YY_MORE_ADJ )
1001
ret_val = EOB_ACT_END_OF_FILE;
1007
ret_val = EOB_ACT_LAST_MATCH;
1008
yy_current_buffer->yy_buffer_status =
1009
YY_BUFFER_EOF_PENDING;
1014
ret_val = EOB_ACT_CONTINUE_SCAN;
1016
yy_n_chars += number_to_move;
1017
yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
1018
yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
1020
yytext_ptr = &yy_current_buffer->yy_ch_buf[0];
1026
/* yy_get_previous_state - get the state just before the EOB char was reached */
1028
static yy_state_type yy_get_previous_state()
1030
register yy_state_type yy_current_state;
1031
register char *yy_cp;
1033
yy_current_state = yy_start;
1035
for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
1037
register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
1038
if ( yy_accept[yy_current_state] )
1040
yy_last_accepting_state = yy_current_state;
1041
yy_last_accepting_cpos = yy_cp;
1043
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1045
yy_current_state = (int) yy_def[yy_current_state];
1046
if ( yy_current_state >= 16 )
1047
yy_c = yy_meta[(unsigned int) yy_c];
1049
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1052
return yy_current_state;
1056
/* yy_try_NUL_trans - try to make a transition on the NUL character
1059
* next_state = yy_try_NUL_trans( current_state );
1062
#ifdef YY_USE_PROTOS
1063
static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
1065
static yy_state_type yy_try_NUL_trans( yy_current_state )
1066
yy_state_type yy_current_state;
1069
register int yy_is_jam;
1070
register char *yy_cp = yy_c_buf_p;
1072
register YY_CHAR yy_c = 1;
1073
if ( yy_accept[yy_current_state] )
1075
yy_last_accepting_state = yy_current_state;
1076
yy_last_accepting_cpos = yy_cp;
1078
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
1080
yy_current_state = (int) yy_def[yy_current_state];
1081
if ( yy_current_state >= 16 )
1082
yy_c = yy_meta[(unsigned int) yy_c];
1084
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
1085
yy_is_jam = (yy_current_state == 15);
1087
return yy_is_jam ? 0 : yy_current_state;
1092
#ifdef YY_USE_PROTOS
1093
static void yyunput( int c, register char *yy_bp )
1095
static void yyunput( c, yy_bp )
1097
register char *yy_bp;
1100
register char *yy_cp = yy_c_buf_p;
1102
/* undo effects of setting up yytext */
1103
*yy_cp = yy_hold_char;
1105
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1106
{ /* need to shift things up to make room */
1107
/* +2 for EOB chars. */
1108
register int number_to_move = yy_n_chars + 2;
1109
register char *dest = &yy_current_buffer->yy_ch_buf[
1110
yy_current_buffer->yy_buf_size + 2];
1111
register char *source =
1112
&yy_current_buffer->yy_ch_buf[number_to_move];
1114
while ( source > yy_current_buffer->yy_ch_buf )
1115
*--dest = *--source;
1117
yy_cp += (int) (dest - source);
1118
yy_bp += (int) (dest - source);
1119
yy_current_buffer->yy_n_chars =
1120
yy_n_chars = yy_current_buffer->yy_buf_size;
1122
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
1123
YY_FATAL_ERROR( "flex scanner push-back overflow" );
1126
*--yy_cp = (char) c;
1130
yy_hold_char = *yy_cp;
1133
#endif /* ifndef YY_NO_UNPUT */
1137
static int yyinput()
1144
*yy_c_buf_p = yy_hold_char;
1146
if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
1148
/* yy_c_buf_p now points to the character we want to return.
1149
* If this occurs *before* the EOB characters, then it's a
1150
* valid NUL; if not, then we've hit the end of the buffer.
1152
if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
1153
/* This was really a NUL. */
1157
{ /* need more input */
1158
int offset = yy_c_buf_p - yytext_ptr;
1161
switch ( yy_get_next_buffer() )
1163
case EOB_ACT_LAST_MATCH:
1164
/* This happens because yy_g_n_b()
1165
* sees that we've accumulated a
1166
* token and flags that we need to
1167
* try matching the token before
1168
* proceeding. But for input(),
1169
* there's no matching to consider.
1170
* So convert the EOB_ACT_LAST_MATCH
1171
* to EOB_ACT_END_OF_FILE.
1174
/* Reset buffer status. */
1179
case EOB_ACT_END_OF_FILE:
1184
if ( ! yy_did_buffer_switch_on_eof )
1193
case EOB_ACT_CONTINUE_SCAN:
1194
yy_c_buf_p = yytext_ptr + offset;
1200
c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
1201
*yy_c_buf_p = '\0'; /* preserve yytext */
1202
yy_hold_char = *++yy_c_buf_p;
1209
#ifdef YY_USE_PROTOS
1210
void yyrestart( FILE *input_file )
1212
void yyrestart( input_file )
1216
if ( ! yy_current_buffer )
1217
yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
1219
yy_init_buffer( yy_current_buffer, input_file );
1220
yy_load_buffer_state();
1224
#ifdef YY_USE_PROTOS
1225
void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
1227
void yy_switch_to_buffer( new_buffer )
1228
YY_BUFFER_STATE new_buffer;
1231
if ( yy_current_buffer == new_buffer )
1234
if ( yy_current_buffer )
1236
/* Flush out information for old buffer. */
1237
*yy_c_buf_p = yy_hold_char;
1238
yy_current_buffer->yy_buf_pos = yy_c_buf_p;
1239
yy_current_buffer->yy_n_chars = yy_n_chars;
1242
yy_current_buffer = new_buffer;
1243
yy_load_buffer_state();
1245
/* We don't actually know whether we did this switch during
1246
* EOF (yywrap()) processing, but the only time this flag
1247
* is looked at is after yywrap() is called, so it's safe
1248
* to go ahead and always set it.
1250
yy_did_buffer_switch_on_eof = 1;
1254
#ifdef YY_USE_PROTOS
1255
void yy_load_buffer_state( void )
1257
void yy_load_buffer_state()
1260
yy_n_chars = yy_current_buffer->yy_n_chars;
1261
yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
1262
yyin = yy_current_buffer->yy_input_file;
1263
yy_hold_char = *yy_c_buf_p;
1267
#ifdef YY_USE_PROTOS
1268
YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
1270
YY_BUFFER_STATE yy_create_buffer( file, size )
1277
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1279
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1281
b->yy_buf_size = size;
1283
/* yy_ch_buf has to be 2 characters longer than the size given because
1284
* we need to put in 2 end-of-buffer characters.
1286
b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
1287
if ( ! b->yy_ch_buf )
1288
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
1290
b->yy_is_our_buffer = 1;
1292
yy_init_buffer( b, file );
1298
#ifdef YY_USE_PROTOS
1299
void yy_delete_buffer( YY_BUFFER_STATE b )
1301
void yy_delete_buffer( b )
1308
if ( b == yy_current_buffer )
1309
yy_current_buffer = (YY_BUFFER_STATE) 0;
1311
if ( b->yy_is_our_buffer )
1312
yy_flex_free( (void *) b->yy_ch_buf );
1314
yy_flex_free( (void *) b );
1318
#ifndef YY_ALWAYS_INTERACTIVE
1319
#ifndef YY_NEVER_INTERACTIVE
1320
extern int isatty YY_PROTO(( int ));
1324
#ifdef YY_USE_PROTOS
1325
void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
1327
void yy_init_buffer( b, file )
1334
yy_flush_buffer( b );
1336
b->yy_input_file = file;
1337
b->yy_fill_buffer = 1;
1339
#if YY_ALWAYS_INTERACTIVE
1340
b->yy_is_interactive = 1;
1342
#if YY_NEVER_INTERACTIVE
1343
b->yy_is_interactive = 0;
1345
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
1351
#ifdef YY_USE_PROTOS
1352
void yy_flush_buffer( YY_BUFFER_STATE b )
1354
void yy_flush_buffer( b )
1364
/* We always need two end-of-buffer characters. The first causes
1365
* a transition to the end-of-buffer state. The second causes
1366
* a jam in that state.
1368
b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
1369
b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
1371
b->yy_buf_pos = &b->yy_ch_buf[0];
1374
b->yy_buffer_status = YY_BUFFER_NEW;
1376
if ( b == yy_current_buffer )
1377
yy_load_buffer_state();
1381
#ifndef YY_NO_SCAN_BUFFER
1382
#ifdef YY_USE_PROTOS
1383
YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size )
1385
YY_BUFFER_STATE yy_scan_buffer( base, size )
1393
base[size-2] != YY_END_OF_BUFFER_CHAR ||
1394
base[size-1] != YY_END_OF_BUFFER_CHAR )
1395
/* They forgot to leave room for the EOB's. */
1398
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
1400
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
1402
b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
1403
b->yy_buf_pos = b->yy_ch_buf = base;
1404
b->yy_is_our_buffer = 0;
1405
b->yy_input_file = 0;
1406
b->yy_n_chars = b->yy_buf_size;
1407
b->yy_is_interactive = 0;
1409
b->yy_fill_buffer = 0;
1410
b->yy_buffer_status = YY_BUFFER_NEW;
1412
yy_switch_to_buffer( b );
1419
#ifndef YY_NO_SCAN_STRING
1420
#ifdef YY_USE_PROTOS
1421
YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
1423
YY_BUFFER_STATE yy_scan_string( yy_str )
1424
yyconst char *yy_str;
1428
for ( len = 0; yy_str[len]; ++len )
1431
return yy_scan_bytes( yy_str, len );
1436
#ifndef YY_NO_SCAN_BYTES
1437
#ifdef YY_USE_PROTOS
1438
YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len )
1440
YY_BUFFER_STATE yy_scan_bytes( bytes, len )
1441
yyconst char *bytes;
1450
/* Get memory for full buffer, including space for trailing EOB's. */
1452
buf = (char *) yy_flex_alloc( n );
1454
YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
1456
for ( i = 0; i < len; ++i )
1459
buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR;
1461
b = yy_scan_buffer( buf, n );
1463
YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
1465
/* It's okay to grow etc. this buffer, and we should throw it
1466
* away when we're done.
1468
b->yy_is_our_buffer = 1;
1475
#ifndef YY_NO_PUSH_STATE
1476
#ifdef YY_USE_PROTOS
1477
static void yy_push_state( int new_state )
1479
static void yy_push_state( new_state )
1483
if ( yy_start_stack_ptr >= yy_start_stack_depth )
1487
yy_start_stack_depth += YY_START_STACK_INCR;
1488
new_size = yy_start_stack_depth * sizeof( int );
1490
if ( ! yy_start_stack )
1491
yy_start_stack = (int *) yy_flex_alloc( new_size );
1494
yy_start_stack = (int *) yy_flex_realloc(
1495
(void *) yy_start_stack, new_size );
1497
if ( ! yy_start_stack )
1499
"out of memory expanding start-condition stack" );
1502
yy_start_stack[yy_start_stack_ptr++] = YY_START;
1509
#ifndef YY_NO_POP_STATE
1510
static void yy_pop_state()
1512
if ( --yy_start_stack_ptr < 0 )
1513
YY_FATAL_ERROR( "start-condition stack underflow" );
1515
BEGIN(yy_start_stack[yy_start_stack_ptr]);
1520
#ifndef YY_NO_TOP_STATE
1521
static int yy_top_state()
1523
return yy_start_stack[yy_start_stack_ptr - 1];
1527
#ifndef YY_EXIT_FAILURE
1528
#define YY_EXIT_FAILURE 2
1531
#ifdef YY_USE_PROTOS
1532
static void yy_fatal_error( yyconst char msg[] )
1534
static void yy_fatal_error( msg )
1538
(void) fprintf( stderr, "%s\n", msg );
1539
exit( YY_EXIT_FAILURE );
1544
/* Redefine yyless() so it works in section 3 code. */
1550
/* Undo effects of setting up yytext. */ \
1551
yytext[yyleng] = yy_hold_char; \
1552
yy_c_buf_p = yytext + n; \
1553
yy_hold_char = *yy_c_buf_p; \
1554
*yy_c_buf_p = '\0'; \
1560
/* Internal utility routines. */
1563
#ifdef YY_USE_PROTOS
1564
static void yy_flex_strncpy( char *s1, yyconst char *s2, int n )
1566
static void yy_flex_strncpy( s1, s2, n )
1573
for ( i = 0; i < n; ++i )
1578
#ifdef YY_NEED_STRLEN
1579
#ifdef YY_USE_PROTOS
1580
static int yy_flex_strlen( yyconst char *s )
1582
static int yy_flex_strlen( s )
1587
for ( n = 0; s[n]; ++n )
1595
#ifdef YY_USE_PROTOS
1596
static void *yy_flex_alloc( yy_size_t size )
1598
static void *yy_flex_alloc( size )
1602
return (void *) malloc( size );
1605
#ifdef YY_USE_PROTOS
1606
static void *yy_flex_realloc( void *ptr, yy_size_t size )
1608
static void *yy_flex_realloc( ptr, size )
1613
/* The cast to (char *) in the following accommodates both
1614
* implementations that use char* generic pointers, and those
1615
* that use void* generic pointers. It works with the latter
1616
* because both ANSI C and C++ allow castless assignment from
1617
* any pointer type to void*, and deal with argument conversions
1618
* as though doing an assignment.
1620
return (void *) realloc( (char *) ptr, size );
1623
#ifdef YY_USE_PROTOS
1624
static void yy_flex_free( void *ptr )
1626
static void yy_flex_free( ptr )
1640
#line 81 "installparse.l"
1642
/*------------------------ Program Section ----------------------------*/
1644
PRFileDesc *Pk11Install_FD=NULL;
1646
/*************************************************************************/
1647
/* dummy function required by lex */
1648
int Pk11Install_yywrap(void) { return 1;}
1650
/*************************************************************************/
1651
/* Return a copy of the given string */
1653
putSimpleString(char *str)
1655
char *tmp = (char*) PR_Malloc(strlen(str)+1);
1660
/*************************************************************************/
1661
/* Strip out quotes, replace escaped characters with what they stand for.
1662
This function assumes that what is passed in is actually a complex
1663
string, so error checking is lax. */
1665
putComplexString(char *str)
1675
/* Allocate the new space. This string will actually be too big,
1676
since quotes and backslashes will be stripped out. But that's ok. */
1677
tmp = (char*) PR_Malloc(size+1);
1680
for(i=0, j=0; i < size; i++) {
1682
continue; /* skip un-escaped quotes */
1683
} else if(str[i]=='\\') {
1684
++i; /* escaped character. skip the backslash */