1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/nss/cmd/modutil/lex.Pk11Install_yy.c Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,1658 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#define yy_create_buffer Pk11Install_yy_create_buffer 1.9 +#define yy_delete_buffer Pk11Install_yy_delete_buffer 1.10 +#define yy_scan_buffer Pk11Install_yy_scan_buffer 1.11 +#define yy_scan_string Pk11Install_yy_scan_string 1.12 +#define yy_scan_bytes Pk11Install_yy_scan_bytes 1.13 +#define yy_flex_debug Pk11Install_yy_flex_debug 1.14 +#define yy_init_buffer Pk11Install_yy_init_buffer 1.15 +#define yy_flush_buffer Pk11Install_yy_flush_buffer 1.16 +#define yy_load_buffer_state Pk11Install_yy_load_buffer_state 1.17 +#define yy_switch_to_buffer Pk11Install_yy_switch_to_buffer 1.18 +#define yyin Pk11Install_yyin 1.19 +#define yyleng Pk11Install_yyleng 1.20 +#define yylex Pk11Install_yylex 1.21 +#define yyout Pk11Install_yyout 1.22 +#define yyrestart Pk11Install_yyrestart 1.23 +#define yytext Pk11Install_yytext 1.24 +#define yywrap Pk11Install_yywrap 1.25 + 1.26 +#line 20 "lex.Pk11Install_yy.c" 1.27 +/* A lexical scanner generated by flex */ 1.28 + 1.29 +#define FLEX_SCANNER 1.30 +#define YY_FLEX_MAJOR_VERSION 2 1.31 +#define YY_FLEX_MINOR_VERSION 5 1.32 + 1.33 +#include <stdio.h> 1.34 + 1.35 + 1.36 +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ 1.37 +#ifdef c_plusplus 1.38 +#ifndef __cplusplus 1.39 +#define __cplusplus 1.40 +#endif 1.41 +#endif 1.42 + 1.43 + 1.44 +#ifdef __cplusplus 1.45 + 1.46 +#include <stdlib.h> 1.47 +//#include <unistd.h> 1.48 + 1.49 +/* Use prototypes in function declarations. */ 1.50 +#define YY_USE_PROTOS 1.51 + 1.52 +/* The "const" storage-class-modifier is valid. */ 1.53 +#define YY_USE_CONST 1.54 + 1.55 +#else /* ! __cplusplus */ 1.56 + 1.57 +#if __STDC__ 1.58 + 1.59 +#define YY_USE_PROTOS 1.60 +#define YY_USE_CONST 1.61 + 1.62 +#endif /* __STDC__ */ 1.63 +#endif /* ! __cplusplus */ 1.64 + 1.65 +#ifdef __TURBOC__ 1.66 + #pragma warn -rch 1.67 + #pragma warn -use 1.68 +#include <io.h> 1.69 +#include <stdlib.h> 1.70 +#define YY_USE_CONST 1.71 +#define YY_USE_PROTOS 1.72 +#endif 1.73 + 1.74 +#ifdef YY_USE_CONST 1.75 +#define yyconst const 1.76 +#else 1.77 +#define yyconst 1.78 +#endif 1.79 + 1.80 + 1.81 +#ifdef YY_USE_PROTOS 1.82 +#define YY_PROTO(proto) proto 1.83 +#else 1.84 +#define YY_PROTO(proto) () 1.85 +#endif 1.86 + 1.87 +/* Returned upon end-of-file. */ 1.88 +#define YY_NULL 0 1.89 + 1.90 +/* Promotes a possibly negative, possibly signed char to an unsigned 1.91 + * integer for use as an array index. If the signed char is negative, 1.92 + * we want to instead treat it as an 8-bit unsigned char, hence the 1.93 + * double cast. 1.94 + */ 1.95 +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) 1.96 + 1.97 +/* Enter a start condition. This macro really ought to take a parameter, 1.98 + * but we do it the disgusting crufty way forced on us by the ()-less 1.99 + * definition of BEGIN. 1.100 + */ 1.101 +#define BEGIN yy_start = 1 + 2 * 1.102 + 1.103 +/* Translate the current start state into a value that can be later handed 1.104 + * to BEGIN to return to the state. The YYSTATE alias is for lex 1.105 + * compatibility. 1.106 + */ 1.107 +#define YY_START ((yy_start - 1) / 2) 1.108 +#define YYSTATE YY_START 1.109 + 1.110 +/* Action number for EOF rule of a given start state. */ 1.111 +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) 1.112 + 1.113 +/* Special action meaning "start processing a new file". */ 1.114 +#define YY_NEW_FILE yyrestart( yyin ) 1.115 + 1.116 +#define YY_END_OF_BUFFER_CHAR 0 1.117 + 1.118 +/* Size of default input buffer. */ 1.119 +#define YY_BUF_SIZE 16384 1.120 + 1.121 +typedef struct yy_buffer_state *YY_BUFFER_STATE; 1.122 + 1.123 +extern int yyleng; 1.124 +extern FILE *yyin, *yyout; 1.125 + 1.126 +#define EOB_ACT_CONTINUE_SCAN 0 1.127 +#define EOB_ACT_END_OF_FILE 1 1.128 +#define EOB_ACT_LAST_MATCH 2 1.129 + 1.130 +/* The funky do-while in the following #define is used to turn the definition 1.131 + * int a single C statement (which needs a semi-colon terminator). This 1.132 + * avoids problems with code like: 1.133 + * 1.134 + * if ( condition_holds ) 1.135 + * yyless( 5 ); 1.136 + * else 1.137 + * do_something_else(); 1.138 + * 1.139 + * Prior to using the do-while the compiler would get upset at the 1.140 + * "else" because it interpreted the "if" statement as being all 1.141 + * done when it reached the ';' after the yyless() call. 1.142 + */ 1.143 + 1.144 +/* Return all but the first 'n' matched characters back to the input stream. */ 1.145 + 1.146 +#define yyless(n) \ 1.147 + do \ 1.148 + { \ 1.149 + /* Undo effects of setting up yytext. */ \ 1.150 + *yy_cp = yy_hold_char; \ 1.151 + YY_RESTORE_YY_MORE_OFFSET \ 1.152 + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ 1.153 + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ 1.154 + } \ 1.155 + while ( 0 ) 1.156 + 1.157 +#define unput(c) yyunput( c, yytext_ptr ) 1.158 + 1.159 +/* The following is because we cannot portably get our hands on size_t 1.160 + * (without autoconf's help, which isn't available because we want 1.161 + * flex-generated scanners to compile on their own). 1.162 + */ 1.163 +typedef unsigned int yy_size_t; 1.164 + 1.165 + 1.166 +struct yy_buffer_state 1.167 + { 1.168 + FILE *yy_input_file; 1.169 + 1.170 + char *yy_ch_buf; /* input buffer */ 1.171 + char *yy_buf_pos; /* current position in input buffer */ 1.172 + 1.173 + /* Size of input buffer in bytes, not including room for EOB 1.174 + * characters. 1.175 + */ 1.176 + yy_size_t yy_buf_size; 1.177 + 1.178 + /* Number of characters read into yy_ch_buf, not including EOB 1.179 + * characters. 1.180 + */ 1.181 + int yy_n_chars; 1.182 + 1.183 + /* Whether we "own" the buffer - i.e., we know we created it, 1.184 + * and can realloc() it to grow it, and should free() it to 1.185 + * delete it. 1.186 + */ 1.187 + int yy_is_our_buffer; 1.188 + 1.189 + /* Whether this is an "interactive" input source; if so, and 1.190 + * if we're using stdio for input, then we want to use getc() 1.191 + * instead of fread(), to make sure we stop fetching input after 1.192 + * each newline. 1.193 + */ 1.194 + int yy_is_interactive; 1.195 + 1.196 + /* Whether we're considered to be at the beginning of a line. 1.197 + * If so, '^' rules will be active on the next match, otherwise 1.198 + * not. 1.199 + */ 1.200 + int yy_at_bol; 1.201 + 1.202 + /* Whether to try to fill the input buffer when we reach the 1.203 + * end of it. 1.204 + */ 1.205 + int yy_fill_buffer; 1.206 + 1.207 + int yy_buffer_status; 1.208 +#define YY_BUFFER_NEW 0 1.209 +#define YY_BUFFER_NORMAL 1 1.210 + /* When an EOF's been seen but there's still some text to process 1.211 + * then we mark the buffer as YY_EOF_PENDING, to indicate that we 1.212 + * shouldn't try reading from the input source any more. We might 1.213 + * still have a bunch of tokens to match, though, because of 1.214 + * possible backing-up. 1.215 + * 1.216 + * When we actually see the EOF, we change the status to "new" 1.217 + * (via yyrestart()), so that the user can continue scanning by 1.218 + * just pointing yyin at a new input file. 1.219 + */ 1.220 +#define YY_BUFFER_EOF_PENDING 2 1.221 + }; 1.222 + 1.223 +static YY_BUFFER_STATE yy_current_buffer = 0; 1.224 + 1.225 +/* We provide macros for accessing buffer states in case in the 1.226 + * future we want to put the buffer states in a more general 1.227 + * "scanner state". 1.228 + */ 1.229 +#define YY_CURRENT_BUFFER yy_current_buffer 1.230 + 1.231 + 1.232 +/* yy_hold_char holds the character lost when yytext is formed. */ 1.233 +static char yy_hold_char; 1.234 + 1.235 +static int yy_n_chars; /* number of characters read into yy_ch_buf */ 1.236 + 1.237 + 1.238 +int yyleng; 1.239 + 1.240 +/* Points to current character in buffer. */ 1.241 +static char *yy_c_buf_p = (char *) 0; 1.242 +static int yy_init = 1; /* whether we need to initialize */ 1.243 +static int yy_start = 0; /* start state number */ 1.244 + 1.245 +/* Flag which is used to allow yywrap()'s to do buffer switches 1.246 + * instead of setting up a fresh yyin. A bit of a hack ... 1.247 + */ 1.248 +static int yy_did_buffer_switch_on_eof; 1.249 + 1.250 +void yyrestart YY_PROTO(( FILE *input_file )); 1.251 + 1.252 +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); 1.253 +void yy_load_buffer_state YY_PROTO(( void )); 1.254 +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); 1.255 +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); 1.256 +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); 1.257 +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); 1.258 +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) 1.259 + 1.260 +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); 1.261 +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); 1.262 +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); 1.263 + 1.264 +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); 1.265 +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); 1.266 +static void yy_flex_free YY_PROTO(( void * )); 1.267 + 1.268 +#define yy_new_buffer yy_create_buffer 1.269 + 1.270 +#define yy_set_interactive(is_interactive) \ 1.271 + { \ 1.272 + if ( ! yy_current_buffer ) \ 1.273 + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ 1.274 + yy_current_buffer->yy_is_interactive = is_interactive; \ 1.275 + } 1.276 + 1.277 +#define yy_set_bol(at_bol) \ 1.278 + { \ 1.279 + if ( ! yy_current_buffer ) \ 1.280 + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ 1.281 + yy_current_buffer->yy_at_bol = at_bol; \ 1.282 + } 1.283 + 1.284 +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) 1.285 + 1.286 +typedef unsigned char YY_CHAR; 1.287 +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; 1.288 +typedef int yy_state_type; 1.289 +extern char *yytext; 1.290 +#define yytext_ptr yytext 1.291 + 1.292 +static yy_state_type yy_get_previous_state YY_PROTO(( void )); 1.293 +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); 1.294 +static int yy_get_next_buffer YY_PROTO(( void )); 1.295 +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); 1.296 + 1.297 +/* Done after the current pattern has been matched and before the 1.298 + * corresponding action - sets up yytext. 1.299 + */ 1.300 +#define YY_DO_BEFORE_ACTION \ 1.301 + yytext_ptr = yy_bp; \ 1.302 + yyleng = (int) (yy_cp - yy_bp); \ 1.303 + yy_hold_char = *yy_cp; \ 1.304 + *yy_cp = '\0'; \ 1.305 + yy_c_buf_p = yy_cp; 1.306 + 1.307 +#define YY_NUM_RULES 8 1.308 +#define YY_END_OF_BUFFER 9 1.309 +static yyconst short int yy_accept[16] = 1.310 + { 0, 1.311 + 0, 0, 9, 3, 6, 5, 7, 1, 2, 3, 1.312 + 6, 0, 0, 4, 0 1.313 + } ; 1.314 + 1.315 +static yyconst int yy_ec[256] = 1.316 + { 0, 1.317 + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1.318 + 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1.319 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.320 + 1, 2, 1, 5, 1, 1, 1, 1, 1, 1, 1.321 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.322 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.323 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.324 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.325 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.326 + 1, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1.327 + 1.328 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.329 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.330 + 1, 1, 7, 1, 8, 1, 1, 1, 1, 1, 1.331 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.332 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.333 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.334 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.335 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.336 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.337 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.338 + 1.339 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.340 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.341 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.342 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.343 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.344 + 1, 1, 1, 1, 1 1.345 + } ; 1.346 + 1.347 +static yyconst int yy_meta[9] = 1.348 + { 0, 1.349 + 1, 2, 3, 4, 3, 1, 5, 5 1.350 + } ; 1.351 + 1.352 +static yyconst short int yy_base[19] = 1.353 + { 0, 1.354 + 0, 0, 19, 0, 0, 21, 12, 21, 21, 0, 1.355 + 0, 4, 6, 21, 21, 13, 11, 15 1.356 + } ; 1.357 + 1.358 +static yyconst short int yy_def[19] = 1.359 + { 0, 1.360 + 15, 1, 15, 16, 17, 15, 18, 15, 15, 16, 1.361 + 17, 18, 15, 15, 0, 15, 15, 15 1.362 + } ; 1.363 + 1.364 +static yyconst short int yy_nxt[30] = 1.365 + { 0, 1.366 + 4, 5, 6, 5, 7, 4, 8, 9, 14, 13, 1.367 + 12, 12, 11, 10, 11, 12, 12, 13, 15, 12, 1.368 + 3, 15, 15, 15, 15, 15, 15, 15, 15 1.369 + } ; 1.370 + 1.371 +static yyconst short int yy_chk[30] = 1.372 + { 0, 1.373 + 1, 1, 1, 1, 1, 1, 1, 1, 12, 12, 1.374 + 13, 13, 17, 16, 17, 18, 18, 7, 3, 18, 1.375 + 15, 15, 15, 15, 15, 15, 15, 15, 15 1.376 + } ; 1.377 + 1.378 +static yy_state_type yy_last_accepting_state; 1.379 +static char *yy_last_accepting_cpos; 1.380 + 1.381 +/* The intent behind this definition is that it'll catch 1.382 + * any uses of REJECT which flex missed. 1.383 + */ 1.384 +#define REJECT reject_used_but_not_detected 1.385 +#define yymore() yymore_used_but_not_detected 1.386 +#define YY_MORE_ADJ 0 1.387 +#define YY_RESTORE_YY_MORE_OFFSET 1.388 +char *yytext; 1.389 +#line 1 "installparse.l" 1.390 +#define INITIAL 0 1.391 +/* lex file for analyzing PKCS #11 Module installation instructions */ 1.392 +/*----------------------------- Definitions ---------------------------*/ 1.393 +#line 5 "installparse.l" 1.394 +#include <string.h> 1.395 + 1.396 +#include "install-ds.h" /* defines tokens and data structures */ 1.397 +#include "installparse.h" /* produced by yacc -d */ 1.398 +#include <prprf.h> 1.399 +static char *putSimpleString(char*); /* return copy of string */ 1.400 +static char *putComplexString(char*); /* strip out quotes, deal with */ 1.401 + /* escaped characters */ 1.402 + 1.403 +void Pk11Install_yyerror(char *); 1.404 + 1.405 +/* Overrides to use NSPR */ 1.406 +#define malloc PR_Malloc 1.407 +#define realloc PR_Realloc 1.408 +#define free PR_Free 1.409 + 1.410 +int Pk11Install_yylinenum=1; 1.411 +static char *err; 1.412 + 1.413 +#define YY_NEVER_INTERACTIVE 1 1.414 +#define yyunput Pkcs11Install_yyunput 1.415 + 1.416 +/* This is the default YY_INPUT modified for NSPR */ 1.417 +#define YY_INPUT(buf,result,max_size) \ 1.418 + if ( yy_current_buffer->yy_is_interactive ) { \ 1.419 + char c; \ 1.420 + int n; \ 1.421 + for ( n = 0; n < max_size && \ 1.422 + PR_Read(Pk11Install_FD, &c, 1)==1 && c != '\n'; ++n ) { \ 1.423 + buf[n] = c; \ 1.424 + } \ 1.425 + if ( c == '\n' ) { \ 1.426 + buf[n++] = c; \ 1.427 + } \ 1.428 + result = n; \ 1.429 + } else { \ 1.430 + result = PR_Read(Pk11Install_FD, buf, max_size); \ 1.431 + } 1.432 + 1.433 +/*** Regular expression definitions ***/ 1.434 +/* simple_string has no whitespace, quotes, or braces */ 1.435 +/* complex_string is enclosed in quotes. Inside the quotes, quotes and 1.436 + backslashes must be backslash-escaped. Otherwise, anything goes. */ 1.437 +/* Standard whitespace */ 1.438 +/*---------------------------- Actions --------------------------------*/ 1.439 +#line 437 "lex.Pk11Install_yy.cpp" 1.440 + 1.441 +/* Macros after this point can all be overridden by user definitions in 1.442 + * section 1. 1.443 + */ 1.444 + 1.445 +#ifndef YY_SKIP_YYWRAP 1.446 +#ifdef __cplusplus 1.447 +extern "C" int yywrap YY_PROTO(( void )); 1.448 +#else 1.449 +extern int yywrap YY_PROTO(( void )); 1.450 +#endif 1.451 +#endif 1.452 + 1.453 +#ifndef YY_NO_UNPUT 1.454 +static void yyunput YY_PROTO(( int c, char *buf_ptr )); 1.455 +#endif 1.456 + 1.457 +#ifndef yytext_ptr 1.458 +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); 1.459 +#endif 1.460 + 1.461 +#ifdef YY_NEED_STRLEN 1.462 +static int yy_flex_strlen YY_PROTO(( yyconst char * )); 1.463 +#endif 1.464 + 1.465 +#ifndef YY_NO_INPUT 1.466 +#ifdef __cplusplus 1.467 +static int yyinput YY_PROTO(( void )); 1.468 +#else 1.469 +static int input YY_PROTO(( void )); 1.470 +#endif 1.471 +#endif 1.472 + 1.473 +#if YY_STACK_USED 1.474 +static int yy_start_stack_ptr = 0; 1.475 +static int yy_start_stack_depth = 0; 1.476 +static int *yy_start_stack = 0; 1.477 +#ifndef YY_NO_PUSH_STATE 1.478 +static void yy_push_state YY_PROTO(( int new_state )); 1.479 +#endif 1.480 +#ifndef YY_NO_POP_STATE 1.481 +static void yy_pop_state YY_PROTO(( void )); 1.482 +#endif 1.483 +#ifndef YY_NO_TOP_STATE 1.484 +static int yy_top_state YY_PROTO(( void )); 1.485 +#endif 1.486 + 1.487 +#else 1.488 +#define YY_NO_PUSH_STATE 1 1.489 +#define YY_NO_POP_STATE 1 1.490 +#define YY_NO_TOP_STATE 1 1.491 +#endif 1.492 + 1.493 +#ifdef YY_MALLOC_DECL 1.494 +YY_MALLOC_DECL 1.495 +#else 1.496 +#if __STDC__ 1.497 +#ifndef __cplusplus 1.498 +#include <stdlib.h> 1.499 +#endif 1.500 +#else 1.501 +/* Just try to get by without declaring the routines. This will fail 1.502 + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) 1.503 + * or sizeof(void*) != sizeof(int). 1.504 + */ 1.505 +#endif 1.506 +#endif 1.507 + 1.508 +/* Amount of stuff to slurp up with each read. */ 1.509 +#ifndef YY_READ_BUF_SIZE 1.510 +#define YY_READ_BUF_SIZE 8192 1.511 +#endif 1.512 + 1.513 +/* Copy whatever the last rule matched to the standard output. */ 1.514 + 1.515 +#ifndef ECHO 1.516 +/* This used to be an fputs(), but since the string might contain NUL's, 1.517 + * we now use fwrite(). 1.518 + */ 1.519 +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) 1.520 +#endif 1.521 + 1.522 +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, 1.523 + * is returned in "result". 1.524 + */ 1.525 +#ifndef YY_INPUT 1.526 +#define YY_INPUT(buf,result,max_size) \ 1.527 + if ( yy_current_buffer->yy_is_interactive ) \ 1.528 + { \ 1.529 + int c = '*', n; \ 1.530 + for ( n = 0; n < max_size && \ 1.531 + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ 1.532 + buf[n] = (char) c; \ 1.533 + if ( c == '\n' ) \ 1.534 + buf[n++] = (char) c; \ 1.535 + if ( c == EOF && ferror( yyin ) ) \ 1.536 + YY_FATAL_ERROR( "input in flex scanner failed" ); \ 1.537 + result = n; \ 1.538 + } \ 1.539 + else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ 1.540 + && ferror( yyin ) ) \ 1.541 + YY_FATAL_ERROR( "input in flex scanner failed" ); 1.542 +#endif 1.543 + 1.544 +/* No semi-colon after return; correct usage is to write "yyterminate();" - 1.545 + * we don't want an extra ';' after the "return" because that will cause 1.546 + * some compilers to complain about unreachable statements. 1.547 + */ 1.548 +#ifndef yyterminate 1.549 +#define yyterminate() return YY_NULL 1.550 +#endif 1.551 + 1.552 +/* Number of entries by which start-condition stack grows. */ 1.553 +#ifndef YY_START_STACK_INCR 1.554 +#define YY_START_STACK_INCR 25 1.555 +#endif 1.556 + 1.557 +/* Report a fatal error. */ 1.558 +#ifndef YY_FATAL_ERROR 1.559 +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) 1.560 +#endif 1.561 + 1.562 +/* Default declaration of generated scanner - a define so the user can 1.563 + * easily add parameters. 1.564 + */ 1.565 +#ifndef YY_DECL 1.566 +#define YY_DECL int yylex YY_PROTO(( void )) 1.567 +#endif 1.568 + 1.569 +/* Code executed at the beginning of each rule, after yytext and yyleng 1.570 + * have been set up. 1.571 + */ 1.572 +#ifndef YY_USER_ACTION 1.573 +#define YY_USER_ACTION 1.574 +#endif 1.575 + 1.576 +/* Code executed at the end of each rule. */ 1.577 +#ifndef YY_BREAK 1.578 +#define YY_BREAK break; 1.579 +#endif 1.580 + 1.581 +#define YY_RULE_SETUP \ 1.582 + YY_USER_ACTION 1.583 + 1.584 +YY_DECL 1.585 + { 1.586 + register yy_state_type yy_current_state; 1.587 + register char *yy_cp, *yy_bp; 1.588 + register int yy_act; 1.589 + 1.590 +#line 60 "installparse.l" 1.591 + 1.592 + 1.593 +#line 591 "lex.Pk11Install_yy.cpp" 1.594 + 1.595 + if ( yy_init ) 1.596 + { 1.597 + yy_init = 0; 1.598 + 1.599 +#ifdef YY_USER_INIT 1.600 + YY_USER_INIT; 1.601 +#endif 1.602 + 1.603 + if ( ! yy_start ) 1.604 + yy_start = 1; /* first start state */ 1.605 + 1.606 + if ( ! yyin ) 1.607 + yyin = stdin; 1.608 + 1.609 + if ( ! yyout ) 1.610 + yyout = stdout; 1.611 + 1.612 + if ( ! yy_current_buffer ) 1.613 + yy_current_buffer = 1.614 + yy_create_buffer( yyin, YY_BUF_SIZE ); 1.615 + 1.616 + yy_load_buffer_state(); 1.617 + } 1.618 + 1.619 + while ( 1 ) /* loops until end-of-file is reached */ 1.620 + { 1.621 + yy_cp = yy_c_buf_p; 1.622 + 1.623 + /* Support of yytext. */ 1.624 + *yy_cp = yy_hold_char; 1.625 + 1.626 + /* yy_bp points to the position in yy_ch_buf of the start of 1.627 + * the current run. 1.628 + */ 1.629 + yy_bp = yy_cp; 1.630 + 1.631 + yy_current_state = yy_start; 1.632 +yy_match: 1.633 + do 1.634 + { 1.635 + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; 1.636 + if ( yy_accept[yy_current_state] ) 1.637 + { 1.638 + yy_last_accepting_state = yy_current_state; 1.639 + yy_last_accepting_cpos = yy_cp; 1.640 + } 1.641 + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1.642 + { 1.643 + yy_current_state = (int) yy_def[yy_current_state]; 1.644 + if ( yy_current_state >= 16 ) 1.645 + yy_c = yy_meta[(unsigned int) yy_c]; 1.646 + } 1.647 + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1.648 + ++yy_cp; 1.649 + } 1.650 + while ( yy_base[yy_current_state] != 21 ); 1.651 + 1.652 +yy_find_action: 1.653 + yy_act = yy_accept[yy_current_state]; 1.654 + if ( yy_act == 0 ) 1.655 + { /* have to back up */ 1.656 + yy_cp = yy_last_accepting_cpos; 1.657 + yy_current_state = yy_last_accepting_state; 1.658 + yy_act = yy_accept[yy_current_state]; 1.659 + } 1.660 + 1.661 + YY_DO_BEFORE_ACTION; 1.662 + 1.663 + 1.664 +do_action: /* This label is used only to access EOF actions. */ 1.665 + 1.666 + 1.667 + switch ( yy_act ) 1.668 + { /* beginning of action switch */ 1.669 + case 0: /* must back up */ 1.670 + /* undo the effects of YY_DO_BEFORE_ACTION */ 1.671 + *yy_cp = yy_hold_char; 1.672 + yy_cp = yy_last_accepting_cpos; 1.673 + yy_current_state = yy_last_accepting_state; 1.674 + goto yy_find_action; 1.675 + 1.676 +case 1: 1.677 +YY_RULE_SETUP 1.678 +#line 62 "installparse.l" 1.679 +return OPENBRACE; 1.680 + YY_BREAK 1.681 +case 2: 1.682 +YY_RULE_SETUP 1.683 +#line 63 "installparse.l" 1.684 +return CLOSEBRACE; 1.685 + YY_BREAK 1.686 +case 3: 1.687 +YY_RULE_SETUP 1.688 +#line 64 "installparse.l" 1.689 +{Pk11Install_yylval.string = 1.690 + putSimpleString(Pk11Install_yytext); 1.691 + return STRING;} 1.692 + YY_BREAK 1.693 +case 4: 1.694 +YY_RULE_SETUP 1.695 +#line 67 "installparse.l" 1.696 +{Pk11Install_yylval.string = 1.697 + putComplexString(Pk11Install_yytext); 1.698 + return STRING;} 1.699 + YY_BREAK 1.700 +case 5: 1.701 +YY_RULE_SETUP 1.702 +#line 71 "installparse.l" 1.703 +Pk11Install_yylinenum++; 1.704 + YY_BREAK 1.705 +case 6: 1.706 +YY_RULE_SETUP 1.707 +#line 73 "installparse.l" 1.708 +; 1.709 + YY_BREAK 1.710 +case 7: 1.711 +YY_RULE_SETUP 1.712 +#line 75 "installparse.l" 1.713 +{err = PR_smprintf("Invalid lexeme: %s",Pk11Install_yytext); 1.714 + Pk11Install_yyerror(err); 1.715 + PR_smprintf_free(err); 1.716 + return 1; 1.717 + } 1.718 + YY_BREAK 1.719 +case 8: 1.720 +YY_RULE_SETUP 1.721 +#line 81 "installparse.l" 1.722 +ECHO; 1.723 + YY_BREAK 1.724 +#line 722 "lex.Pk11Install_yy.cpp" 1.725 +case YY_STATE_EOF(INITIAL): 1.726 + yyterminate(); 1.727 + 1.728 + case YY_END_OF_BUFFER: 1.729 + { 1.730 + /* Amount of text matched not including the EOB char. */ 1.731 + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; 1.732 + 1.733 + /* Undo the effects of YY_DO_BEFORE_ACTION. */ 1.734 + *yy_cp = yy_hold_char; 1.735 + YY_RESTORE_YY_MORE_OFFSET 1.736 + 1.737 + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) 1.738 + { 1.739 + /* We're scanning a new file or input source. It's 1.740 + * possible that this happened because the user 1.741 + * just pointed yyin at a new source and called 1.742 + * yylex(). If so, then we have to assure 1.743 + * consistency between yy_current_buffer and our 1.744 + * globals. Here is the right place to do so, because 1.745 + * this is the first action (other than possibly a 1.746 + * back-up) that will match for the new input source. 1.747 + */ 1.748 + yy_n_chars = yy_current_buffer->yy_n_chars; 1.749 + yy_current_buffer->yy_input_file = yyin; 1.750 + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; 1.751 + } 1.752 + 1.753 + /* Note that here we test for yy_c_buf_p "<=" to the position 1.754 + * of the first EOB in the buffer, since yy_c_buf_p will 1.755 + * already have been incremented past the NUL character 1.756 + * (since all states make transitions on EOB to the 1.757 + * end-of-buffer state). Contrast this with the test 1.758 + * in input(). 1.759 + */ 1.760 + if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) 1.761 + { /* This was really a NUL. */ 1.762 + yy_state_type yy_next_state; 1.763 + 1.764 + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; 1.765 + 1.766 + yy_current_state = yy_get_previous_state(); 1.767 + 1.768 + /* Okay, we're now positioned to make the NUL 1.769 + * transition. We couldn't have 1.770 + * yy_get_previous_state() go ahead and do it 1.771 + * for us because it doesn't know how to deal 1.772 + * with the possibility of jamming (and we don't 1.773 + * want to build jamming into it because then it 1.774 + * will run more slowly). 1.775 + */ 1.776 + 1.777 + yy_next_state = yy_try_NUL_trans( yy_current_state ); 1.778 + 1.779 + yy_bp = yytext_ptr + YY_MORE_ADJ; 1.780 + 1.781 + if ( yy_next_state ) 1.782 + { 1.783 + /* Consume the NUL. */ 1.784 + yy_cp = ++yy_c_buf_p; 1.785 + yy_current_state = yy_next_state; 1.786 + goto yy_match; 1.787 + } 1.788 + 1.789 + else 1.790 + { 1.791 + yy_cp = yy_c_buf_p; 1.792 + goto yy_find_action; 1.793 + } 1.794 + } 1.795 + 1.796 + else switch ( yy_get_next_buffer() ) 1.797 + { 1.798 + case EOB_ACT_END_OF_FILE: 1.799 + { 1.800 + yy_did_buffer_switch_on_eof = 0; 1.801 + 1.802 + if ( yywrap() ) 1.803 + { 1.804 + /* Note: because we've taken care in 1.805 + * yy_get_next_buffer() to have set up 1.806 + * yytext, we can now set up 1.807 + * yy_c_buf_p so that if some total 1.808 + * hoser (like flex itself) wants to 1.809 + * call the scanner after we return the 1.810 + * YY_NULL, it'll still work - another 1.811 + * YY_NULL will get returned. 1.812 + */ 1.813 + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; 1.814 + 1.815 + yy_act = YY_STATE_EOF(YY_START); 1.816 + goto do_action; 1.817 + } 1.818 + 1.819 + else 1.820 + { 1.821 + if ( ! yy_did_buffer_switch_on_eof ) 1.822 + YY_NEW_FILE; 1.823 + } 1.824 + break; 1.825 + } 1.826 + 1.827 + case EOB_ACT_CONTINUE_SCAN: 1.828 + yy_c_buf_p = 1.829 + yytext_ptr + yy_amount_of_matched_text; 1.830 + 1.831 + yy_current_state = yy_get_previous_state(); 1.832 + 1.833 + yy_cp = yy_c_buf_p; 1.834 + yy_bp = yytext_ptr + YY_MORE_ADJ; 1.835 + goto yy_match; 1.836 + 1.837 + case EOB_ACT_LAST_MATCH: 1.838 + yy_c_buf_p = 1.839 + &yy_current_buffer->yy_ch_buf[yy_n_chars]; 1.840 + 1.841 + yy_current_state = yy_get_previous_state(); 1.842 + 1.843 + yy_cp = yy_c_buf_p; 1.844 + yy_bp = yytext_ptr + YY_MORE_ADJ; 1.845 + goto yy_find_action; 1.846 + } 1.847 + break; 1.848 + } 1.849 + 1.850 + default: 1.851 + YY_FATAL_ERROR( 1.852 + "fatal flex scanner internal error--no action found" ); 1.853 + } /* end of action switch */ 1.854 + } /* end of scanning one token */ 1.855 + } /* end of yylex */ 1.856 + 1.857 + 1.858 +/* yy_get_next_buffer - try to read in a new buffer 1.859 + * 1.860 + * Returns a code representing an action: 1.861 + * EOB_ACT_LAST_MATCH - 1.862 + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position 1.863 + * EOB_ACT_END_OF_FILE - end of file 1.864 + */ 1.865 + 1.866 +static int yy_get_next_buffer() 1.867 + { 1.868 + register char *dest = yy_current_buffer->yy_ch_buf; 1.869 + register char *source = yytext_ptr; 1.870 + register int number_to_move, i; 1.871 + int ret_val; 1.872 + 1.873 + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) 1.874 + YY_FATAL_ERROR( 1.875 + "fatal flex scanner internal error--end of buffer missed" ); 1.876 + 1.877 + if ( yy_current_buffer->yy_fill_buffer == 0 ) 1.878 + { /* Don't try to fill the buffer, so this is an EOF. */ 1.879 + if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) 1.880 + { 1.881 + /* We matched a single character, the EOB, so 1.882 + * treat this as a final EOF. 1.883 + */ 1.884 + return EOB_ACT_END_OF_FILE; 1.885 + } 1.886 + 1.887 + else 1.888 + { 1.889 + /* We matched some text prior to the EOB, first 1.890 + * process it. 1.891 + */ 1.892 + return EOB_ACT_LAST_MATCH; 1.893 + } 1.894 + } 1.895 + 1.896 + /* Try to read more data. */ 1.897 + 1.898 + /* First move last chars to start of buffer. */ 1.899 + number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; 1.900 + 1.901 + for ( i = 0; i < number_to_move; ++i ) 1.902 + *(dest++) = *(source++); 1.903 + 1.904 + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) 1.905 + /* don't do the read, it's not guaranteed to return an EOF, 1.906 + * just force an EOF 1.907 + */ 1.908 + yy_current_buffer->yy_n_chars = yy_n_chars = 0; 1.909 + 1.910 + else 1.911 + { 1.912 + int num_to_read = 1.913 + yy_current_buffer->yy_buf_size - number_to_move - 1; 1.914 + 1.915 + while ( num_to_read <= 0 ) 1.916 + { /* Not enough room in the buffer - grow it. */ 1.917 +#ifdef YY_USES_REJECT 1.918 + YY_FATAL_ERROR( 1.919 +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); 1.920 +#else 1.921 + 1.922 + /* just a shorter name for the current buffer */ 1.923 + YY_BUFFER_STATE b = yy_current_buffer; 1.924 + 1.925 + int yy_c_buf_p_offset = 1.926 + (int) (yy_c_buf_p - b->yy_ch_buf); 1.927 + 1.928 + if ( b->yy_is_our_buffer ) 1.929 + { 1.930 + int new_size = b->yy_buf_size * 2; 1.931 + 1.932 + if ( new_size <= 0 ) 1.933 + b->yy_buf_size += b->yy_buf_size / 8; 1.934 + else 1.935 + b->yy_buf_size *= 2; 1.936 + 1.937 + b->yy_ch_buf = (char *) 1.938 + /* Include room in for 2 EOB chars. */ 1.939 + yy_flex_realloc( (void *) b->yy_ch_buf, 1.940 + b->yy_buf_size + 2 ); 1.941 + } 1.942 + else 1.943 + /* Can't grow it, we don't own it. */ 1.944 + b->yy_ch_buf = 0; 1.945 + 1.946 + if ( ! b->yy_ch_buf ) 1.947 + YY_FATAL_ERROR( 1.948 + "fatal error - scanner input buffer overflow" ); 1.949 + 1.950 + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; 1.951 + 1.952 + num_to_read = yy_current_buffer->yy_buf_size - 1.953 + number_to_move - 1; 1.954 +#endif 1.955 + } 1.956 + 1.957 + if ( num_to_read > YY_READ_BUF_SIZE ) 1.958 + num_to_read = YY_READ_BUF_SIZE; 1.959 + 1.960 + /* Read in more data. */ 1.961 + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), 1.962 + yy_n_chars, num_to_read ); 1.963 + 1.964 + yy_current_buffer->yy_n_chars = yy_n_chars; 1.965 + } 1.966 + 1.967 + if ( yy_n_chars == 0 ) 1.968 + { 1.969 + if ( number_to_move == YY_MORE_ADJ ) 1.970 + { 1.971 + ret_val = EOB_ACT_END_OF_FILE; 1.972 + yyrestart( yyin ); 1.973 + } 1.974 + 1.975 + else 1.976 + { 1.977 + ret_val = EOB_ACT_LAST_MATCH; 1.978 + yy_current_buffer->yy_buffer_status = 1.979 + YY_BUFFER_EOF_PENDING; 1.980 + } 1.981 + } 1.982 + 1.983 + else 1.984 + ret_val = EOB_ACT_CONTINUE_SCAN; 1.985 + 1.986 + yy_n_chars += number_to_move; 1.987 + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; 1.988 + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; 1.989 + 1.990 + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; 1.991 + 1.992 + return ret_val; 1.993 + } 1.994 + 1.995 + 1.996 +/* yy_get_previous_state - get the state just before the EOB char was reached */ 1.997 + 1.998 +static yy_state_type yy_get_previous_state() 1.999 + { 1.1000 + register yy_state_type yy_current_state; 1.1001 + register char *yy_cp; 1.1002 + 1.1003 + yy_current_state = yy_start; 1.1004 + 1.1005 + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) 1.1006 + { 1.1007 + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); 1.1008 + if ( yy_accept[yy_current_state] ) 1.1009 + { 1.1010 + yy_last_accepting_state = yy_current_state; 1.1011 + yy_last_accepting_cpos = yy_cp; 1.1012 + } 1.1013 + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1.1014 + { 1.1015 + yy_current_state = (int) yy_def[yy_current_state]; 1.1016 + if ( yy_current_state >= 16 ) 1.1017 + yy_c = yy_meta[(unsigned int) yy_c]; 1.1018 + } 1.1019 + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1.1020 + } 1.1021 + 1.1022 + return yy_current_state; 1.1023 + } 1.1024 + 1.1025 + 1.1026 +/* yy_try_NUL_trans - try to make a transition on the NUL character 1.1027 + * 1.1028 + * synopsis 1.1029 + * next_state = yy_try_NUL_trans( current_state ); 1.1030 + */ 1.1031 + 1.1032 +#ifdef YY_USE_PROTOS 1.1033 +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) 1.1034 +#else 1.1035 +static yy_state_type yy_try_NUL_trans( yy_current_state ) 1.1036 +yy_state_type yy_current_state; 1.1037 +#endif 1.1038 + { 1.1039 + register int yy_is_jam; 1.1040 + register char *yy_cp = yy_c_buf_p; 1.1041 + 1.1042 + register YY_CHAR yy_c = 1; 1.1043 + if ( yy_accept[yy_current_state] ) 1.1044 + { 1.1045 + yy_last_accepting_state = yy_current_state; 1.1046 + yy_last_accepting_cpos = yy_cp; 1.1047 + } 1.1048 + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) 1.1049 + { 1.1050 + yy_current_state = (int) yy_def[yy_current_state]; 1.1051 + if ( yy_current_state >= 16 ) 1.1052 + yy_c = yy_meta[(unsigned int) yy_c]; 1.1053 + } 1.1054 + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; 1.1055 + yy_is_jam = (yy_current_state == 15); 1.1056 + 1.1057 + return yy_is_jam ? 0 : yy_current_state; 1.1058 + } 1.1059 + 1.1060 + 1.1061 +#ifndef YY_NO_UNPUT 1.1062 +#ifdef YY_USE_PROTOS 1.1063 +static void yyunput( int c, register char *yy_bp ) 1.1064 +#else 1.1065 +static void yyunput( c, yy_bp ) 1.1066 +int c; 1.1067 +register char *yy_bp; 1.1068 +#endif 1.1069 + { 1.1070 + register char *yy_cp = yy_c_buf_p; 1.1071 + 1.1072 + /* undo effects of setting up yytext */ 1.1073 + *yy_cp = yy_hold_char; 1.1074 + 1.1075 + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) 1.1076 + { /* need to shift things up to make room */ 1.1077 + /* +2 for EOB chars. */ 1.1078 + register int number_to_move = yy_n_chars + 2; 1.1079 + register char *dest = &yy_current_buffer->yy_ch_buf[ 1.1080 + yy_current_buffer->yy_buf_size + 2]; 1.1081 + register char *source = 1.1082 + &yy_current_buffer->yy_ch_buf[number_to_move]; 1.1083 + 1.1084 + while ( source > yy_current_buffer->yy_ch_buf ) 1.1085 + *--dest = *--source; 1.1086 + 1.1087 + yy_cp += (int) (dest - source); 1.1088 + yy_bp += (int) (dest - source); 1.1089 + yy_current_buffer->yy_n_chars = 1.1090 + yy_n_chars = yy_current_buffer->yy_buf_size; 1.1091 + 1.1092 + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) 1.1093 + YY_FATAL_ERROR( "flex scanner push-back overflow" ); 1.1094 + } 1.1095 + 1.1096 + *--yy_cp = (char) c; 1.1097 + 1.1098 + 1.1099 + yytext_ptr = yy_bp; 1.1100 + yy_hold_char = *yy_cp; 1.1101 + yy_c_buf_p = yy_cp; 1.1102 + } 1.1103 +#endif /* ifndef YY_NO_UNPUT */ 1.1104 + 1.1105 + 1.1106 +#ifdef __cplusplus 1.1107 +static int yyinput() 1.1108 +#else 1.1109 +static int input() 1.1110 +#endif 1.1111 + { 1.1112 + int c; 1.1113 + 1.1114 + *yy_c_buf_p = yy_hold_char; 1.1115 + 1.1116 + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) 1.1117 + { 1.1118 + /* yy_c_buf_p now points to the character we want to return. 1.1119 + * If this occurs *before* the EOB characters, then it's a 1.1120 + * valid NUL; if not, then we've hit the end of the buffer. 1.1121 + */ 1.1122 + if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) 1.1123 + /* This was really a NUL. */ 1.1124 + *yy_c_buf_p = '\0'; 1.1125 + 1.1126 + else 1.1127 + { /* need more input */ 1.1128 + int offset = yy_c_buf_p - yytext_ptr; 1.1129 + ++yy_c_buf_p; 1.1130 + 1.1131 + switch ( yy_get_next_buffer() ) 1.1132 + { 1.1133 + case EOB_ACT_LAST_MATCH: 1.1134 + /* This happens because yy_g_n_b() 1.1135 + * sees that we've accumulated a 1.1136 + * token and flags that we need to 1.1137 + * try matching the token before 1.1138 + * proceeding. But for input(), 1.1139 + * there's no matching to consider. 1.1140 + * So convert the EOB_ACT_LAST_MATCH 1.1141 + * to EOB_ACT_END_OF_FILE. 1.1142 + */ 1.1143 + 1.1144 + /* Reset buffer status. */ 1.1145 + yyrestart( yyin ); 1.1146 + 1.1147 + /* fall through */ 1.1148 + 1.1149 + case EOB_ACT_END_OF_FILE: 1.1150 + { 1.1151 + if ( yywrap() ) 1.1152 + return EOF; 1.1153 + 1.1154 + if ( ! yy_did_buffer_switch_on_eof ) 1.1155 + YY_NEW_FILE; 1.1156 +#ifdef __cplusplus 1.1157 + return yyinput(); 1.1158 +#else 1.1159 + return input(); 1.1160 +#endif 1.1161 + } 1.1162 + 1.1163 + case EOB_ACT_CONTINUE_SCAN: 1.1164 + yy_c_buf_p = yytext_ptr + offset; 1.1165 + break; 1.1166 + } 1.1167 + } 1.1168 + } 1.1169 + 1.1170 + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ 1.1171 + *yy_c_buf_p = '\0'; /* preserve yytext */ 1.1172 + yy_hold_char = *++yy_c_buf_p; 1.1173 + 1.1174 + 1.1175 + return c; 1.1176 + } 1.1177 + 1.1178 + 1.1179 +#ifdef YY_USE_PROTOS 1.1180 +void yyrestart( FILE *input_file ) 1.1181 +#else 1.1182 +void yyrestart( input_file ) 1.1183 +FILE *input_file; 1.1184 +#endif 1.1185 + { 1.1186 + if ( ! yy_current_buffer ) 1.1187 + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); 1.1188 + 1.1189 + yy_init_buffer( yy_current_buffer, input_file ); 1.1190 + yy_load_buffer_state(); 1.1191 + } 1.1192 + 1.1193 + 1.1194 +#ifdef YY_USE_PROTOS 1.1195 +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) 1.1196 +#else 1.1197 +void yy_switch_to_buffer( new_buffer ) 1.1198 +YY_BUFFER_STATE new_buffer; 1.1199 +#endif 1.1200 + { 1.1201 + if ( yy_current_buffer == new_buffer ) 1.1202 + return; 1.1203 + 1.1204 + if ( yy_current_buffer ) 1.1205 + { 1.1206 + /* Flush out information for old buffer. */ 1.1207 + *yy_c_buf_p = yy_hold_char; 1.1208 + yy_current_buffer->yy_buf_pos = yy_c_buf_p; 1.1209 + yy_current_buffer->yy_n_chars = yy_n_chars; 1.1210 + } 1.1211 + 1.1212 + yy_current_buffer = new_buffer; 1.1213 + yy_load_buffer_state(); 1.1214 + 1.1215 + /* We don't actually know whether we did this switch during 1.1216 + * EOF (yywrap()) processing, but the only time this flag 1.1217 + * is looked at is after yywrap() is called, so it's safe 1.1218 + * to go ahead and always set it. 1.1219 + */ 1.1220 + yy_did_buffer_switch_on_eof = 1; 1.1221 + } 1.1222 + 1.1223 + 1.1224 +#ifdef YY_USE_PROTOS 1.1225 +void yy_load_buffer_state( void ) 1.1226 +#else 1.1227 +void yy_load_buffer_state() 1.1228 +#endif 1.1229 + { 1.1230 + yy_n_chars = yy_current_buffer->yy_n_chars; 1.1231 + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; 1.1232 + yyin = yy_current_buffer->yy_input_file; 1.1233 + yy_hold_char = *yy_c_buf_p; 1.1234 + } 1.1235 + 1.1236 + 1.1237 +#ifdef YY_USE_PROTOS 1.1238 +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) 1.1239 +#else 1.1240 +YY_BUFFER_STATE yy_create_buffer( file, size ) 1.1241 +FILE *file; 1.1242 +int size; 1.1243 +#endif 1.1244 + { 1.1245 + YY_BUFFER_STATE b; 1.1246 + 1.1247 + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); 1.1248 + if ( ! b ) 1.1249 + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 1.1250 + 1.1251 + b->yy_buf_size = size; 1.1252 + 1.1253 + /* yy_ch_buf has to be 2 characters longer than the size given because 1.1254 + * we need to put in 2 end-of-buffer characters. 1.1255 + */ 1.1256 + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); 1.1257 + if ( ! b->yy_ch_buf ) 1.1258 + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); 1.1259 + 1.1260 + b->yy_is_our_buffer = 1; 1.1261 + 1.1262 + yy_init_buffer( b, file ); 1.1263 + 1.1264 + return b; 1.1265 + } 1.1266 + 1.1267 + 1.1268 +#ifdef YY_USE_PROTOS 1.1269 +void yy_delete_buffer( YY_BUFFER_STATE b ) 1.1270 +#else 1.1271 +void yy_delete_buffer( b ) 1.1272 +YY_BUFFER_STATE b; 1.1273 +#endif 1.1274 + { 1.1275 + if ( ! b ) 1.1276 + return; 1.1277 + 1.1278 + if ( b == yy_current_buffer ) 1.1279 + yy_current_buffer = (YY_BUFFER_STATE) 0; 1.1280 + 1.1281 + if ( b->yy_is_our_buffer ) 1.1282 + yy_flex_free( (void *) b->yy_ch_buf ); 1.1283 + 1.1284 + yy_flex_free( (void *) b ); 1.1285 + } 1.1286 + 1.1287 + 1.1288 +#ifndef YY_ALWAYS_INTERACTIVE 1.1289 +#ifndef YY_NEVER_INTERACTIVE 1.1290 +extern int isatty YY_PROTO(( int )); 1.1291 +#endif 1.1292 +#endif 1.1293 + 1.1294 +#ifdef YY_USE_PROTOS 1.1295 +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) 1.1296 +#else 1.1297 +void yy_init_buffer( b, file ) 1.1298 +YY_BUFFER_STATE b; 1.1299 +FILE *file; 1.1300 +#endif 1.1301 + 1.1302 + 1.1303 + { 1.1304 + yy_flush_buffer( b ); 1.1305 + 1.1306 + b->yy_input_file = file; 1.1307 + b->yy_fill_buffer = 1; 1.1308 + 1.1309 +#if YY_ALWAYS_INTERACTIVE 1.1310 + b->yy_is_interactive = 1; 1.1311 +#else 1.1312 +#if YY_NEVER_INTERACTIVE 1.1313 + b->yy_is_interactive = 0; 1.1314 +#else 1.1315 + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; 1.1316 +#endif 1.1317 +#endif 1.1318 + } 1.1319 + 1.1320 + 1.1321 +#ifdef YY_USE_PROTOS 1.1322 +void yy_flush_buffer( YY_BUFFER_STATE b ) 1.1323 +#else 1.1324 +void yy_flush_buffer( b ) 1.1325 +YY_BUFFER_STATE b; 1.1326 +#endif 1.1327 + 1.1328 + { 1.1329 + if ( ! b ) 1.1330 + return; 1.1331 + 1.1332 + b->yy_n_chars = 0; 1.1333 + 1.1334 + /* We always need two end-of-buffer characters. The first causes 1.1335 + * a transition to the end-of-buffer state. The second causes 1.1336 + * a jam in that state. 1.1337 + */ 1.1338 + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; 1.1339 + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; 1.1340 + 1.1341 + b->yy_buf_pos = &b->yy_ch_buf[0]; 1.1342 + 1.1343 + b->yy_at_bol = 1; 1.1344 + b->yy_buffer_status = YY_BUFFER_NEW; 1.1345 + 1.1346 + if ( b == yy_current_buffer ) 1.1347 + yy_load_buffer_state(); 1.1348 + } 1.1349 + 1.1350 + 1.1351 +#ifndef YY_NO_SCAN_BUFFER 1.1352 +#ifdef YY_USE_PROTOS 1.1353 +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) 1.1354 +#else 1.1355 +YY_BUFFER_STATE yy_scan_buffer( base, size ) 1.1356 +char *base; 1.1357 +yy_size_t size; 1.1358 +#endif 1.1359 + { 1.1360 + YY_BUFFER_STATE b; 1.1361 + 1.1362 + if ( size < 2 || 1.1363 + base[size-2] != YY_END_OF_BUFFER_CHAR || 1.1364 + base[size-1] != YY_END_OF_BUFFER_CHAR ) 1.1365 + /* They forgot to leave room for the EOB's. */ 1.1366 + return 0; 1.1367 + 1.1368 + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); 1.1369 + if ( ! b ) 1.1370 + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); 1.1371 + 1.1372 + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ 1.1373 + b->yy_buf_pos = b->yy_ch_buf = base; 1.1374 + b->yy_is_our_buffer = 0; 1.1375 + b->yy_input_file = 0; 1.1376 + b->yy_n_chars = b->yy_buf_size; 1.1377 + b->yy_is_interactive = 0; 1.1378 + b->yy_at_bol = 1; 1.1379 + b->yy_fill_buffer = 0; 1.1380 + b->yy_buffer_status = YY_BUFFER_NEW; 1.1381 + 1.1382 + yy_switch_to_buffer( b ); 1.1383 + 1.1384 + return b; 1.1385 + } 1.1386 +#endif 1.1387 + 1.1388 + 1.1389 +#ifndef YY_NO_SCAN_STRING 1.1390 +#ifdef YY_USE_PROTOS 1.1391 +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) 1.1392 +#else 1.1393 +YY_BUFFER_STATE yy_scan_string( yy_str ) 1.1394 +yyconst char *yy_str; 1.1395 +#endif 1.1396 + { 1.1397 + int len; 1.1398 + for ( len = 0; yy_str[len]; ++len ) 1.1399 + ; 1.1400 + 1.1401 + return yy_scan_bytes( yy_str, len ); 1.1402 + } 1.1403 +#endif 1.1404 + 1.1405 + 1.1406 +#ifndef YY_NO_SCAN_BYTES 1.1407 +#ifdef YY_USE_PROTOS 1.1408 +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) 1.1409 +#else 1.1410 +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) 1.1411 +yyconst char *bytes; 1.1412 +int len; 1.1413 +#endif 1.1414 + { 1.1415 + YY_BUFFER_STATE b; 1.1416 + char *buf; 1.1417 + yy_size_t n; 1.1418 + int i; 1.1419 + 1.1420 + /* Get memory for full buffer, including space for trailing EOB's. */ 1.1421 + n = len + 2; 1.1422 + buf = (char *) yy_flex_alloc( n ); 1.1423 + if ( ! buf ) 1.1424 + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); 1.1425 + 1.1426 + for ( i = 0; i < len; ++i ) 1.1427 + buf[i] = bytes[i]; 1.1428 + 1.1429 + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; 1.1430 + 1.1431 + b = yy_scan_buffer( buf, n ); 1.1432 + if ( ! b ) 1.1433 + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); 1.1434 + 1.1435 + /* It's okay to grow etc. this buffer, and we should throw it 1.1436 + * away when we're done. 1.1437 + */ 1.1438 + b->yy_is_our_buffer = 1; 1.1439 + 1.1440 + return b; 1.1441 + } 1.1442 +#endif 1.1443 + 1.1444 + 1.1445 +#ifndef YY_NO_PUSH_STATE 1.1446 +#ifdef YY_USE_PROTOS 1.1447 +static void yy_push_state( int new_state ) 1.1448 +#else 1.1449 +static void yy_push_state( new_state ) 1.1450 +int new_state; 1.1451 +#endif 1.1452 + { 1.1453 + if ( yy_start_stack_ptr >= yy_start_stack_depth ) 1.1454 + { 1.1455 + yy_size_t new_size; 1.1456 + 1.1457 + yy_start_stack_depth += YY_START_STACK_INCR; 1.1458 + new_size = yy_start_stack_depth * sizeof( int ); 1.1459 + 1.1460 + if ( ! yy_start_stack ) 1.1461 + yy_start_stack = (int *) yy_flex_alloc( new_size ); 1.1462 + 1.1463 + else 1.1464 + yy_start_stack = (int *) yy_flex_realloc( 1.1465 + (void *) yy_start_stack, new_size ); 1.1466 + 1.1467 + if ( ! yy_start_stack ) 1.1468 + YY_FATAL_ERROR( 1.1469 + "out of memory expanding start-condition stack" ); 1.1470 + } 1.1471 + 1.1472 + yy_start_stack[yy_start_stack_ptr++] = YY_START; 1.1473 + 1.1474 + BEGIN(new_state); 1.1475 + } 1.1476 +#endif 1.1477 + 1.1478 + 1.1479 +#ifndef YY_NO_POP_STATE 1.1480 +static void yy_pop_state() 1.1481 + { 1.1482 + if ( --yy_start_stack_ptr < 0 ) 1.1483 + YY_FATAL_ERROR( "start-condition stack underflow" ); 1.1484 + 1.1485 + BEGIN(yy_start_stack[yy_start_stack_ptr]); 1.1486 + } 1.1487 +#endif 1.1488 + 1.1489 + 1.1490 +#ifndef YY_NO_TOP_STATE 1.1491 +static int yy_top_state() 1.1492 + { 1.1493 + return yy_start_stack[yy_start_stack_ptr - 1]; 1.1494 + } 1.1495 +#endif 1.1496 + 1.1497 +#ifndef YY_EXIT_FAILURE 1.1498 +#define YY_EXIT_FAILURE 2 1.1499 +#endif 1.1500 + 1.1501 +#ifdef YY_USE_PROTOS 1.1502 +static void yy_fatal_error( yyconst char msg[] ) 1.1503 +#else 1.1504 +static void yy_fatal_error( msg ) 1.1505 +char msg[]; 1.1506 +#endif 1.1507 + { 1.1508 + (void) fprintf( stderr, "%s\n", msg ); 1.1509 + exit( YY_EXIT_FAILURE ); 1.1510 + } 1.1511 + 1.1512 + 1.1513 + 1.1514 +/* Redefine yyless() so it works in section 3 code. */ 1.1515 + 1.1516 +#undef yyless 1.1517 +#define yyless(n) \ 1.1518 + do \ 1.1519 + { \ 1.1520 + /* Undo effects of setting up yytext. */ \ 1.1521 + yytext[yyleng] = yy_hold_char; \ 1.1522 + yy_c_buf_p = yytext + n; \ 1.1523 + yy_hold_char = *yy_c_buf_p; \ 1.1524 + *yy_c_buf_p = '\0'; \ 1.1525 + yyleng = n; \ 1.1526 + } \ 1.1527 + while ( 0 ) 1.1528 + 1.1529 + 1.1530 +/* Internal utility routines. */ 1.1531 + 1.1532 +#ifndef yytext_ptr 1.1533 +#ifdef YY_USE_PROTOS 1.1534 +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) 1.1535 +#else 1.1536 +static void yy_flex_strncpy( s1, s2, n ) 1.1537 +char *s1; 1.1538 +yyconst char *s2; 1.1539 +int n; 1.1540 +#endif 1.1541 + { 1.1542 + register int i; 1.1543 + for ( i = 0; i < n; ++i ) 1.1544 + s1[i] = s2[i]; 1.1545 + } 1.1546 +#endif 1.1547 + 1.1548 +#ifdef YY_NEED_STRLEN 1.1549 +#ifdef YY_USE_PROTOS 1.1550 +static int yy_flex_strlen( yyconst char *s ) 1.1551 +#else 1.1552 +static int yy_flex_strlen( s ) 1.1553 +yyconst char *s; 1.1554 +#endif 1.1555 + { 1.1556 + register int n; 1.1557 + for ( n = 0; s[n]; ++n ) 1.1558 + ; 1.1559 + 1.1560 + return n; 1.1561 + } 1.1562 +#endif 1.1563 + 1.1564 + 1.1565 +#ifdef YY_USE_PROTOS 1.1566 +static void *yy_flex_alloc( yy_size_t size ) 1.1567 +#else 1.1568 +static void *yy_flex_alloc( size ) 1.1569 +yy_size_t size; 1.1570 +#endif 1.1571 + { 1.1572 + return (void *) malloc( size ); 1.1573 + } 1.1574 + 1.1575 +#ifdef YY_USE_PROTOS 1.1576 +static void *yy_flex_realloc( void *ptr, yy_size_t size ) 1.1577 +#else 1.1578 +static void *yy_flex_realloc( ptr, size ) 1.1579 +void *ptr; 1.1580 +yy_size_t size; 1.1581 +#endif 1.1582 + { 1.1583 + /* The cast to (char *) in the following accommodates both 1.1584 + * implementations that use char* generic pointers, and those 1.1585 + * that use void* generic pointers. It works with the latter 1.1586 + * because both ANSI C and C++ allow castless assignment from 1.1587 + * any pointer type to void*, and deal with argument conversions 1.1588 + * as though doing an assignment. 1.1589 + */ 1.1590 + return (void *) realloc( (char *) ptr, size ); 1.1591 + } 1.1592 + 1.1593 +#ifdef YY_USE_PROTOS 1.1594 +static void yy_flex_free( void *ptr ) 1.1595 +#else 1.1596 +static void yy_flex_free( ptr ) 1.1597 +void *ptr; 1.1598 +#endif 1.1599 + { 1.1600 + free( ptr ); 1.1601 + } 1.1602 + 1.1603 +#if YY_MAIN 1.1604 +int main() 1.1605 + { 1.1606 + yylex(); 1.1607 + return 0; 1.1608 + } 1.1609 +#endif 1.1610 +#line 81 "installparse.l" 1.1611 + 1.1612 +/*------------------------ Program Section ----------------------------*/ 1.1613 + 1.1614 +PRFileDesc *Pk11Install_FD=NULL; 1.1615 + 1.1616 +/*************************************************************************/ 1.1617 +/* dummy function required by lex */ 1.1618 +int Pk11Install_yywrap(void) { return 1;} 1.1619 + 1.1620 +/*************************************************************************/ 1.1621 +/* Return a copy of the given string */ 1.1622 +static char* 1.1623 +putSimpleString(char *str) 1.1624 +{ 1.1625 + char *tmp = (char*) PR_Malloc(strlen(str)+1); 1.1626 + strcpy(tmp, str); 1.1627 + return tmp; 1.1628 +} 1.1629 + 1.1630 +/*************************************************************************/ 1.1631 +/* Strip out quotes, replace escaped characters with what they stand for. 1.1632 + This function assumes that what is passed in is actually a complex 1.1633 + string, so error checking is lax. */ 1.1634 +static char* 1.1635 +putComplexString(char *str) 1.1636 +{ 1.1637 + int size, i,j; 1.1638 + char *tmp; 1.1639 + 1.1640 + if(!str) { 1.1641 + return NULL; 1.1642 + } 1.1643 + size = strlen(str); 1.1644 + 1.1645 + /* Allocate the new space. This string will actually be too big, 1.1646 + since quotes and backslashes will be stripped out. But that's ok. */ 1.1647 + tmp = (char*) PR_Malloc(size+1); 1.1648 + 1.1649 + /* Copy it over */ 1.1650 + for(i=0, j=0; i < size; i++) { 1.1651 + if(str[i]=='\"') { 1.1652 + continue; /* skip un-escaped quotes */ 1.1653 + } else if(str[i]=='\\') { 1.1654 + ++i; /* escaped character. skip the backslash */ 1.1655 + } 1.1656 + tmp[j++] = str[i]; 1.1657 + } 1.1658 + tmp[j] = '\0'; 1.1659 + 1.1660 + return tmp; 1.1661 +}