security/nss/cmd/crlutil/crlgen_lex.c

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

mercurial