security/nss/cmd/crlutil/crlgen_lex.c

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial