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