security/nss/cmd/modutil/lex.Pk11Install_yy.c

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

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

mercurial