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