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