Remove building with NOCRYPTO option
[minix3.git] / external / bsd / byacc / dist / test / err_inherit1.y
blob212788ea0c61ca33346e02d6e23b50220bd20a7a
1 /* $NetBSD: err_inherit1.y,v 1.1.1.1 2015/01/03 22:58:23 christos Exp $ */
3 %{
4 #include <stdlib.h>
6 typedef enum {cGLOBAL, cLOCAL} class;
7 typedef enum {tREAL, tINTEGER} type;
8 typedef char * name;
10 struct symbol { class c; type t; name id; };
11 typedef struct symbol symbol;
13 struct namelist { symbol *s; struct namelist *next; };
14 typedef struct namelist namelist;
16 extern symbol *mksymbol(type t, class c, name id);
18 #ifdef YYBISON
19 #define YYLEX_DECL() yylex(void)
20 #define YYERROR_DECL() yyerror(const char *s)
21 #endif
24 %token <cval> GLOBAL LOCAL
25 %token <tval> REAL INTEGER
26 %token <id> NAME
28 %type <nlist> declaration namelist(<cval>, <tval>) locnamelist(<tval>)
29 %type <cval> class
30 %type <tval> type
32 %destructor {
33 namelist *p = $$;
34 while (p != NULL)
35 { namelist *pp = p;
36 p = p->next;
37 free(pp->s); free(pp);
39 } <nlist>
41 %union
43 class cval;
44 type tval;
45 namelist * nlist;
46 name id;
49 %start declaration
52 declaration: class type namelist($1, $2)
53 { $$ = $3; }
54 | type locnamelist($1)
55 { $$ = $2; }
58 class : GLOBAL { $$ = cGLOBAL; }
59 | LOCAL { $$ = cLOCAL; }
62 type : REAL { $$ = tREAL; }
63 | INTEGER { $$ = tINTEGER; }
66 namelist($c, $t