GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: usr.bin/keynote/z.tab.c Lines: 0 110 0.0 %
Date: 2017-11-13 Branches: 0 108 0.0 %

Line Branch Exec Source
1
#include <stdlib.h>
2
#include <string.h>
3
#define YYBYACC 1
4
#define YYMAJOR 1
5
#define YYMINOR 9
6
#define YYLEX yylex()
7
#define YYEMPTY -1
8
#define yyclearin (yychar=(YYEMPTY))
9
#define yyerrok (yyerrflag=0)
10
#define YYRECOVERING() (yyerrflag!=0)
11
#define yyparse kvparse
12
#define yylex kvlex
13
#define yyerror kverror
14
#define yychar kvchar
15
#define yyval kvval
16
#define yylval kvlval
17
#define yydebug kvdebug
18
#define yynerrs kvnerrs
19
#define yyerrflag kverrflag
20
#define yyss kvss
21
#define yysslim kvsslim
22
#define yyssp kvssp
23
#define yyvs kvvs
24
#define yyvsp kvvsp
25
#define yystacksize kvstacksize
26
#define yylhs kvlhs
27
#define yylen kvlen
28
#define yydefred kvdefred
29
#define yydgoto kvdgoto
30
#define yysindex kvsindex
31
#define yyrindex kvrindex
32
#define yygindex kvgindex
33
#define yytable kvtable
34
#define yycheck kvcheck
35
#define yyname kvname
36
#define yyrule kvrule
37
#define YYPREFIX "kv"
38
#line 21 "/usr/src/usr.bin/keynote/../../lib/libkeynote/keynote-ver.y"
39
#ifndef YYSTYPE_DEFINED
40
#define YYSTYPE_DEFINED
41
typedef union {
42
	struct s {
43
		char   *string;
44
	} s;
45
} YYSTYPE;
46
#endif /* YYSTYPE_DEFINED */
47
#line 31 "/usr/src/usr.bin/keynote/../../lib/libkeynote/keynote-ver.y"
48
49
#include <sys/types.h>
50
51
#include <regex.h>
52
#include <stdio.h>
53
#include <stdlib.h>
54
#include <string.h>
55
56
#include "header.h"
57
#include "keynote.h"
58
#line 59 "z.tab.c"
59
#define STRING 257
60
#define VSTRING 258
61
#define EQ 259
62
#define YYERRCODE 256
63
const short kvlhs[] =
64
	{                                        -1,
65
    0,    0,    1,    2,    1,
66
};
67
const short kvlen[] =
68
	{                                         2,
69
    1,    1,    3,    0,    5,
70
};
71
const short kvdefred[] =
72
	{                                      0,
73
    2,    0,    0,    1,    0,    0,    0,    5,
74
};
75
const short kvdgoto[] =
76
	{                                       3,
77
    4,    7,
78
};
79
const short kvsindex[] =
80
	{                                   -255,
81
    0, -259,    0,    0, -253,    0, -252,    0,};
82
const short kvrindex[] =
83
	{                                      0,
84
    0,    0,    0,    0,    0,    1,    0,    0,};
