1*0a6a1f1dSLionel Sambuc /* $NetBSD: ok_syntax1.tab.c,v 1.1.1.1 2015/01/03 22:58:24 christos Exp $ */
2*0a6a1f1dSLionel Sambuc
3*0a6a1f1dSLionel Sambuc /* original parser id follows */
4*0a6a1f1dSLionel Sambuc /* yysccsid[] = "@(#)yaccpar 1.9 (Berkeley) 02/21/93" */
5*0a6a1f1dSLionel Sambuc /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
6*0a6a1f1dSLionel Sambuc
7*0a6a1f1dSLionel Sambuc #define YYBYACC 1
8*0a6a1f1dSLionel Sambuc #define YYMAJOR 1
9*0a6a1f1dSLionel Sambuc #define YYMINOR 9
10*0a6a1f1dSLionel Sambuc #define YYCHECK "yyyymmdd"
11*0a6a1f1dSLionel Sambuc
12*0a6a1f1dSLionel Sambuc #define YYEMPTY (-1)
13*0a6a1f1dSLionel Sambuc #define yyclearin (yychar = YYEMPTY)
14*0a6a1f1dSLionel Sambuc #define yyerrok (yyerrflag = 0)
15*0a6a1f1dSLionel Sambuc #define YYRECOVERING() (yyerrflag != 0)
16*0a6a1f1dSLionel Sambuc #define YYENOMEM (-2)
17*0a6a1f1dSLionel Sambuc #define YYEOF 0
18*0a6a1f1dSLionel Sambuc
19*0a6a1f1dSLionel Sambuc #ifndef yyparse
20*0a6a1f1dSLionel Sambuc #define yyparse ok_syntax1_parse
21*0a6a1f1dSLionel Sambuc #endif /* yyparse */
22*0a6a1f1dSLionel Sambuc
23*0a6a1f1dSLionel Sambuc #ifndef yylex
24*0a6a1f1dSLionel Sambuc #define yylex ok_syntax1_lex
25*0a6a1f1dSLionel Sambuc #endif /* yylex */
26*0a6a1f1dSLionel Sambuc
27*0a6a1f1dSLionel Sambuc #ifndef yyerror
28*0a6a1f1dSLionel Sambuc #define yyerror ok_syntax1_error
29*0a6a1f1dSLionel Sambuc #endif /* yyerror */
30*0a6a1f1dSLionel Sambuc
31*0a6a1f1dSLionel Sambuc #ifndef yychar
32*0a6a1f1dSLionel Sambuc #define yychar ok_syntax1_char
33*0a6a1f1dSLionel Sambuc #endif /* yychar */
34*0a6a1f1dSLionel Sambuc
35*0a6a1f1dSLionel Sambuc #ifndef yyval
36*0a6a1f1dSLionel Sambuc #define yyval ok_syntax1_val
37*0a6a1f1dSLionel Sambuc #endif /* yyval */
38*0a6a1f1dSLionel Sambuc
39*0a6a1f1dSLionel Sambuc #ifndef yylval
40*0a6a1f1dSLionel Sambuc #define yylval ok_syntax1_lval
41*0a6a1f1dSLionel Sambuc #endif /* yylval */
42*0a6a1f1dSLionel Sambuc
43*0a6a1f1dSLionel Sambuc #ifndef yydebug
44*0a6a1f1dSLionel Sambuc #define yydebug ok_syntax1_debug
45*0a6a1f1dSLionel Sambuc #endif /* yydebug */
46*0a6a1f1dSLionel Sambuc
47*0a6a1f1dSLionel Sambuc #ifndef yynerrs
48*0a6a1f1dSLionel Sambuc #define yynerrs ok_syntax1_nerrs
49*0a6a1f1dSLionel Sambuc #endif /* yynerrs */
50*0a6a1f1dSLionel Sambuc
51*0a6a1f1dSLionel Sambuc #ifndef yyerrflag
52*0a6a1f1dSLionel Sambuc #define yyerrflag ok_syntax1_errflag
53*0a6a1f1dSLionel Sambuc #endif /* yyerrflag */
54*0a6a1f1dSLionel Sambuc
55*0a6a1f1dSLionel Sambuc #ifndef yylhs
56*0a6a1f1dSLionel Sambuc #define yylhs ok_syntax1_lhs
57*0a6a1f1dSLionel Sambuc #endif /* yylhs */
58*0a6a1f1dSLionel Sambuc
59*0a6a1f1dSLionel Sambuc #ifndef yylen
60*0a6a1f1dSLionel Sambuc #define yylen ok_syntax1_len
61*0a6a1f1dSLionel Sambuc #endif /* yylen */
62*0a6a1f1dSLionel Sambuc
63*0a6a1f1dSLionel Sambuc #ifndef yydefred
64*0a6a1f1dSLionel Sambuc #define yydefred ok_syntax1_defred
65*0a6a1f1dSLionel Sambuc #endif /* yydefred */
66*0a6a1f1dSLionel Sambuc
67*0a6a1f1dSLionel Sambuc #ifndef yydgoto
68*0a6a1f1dSLionel Sambuc #define yydgoto ok_syntax1_dgoto
69*0a6a1f1dSLionel Sambuc #endif /* yydgoto */
70*0a6a1f1dSLionel Sambuc
71*0a6a1f1dSLionel Sambuc #ifndef yysindex
72*0a6a1f1dSLionel Sambuc #define yysindex ok_syntax1_sindex
73*0a6a1f1dSLionel Sambuc #endif /* yysindex */
74*0a6a1f1dSLionel Sambuc
75*0a6a1f1dSLionel Sambuc #ifndef yyrindex
76*0a6a1f1dSLionel Sambuc #define yyrindex ok_syntax1_rindex
77*0a6a1f1dSLionel Sambuc #endif /* yyrindex */
78*0a6a1f1dSLionel Sambuc
79*0a6a1f1dSLionel Sambuc #ifndef yygindex
80*0a6a1f1dSLionel Sambuc #define yygindex ok_syntax1_gindex
81*0a6a1f1dSLionel Sambuc #endif /* yygindex */
82*0a6a1f1dSLionel Sambuc
83*0a6a1f1dSLionel Sambuc #ifndef yytable
84*0a6a1f1dSLionel Sambuc #define yytable ok_syntax1_table
85*0a6a1f1dSLionel Sambuc #endif /* yytable */
86*0a6a1f1dSLionel Sambuc
87*0a6a1f1dSLionel Sambuc #ifndef yycheck
88*0a6a1f1dSLionel Sambuc #define yycheck ok_syntax1_check
89*0a6a1f1dSLionel Sambuc #endif /* yycheck */
90*0a6a1f1dSLionel Sambuc
91*0a6a1f1dSLionel Sambuc #ifndef yyname
92*0a6a1f1dSLionel Sambuc #define yyname ok_syntax1_name
93*0a6a1f1dSLionel Sambuc #endif /* yyname */
94*0a6a1f1dSLionel Sambuc
95*0a6a1f1dSLionel Sambuc #ifndef yyrule
96*0a6a1f1dSLionel Sambuc #define yyrule ok_syntax1_rule
97*0a6a1f1dSLionel Sambuc #endif /* yyrule */
98*0a6a1f1dSLionel Sambuc #define YYPREFIX "ok_syntax1_"
99*0a6a1f1dSLionel Sambuc
100*0a6a1f1dSLionel Sambuc #define YYPURE 1
101*0a6a1f1dSLionel Sambuc
102*0a6a1f1dSLionel Sambuc #line 9 "ok_syntax1.y"
103*0a6a1f1dSLionel Sambuc # include <stdio.h>
104*0a6a1f1dSLionel Sambuc # include <ctype.h>
105*0a6a1f1dSLionel Sambuc
106*0a6a1f1dSLionel Sambuc #ifdef YYBISON
107*0a6a1f1dSLionel Sambuc #define YYSTYPE int
108*0a6a1f1dSLionel Sambuc #define YYLEX_PARAM base
109*0a6a1f1dSLionel Sambuc #define YYLEX_DECL() yylex(YYSTYPE *yylval, int *YYLEX_PARAM)
110*0a6a1f1dSLionel Sambuc #define YYERROR_DECL() yyerror(int regs[26], int *base, const char *s)
111*0a6a1f1dSLionel Sambuc int YYLEX_DECL();
112*0a6a1f1dSLionel Sambuc static void YYERROR_DECL();
113*0a6a1f1dSLionel Sambuc #endif
114*0a6a1f1dSLionel Sambuc
115*0a6a1f1dSLionel Sambuc #line 43 "ok_syntax1.y"
116*0a6a1f1dSLionel Sambuc #ifdef YYSTYPE
117*0a6a1f1dSLionel Sambuc #undef YYSTYPE_IS_DECLARED
118*0a6a1f1dSLionel Sambuc #define YYSTYPE_IS_DECLARED 1
119*0a6a1f1dSLionel Sambuc #endif
120*0a6a1f1dSLionel Sambuc #ifndef YYSTYPE_IS_DECLARED
121*0a6a1f1dSLionel Sambuc #define YYSTYPE_IS_DECLARED 1
122*0a6a1f1dSLionel Sambuc typedef union
123*0a6a1f1dSLionel Sambuc {
124*0a6a1f1dSLionel Sambuc char * cval;
125*0a6a1f1dSLionel Sambuc int ival;
126*0a6a1f1dSLionel Sambuc double dval;
127*0a6a1f1dSLionel Sambuc } YYSTYPE;
128*0a6a1f1dSLionel Sambuc #endif /* !YYSTYPE_IS_DECLARED */
129*0a6a1f1dSLionel Sambuc #line 128 "ok_syntax1.tab.c"
130*0a6a1f1dSLionel Sambuc
131*0a6a1f1dSLionel Sambuc /* compatibility with bison */
132*0a6a1f1dSLionel Sambuc #ifdef YYPARSE_PARAM
133*0a6a1f1dSLionel Sambuc /* compatibility with FreeBSD */
134*0a6a1f1dSLionel Sambuc # ifdef YYPARSE_PARAM_TYPE
135*0a6a1f1dSLionel Sambuc # define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
136*0a6a1f1dSLionel Sambuc # else
137*0a6a1f1dSLionel Sambuc # define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
138*0a6a1f1dSLionel Sambuc # endif
139*0a6a1f1dSLionel Sambuc #else
140*0a6a1f1dSLionel Sambuc # define YYPARSE_DECL() yyparse(int regs[26], int *base)
141*0a6a1f1dSLionel Sambuc #endif
142*0a6a1f1dSLionel Sambuc
143*0a6a1f1dSLionel Sambuc /* Parameters sent to lex. */
144*0a6a1f1dSLionel Sambuc #ifdef YYLEX_PARAM
145*0a6a1f1dSLionel Sambuc # ifdef YYLEX_PARAM_TYPE
146*0a6a1f1dSLionel Sambuc # define YYLEX_DECL() yylex(YYSTYPE *yylval, YYLEX_PARAM_TYPE YYLEX_PARAM)
147*0a6a1f1dSLionel Sambuc # else
148*0a6a1f1dSLionel Sambuc # define YYLEX_DECL() yylex(YYSTYPE *yylval, void * YYLEX_PARAM)
149*0a6a1f1dSLionel Sambuc # endif
150*0a6a1f1dSLionel Sambuc # define YYLEX yylex(&yylval, YYLEX_PARAM)
151*0a6a1f1dSLionel Sambuc #else
152*0a6a1f1dSLionel Sambuc # define YYLEX_DECL() yylex(YYSTYPE *yylval, int *base)
153*0a6a1f1dSLionel Sambuc # define YYLEX yylex(&yylval, base)
154*0a6a1f1dSLionel Sambuc #endif
155*0a6a1f1dSLionel Sambuc
156*0a6a1f1dSLionel Sambuc /* Parameters sent to yyerror. */
157*0a6a1f1dSLionel Sambuc #ifndef YYERROR_DECL
158*0a6a1f1dSLionel Sambuc #define YYERROR_DECL() yyerror(int regs[26], int *base, const char *s)
159*0a6a1f1dSLionel Sambuc #endif
160*0a6a1f1dSLionel Sambuc #ifndef YYERROR_CALL
161*0a6a1f1dSLionel Sambuc #define YYERROR_CALL(msg) yyerror(regs, base, msg)
162*0a6a1f1dSLionel Sambuc #endif
163*0a6a1f1dSLionel Sambuc
164*0a6a1f1dSLionel Sambuc extern int YYPARSE_DECL();
165*0a6a1f1dSLionel Sambuc
166*0a6a1f1dSLionel Sambuc #define DIGIT 257
167*0a6a1f1dSLionel Sambuc #define LETTER 258
168*0a6a1f1dSLionel Sambuc #define OCT1 259
169*0a6a1f1dSLionel Sambuc #define HEX1 260
170*0a6a1f1dSLionel Sambuc #define HEX2 261
171*0a6a1f1dSLionel Sambuc #define HEX3 262
172*0a6a1f1dSLionel Sambuc #define STR1 263
173*0a6a1f1dSLionel Sambuc #define STR2 265
174*0a6a1f1dSLionel Sambuc #define BELL 266
175*0a6a1f1dSLionel Sambuc #define BS 267
176*0a6a1f1dSLionel Sambuc #define NL 268
177*0a6a1f1dSLionel Sambuc #define LF 269
178*0a6a1f1dSLionel Sambuc #define CR 270
179*0a6a1f1dSLionel Sambuc #define TAB 271
180*0a6a1f1dSLionel Sambuc #define VT 272
181*0a6a1f1dSLionel Sambuc #define UMINUS 273
182*0a6a1f1dSLionel Sambuc #define YYERRCODE 256
183*0a6a1f1dSLionel Sambuc typedef short YYINT;
184*0a6a1f1dSLionel Sambuc static const YYINT ok_syntax1_lhs[] = { -1,
185*0a6a1f1dSLionel Sambuc 0, 0, 0, 1, 1, 2, 2, 2, 2, 2,
186*0a6a1f1dSLionel Sambuc 2, 2, 2, 2, 2, 2, 3, 3,
187*0a6a1f1dSLionel Sambuc };
188*0a6a1f1dSLionel Sambuc static const YYINT ok_syntax1_len[] = { 2,
189*0a6a1f1dSLionel Sambuc 0, 3, 3, 1, 3, 3, 3, 3, 3, 3,
190*0a6a1f1dSLionel Sambuc 3, 3, 3, 2, 1, 1, 1, 2,
191*0a6a1f1dSLionel Sambuc };
192*0a6a1f1dSLionel Sambuc static const YYINT ok_syntax1_defred[] = { 1,
193*0a6a1f1dSLionel Sambuc 0, 0, 17, 0, 0, 0, 0, 0, 0, 3,
194*0a6a1f1dSLionel Sambuc 0, 15, 14, 0, 2, 0, 0, 0, 0, 0,
195*0a6a1f1dSLionel Sambuc 0, 0, 18, 0, 6, 0, 0, 0, 0, 9,
196*0a6a1f1dSLionel Sambuc 10, 11,
197*0a6a1f1dSLionel Sambuc };
198*0a6a1f1dSLionel Sambuc static const YYINT ok_syntax1_dgoto[] = { 1,
199*0a6a1f1dSLionel Sambuc 7, 8, 9,
200*0a6a1f1dSLionel Sambuc };
201*0a6a1f1dSLionel Sambuc static const YYINT ok_syntax1_sindex[] = { 0,
202*0a6a1f1dSLionel Sambuc -40, -7, 0, -55, -38, -38, 1, -29, -247, 0,
203*0a6a1f1dSLionel Sambuc -38, 0, 0, 22, 0, -38, -38, -38, -38, -38,
204*0a6a1f1dSLionel Sambuc -38, -38, 0, -29, 0, 51, 60, -20, -20, 0,
205*0a6a1f1dSLionel Sambuc 0, 0,
206*0a6a1f1dSLionel Sambuc };
207*0a6a1f1dSLionel Sambuc static const YYINT ok_syntax1_rindex[] = { 0,
208*0a6a1f1dSLionel Sambuc 0, 0, 0, 2, 0, 0, 0, 9, -9, 0,
209*0a6a1f1dSLionel Sambuc 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
210*0a6a1f1dSLionel Sambuc 0, 0, 0, 10, 0, -6, 14, 5, 13, 0,
211*0a6a1f1dSLionel Sambuc 0, 0,
212*0a6a1f1dSLionel Sambuc };
213*0a6a1f1dSLionel Sambuc static const YYINT ok_syntax1_gindex[] = { 0,
214*0a6a1f1dSLionel Sambuc 0, 65, 0,
215*0a6a1f1dSLionel Sambuc };
216*0a6a1f1dSLionel Sambuc #define YYTABLESIZE 220
217*0a6a1f1dSLionel Sambuc static const YYINT ok_syntax1_table[] = { 6,
218*0a6a1f1dSLionel Sambuc 16, 6, 10, 13, 5, 11, 5, 22, 17, 23,
219*0a6a1f1dSLionel Sambuc 15, 15, 20, 18, 7, 19, 22, 21, 4, 5,
220*0a6a1f1dSLionel Sambuc 0, 20, 8, 12, 0, 0, 21, 16, 16, 0,
221*0a6a1f1dSLionel Sambuc 0, 16, 16, 16, 13, 16, 0, 16, 15, 15,
222*0a6a1f1dSLionel Sambuc 0, 0, 7, 15, 15, 7, 15, 7, 15, 7,
223*0a6a1f1dSLionel Sambuc 8, 12, 0, 8, 12, 8, 0, 8, 22, 17,
224*0a6a1f1dSLionel Sambuc 0, 0, 25, 20, 18, 0, 19, 0, 21, 13,
225*0a6a1f1dSLionel Sambuc 14, 0, 0, 0, 0, 24, 0, 0, 0, 0,
226*0a6a1f1dSLionel Sambuc 26, 27, 28, 29, 30, 31, 32, 22, 17, 0,
227*0a6a1f1dSLionel Sambuc 0, 0, 20, 18, 16, 19, 22, 21, 0, 0,
228*0a6a1f1dSLionel Sambuc 0, 20, 18, 0, 19, 0, 21, 0, 0, 0,
229*0a6a1f1dSLionel Sambuc 0, 0, 0, 0, 16, 0, 0, 13, 0, 0,
230*0a6a1f1dSLionel Sambuc 0, 0, 0, 0, 0, 15, 0, 0, 7, 0,
231*0a6a1f1dSLionel Sambuc 0, 0, 0, 0, 0, 0, 8, 12, 0, 0,
232*0a6a1f1dSLionel Sambuc 0, 0, 0, 0, 0, 16, 0, 0, 0, 0,
233*0a6a1f1dSLionel Sambuc 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
234*0a6a1f1dSLionel Sambuc 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
235*0a6a1f1dSLionel Sambuc 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
236*0a6a1f1dSLionel Sambuc 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
237*0a6a1f1dSLionel Sambuc 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
238*0a6a1f1dSLionel Sambuc 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
239*0a6a1f1dSLionel Sambuc 0, 0, 0, 0, 0, 2, 3, 4, 3, 12,
240*0a6a1f1dSLionel Sambuc };
241*0a6a1f1dSLionel Sambuc static const YYINT ok_syntax1_check[] = { 40,
242*0a6a1f1dSLionel Sambuc 10, 40, 10, 10, 45, 61, 45, 37, 38, 257,
243*0a6a1f1dSLionel Sambuc 10, 10, 42, 43, 10, 45, 37, 47, 10, 10,
244*0a6a1f1dSLionel Sambuc -1, 42, 10, 10, -1, -1, 47, 37, 38, -1,
245*0a6a1f1dSLionel Sambuc -1, 41, 42, 43, 41, 45, -1, 47, 37, 38,
246*0a6a1f1dSLionel Sambuc -1, -1, 38, 42, 43, 41, 45, 43, 47, 45,
247*0a6a1f1dSLionel Sambuc 38, 38, -1, 41, 41, 43, -1, 45, 37, 38,
248*0a6a1f1dSLionel Sambuc -1, -1, 41, 42, 43, -1, 45, -1, 47, 5,
249*0a6a1f1dSLionel Sambuc 6, -1, -1, -1, -1, 11, -1, -1, -1, -1,
250*0a6a1f1dSLionel Sambuc 16, 17, 18, 19, 20, 21, 22, 37, 38, -1,
251*0a6a1f1dSLionel Sambuc -1, -1, 42, 43, 124, 45, 37, 47, -1, -1,
252*0a6a1f1dSLionel Sambuc -1, 42, 43, -1, 45, -1, 47, -1, -1, -1,
253*0a6a1f1dSLionel Sambuc -1, -1, -1, -1, 124, -1, -1, 124, -1, -1,
254*0a6a1f1dSLionel Sambuc -1, -1, -1, -1, -1, 124, -1, -1, 124, -1,
255*0a6a1f1dSLionel Sambuc -1, -1, -1, -1, -1, -1, 124, 124, -1, -1,
256*0a6a1f1dSLionel Sambuc -1, -1, -1, -1, -1, 124, -1, -1, -1, -1,
257*0a6a1f1dSLionel Sambuc -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
258*0a6a1f1dSLionel Sambuc -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
259*0a6a1f1dSLionel Sambuc -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
260*0a6a1f1dSLionel Sambuc -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
261*0a6a1f1dSLionel Sambuc -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
262*0a6a1f1dSLionel Sambuc -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
263*0a6a1f1dSLionel Sambuc -1, -1, -1, -1, -1, 256, 257, 258, 257, 258,
264*0a6a1f1dSLionel Sambuc };
265*0a6a1f1dSLionel Sambuc #define YYFINAL 1
266*0a6a1f1dSLionel Sambuc #ifndef YYDEBUG
267*0a6a1f1dSLionel Sambuc #define YYDEBUG 0
268*0a6a1f1dSLionel Sambuc #endif
269*0a6a1f1dSLionel Sambuc #define YYMAXTOKEN 273
270*0a6a1f1dSLionel Sambuc #define YYUNDFTOKEN 279
271*0a6a1f1dSLionel Sambuc #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
272*0a6a1f1dSLionel Sambuc #if YYDEBUG
273*0a6a1f1dSLionel Sambuc static const char *const ok_syntax1_name[] = {
274*0a6a1f1dSLionel Sambuc
275*0a6a1f1dSLionel Sambuc "end-of-file",0,0,0,0,0,0,"'\\a'","'\\b'","'\\t'","'\\n'","'\\v'","'\\f'",
276*0a6a1f1dSLionel Sambuc "'\\r'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'#'",0,"'%'","'&'",0,"'('",
277*0a6a1f1dSLionel Sambuc "')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0,0,0,0,0,0,0,"'='",0,0,"'@'",0,0,
278*0a6a1f1dSLionel Sambuc 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'^'",0,0,0,0,0,0,0,0,0,0,
279*0a6a1f1dSLionel Sambuc 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'|'",0,"'~'","'\\177'",0,0,0,0,0,0,0,0,0,
280*0a6a1f1dSLionel Sambuc 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
281*0a6a1f1dSLionel Sambuc 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
282*0a6a1f1dSLionel Sambuc 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
283*0a6a1f1dSLionel Sambuc "'\\377'",0,"DIGIT","LETTER","OCT1","HEX1","HEX2","HEX3","STR1",
284*0a6a1f1dSLionel Sambuc "\"\\177\\177\\\\\\n\"","STR2","BELL","BS","NL","LF","CR","TAB","VT","UMINUS",0,
285*0a6a1f1dSLionel Sambuc 0,0,0,0,"illegal-symbol",
286*0a6a1f1dSLionel Sambuc };
287*0a6a1f1dSLionel Sambuc static const char *const ok_syntax1_rule[] = {
288*0a6a1f1dSLionel Sambuc "$accept : list",
289*0a6a1f1dSLionel Sambuc "list :",
290*0a6a1f1dSLionel Sambuc "list : list stat '\\n'",
291*0a6a1f1dSLionel Sambuc "list : list error '\\n'",
292*0a6a1f1dSLionel Sambuc "stat : expr",
293*0a6a1f1dSLionel Sambuc "stat : LETTER '=' expr",
294*0a6a1f1dSLionel Sambuc "expr : '(' expr ')'",
295*0a6a1f1dSLionel Sambuc "expr : expr '+' expr",
296*0a6a1f1dSLionel Sambuc "expr : expr '-' expr",
297*0a6a1f1dSLionel Sambuc "expr : expr '*' expr",
298*0a6a1f1dSLionel Sambuc "expr : expr '/' expr",
299*0a6a1f1dSLionel Sambuc "expr : expr '%' expr",
300*0a6a1f1dSLionel Sambuc "expr : expr '&' expr",
301*0a6a1f1dSLionel Sambuc "expr : expr '|' expr",
302*0a6a1f1dSLionel Sambuc "expr : '-' expr",
303*0a6a1f1dSLionel Sambuc "expr : LETTER",
304*0a6a1f1dSLionel Sambuc "expr : number",
305*0a6a1f1dSLionel Sambuc "number : DIGIT",
306*0a6a1f1dSLionel Sambuc "number : number DIGIT",
307*0a6a1f1dSLionel Sambuc
308*0a6a1f1dSLionel Sambuc };
309*0a6a1f1dSLionel Sambuc #endif
310*0a6a1f1dSLionel Sambuc
311*0a6a1f1dSLionel Sambuc int yydebug;
312*0a6a1f1dSLionel Sambuc int yynerrs;
313*0a6a1f1dSLionel Sambuc
314*0a6a1f1dSLionel Sambuc /* define the initial stack-sizes */
315*0a6a1f1dSLionel Sambuc #ifdef YYSTACKSIZE
316*0a6a1f1dSLionel Sambuc #undef YYMAXDEPTH
317*0a6a1f1dSLionel Sambuc #define YYMAXDEPTH YYSTACKSIZE
318*0a6a1f1dSLionel Sambuc #else
319*0a6a1f1dSLionel Sambuc #ifdef YYMAXDEPTH
320*0a6a1f1dSLionel Sambuc #define YYSTACKSIZE YYMAXDEPTH
321*0a6a1f1dSLionel Sambuc #else
322*0a6a1f1dSLionel Sambuc #define YYSTACKSIZE 10000
323*0a6a1f1dSLionel Sambuc #define YYMAXDEPTH 10000
324*0a6a1f1dSLionel Sambuc #endif
325*0a6a1f1dSLionel Sambuc #endif
326*0a6a1f1dSLionel Sambuc
327*0a6a1f1dSLionel Sambuc #define YYINITSTACKSIZE 200
328*0a6a1f1dSLionel Sambuc
329*0a6a1f1dSLionel Sambuc typedef struct {
330*0a6a1f1dSLionel Sambuc unsigned stacksize;
331*0a6a1f1dSLionel Sambuc YYINT *s_base;
332*0a6a1f1dSLionel Sambuc YYINT *s_mark;
333*0a6a1f1dSLionel Sambuc YYINT *s_last;
334*0a6a1f1dSLionel Sambuc YYSTYPE *l_base;
335*0a6a1f1dSLionel Sambuc YYSTYPE *l_mark;
336*0a6a1f1dSLionel Sambuc } YYSTACKDATA;
337*0a6a1f1dSLionel Sambuc #line 104 "ok_syntax1.y"
338*0a6a1f1dSLionel Sambuc /* start of programs */
339*0a6a1f1dSLionel Sambuc
340*0a6a1f1dSLionel Sambuc #ifdef YYBYACC
341*0a6a1f1dSLionel Sambuc extern int YYLEX_DECL();
342*0a6a1f1dSLionel Sambuc #endif
343*0a6a1f1dSLionel Sambuc
344*0a6a1f1dSLionel Sambuc int
main(void)345*0a6a1f1dSLionel Sambuc main (void)
346*0a6a1f1dSLionel Sambuc {
347*0a6a1f1dSLionel Sambuc int regs[26];
348*0a6a1f1dSLionel Sambuc int base = 10;
349*0a6a1f1dSLionel Sambuc
350*0a6a1f1dSLionel Sambuc while(!feof(stdin)) {
351*0a6a1f1dSLionel Sambuc yyparse(regs, &base);
352*0a6a1f1dSLionel Sambuc }
353*0a6a1f1dSLionel Sambuc return 0;
354*0a6a1f1dSLionel Sambuc }
355*0a6a1f1dSLionel Sambuc
356*0a6a1f1dSLionel Sambuc #define UNUSED(x) ((void)(x))
357*0a6a1f1dSLionel Sambuc
358*0a6a1f1dSLionel Sambuc static void
YYERROR_DECL()359*0a6a1f1dSLionel Sambuc YYERROR_DECL()
360*0a6a1f1dSLionel Sambuc {
361*0a6a1f1dSLionel Sambuc UNUSED(regs); /* %parse-param regs is not actually used here */
362*0a6a1f1dSLionel Sambuc UNUSED(base); /* %parse-param base is not actually used here */
363*0a6a1f1dSLionel Sambuc fprintf(stderr, "%s\n", s);
364*0a6a1f1dSLionel Sambuc }
365*0a6a1f1dSLionel Sambuc
366*0a6a1f1dSLionel Sambuc int
YYLEX_DECL()367*0a6a1f1dSLionel Sambuc YYLEX_DECL()
368*0a6a1f1dSLionel Sambuc {
369*0a6a1f1dSLionel Sambuc /* lexical analysis routine */
370*0a6a1f1dSLionel Sambuc /* returns LETTER for a lower case letter, yylval = 0 through 25 */
371*0a6a1f1dSLionel Sambuc /* return DIGIT for a digit, yylval = 0 through 9 */
372*0a6a1f1dSLionel Sambuc /* all other characters are returned immediately */
373*0a6a1f1dSLionel Sambuc
374*0a6a1f1dSLionel Sambuc int c;
375*0a6a1f1dSLionel Sambuc
376*0a6a1f1dSLionel Sambuc while( (c=getchar()) == ' ' ) { /* skip blanks */ }
377*0a6a1f1dSLionel Sambuc
378*0a6a1f1dSLionel Sambuc /* c is now nonblank */
379*0a6a1f1dSLionel Sambuc
380*0a6a1f1dSLionel Sambuc if( islower( c )) {
381*0a6a1f1dSLionel Sambuc yylval->ival = (c - 'a');
382*0a6a1f1dSLionel Sambuc return ( LETTER );
383*0a6a1f1dSLionel Sambuc }
384*0a6a1f1dSLionel Sambuc if( isdigit( c )) {
385*0a6a1f1dSLionel Sambuc yylval->ival = (c - '0') % (*base);
386*0a6a1f1dSLionel Sambuc return ( DIGIT );
387*0a6a1f1dSLionel Sambuc }
388*0a6a1f1dSLionel Sambuc return( c );
389*0a6a1f1dSLionel Sambuc }
390*0a6a1f1dSLionel Sambuc #line 389 "ok_syntax1.tab.c"
391*0a6a1f1dSLionel Sambuc
392*0a6a1f1dSLionel Sambuc #if YYDEBUG
393*0a6a1f1dSLionel Sambuc #include <stdio.h> /* needed for printf */
394*0a6a1f1dSLionel Sambuc #endif
395*0a6a1f1dSLionel Sambuc
396*0a6a1f1dSLionel Sambuc #include <stdlib.h> /* needed for malloc, etc */
397*0a6a1f1dSLionel Sambuc #include <string.h> /* needed for memset */
398*0a6a1f1dSLionel Sambuc
399*0a6a1f1dSLionel Sambuc /* allocate initial stack or double stack size, up to YYMAXDEPTH */
yygrowstack(YYSTACKDATA * data)400*0a6a1f1dSLionel Sambuc static int yygrowstack(YYSTACKDATA *data)
401*0a6a1f1dSLionel Sambuc {
402*0a6a1f1dSLionel Sambuc int i;
403*0a6a1f1dSLionel Sambuc unsigned newsize;
404*0a6a1f1dSLionel Sambuc YYINT *newss;
405*0a6a1f1dSLionel Sambuc YYSTYPE *newvs;
406*0a6a1f1dSLionel Sambuc
407*0a6a1f1dSLionel Sambuc if ((newsize = data->stacksize) == 0)
408*0a6a1f1dSLionel Sambuc newsize = YYINITSTACKSIZE;
409*0a6a1f1dSLionel Sambuc else if (newsize >= YYMAXDEPTH)
410*0a6a1f1dSLionel Sambuc return YYENOMEM;
411*0a6a1f1dSLionel Sambuc else if ((newsize *= 2) > YYMAXDEPTH)
412*0a6a1f1dSLionel Sambuc newsize = YYMAXDEPTH;
413*0a6a1f1dSLionel Sambuc
414*0a6a1f1dSLionel Sambuc i = (int) (data->s_mark - data->s_base);
415*0a6a1f1dSLionel Sambuc newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
416*0a6a1f1dSLionel Sambuc if (newss == 0)
417*0a6a1f1dSLionel Sambuc return YYENOMEM;
418*0a6a1f1dSLionel Sambuc
419*0a6a1f1dSLionel Sambuc data->s_base = newss;
420*0a6a1f1dSLionel Sambuc data->s_mark = newss + i;
421*0a6a1f1dSLionel Sambuc
422*0a6a1f1dSLionel Sambuc newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
423*0a6a1f1dSLionel Sambuc if (newvs == 0)
424*0a6a1f1dSLionel Sambuc return YYENOMEM;
425*0a6a1f1dSLionel Sambuc
426*0a6a1f1dSLionel Sambuc data->l_base = newvs;
427*0a6a1f1dSLionel Sambuc data->l_mark = newvs + i;
428*0a6a1f1dSLionel Sambuc
429*0a6a1f1dSLionel Sambuc data->stacksize = newsize;
430*0a6a1f1dSLionel Sambuc data->s_last = data->s_base + newsize - 1;
431*0a6a1f1dSLionel Sambuc return 0;
432*0a6a1f1dSLionel Sambuc }
433*0a6a1f1dSLionel Sambuc
434*0a6a1f1dSLionel Sambuc #if YYPURE || defined(YY_NO_LEAKS)
yyfreestack(YYSTACKDATA * data)435*0a6a1f1dSLionel Sambuc static void yyfreestack(YYSTACKDATA *data)
436*0a6a1f1dSLionel Sambuc {
437*0a6a1f1dSLionel Sambuc free(data->s_base);
438*0a6a1f1dSLionel Sambuc free(data->l_base);
439*0a6a1f1dSLionel Sambuc memset(data, 0, sizeof(*data));
440*0a6a1f1dSLionel Sambuc }
441*0a6a1f1dSLionel Sambuc #else
442*0a6a1f1dSLionel Sambuc #define yyfreestack(data) /* nothing */
443*0a6a1f1dSLionel Sambuc #endif
444*0a6a1f1dSLionel Sambuc
445*0a6a1f1dSLionel Sambuc #define YYABORT goto yyabort
446*0a6a1f1dSLionel Sambuc #define YYREJECT goto yyabort
447*0a6a1f1dSLionel Sambuc #define YYACCEPT goto yyaccept
448*0a6a1f1dSLionel Sambuc #define YYERROR goto yyerrlab
449*0a6a1f1dSLionel Sambuc
450*0a6a1f1dSLionel Sambuc int
YYPARSE_DECL()451*0a6a1f1dSLionel Sambuc YYPARSE_DECL()
452*0a6a1f1dSLionel Sambuc {
453*0a6a1f1dSLionel Sambuc int yyerrflag;
454*0a6a1f1dSLionel Sambuc int yychar;
455*0a6a1f1dSLionel Sambuc YYSTYPE yyval;
456*0a6a1f1dSLionel Sambuc YYSTYPE yylval;
457*0a6a1f1dSLionel Sambuc
458*0a6a1f1dSLionel Sambuc /* variables for the parser stack */
459*0a6a1f1dSLionel Sambuc YYSTACKDATA yystack;
460*0a6a1f1dSLionel Sambuc int yym, yyn, yystate;
461*0a6a1f1dSLionel Sambuc #if YYDEBUG
462*0a6a1f1dSLionel Sambuc const char *yys;
463*0a6a1f1dSLionel Sambuc
464*0a6a1f1dSLionel Sambuc if ((yys = getenv("YYDEBUG")) != 0)
465*0a6a1f1dSLionel Sambuc {
466*0a6a1f1dSLionel Sambuc yyn = *yys;
467*0a6a1f1dSLionel Sambuc if (yyn >= '0' && yyn <= '9')
468*0a6a1f1dSLionel Sambuc yydebug = yyn - '0';
469*0a6a1f1dSLionel Sambuc }
470*0a6a1f1dSLionel Sambuc #endif
471*0a6a1f1dSLionel Sambuc
472*0a6a1f1dSLionel Sambuc yynerrs = 0;
473*0a6a1f1dSLionel Sambuc yyerrflag = 0;
474*0a6a1f1dSLionel Sambuc yychar = YYEMPTY;
475*0a6a1f1dSLionel Sambuc yystate = 0;
476*0a6a1f1dSLionel Sambuc
477*0a6a1f1dSLionel Sambuc #if YYPURE
478*0a6a1f1dSLionel Sambuc memset(&yystack, 0, sizeof(yystack));
479*0a6a1f1dSLionel Sambuc #endif
480*0a6a1f1dSLionel Sambuc
481*0a6a1f1dSLionel Sambuc if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
482*0a6a1f1dSLionel Sambuc yystack.s_mark = yystack.s_base;
483*0a6a1f1dSLionel Sambuc yystack.l_mark = yystack.l_base;
484*0a6a1f1dSLionel Sambuc yystate = 0;
485*0a6a1f1dSLionel Sambuc *yystack.s_mark = 0;
486*0a6a1f1dSLionel Sambuc
487*0a6a1f1dSLionel Sambuc yyloop:
488*0a6a1f1dSLionel Sambuc if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
489*0a6a1f1dSLionel Sambuc if (yychar < 0)
490*0a6a1f1dSLionel Sambuc {
491*0a6a1f1dSLionel Sambuc if ((yychar = YYLEX) < 0) yychar = YYEOF;
492*0a6a1f1dSLionel Sambuc #if YYDEBUG
493*0a6a1f1dSLionel Sambuc if (yydebug)
494*0a6a1f1dSLionel Sambuc {
495*0a6a1f1dSLionel Sambuc yys = yyname[YYTRANSLATE(yychar)];
496*0a6a1f1dSLionel Sambuc printf("%sdebug: state %d, reading %d (%s)\n",
497*0a6a1f1dSLionel Sambuc YYPREFIX, yystate, yychar, yys);
498*0a6a1f1dSLionel Sambuc }
499*0a6a1f1dSLionel Sambuc #endif
500*0a6a1f1dSLionel Sambuc }
501*0a6a1f1dSLionel Sambuc if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
502*0a6a1f1dSLionel Sambuc yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
503*0a6a1f1dSLionel Sambuc {
504*0a6a1f1dSLionel Sambuc #if YYDEBUG
505*0a6a1f1dSLionel Sambuc if (yydebug)
506*0a6a1f1dSLionel Sambuc printf("%sdebug: state %d, shifting to state %d\n",
507*0a6a1f1dSLionel Sambuc YYPREFIX, yystate, yytable[yyn]);
508*0a6a1f1dSLionel Sambuc #endif
509*0a6a1f1dSLionel Sambuc if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
510*0a6a1f1dSLionel Sambuc {
511*0a6a1f1dSLionel Sambuc goto yyoverflow;
512*0a6a1f1dSLionel Sambuc }
513*0a6a1f1dSLionel Sambuc yystate = yytable[yyn];
514*0a6a1f1dSLionel Sambuc *++yystack.s_mark = yytable[yyn];
515*0a6a1f1dSLionel Sambuc *++yystack.l_mark = yylval;
516*0a6a1f1dSLionel Sambuc yychar = YYEMPTY;
517*0a6a1f1dSLionel Sambuc if (yyerrflag > 0) --yyerrflag;
518*0a6a1f1dSLionel Sambuc goto yyloop;
519*0a6a1f1dSLionel Sambuc }
520*0a6a1f1dSLionel Sambuc if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
521*0a6a1f1dSLionel Sambuc yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
522*0a6a1f1dSLionel Sambuc {
523*0a6a1f1dSLionel Sambuc yyn = yytable[yyn];
524*0a6a1f1dSLionel Sambuc goto yyreduce;
525*0a6a1f1dSLionel Sambuc }
526*0a6a1f1dSLionel Sambuc if (yyerrflag) goto yyinrecovery;
527*0a6a1f1dSLionel Sambuc
528*0a6a1f1dSLionel Sambuc YYERROR_CALL("syntax error");
529*0a6a1f1dSLionel Sambuc
530*0a6a1f1dSLionel Sambuc goto yyerrlab;
531*0a6a1f1dSLionel Sambuc
532*0a6a1f1dSLionel Sambuc yyerrlab:
533*0a6a1f1dSLionel Sambuc ++yynerrs;
534*0a6a1f1dSLionel Sambuc
535*0a6a1f1dSLionel Sambuc yyinrecovery:
536*0a6a1f1dSLionel Sambuc if (yyerrflag < 3)
537*0a6a1f1dSLionel Sambuc {
538*0a6a1f1dSLionel Sambuc yyerrflag = 3;
539*0a6a1f1dSLionel Sambuc for (;;)
540*0a6a1f1dSLionel Sambuc {
541*0a6a1f1dSLionel Sambuc if ((yyn = yysindex[*yystack.s_mark]) && (yyn += YYERRCODE) >= 0 &&
542*0a6a1f1dSLionel Sambuc yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
543*0a6a1f1dSLionel Sambuc {
544*0a6a1f1dSLionel Sambuc #if YYDEBUG
545*0a6a1f1dSLionel Sambuc if (yydebug)
546*0a6a1f1dSLionel Sambuc printf("%sdebug: state %d, error recovery shifting\
547*0a6a1f1dSLionel Sambuc to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
548*0a6a1f1dSLionel Sambuc #endif
549*0a6a1f1dSLionel Sambuc if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
550*0a6a1f1dSLionel Sambuc {
551*0a6a1f1dSLionel Sambuc goto yyoverflow;
552*0a6a1f1dSLionel Sambuc }
553*0a6a1f1dSLionel Sambuc yystate = yytable[yyn];
554*0a6a1f1dSLionel Sambuc *++yystack.s_mark = yytable[yyn];
555*0a6a1f1dSLionel Sambuc *++yystack.l_mark = yylval;
556*0a6a1f1dSLionel Sambuc goto yyloop;
557*0a6a1f1dSLionel Sambuc }
558*0a6a1f1dSLionel Sambuc else
559*0a6a1f1dSLionel Sambuc {
560*0a6a1f1dSLionel Sambuc #if YYDEBUG
561*0a6a1f1dSLionel Sambuc if (yydebug)
562*0a6a1f1dSLionel Sambuc printf("%sdebug: error recovery discarding state %d\n",
563*0a6a1f1dSLionel Sambuc YYPREFIX, *yystack.s_mark);
564*0a6a1f1dSLionel Sambuc #endif
565*0a6a1f1dSLionel Sambuc if (yystack.s_mark <= yystack.s_base) goto yyabort;
566*0a6a1f1dSLionel Sambuc --yystack.s_mark;
567*0a6a1f1dSLionel Sambuc --yystack.l_mark;
568*0a6a1f1dSLionel Sambuc }
569*0a6a1f1dSLionel Sambuc }
570*0a6a1f1dSLionel Sambuc }
571*0a6a1f1dSLionel Sambuc else
572*0a6a1f1dSLionel Sambuc {
573*0a6a1f1dSLionel Sambuc if (yychar == YYEOF) goto yyabort;
574*0a6a1f1dSLionel Sambuc #if YYDEBUG
575*0a6a1f1dSLionel Sambuc if (yydebug)
576*0a6a1f1dSLionel Sambuc {
577*0a6a1f1dSLionel Sambuc yys = yyname[YYTRANSLATE(yychar)];
578*0a6a1f1dSLionel Sambuc printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
579*0a6a1f1dSLionel Sambuc YYPREFIX, yystate, yychar, yys);
580*0a6a1f1dSLionel Sambuc }
581*0a6a1f1dSLionel Sambuc #endif
582*0a6a1f1dSLionel Sambuc yychar = YYEMPTY;
583*0a6a1f1dSLionel Sambuc goto yyloop;
584*0a6a1f1dSLionel Sambuc }
585*0a6a1f1dSLionel Sambuc
586*0a6a1f1dSLionel Sambuc yyreduce:
587*0a6a1f1dSLionel Sambuc #if YYDEBUG
588*0a6a1f1dSLionel Sambuc if (yydebug)
589*0a6a1f1dSLionel Sambuc printf("%sdebug: state %d, reducing by rule %d (%s)\n",
590*0a6a1f1dSLionel Sambuc YYPREFIX, yystate, yyn, yyrule[yyn]);
591*0a6a1f1dSLionel Sambuc #endif
592*0a6a1f1dSLionel Sambuc yym = yylen[yyn];
593*0a6a1f1dSLionel Sambuc if (yym)
594*0a6a1f1dSLionel Sambuc yyval = yystack.l_mark[1-yym];
595*0a6a1f1dSLionel Sambuc else
596*0a6a1f1dSLionel Sambuc memset(&yyval, 0, sizeof yyval);
597*0a6a1f1dSLionel Sambuc switch (yyn)
598*0a6a1f1dSLionel Sambuc {
599*0a6a1f1dSLionel Sambuc case 3:
600*0a6a1f1dSLionel Sambuc #line 66 "ok_syntax1.y"
601*0a6a1f1dSLionel Sambuc { yyerrok ; }
602*0a6a1f1dSLionel Sambuc break;
603*0a6a1f1dSLionel Sambuc case 4:
604*0a6a1f1dSLionel Sambuc #line 70 "ok_syntax1.y"
605*0a6a1f1dSLionel Sambuc { printf("%d\n",yystack.l_mark[0].ival);}
606*0a6a1f1dSLionel Sambuc break;
607*0a6a1f1dSLionel Sambuc case 5:
608*0a6a1f1dSLionel Sambuc #line 72 "ok_syntax1.y"
609*0a6a1f1dSLionel Sambuc { regs[yystack.l_mark[-2].ival] = yystack.l_mark[0].ival; }
610*0a6a1f1dSLionel Sambuc break;
611*0a6a1f1dSLionel Sambuc case 6:
612*0a6a1f1dSLionel Sambuc #line 76 "ok_syntax1.y"
613*0a6a1f1dSLionel Sambuc { yyval.ival = yystack.l_mark[-1].ival; }
614*0a6a1f1dSLionel Sambuc break;
615*0a6a1f1dSLionel Sambuc case 7:
616*0a6a1f1dSLionel Sambuc #line 78 "ok_syntax1.y"
617*0a6a1f1dSLionel Sambuc { yyval.ival = yystack.l_mark[-2].ival + yystack.l_mark[0].ival; }
618*0a6a1f1dSLionel Sambuc break;
619*0a6a1f1dSLionel Sambuc case 8:
620*0a6a1f1dSLionel Sambuc #line 80 "ok_syntax1.y"
621*0a6a1f1dSLionel Sambuc { yyval.ival = yystack.l_mark[-2].ival - yystack.l_mark[0].ival; }
622*0a6a1f1dSLionel Sambuc break;
623*0a6a1f1dSLionel Sambuc case 9:
624*0a6a1f1dSLionel Sambuc #line 82 "ok_syntax1.y"
625*0a6a1f1dSLionel Sambuc { yyval.ival = yystack.l_mark[-2].ival * yystack.l_mark[0].ival; }
626*0a6a1f1dSLionel Sambuc break;
627*0a6a1f1dSLionel Sambuc case 10:
628*0a6a1f1dSLionel Sambuc #line 84 "ok_syntax1.y"
629*0a6a1f1dSLionel Sambuc { yyval.ival = yystack.l_mark[-2].ival / yystack.l_mark[0].ival; }
630*0a6a1f1dSLionel Sambuc break;
631*0a6a1f1dSLionel Sambuc case 11:
632*0a6a1f1dSLionel Sambuc #line 86 "ok_syntax1.y"
633*0a6a1f1dSLionel Sambuc { yyval.ival = yystack.l_mark[-2].ival % yystack.l_mark[0].ival; }
634*0a6a1f1dSLionel Sambuc break;
635*0a6a1f1dSLionel Sambuc case 12:
636*0a6a1f1dSLionel Sambuc #line 88 "ok_syntax1.y"
637*0a6a1f1dSLionel Sambuc { yyval.ival = yystack.l_mark[-2].ival & yystack.l_mark[0].ival; }
638*0a6a1f1dSLionel Sambuc break;
639*0a6a1f1dSLionel Sambuc case 13:
640*0a6a1f1dSLionel Sambuc #line 90 "ok_syntax1.y"
641*0a6a1f1dSLionel Sambuc { yyval.ival = yystack.l_mark[-2].ival | yystack.l_mark[0].ival; }
642*0a6a1f1dSLionel Sambuc break;
643*0a6a1f1dSLionel Sambuc case 14:
644*0a6a1f1dSLionel Sambuc #line 92 "ok_syntax1.y"
645*0a6a1f1dSLionel Sambuc { yyval.ival = - yystack.l_mark[0].ival; }
646*0a6a1f1dSLionel Sambuc break;
647*0a6a1f1dSLionel Sambuc case 15:
648*0a6a1f1dSLionel Sambuc #line 94 "ok_syntax1.y"
649*0a6a1f1dSLionel Sambuc { yyval.ival = regs[yystack.l_mark[0].ival]; }
650*0a6a1f1dSLionel Sambuc break;
651*0a6a1f1dSLionel Sambuc case 17:
652*0a6a1f1dSLionel Sambuc #line 99 "ok_syntax1.y"
653*0a6a1f1dSLionel Sambuc { yyval.ival = yystack.l_mark[0].ival; (*base) = (yystack.l_mark[0].ival==0) ? 8 : 10; }
654*0a6a1f1dSLionel Sambuc break;
655*0a6a1f1dSLionel Sambuc case 18:
656*0a6a1f1dSLionel Sambuc #line 101 "ok_syntax1.y"
657*0a6a1f1dSLionel Sambuc { yyval.ival = (*base) * yystack.l_mark[-1].ival + yystack.l_mark[0].ival; }
658*0a6a1f1dSLionel Sambuc break;
659*0a6a1f1dSLionel Sambuc #line 658 "ok_syntax1.tab.c"
660*0a6a1f1dSLionel Sambuc }
661*0a6a1f1dSLionel Sambuc yystack.s_mark -= yym;
662*0a6a1f1dSLionel Sambuc yystate = *yystack.s_mark;
663*0a6a1f1dSLionel Sambuc yystack.l_mark -= yym;
664*0a6a1f1dSLionel Sambuc yym = yylhs[yyn];
665*0a6a1f1dSLionel Sambuc if (yystate == 0 && yym == 0)
666*0a6a1f1dSLionel Sambuc {
667*0a6a1f1dSLionel Sambuc #if YYDEBUG
668*0a6a1f1dSLionel Sambuc if (yydebug)
669*0a6a1f1dSLionel Sambuc printf("%sdebug: after reduction, shifting from state 0 to\
670*0a6a1f1dSLionel Sambuc state %d\n", YYPREFIX, YYFINAL);
671*0a6a1f1dSLionel Sambuc #endif
672*0a6a1f1dSLionel Sambuc yystate = YYFINAL;
673*0a6a1f1dSLionel Sambuc *++yystack.s_mark = YYFINAL;
674*0a6a1f1dSLionel Sambuc *++yystack.l_mark = yyval;
675*0a6a1f1dSLionel Sambuc if (yychar < 0)
676*0a6a1f1dSLionel Sambuc {
677*0a6a1f1dSLionel Sambuc if ((yychar = YYLEX) < 0) yychar = YYEOF;
678*0a6a1f1dSLionel Sambuc #if YYDEBUG
679*0a6a1f1dSLionel Sambuc if (yydebug)
680*0a6a1f1dSLionel Sambuc {
681*0a6a1f1dSLionel Sambuc yys = yyname[YYTRANSLATE(yychar)];
682*0a6a1f1dSLionel Sambuc printf("%sdebug: state %d, reading %d (%s)\n",
683*0a6a1f1dSLionel Sambuc YYPREFIX, YYFINAL, yychar, yys);
684*0a6a1f1dSLionel Sambuc }
685*0a6a1f1dSLionel Sambuc #endif
686*0a6a1f1dSLionel Sambuc }
687*0a6a1f1dSLionel Sambuc if (yychar == YYEOF) goto yyaccept;
688*0a6a1f1dSLionel Sambuc goto yyloop;
689*0a6a1f1dSLionel Sambuc }
690*0a6a1f1dSLionel Sambuc if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
691*0a6a1f1dSLionel Sambuc yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
692*0a6a1f1dSLionel Sambuc yystate = yytable[yyn];
693*0a6a1f1dSLionel Sambuc else
694*0a6a1f1dSLionel Sambuc yystate = yydgoto[yym];
695*0a6a1f1dSLionel Sambuc #if YYDEBUG
696*0a6a1f1dSLionel Sambuc if (yydebug)
697*0a6a1f1dSLionel Sambuc printf("%sdebug: after reduction, shifting from state %d \
698*0a6a1f1dSLionel Sambuc to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
699*0a6a1f1dSLionel Sambuc #endif
700*0a6a1f1dSLionel Sambuc if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM)
701*0a6a1f1dSLionel Sambuc {
702*0a6a1f1dSLionel Sambuc goto yyoverflow;
703*0a6a1f1dSLionel Sambuc }
704*0a6a1f1dSLionel Sambuc *++yystack.s_mark = (YYINT) yystate;
705*0a6a1f1dSLionel Sambuc *++yystack.l_mark = yyval;
706*0a6a1f1dSLionel Sambuc goto yyloop;
707*0a6a1f1dSLionel Sambuc
708*0a6a1f1dSLionel Sambuc yyoverflow:
709*0a6a1f1dSLionel Sambuc YYERROR_CALL("yacc stack overflow");
710*0a6a1f1dSLionel Sambuc
711*0a6a1f1dSLionel Sambuc yyabort:
712*0a6a1f1dSLionel Sambuc yyfreestack(&yystack);
713*0a6a1f1dSLionel Sambuc return (1);
714*0a6a1f1dSLionel Sambuc
715*0a6a1f1dSLionel Sambuc yyaccept:
716*0a6a1f1dSLionel Sambuc yyfreestack(&yystack);
717*0a6a1f1dSLionel Sambuc return (0);
718*0a6a1f1dSLionel Sambuc }
719