security/nss/cmd/modutil/installparse.c

Wed, 31 Dec 2014 07:16:47 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:16:47 +0100
branch
TOR_BUG_9701
changeset 3
141e0f1194b1
permissions
-rw-r--r--

Revert simplistic fix pending revisit of Mozilla integration attempt.

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 #ifndef lint
michael@0 6 char yysccsid[] = "@(#)yaccpar 1.4 (Berkeley) 02/25/90";
michael@0 7 #endif
michael@0 8 #line 37 "installparse.y"
michael@0 9
michael@0 10 #define yyparse Pk11Install_yyparse
michael@0 11 #define yylex Pk11Install_yylex
michael@0 12 #define yyerror Pk11Install_yyerror
michael@0 13 #define yychar Pk11Install_yychar
michael@0 14 #define yyval Pk11Install_yyval
michael@0 15 #define yylval Pk11Install_yylval
michael@0 16 #define yydebug Pk11Install_yydebug
michael@0 17 #define yynerrs Pk11Install_yynerrs
michael@0 18 #define yyerrflag Pk11Install_yyerrflag
michael@0 19 #define yyss Pk11Install_yyss
michael@0 20 #define yyssp Pk11Install_yyssp
michael@0 21 #define yyvs Pk11Install_yyvs
michael@0 22 #define yyvsp Pk11Install_yyvsp
michael@0 23 #define yylhs Pk11Install_yylhs
michael@0 24 #define yylen Pk11Install_yylen
michael@0 25 #define yydefred Pk11Install_yydefred
michael@0 26 #define yydgoto Pk11Install_yydgoto
michael@0 27 #define yysindex Pk11Install_yysindex
michael@0 28 #define yyrindex Pk11Install_yyrindex
michael@0 29 #define yygindex Pk11Install_yygindex
michael@0 30 #define yytable Pk11Install_yytable
michael@0 31 #define yycheck Pk11Install_yycheck
michael@0 32 #define yyname Pk11Install_yyname
michael@0 33 #define yyrule Pk11Install_yyrule
michael@0 34
michael@0 35 /* C Stuff */
michael@0 36 #include "install-ds.h"
michael@0 37 #include <prprf.h>
michael@0 38
michael@0 39 #define YYSTYPE Pk11Install_Pointer
michael@0 40 extern char *Pk11Install_yytext;
michael@0 41 char *Pk11Install_yyerrstr=NULL;
michael@0 42
michael@0 43 #line 40 "ytab.c"
michael@0 44 #define OPENBRACE 257
michael@0 45 #define CLOSEBRACE 258
michael@0 46 #define STRING 259
michael@0 47 #define YYERRCODE 256
michael@0 48 short yylhs[] = { -1,
michael@0 49 0, 1, 1, 2, 2, 3, 4,
michael@0 50 };
michael@0 51 short yylen[] = { 2,
michael@0 52 1, 2, 0, 1, 1, 4, 1,
michael@0 53 };
michael@0 54 short yydefred[] = { 0,
michael@0 55 0, 0, 1, 0, 4, 0, 2, 0, 0, 6,
michael@0 56 };
michael@0 57 short yydgoto[] = { 2,
michael@0 58 3, 4, 5, 6,
michael@0 59 };
michael@0 60 short yysindex[] = { -257,
michael@0 61 0, 0, 0, -257, 0, -252, 0, -257, -251, 0,
michael@0 62 };
michael@0 63 short yyrindex[] = { 6,
michael@0 64 1, 0, 0, 3, 0, 0, 0, -250, 0, 0,
michael@0 65 };
michael@0 66 short yygindex[] = { 0,
michael@0 67 -4, 0, 0, 0,
michael@0 68 };
michael@0 69 #define YYTABLESIZE 261
michael@0 70 short yytable[] = { 7,
michael@0 71 5, 1, 3, 9, 8, 3, 10, 3, 0, 0,
michael@0 72 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 73 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 74 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 75 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 76 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 77 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 78 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 79 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 80 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 81 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 82 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 83 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 84 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 85 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 86 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 87 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 88 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 89 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 90 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 91 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 92 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 93 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 94 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 95 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
michael@0 96 0, 0, 0, 0, 0, 0, 0, 7, 5, 5,
michael@0 97 3,
michael@0 98 };
michael@0 99 short yycheck[] = { 4,
michael@0 100 0, 259, 0, 8, 257, 0, 258, 258, -1, -1,
michael@0 101 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 102 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 103 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 104 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 105 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 106 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 107 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 108 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 109 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 110 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 111 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 112 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 113 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 114 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 115 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 116 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 117 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 118 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 119 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 120 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 121 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 122 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 123 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 124 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
michael@0 125 -1, -1, -1, -1, -1, -1, -1, 257, 258, 259,
michael@0 126 258,
michael@0 127 };
michael@0 128 #define YYFINAL 2
michael@0 129 #ifndef YYDEBUG
michael@0 130 #define YYDEBUG 0
michael@0 131 #endif
michael@0 132 #define YYMAXTOKEN 259
michael@0 133 #if YYDEBUG
michael@0 134 char *yyname[] = {
michael@0 135 "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
michael@0 136 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
michael@0 137 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
michael@0 138 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
michael@0 139 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
michael@0 140 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
michael@0 141 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"OPENBRACE","CLOSEBRACE","STRING",
michael@0 142 };
michael@0 143 char *yyrule[] = {
michael@0 144 "$accept : toplist",
michael@0 145 "toplist : valuelist",
michael@0 146 "valuelist : value valuelist",
michael@0 147 "valuelist :",
michael@0 148 "value : key_value_pair",
michael@0 149 "value : STRING",
michael@0 150 "key_value_pair : key OPENBRACE valuelist CLOSEBRACE",
michael@0 151 "key : STRING",
michael@0 152 };
michael@0 153 #endif
michael@0 154 #ifndef YYSTYPE
michael@0 155 typedef int YYSTYPE;
michael@0 156 #endif
michael@0 157 #define yyclearin (yychar=(-1))
michael@0 158 #define yyerrok (yyerrflag=0)
michael@0 159 #ifndef YYSTACKSIZE
michael@0 160 #ifdef YYMAXDEPTH
michael@0 161 #define YYSTACKSIZE YYMAXDEPTH
michael@0 162 #else
michael@0 163 #define YYSTACKSIZE 300
michael@0 164 #endif
michael@0 165 #endif
michael@0 166 int yydebug;
michael@0 167 int yynerrs;
michael@0 168 int yyerrflag;
michael@0 169 int yychar;
michael@0 170 short *yyssp;
michael@0 171 YYSTYPE *yyvsp;
michael@0 172 YYSTYPE yyval;
michael@0 173 YYSTYPE yylval;
michael@0 174 #define yystacksize YYSTACKSIZE
michael@0 175 short yyss[YYSTACKSIZE];
michael@0 176 YYSTYPE yyvs[YYSTACKSIZE];
michael@0 177 #line 118 "installparse.y"
michael@0 178 /*----------------------- Program Section --------------------------------*/
michael@0 179
michael@0 180 /*************************************************************************/
michael@0 181 void
michael@0 182 Pk11Install_yyerror(char *message)
michael@0 183 {
michael@0 184 char *tmp;
michael@0 185 if(Pk11Install_yyerrstr) {
michael@0 186 tmp=PR_smprintf("%sline %d: %s\n", Pk11Install_yyerrstr,
michael@0 187 Pk11Install_yylinenum, message);
michael@0 188 PR_smprintf_free(Pk11Install_yyerrstr);
michael@0 189 } else {
michael@0 190 tmp = PR_smprintf("line %d: %s\n", Pk11Install_yylinenum, message);
michael@0 191 }
michael@0 192 Pk11Install_yyerrstr=tmp;
michael@0 193 }
michael@0 194 #line 191 "ytab.c"
michael@0 195 #define YYABORT goto yyabort
michael@0 196 #define YYACCEPT goto yyaccept
michael@0 197 #define YYERROR goto yyerrlab
michael@0 198 int
michael@0 199 yyparse()
michael@0 200 {
michael@0 201 register int yym, yyn, yystate;
michael@0 202 #if YYDEBUG
michael@0 203 register char *yys;
michael@0 204 extern char *getenv();
michael@0 205
michael@0 206 if (yys = getenv("YYDEBUG"))
michael@0 207 {
michael@0 208 yyn = *yys;
michael@0 209 if (yyn >= '0' && yyn <= '9')
michael@0 210 yydebug = yyn - '0';
michael@0 211 }
michael@0 212 #endif
michael@0 213
michael@0 214 yynerrs = 0;
michael@0 215 yyerrflag = 0;
michael@0 216 yychar = (-1);
michael@0 217
michael@0 218 yyssp = yyss;
michael@0 219 yyvsp = yyvs;
michael@0 220 *yyssp = yystate = 0;
michael@0 221
michael@0 222 yyloop:
michael@0 223 if (yyn = yydefred[yystate]) goto yyreduce;
michael@0 224 if (yychar < 0)
michael@0 225 {
michael@0 226 if ((yychar = yylex()) < 0) yychar = 0;
michael@0 227 #if YYDEBUG
michael@0 228 if (yydebug)
michael@0 229 {
michael@0 230 yys = 0;
michael@0 231 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
michael@0 232 if (!yys) yys = "illegal-symbol";
michael@0 233 printf("yydebug: state %d, reading %d (%s)\n", yystate,
michael@0 234 yychar, yys);
michael@0 235 }
michael@0 236 #endif
michael@0 237 }
michael@0 238 if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
michael@0 239 yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
michael@0 240 {
michael@0 241 #if YYDEBUG
michael@0 242 if (yydebug)
michael@0 243 printf("yydebug: state %d, shifting to state %d\n",
michael@0 244 yystate, yytable[yyn]);
michael@0 245 #endif
michael@0 246 if (yyssp >= yyss + yystacksize - 1)
michael@0 247 {
michael@0 248 goto yyoverflow;
michael@0 249 }
michael@0 250 *++yyssp = yystate = yytable[yyn];
michael@0 251 *++yyvsp = yylval;
michael@0 252 yychar = (-1);
michael@0 253 if (yyerrflag > 0) --yyerrflag;
michael@0 254 goto yyloop;
michael@0 255 }
michael@0 256 if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
michael@0 257 yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
michael@0 258 {
michael@0 259 yyn = yytable[yyn];
michael@0 260 goto yyreduce;
michael@0 261 }
michael@0 262 if (yyerrflag) goto yyinrecovery;
michael@0 263 #ifdef lint
michael@0 264 goto yynewerror;
michael@0 265 yynewerror:
michael@0 266 #endif
michael@0 267 yyerror("syntax error");
michael@0 268 #ifdef lint
michael@0 269 goto yyerrlab;
michael@0 270 yyerrlab:
michael@0 271 #endif
michael@0 272 ++yynerrs;
michael@0 273 yyinrecovery:
michael@0 274 if (yyerrflag < 3)
michael@0 275 {
michael@0 276 yyerrflag = 3;
michael@0 277 for (;;)
michael@0 278 {
michael@0 279 if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
michael@0 280 yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
michael@0 281 {
michael@0 282 #if YYDEBUG
michael@0 283 if (yydebug)
michael@0 284 printf("yydebug: state %d, error recovery shifting\
michael@0 285 to state %d\n", *yyssp, yytable[yyn]);
michael@0 286 #endif
michael@0 287 if (yyssp >= yyss + yystacksize - 1)
michael@0 288 {
michael@0 289 goto yyoverflow;
michael@0 290 }
michael@0 291 *++yyssp = yystate = yytable[yyn];
michael@0 292 *++yyvsp = yylval;
michael@0 293 goto yyloop;
michael@0 294 }
michael@0 295 else
michael@0 296 {
michael@0 297 #if YYDEBUG
michael@0 298 if (yydebug)
michael@0 299 printf("yydebug: error recovery discarding state %d\n",
michael@0 300 *yyssp);
michael@0 301 #endif
michael@0 302 if (yyssp <= yyss) goto yyabort;
michael@0 303 --yyssp;
michael@0 304 --yyvsp;
michael@0 305 }
michael@0 306 }
michael@0 307 }
michael@0 308 else
michael@0 309 {
michael@0 310 if (yychar == 0) goto yyabort;
michael@0 311 #if YYDEBUG
michael@0 312 if (yydebug)
michael@0 313 {
michael@0 314 yys = 0;
michael@0 315 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
michael@0 316 if (!yys) yys = "illegal-symbol";
michael@0 317 printf("yydebug: state %d, error recovery discards token %d (%s)\n",
michael@0 318 yystate, yychar, yys);
michael@0 319 }
michael@0 320 #endif
michael@0 321 yychar = (-1);
michael@0 322 goto yyloop;
michael@0 323 }
michael@0 324 yyreduce:
michael@0 325 #if YYDEBUG
michael@0 326 if (yydebug)
michael@0 327 printf("yydebug: state %d, reducing by rule %d (%s)\n",
michael@0 328 yystate, yyn, yyrule[yyn]);
michael@0 329 #endif
michael@0 330 yym = yylen[yyn];
michael@0 331 yyval = yyvsp[1-yym];
michael@0 332 switch (yyn)
michael@0 333 {
michael@0 334 case 1:
michael@0 335 #line 84 "installparse.y"
michael@0 336 {
michael@0 337 Pk11Install_valueList = yyvsp[0].list;
michael@0 338 }
michael@0 339 break;
michael@0 340 case 2:
michael@0 341 #line 89 "installparse.y"
michael@0 342 {
michael@0 343 Pk11Install_ValueList_AddItem(yyvsp[0].list,yyvsp[-1].value);
michael@0 344 yyval .list = yyvsp[0].list;
michael@0 345 }
michael@0 346 break;
michael@0 347 case 3:
michael@0 348 #line 94 "installparse.y"
michael@0 349 {
michael@0 350 yyval .list = Pk11Install_ValueList_new();
michael@0 351 }
michael@0 352 break;
michael@0 353 case 4:
michael@0 354 #line 99 "installparse.y"
michael@0 355 {
michael@0 356 yyval .value= Pk11Install_Value_new(PAIR_VALUE,yyvsp[0]);
michael@0 357 }
michael@0 358 break;
michael@0 359 case 5:
michael@0 360 #line 103 "installparse.y"
michael@0 361 {
michael@0 362 yyval .value= Pk11Install_Value_new(STRING_VALUE, yyvsp[0]);
michael@0 363 }
michael@0 364 break;
michael@0 365 case 6:
michael@0 366 #line 108 "installparse.y"
michael@0 367 {
michael@0 368 yyval .pair = Pk11Install_Pair_new(yyvsp[-3].string,yyvsp[-1].list);
michael@0 369 }
michael@0 370 break;
michael@0 371 case 7:
michael@0 372 #line 113 "installparse.y"
michael@0 373 {
michael@0 374 yyval .string = yyvsp[0].string;
michael@0 375 }
michael@0 376 break;
michael@0 377 #line 374 "ytab.c"
michael@0 378 }
michael@0 379 yyssp -= yym;
michael@0 380 yystate = *yyssp;
michael@0 381 yyvsp -= yym;
michael@0 382 yym = yylhs[yyn];
michael@0 383 if (yystate == 0 && yym == 0)
michael@0 384 {
michael@0 385 #ifdef YYDEBUG
michael@0 386 if (yydebug)
michael@0 387 printf("yydebug: after reduction, shifting from state 0 to\
michael@0 388 state %d\n", YYFINAL);
michael@0 389 #endif
michael@0 390 yystate = YYFINAL;
michael@0 391 *++yyssp = YYFINAL;
michael@0 392 *++yyvsp = yyval;
michael@0 393 if (yychar < 0)
michael@0 394 {
michael@0 395 if ((yychar = yylex()) < 0) yychar = 0;
michael@0 396 #if YYDEBUG
michael@0 397 if (yydebug)
michael@0 398 {
michael@0 399 yys = 0;
michael@0 400 if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
michael@0 401 if (!yys) yys = "illegal-symbol";
michael@0 402 printf("yydebug: state %d, reading %d (%s)\n",
michael@0 403 YYFINAL, yychar, yys);
michael@0 404 }
michael@0 405 #endif
michael@0 406 }
michael@0 407 if (yychar == 0) goto yyaccept;
michael@0 408 goto yyloop;
michael@0 409 }
michael@0 410 if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
michael@0 411 yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
michael@0 412 yystate = yytable[yyn];
michael@0 413 else
michael@0 414 yystate = yydgoto[yym];
michael@0 415 #ifdef YYDEBUG
michael@0 416 if (yydebug)
michael@0 417 printf("yydebug: after reduction, shifting from state %d \
michael@0 418 to state %d\n", *yyssp, yystate);
michael@0 419 #endif
michael@0 420 if (yyssp >= yyss + yystacksize - 1)
michael@0 421 {
michael@0 422 goto yyoverflow;
michael@0 423 }
michael@0 424 *++yyssp = yystate;
michael@0 425 *++yyvsp = yyval;
michael@0 426 goto yyloop;
michael@0 427 yyoverflow:
michael@0 428 yyerror("yacc stack overflow");
michael@0 429 yyabort:
michael@0 430 return (1);
michael@0 431 yyaccept:
michael@0 432 return (0);
michael@0 433 }

mercurial