85
const short kvgindex[] =
86
	{                                      0,
87
   -2,    0,
88
};
89
#define YYTABLESIZE 259
90
const short kvtable[] =
91
	{                                       5,
92
    3,    1,    2,    6,    8,    2,    0,    0,    0,    0,
93
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
94
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
95
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
96
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
97
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
98
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
99
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
100
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
101
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
102
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
103
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
104
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
105
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
106
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
107
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
108
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
109
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
110
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
111
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
112
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
113
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
114
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
115
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
116
    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
117
    0,    0,    0,    0,    0,    0,    0,    0,    4,
118
};
119
const short kvcheck[] =
120
	{                                     259,
121
    0,  257,  258,  257,    7,  258,   -1,   -1,   -1,   -1,
122
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
123
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
124
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
125
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
126
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
127
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
128
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
129
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
130
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
131
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
132
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
133
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
134
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
135
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
136
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
137
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
138
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
139
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
140
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
141
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
142
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
143
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
144
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
145
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
146
   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,  258,
147
};
148
#define YYFINAL 3
149
#ifndef YYDEBUG
150
#define YYDEBUG 0
151
#endif
152
#define YYMAXTOKEN 259
153
#if YYDEBUG
154
const char * const kvname[] =
155
	{
156
"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,
157
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,
158
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,
159
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,
160
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,
161
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,
162
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"STRING","VSTRING","EQ",
163
};
164
const char * const kvrule[] =
165
	{"$accept : program",
166
"program : expr",
167
"program : STRING",
168
"expr : VSTRING EQ STRING",
169
"$$1 :",
170
"expr : VSTRING EQ STRING $$1 expr",
171
};
172
#endif
173
#ifdef YYSTACKSIZE
174
#undef YYMAXDEPTH
175
#define YYMAXDEPTH YYSTACKSIZE
176
#else
177
#ifdef YYMAXDEPTH
178
#define YYSTACKSIZE YYMAXDEPTH
179
#else
180
#define YYSTACKSIZE 10000
181
#define YYMAXDEPTH 10000
182
#endif
183
#endif
184
#define YYINITSTACKSIZE 200
185
/* LINTUSED */
186
int yydebug;
187
int yynerrs;
188
int yyerrflag;
189
int yychar;
190
short *yyssp;
191
YYSTYPE *yyvsp;
192
YYSTYPE yyval;
193
YYSTYPE yylval;
194
short *yyss;
195
short *yysslim;
196
YYSTYPE *yyvs;
197
unsigned int yystacksize;
198
int yyparse(void);
199
#line 65 "/usr/src/usr.bin/keynote/../../lib/libkeynote/keynote-ver.y"
200
void
201
kverror(char *s)
202
{}
203
#line 196 "z.tab.c"
204
/* allocate initial stack or double stack size, up to YYMAXDEPTH */
205
static int yygrowstack(void)
206
{
207
    unsigned int newsize;
208
    long sslen;
209
    short *newss;
210
    YYSTYPE *newvs;
211
212
    if ((newsize = yystacksize) == 0)
213
        newsize = YYINITSTACKSIZE;
214
    else if (newsize >= YYMAXDEPTH)
215
        return -1;
216
    else if ((newsize *= 2) > YYMAXDEPTH)
217
        newsize = YYMAXDEPTH;
218
    sslen = yyssp - yyss;
219
#ifdef SIZE_MAX
220
#define YY_SIZE_MAX SIZE_MAX
221
#else
222
#define YY_SIZE_MAX 0xffffffffU
223
#endif
224
    if (newsize && YY_SIZE_MAX / newsize < sizeof *newss)
225
        goto bail;
226
    newss = yyss ? (short *)realloc(yyss, newsize * sizeof *newss) :
227
      (short *)malloc(newsize * sizeof *newss); /* overflow check above */
228
    if (newss == NULL)
229
        goto bail;
230
    yyss = newss;
231
    yyssp = newss + sslen;
232
    if (newsize && YY_SIZE_MAX / newsize < sizeof *newvs)
233
        goto bail;
234
    newvs = yyvs ? (YYSTYPE *)realloc(yyvs, newsize * sizeof *newvs) :
235
      (YYSTYPE *)malloc(newsize * sizeof *newvs); /* overflow check above */
236
    if (newvs == NULL)
237
        goto bail;
238
    yyvs = newvs;
239
    yyvsp = newvs + sslen;
240
    yystacksize = newsize;
241
    yysslim = yyss + newsize - 1;
242
    return 0;
243
bail:
244
    if (yyss)
245
            free(yyss);
246
    if (yyvs)
247
            free(yyvs);
248
    yyss = yyssp = NULL;
249
    yyvs = yyvsp = NULL;
250
    yystacksize = 0;
251
    return -1;
252
}
253
254
#define YYABORT goto yyabort
255
#define YYREJECT goto yyabort
256
#define YYACCEPT goto yyaccept
257
#define YYERROR goto yyerrlab
258
int
259
yyparse(void)
260
{
261
    int yym, yyn, yystate;
262
#if YYDEBUG
263
    const char *yys;
264
265
    if ((yys = getenv("YYDEBUG")))
266
    {
267
        yyn = *yys;
268
        if (yyn >= '0' && yyn <= '9')
269
            yydebug = yyn - '0';
270
    }
271
#endif /* YYDEBUG */
272
273
    yynerrs = 0;
274
    yyerrflag = 0;
275
    yychar = (-1);
276
277
    if (yyss == NULL && yygrowstack()) goto yyoverflow;
278
    yyssp = yyss;
279
    yyvsp = yyvs;
280
    *yyssp = yystate = 0;
281
282
yyloop:
283
    if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
284
    if (yychar < 0)
285
    {
286
        if ((yychar = yylex()) < 0) yychar = 0;
287
#if YYDEBUG
288
        if (yydebug)
289
        {
290
            yys = 0;
291
            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
292
            if (!yys) yys = "illegal-symbol";
293
            printf("%sdebug: state %d, reading %d (%s)\n",
294
                    YYPREFIX, yystate, yychar, yys);
295
        }
296
#endif
297
    }
298
    if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
299
            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
300
    {
301
#if YYDEBUG
302
        if (yydebug)
303
            printf("%sdebug: state %d, shifting to state %d\n",
304
                    YYPREFIX, yystate, yytable[yyn]);
305
#endif
306
        if (yyssp >= yysslim && yygrowstack())
307
        {
308
            goto yyoverflow;
309
        }
310
        *++yyssp = yystate = yytable[yyn];
311
        *++yyvsp = yylval;
312
        yychar = (-1);
313
        if (yyerrflag > 0)  --yyerrflag;
314
        goto yyloop;
315
    }
316
    if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
317
            yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
318
    {
319
        yyn = yytable[yyn];
320
        goto yyreduce;
321
    }
322
    if (yyerrflag) goto yyinrecovery;
323
#if defined(__GNUC__)
324
    goto yynewerror;
325
#endif
326
yynewerror:
327
    yyerror("syntax error");
328
#if defined(__GNUC__)
329
    goto yyerrlab;
330
#endif
331
yyerrlab:
332
    ++yynerrs;
333
yyinrecovery:
334
    if (yyerrflag < 3)
335
    {
336
        yyerrflag = 3;
337
        for (;;)
338
        {
339
            if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
340
                    yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
341
            {
342
#if YYDEBUG
343
                if (yydebug)
344
                    printf("%sdebug: state %d, error recovery shifting\
345
 to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
346
#endif
347
                if (yyssp >= yysslim && yygrowstack())
348
                {
349
                    goto yyoverflow;
350
                }
351
                *++yyssp = yystate = yytable[yyn];
352
                *++yyvsp = yylval;
353
                goto yyloop;
354
            }
355
            else
356
            {
357
#if YYDEBUG
358
                if (yydebug)
359
                    printf("%sdebug: error recovery discarding state %d\n",
360
                            YYPREFIX, *yyssp);
361
#endif
362
                if (yyssp <= yyss) goto yyabort;
363
                --yyssp;
364
                --yyvsp;
365
            }
366
        }
367
    }
368
    else
369
    {
370
        if (yychar == 0) goto yyabort;
371
#if YYDEBUG
372
        if (yydebug)
373
        {
374
            yys = 0;
375
            if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
376
            if (!yys) yys = "illegal-symbol";
377
            printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
378
                    YYPREFIX, yystate, yychar, yys);
379
        }
380
#endif
381
        yychar = (-1);
382
        goto yyloop;
383
    }
384
yyreduce:
385
#if YYDEBUG
386
    if (yydebug)
387
        printf("%sdebug: state %d, reducing by rule %d (%s)\n",
388
                YYPREFIX, yystate, yyn, yyrule[yyn]);
389
#endif
390
    yym = yylen[yyn];
391
    if (yym)
392
        yyval = yyvsp[1-yym];
393
    else
394
        memset(&yyval, 0, sizeof yyval);
395
    switch (yyn)
396
    {
397
case 2:
398
#line 45 "/usr/src/usr.bin/keynote/../../lib/libkeynote/keynote-ver.y"
399
{ if (kn_add_authorizer(sessid, yyvsp[0].s.string) != 0)
400
				 return keynote_errno;
401
                               free(yyvsp[0].s.string);
402
                             }
403
break;
404
case 3:
405
#line 50 "/usr/src/usr.bin/keynote/../../lib/libkeynote/keynote-ver.y"
406
{ int i = kn_add_action(sessid, yyvsp[-2].s.string, yyvsp[0].s.string, 0);
407
408
                               if (i != 0)
409
				 return i;
410
			       free(yyvsp[-2].s.string);
411
			       free(yyvsp[0].s.string);
412
                             }
413
break;
414
case 4:
415
#line 57 "/usr/src/usr.bin/keynote/../../lib/libkeynote/keynote-ver.y"
416
{ int i = kn_add_action(sessid, yyvsp[-2].s.string, yyvsp[0].s.string, 0);
417
418
                               if (i != 0)
419
				 return i;
420
			       free(yyvsp[-2].s.string);
421
			       free(yyvsp[0].s.string);
422
                             }
423
break;
424
#line 417 "z.tab.c"
425
    }
426
    yyssp -= yym;
427
    yystate = *yyssp;
428
    yyvsp -= yym;
429
    yym = yylhs[yyn];
430
    if (yystate == 0 && yym == 0)
431
    {
432
#if YYDEBUG
433
        if (yydebug)
434
            printf("%sdebug: after reduction, shifting from state 0 to\
435
 state %d\n", YYPREFIX, YYFINAL);
436
#endif
437
        yystate = YYFINAL;
438
        *++yyssp = YYFINAL;
439
        *++yyvsp = yyval;
440
        if (yychar < 0)
441
        {
442
            if ((yychar = yylex()) < 0) yychar = 0;
443
#if YYDEBUG
444
            if (yydebug)
445
            {
446
                yys = 0;
447
                if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
448
                if (!yys) yys = "illegal-symbol";
449
                printf("%sdebug: state %d, reading %d (%s)\n",
450
                        YYPREFIX, YYFINAL, yychar, yys);
451
            }
452
#endif
453
        }
454
        if (yychar == 0) goto yyaccept;
455
        goto yyloop;
456
    }
457
    if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
458
            yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
459
        yystate = yytable[yyn];
460
    else
461
        yystate = yydgoto[yym];
462
#if YYDEBUG
463
    if (yydebug)
464
        printf("%sdebug: after reduction, shifting from state %d \
465
to state %d\n", YYPREFIX, *yyssp, yystate);
466
#endif
467
    if (yyssp >= yysslim && yygrowstack())
468
    {
469
        goto yyoverflow;
470
    }
471
    *++yyssp = yystate;
472
    *++yyvsp = yyval;
473
    goto yyloop;
474
yyoverflow:
475
    yyerror("yacc stack overflow");
476
yyabort:
477
    if (yyss)
478
            free(yyss);
479
    if (yyvs)
480
            free(yyvs);
481
    yyss = yyssp = NULL;
482
    yyvs = yyvsp = NULL;
483
    yystacksize = 0;
484
    return (1);
485
yyaccept:
486
    if (yyss)
487
            free(yyss);
488
    if (yyvs)
489
            free(yyvs);
490
    yyss = yyssp = NULL;
491
    yyvs = yyvsp = NULL;
492
    yystacksize = 0;
493
    return (0);
494
}