7fd59977 |
1 | |
2 | /* A Bison parser, made from j:/kas/c40/ros/src/exprintrp/exprintrp.yacc |
3 | by GNU Bison version 1.25 |
4 | */ |
5 | |
6 | #define YYBISON 1 /* Identify Bison output. */ |
7 | |
8 | #define yyparse ExprIntrpparse |
9 | #define yylex ExprIntrplex |
10 | #define yyerror ExprIntrperror |
11 | #define yylval ExprIntrplval |
12 | #define yychar ExprIntrpchar |
13 | #define yydebug ExprIntrpdebug |
14 | #define yynerrs ExprIntrpnerrs |
15 | #define SUMOP 258 |
16 | #define MINUSOP 259 |
17 | #define DIVIDEOP 260 |
18 | #define EXPOP 261 |
19 | #define MULTOP 262 |
20 | #define PARENTHESIS 263 |
21 | #define BRACKET 264 |
22 | #define ENDPARENTHESIS 265 |
23 | #define ENDBRACKET 266 |
24 | #define VALUE 267 |
25 | #define IDENTIFIER 268 |
26 | #define COMMA 269 |
27 | #define DIFFERENTIAL 270 |
28 | #define DERIVATE 271 |
29 | #define DERIVKEY 272 |
30 | #define ASSIGNOP 273 |
31 | #define DEASSIGNKEY 274 |
32 | #define EQUALOP 275 |
33 | #define RELSEPARATOR 276 |
34 | #define CONSTKEY 277 |
35 | #define SUMKEY 278 |
36 | #define PRODKEY 279 |
37 | |
38 | #line 1 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
39 | |
40 | extern void ExprIntrp_EndOfFuncDef(); |
41 | extern void ExprIntrp_EndOfRelation(); |
42 | extern void ExprIntrp_AssignVariable(); |
43 | extern void ExprIntrp_EndOfAssign(); |
44 | extern void ExprIntrp_Deassign(); |
45 | extern void ExprIntrp_SumOperator(); |
46 | extern void ExprIntrp_MinusOperator(); |
47 | extern void ExprIntrp_ProductOperator(); |
48 | extern void ExprIntrp_DivideOperator(); |
49 | extern void ExprIntrp_ExpOperator(); |
50 | extern void ExprIntrp_UnaryMinusOperator(); |
51 | extern void ExprIntrp_VariableIdentifier(); |
52 | extern void ExprIntrp_NumValue(); |
53 | extern void ExprIntrp_EndFunction(); |
54 | extern void ExprIntrp_EndDerFunction(); |
55 | extern void ExprIntrp_EndDifferential(); |
56 | extern void ExprIntrp_EndDiffFunction(); |
57 | extern void ExprIntrp_EndFuncArg(); |
58 | extern void ExprIntrp_NextFuncArg(); |
59 | extern void ExprIntrp_StartFunction(); |
60 | extern void ExprIntrp_DefineFunction(); |
61 | extern void ExprIntrp_StartDerivate(); |
62 | extern void ExprIntrp_EndDerivate(); |
63 | extern void ExprIntrp_DiffVar(); |
64 | extern void ExprIntrp_DiffDegree(); |
65 | extern void ExprIntrp_VerDiffDegree(); |
66 | extern void ExprIntrp_DiffDegreeVar(); |
67 | extern void ExprIntrp_StartDifferential(); |
68 | extern void ExprIntrp_StartFunction(); |
69 | extern void ExprIntrp_EndFuncArg(); |
70 | extern void ExprIntrp_NextFuncArg(); |
71 | extern void ExprIntrp_VariableIdentifier(); |
72 | extern void ExprIntrp_Derivation(); |
73 | extern void ExprIntrp_EndDerivation(); |
74 | extern void ExprIntrp_DerivationValue(); |
75 | extern void ExprIntrp_ConstantIdentifier(); |
76 | extern void ExprIntrp_ConstantDefinition(); |
77 | extern void ExprIntrp_VariableIdentifier(); |
78 | extern void ExprIntrp_NumValue(); |
79 | extern void ExprIntrp_Sumator(); |
80 | extern void ExprIntrp_VariableIdentifier(); |
81 | extern void ExprIntrp_Productor(); |
82 | extern void ExprIntrp_EndOfEqual(); |
83 | #line 52 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
84 | |
85 | #ifndef YYSTYPE |
86 | #define YYSTYPE int |
87 | #endif |
88 | #include <stdio.h> |
89 | |
90 | #ifndef __cplusplus |
91 | #ifndef __STDC__ |
92 | #define const |
93 | #endif |
94 | #endif |
95 | |
96 | |
97 | |
98 | #define YYFINAL 147 |
99 | #define YYFLAG -32768 |
100 | #define YYNTBASE 26 |
101 | |
102 | #define YYTRANSLATE(x) ((unsigned)(x) <= 279 ? yytranslate[x] : 67) |
103 | |
104 | static const char yytranslate[] = { 0, |
105 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 25, |
106 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
107 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
108 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
109 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
110 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
111 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
112 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
113 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
114 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
115 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
116 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
117 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
118 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
119 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
120 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
121 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
122 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
123 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
124 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
125 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
126 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
127 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
128 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
129 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
130 | 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, |
131 | 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, |
132 | 16, 17, 18, 19, 20, 21, 22, 23, 24 |
133 | }; |
134 | |
135 | #if YYDEBUG != 0 |
136 | static const short yyprhs[] = { 0, |
137 | 0, 2, 4, 6, 8, 10, 11, 16, 17, 23, |
138 | 27, 31, 35, 39, 43, 47, 51, 54, 56, 58, |
139 | 60, 62, 64, 66, 68, 70, 72, 77, 82, 83, |
140 | 89, 91, 92, 97, 99, 100, 105, 106, 110, 116, |
141 | 117, 118, 128, 130, 132, 133, 139, 141, 142, 147, |
142 | 149, 150, 158, 159, 160, 171, 172, 173, 182, 183, |
143 | 184, 199, 200, 201, 216, 218, 222, 226 |
144 | }; |
145 | |
146 | static const short yyrhs[] = { 31, |
147 | 0, 27, 0, 29, 0, 39, 0, 65, 0, 0, |
148 | 13, 28, 18, 31, 0, 0, 19, 9, 13, 30, |
149 | 11, 0, 31, 3, 31, 0, 31, 4, 31, 0, |
150 | 31, 7, 31, 0, 31, 5, 31, 0, 31, 6, |
151 | 31, 0, 8, 31, 10, 0, 9, 31, 11, 0, |
152 | 4, 31, 0, 32, 0, 52, 0, 56, 0, 59, |
153 | 0, 62, 0, 33, 0, 34, 0, 13, 0, 12, |
154 | 0, 38, 8, 36, 10, 0, 41, 8, 36, 10, |
155 | 0, 0, 43, 35, 8, 36, 10, 0, 31, 0, |
156 | 0, 31, 14, 37, 36, 0, 13, 0, 0, 47, |
157 | 40, 18, 31, 0, 0, 13, 42, 16, 0, 15, |
158 | 46, 5, 15, 13, 0, 0, 0, 15, 12, 44, |
159 | 46, 5, 15, 12, 45, 13, 0, 13, 0, 43, |
160 | 0, 0, 13, 48, 9, 49, 11, 0, 51, 0, |
161 | 0, 51, 14, 50, 49, 0, 13, 0, 0, 17, |
162 | 9, 31, 14, 13, 53, 11, 0, 0, 0, 17, |
163 | 9, 31, 14, 13, 54, 14, 12, 55, 11, 0, |
164 | 0, 0, 22, 9, 13, 57, 14, 12, 58, 11, |
165 | 0, 0, 0, 23, 9, 31, 14, 13, 60, 14, |
166 | 31, 14, 31, 14, 12, 61, 11, 0, 0, 0, |
167 | 24, 9, 31, 14, 13, 63, 14, 31, 14, 31, |
168 | 14, 12, 64, 11, 0, 66, 0, 66, 21, 65, |
169 | 0, 66, 25, 65, 0, 31, 20, 31, 0 |
170 | }; |
171 | |
172 | #endif |
173 | |
174 | #if YYDEBUG != 0 |
175 | static const short yyrline[] = { 0, |
176 | 56, 57, 58, 59, 60, 63, 63, 66, 67, 69, |
177 | 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, |
178 | 80, 81, 84, 85, 89, 90, 93, 94, 95, 95, |
179 | 98, 99, 100, 102, 105, 105, 108, 108, 111, 112, |
180 | 112, 112, 115, 116, 119, 119, 122, 123, 124, 126, |
181 | 129, 129, 130, 130, 130, 133, 133, 134, 136, 136, |
182 | 136, 139, 139, 139, 142, 143, 144, 147 |
183 | }; |
184 | #endif |
185 | |
186 | |
187 | #if YYDEBUG != 0 || defined (YYERROR_VERBOSE) |
188 | |
189 | static const char * const yytname[] = { "$","error","$undefined.","SUMOP", |
190 | "MINUSOP","DIVIDEOP","EXPOP","MULTOP","PARENTHESIS","BRACKET","ENDPARENTHESIS", |
191 | "ENDBRACKET","VALUE","IDENTIFIER","COMMA","DIFFERENTIAL","DERIVATE","DERIVKEY", |
192 | "ASSIGNOP","DEASSIGNKEY","EQUALOP","RELSEPARATOR","CONSTKEY","SUMKEY","PRODKEY", |
193 | "'\\n'","exprentry","Assignment","@1","Deassignment","@2","GenExpr","SingleExpr", |
194 | "Single","Function","@3","ListGenExpr","@4","funcident","FunctionDefinition", |
195 | "@5","DerFunctionId","@6","DiffFuncId","@7","@8","DiffId","FunctionDef","@9", |
196 | "ListArg","@10","unarg","Derivation","@11","@12","@13","ConstantDefinition", |
197 | "@14","@15","Sumator","@16","@17","Productor","@18","@19","RelationList","SingleRelation", NULL |
198 | }; |
199 | #endif |
200 | |
201 | static const short yyr1[] = { 0, |
202 | 26, 26, 26, 26, 26, 28, 27, 30, 29, 31, |
203 | 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, |
204 | 31, 31, 32, 32, 33, 33, 34, 34, 35, 34, |
205 | 36, 37, 36, 38, 40, 39, 42, 41, 43, 44, |
206 | 45, 43, 46, 46, 48, 47, 49, 50, 49, 51, |
207 | 53, 52, 54, 55, 52, 57, 58, 56, 60, 61, |
208 | 59, 63, 64, 62, 65, 65, 65, 66 |
209 | }; |
210 | |
211 | static const short yyr2[] = { 0, |
212 | 1, 1, 1, 1, 1, 0, 4, 0, 5, 3, |
213 | 3, 3, 3, 3, 3, 3, 2, 1, 1, 1, |
214 | 1, 1, 1, 1, 1, 1, 4, 4, 0, 5, |
215 | 1, 0, 4, 1, 0, 4, 0, 3, 5, 0, |
216 | 0, 9, 1, 1, 0, 5, 1, 0, 4, 1, |
217 | 0, 7, 0, 0, 10, 0, 0, 8, 0, 0, |
218 | 14, 0, 0, 14, 1, 3, 3, 3 |
219 | }; |
220 | |
221 | static const short yydefact[] = { 0, |
222 | 0, 0, 0, 26, 25, 0, 0, 0, 0, 0, |
223 | 0, 2, 3, 1, 18, 23, 24, 0, 4, 0, |
224 | 29, 35, 19, 20, 21, 22, 5, 65, 25, 17, |
225 | 0, 0, 0, 0, 0, 40, 43, 44, 0, 0, |
226 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
227 | 0, 0, 0, 0, 0, 0, 15, 16, 0, 38, |
228 | 0, 0, 0, 0, 8, 56, 0, 0, 10, 11, |
229 | 13, 14, 12, 68, 31, 0, 0, 0, 0, 0, |
230 | 66, 67, 7, 50, 0, 47, 0, 0, 0, 0, |
231 | 0, 0, 0, 32, 27, 28, 0, 36, 46, 48, |
232 | 0, 39, 51, 9, 0, 59, 62, 0, 30, 0, |
233 | 0, 0, 0, 57, 0, 0, 33, 49, 41, 52, |
234 | 0, 0, 0, 0, 0, 54, 58, 0, 0, 42, |
235 | 0, 0, 0, 55, 0, 0, 0, 0, 60, 63, |
236 | 0, 0, 61, 64, 0, 0, 0 |
237 | }; |
238 | |
239 | static const short yydefgoto[] = { 145, |
240 | 12, 33, 13, 90, 75, 15, 16, 17, 53, 76, |
241 | 108, 18, 19, 54, 20, 34, 21, 62, 125, 39, |
242 | 22, 35, 85, 110, 86, 23, 112, 113, 131, 24, |
243 | 91, 122, 25, 115, 141, 26, 116, 142, 27, 28 |
244 | }; |
245 | |
246 | static const short yypact[] = { 2, |
247 | 54, 54, 54,-32768, 4, 60, 9, 18, 20, 24, |
248 | 30,-32768,-32768, 31,-32768,-32768,-32768, 8,-32768, 49, |
249 | -32768,-32768,-32768,-32768,-32768,-32768,-32768, 7, 15, 47, |
250 | 161, 152, -10, 48, 56,-32768,-32768,-32768, 63, 54, |
251 | 57, 61, 54, 54, 54, 54, 54, 54, 54, 54, |
252 | 54, 54, 84, 72, 54, 54,-32768,-32768, 54,-32768, |
253 | 80, -6, 79, 77,-32768,-32768, 82, 94, 47, 47, |
254 | 89,-32768, 89, 169, 99, 97, 100, 54, 54, 31, |
255 | -32768,-32768, 169,-32768, 98, 105, 106, 107, 108, 101, |
256 | 117, 109, 121,-32768,-32768,-32768, 125, 169,-32768,-32768, |
257 | 133,-32768, 122,-32768, 138,-32768,-32768, 54,-32768, 80, |
258 | 139, 141, 146,-32768, 147, 148,-32768,-32768,-32768,-32768, |
259 | 157, 142, 54, 54, 164,-32768,-32768, 111, 123,-32768, |
260 | 159, 54, 54,-32768, 135, 140, 166, 167,-32768,-32768, |
261 | 170, 171,-32768,-32768, 180, 183,-32768 |
262 | }; |
263 | |
264 | static const short yypgoto[] = {-32768, |
265 | -32768,-32768,-32768,-32768, 0,-32768,-32768,-32768,-32768, -48, |
266 | -32768,-32768,-32768,-32768,-32768,-32768, -1,-32768,-32768, 124, |
267 | -32768,-32768, 74,-32768,-32768,-32768,-32768,-32768,-32768,-32768, |
268 | -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -14,-32768 |
269 | }; |
270 | |
271 | |
272 | #define YYLAST 186 |
273 | |
274 | |
275 | static const short yytable[] = { 14, |
276 | 30, 31, 32, 77, 38, 1, 37, 59, 6, 2, |
277 | 3, -34, -45, 4, 5, 51, 6, 40, 7, -37, |
278 | 8, -6, -34, 9, 10, 11, 41, 55, 42, 97, |
279 | -37, 56, 43, 45, 46, 47, 48, 49, 44, 64, |
280 | 81, 82, 67, 68, 69, 70, 71, 72, 73, 74, |
281 | 50, 47, 48, 49, 80, 80, 52, 1, 83, 117, |
282 | 38, 2, 3, 60, 61, 4, 29, 63, 6, 65, |
283 | 7, 36, 37, 66, 6, 9, 10, 11, 98, 45, |
284 | 46, 47, 48, 49, 45, 46, 47, 48, 49, 79, |
285 | 89, 78, 84, 88, 48, 92, 45, 46, 47, 48, |
286 | 49, 45, 46, 47, 48, 49, 95, 93, 99, 96, |
287 | 101, 104, 94, 45, 46, 47, 48, 49, 100, 102, |
288 | 103, 106, 128, 129, 132, 45, 46, 47, 48, 49, |
289 | 105, 135, 136, 107, 109, -53, 133, 45, 46, 47, |
290 | 48, 49, 45, 46, 47, 48, 49, 111, 137, 114, |
291 | 119, 120, 127, 138, 45, 46, 47, 48, 49, 121, |
292 | 123, 124, 58, 45, 46, 47, 48, 49, 126, 134, |
293 | 57, 45, 46, 47, 48, 49, 130, 139, 140, 146, |
294 | 143, 144, 147, 118, 0, 87 |
295 | }; |
296 | |
297 | static const short yycheck[] = { 0, |
298 | 1, 2, 3, 52, 6, 4, 13, 18, 15, 8, |
299 | 9, 8, 9, 12, 13, 8, 15, 9, 17, 16, |
300 | 19, 18, 8, 22, 23, 24, 9, 21, 9, 78, |
301 | 16, 25, 9, 3, 4, 5, 6, 7, 9, 40, |
302 | 55, 56, 43, 44, 45, 46, 47, 48, 49, 50, |
303 | 20, 5, 6, 7, 55, 56, 8, 4, 59, 108, |
304 | 62, 8, 9, 16, 9, 12, 13, 5, 15, 13, |
305 | 17, 12, 13, 13, 15, 22, 23, 24, 79, 3, |
306 | 4, 5, 6, 7, 3, 4, 5, 6, 7, 18, |
307 | 14, 8, 13, 15, 6, 14, 3, 4, 5, 6, |
308 | 7, 3, 4, 5, 6, 7, 10, 14, 11, 10, |
309 | 5, 11, 14, 3, 4, 5, 6, 7, 14, 13, |
310 | 13, 13, 123, 124, 14, 3, 4, 5, 6, 7, |
311 | 14, 132, 133, 13, 10, 14, 14, 3, 4, 5, |
312 | 6, 7, 3, 4, 5, 6, 7, 15, 14, 12, |
313 | 12, 11, 11, 14, 3, 4, 5, 6, 7, 14, |
314 | 14, 14, 11, 3, 4, 5, 6, 7, 12, 11, |
315 | 10, 3, 4, 5, 6, 7, 13, 12, 12, 0, |
316 | 11, 11, 0, 110, -1, 62 |
317 | }; |
318 | /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ |
319 | #line 3 "bison.simple" |
320 | |
321 | /* Skeleton output parser for bison, |
322 | Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman |
323 | |
324 | This program is free software; you can redistribute it and/or modify |
325 | it under the terms of the GNU General Public License as published by |
326 | the Free Software Foundation; either version 1, or (at your option) |
327 | any later version. |
328 | |
329 | This program is distributed in the hope that it will be useful, |
330 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
331 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
332 | GNU General Public License for more details. |
333 | |
334 | You should have received a copy of the GNU General Public License |
335 | along with this program; if not, write to the Free Software |
336 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ |
337 | |
338 | |
339 | #ifndef alloca |
340 | #ifdef __GNUC__ |
341 | #define alloca __builtin_alloca |
342 | #else /* not GNU C. */ |
343 | #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) |
344 | #include <alloca.h> |
345 | #else /* not sparc */ |
346 | #if ( defined( MSDOS ) || defined( WNT ) ) && !defined (__TURBOC__) |
347 | #include <malloc.h> |
348 | #else /* not MSDOS, or __TURBOC__ */ |
349 | #if defined(_AIX) |
350 | #include <malloc.h> |
351 | #pragma alloca |
352 | #else /* not MSDOS, __TURBOC__, or _AIX */ |
353 | #ifdef __hpux |
354 | #include <malloc.h> |
355 | #define alloca malloc |
356 | #endif /* __hpux */ |
357 | #endif /* not _AIX */ |
358 | #endif /* not MSDOS, or __TURBOC__ */ |
359 | #endif /* not sparc. */ |
360 | #endif /* not GNU C. */ |
361 | #endif /* alloca not defined. */ |
362 | |
363 | /* This is the parser code that is written into each bison parser |
364 | when the %semantic_parser declaration is not specified in the grammar. |
365 | It was written by Richard Stallman by simplifying the hairy parser |
366 | used when %semantic_parser is specified. */ |
367 | |
368 | /* Note: there must be only one dollar sign in this file. |
369 | It is replaced by the list of actions, each action |
370 | as one case of the switch. */ |
371 | |
372 | #define yyerrok (yyerrstatus = 0) |
373 | #define yyclearin (yychar = YYEMPTY) |
374 | #define YYEMPTY -2 |
375 | #define YYEOF 0 |
376 | #define YYACCEPT return(0) |
377 | #define YYABORT return(1) |
378 | #define YYERROR goto yyerrlab1 |
379 | /* Like YYERROR except do call yyerror. |
380 | This remains here temporarily to ease the |
381 | transition to the new meaning of YYERROR, for GCC. |
382 | Once GCC version 2 has supplanted version 1, this can go. */ |
383 | #define YYFAIL goto yyerrlab |
384 | #define YYRECOVERING() (!!yyerrstatus) |
385 | #define YYBACKUP(token, value) \ |
386 | do \ |
387 | if (yychar == YYEMPTY && yylen == 1) \ |
388 | { yychar = (token), yylval = (value); \ |
389 | yychar1 = YYTRANSLATE (yychar); \ |
390 | YYPOPSTACK; \ |
391 | goto yybackup; \ |
392 | } \ |
393 | else \ |
394 | { yyerror ("syntax error: cannot back up"); YYERROR; } \ |
395 | while (0) |
396 | |
397 | #define YYTERROR 1 |
398 | #define YYERRCODE 256 |
399 | |
400 | #ifndef YYPURE |
401 | #define YYLEX yylex() |
402 | #endif |
403 | |
404 | #ifdef YYPURE |
405 | #ifdef YYLSP_NEEDED |
406 | #ifdef YYLEX_PARAM |
407 | #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) |
408 | #else |
409 | #define YYLEX yylex(&yylval, &yylloc) |
410 | #endif |
411 | #else /* not YYLSP_NEEDED */ |
412 | #ifdef YYLEX_PARAM |
413 | #define YYLEX yylex(&yylval, YYLEX_PARAM) |
414 | #else |
415 | #define YYLEX yylex(&yylval) |
416 | #endif |
417 | #endif /* not YYLSP_NEEDED */ |
418 | #endif |
419 | |
420 | /* If nonreentrant, generate the variables here */ |
421 | |
422 | #ifndef YYPURE |
423 | |
424 | int yychar; /* the lookahead symbol */ |
425 | YYSTYPE yylval; /* the semantic value of the */ |
426 | /* lookahead symbol */ |
427 | |
428 | #ifdef YYLSP_NEEDED |
429 | YYLTYPE yylloc; /* location data for the lookahead */ |
430 | /* symbol */ |
431 | #endif |
432 | |
433 | int yynerrs; /* number of parse errors so far */ |
434 | #endif /* not YYPURE */ |
435 | |
436 | #if YYDEBUG != 0 |
437 | int yydebug; /* nonzero means print parse trace */ |
438 | /* Since this is uninitialized, it does not stop multiple parsers |
439 | from coexisting. */ |
440 | #endif |
441 | |
442 | /* YYINITDEPTH indicates the initial size of the parser's stacks */ |
443 | |
444 | #ifndef YYINITDEPTH |
445 | #define YYINITDEPTH 200 |
446 | #endif |
447 | |
448 | /* YYMAXDEPTH is the maximum size the stacks can grow to |
449 | (effective only if the built-in stack extension method is used). */ |
450 | |
451 | #if YYMAXDEPTH == 0 |
452 | #undef YYMAXDEPTH |
453 | #endif |
454 | |
455 | #ifndef YYMAXDEPTH |
456 | #define YYMAXDEPTH 10000 |
457 | #endif |
458 | |
459 | /* Prevent warning if -Wstrict-prototypes. */ |
460 | #ifdef __GNUC__ |
461 | int yyparse (void); |
462 | #endif |
463 | \f |
464 | #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ |
465 | #if defined( WNT ) |
466 | #define __yy_bcopy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT) |
467 | #else /* not GNU C or C++ */ |
468 | #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) |
469 | #endif |
470 | #else /* not GNU C or C++ */ |
471 | #ifndef __cplusplus |
472 | |
473 | /* This is the most reliable way to avoid incompatibilities |
474 | in available built-in functions on various systems. */ |
475 | static void |
476 | #if defined( WNT ) |
477 | __yy_bcopy (__from, __to, __count) |
478 | char *__from; |
479 | char *__to; |
480 | int __count; |
481 | #else |
482 | __yy_memcpy (to, from, count) |
483 | char *to; |
484 | char *from; |
485 | int count; |
486 | #endif |
487 | { |
488 | #ifdef WNT |
489 | register char *f = __from; |
490 | register char *t = __to; |
491 | register int i = __count; |
492 | #else |
493 | register char *f = from; |
494 | register char *t = to; |
495 | register int i = count; |
496 | #endif |
497 | while (i-- > 0) |
498 | *t++ = *f++; |
499 | } |
500 | |
501 | #else /* __cplusplus */ |
502 | |
503 | /* This is the most reliable way to avoid incompatibilities |
504 | in available built-in functions on various systems. */ |
505 | static void |
506 | #if defined(WNT) |
507 | __yy_bcopy (char *__from, char *__to, int __count) |
508 | #else |
509 | __yy_memcpy (char *to, char *from, int count) |
510 | #endif |
511 | { |
512 | #if defined(WNT) |
513 | register char *f = __from; |
514 | register char *t = __to; |
515 | register int i = __count; |
516 | #else |
517 | register char *f = from; |
518 | register char *t = to; |
519 | register int i = count; |
520 | #endif |
521 | |
522 | while (i-- > 0) |
523 | *t++ = *f++; |
524 | } |
525 | |
526 | #endif |
527 | #endif |
528 | \f |
529 | #line 196 "/PRODUCTS/flexbis-253-125/share/bison.simple" |
530 | |
531 | /* The user can define YYPARSE_PARAM as the name of an argument to be passed |
532 | into yyparse. The argument should have type void *. |
533 | It should actually point to an object. |
534 | Grammar actions can access the variable by casting it |
535 | to the proper pointer type. */ |
536 | |
537 | #ifdef YYPARSE_PARAM |
538 | #ifdef __cplusplus |
539 | #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM |
540 | #define YYPARSE_PARAM_DECL |
541 | #else /* not __cplusplus */ |
542 | #define YYPARSE_PARAM_ARG YYPARSE_PARAM |
543 | #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; |
544 | #endif /* not __cplusplus */ |
545 | #else /* not YYPARSE_PARAM */ |
546 | #define YYPARSE_PARAM_ARG |
547 | #define YYPARSE_PARAM_DECL |
548 | #endif /* not YYPARSE_PARAM */ |
549 | |
550 | int |
551 | #if defined(WNT) |
552 | yyparse() |
553 | #else |
554 | yyparse(YYPARSE_PARAM_ARG) |
555 | YYPARSE_PARAM_DECL |
556 | #endif |
557 | { |
558 | register int yystate; |
559 | register int yyn; |
560 | register short *yyssp; |
561 | register YYSTYPE *yyvsp; |
562 | int yyerrstatus; /* number of tokens to shift before error messages enabled */ |
563 | int yychar1 = 0; /* lookahead token as an internal (translated) token number */ |
564 | |
565 | short yyssa[YYINITDEPTH]; /* the state stack */ |
566 | YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ |
567 | |
568 | short *yyss = yyssa; /* refer to the stacks thru separate pointers */ |
569 | YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ |
570 | |
571 | #ifdef YYLSP_NEEDED |
572 | YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ |
573 | YYLTYPE *yyls = yylsa; |
574 | YYLTYPE *yylsp; |
575 | |
576 | #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) |
577 | #else |
578 | #define YYPOPSTACK (yyvsp--, yyssp--) |
579 | #endif |
580 | |
581 | int yystacksize = YYINITDEPTH; |
582 | |
583 | #ifdef YYPURE |
584 | int yychar; |
585 | YYSTYPE yylval; |
586 | int yynerrs; |
587 | #ifdef YYLSP_NEEDED |
588 | YYLTYPE yylloc; |
589 | #endif |
590 | #endif |
591 | |
592 | YYSTYPE yyval; /* the variable used to return */ |
593 | /* semantic values from the action */ |
594 | /* routines */ |
595 | |
596 | int yylen; |
597 | |
598 | #if YYDEBUG != 0 |
599 | if (yydebug) |
600 | fprintf(stderr, "Starting parse\n"); |
601 | #endif |
602 | |
603 | yystate = 0; |
604 | yyerrstatus = 0; |
605 | yynerrs = 0; |
606 | yychar = YYEMPTY; /* Cause a token to be read. */ |
607 | |
608 | /* Initialize stack pointers. |
609 | Waste one element of value and location stack |
610 | so that they stay on the same level as the state stack. |
611 | The wasted elements are never initialized. */ |
612 | |
613 | yyssp = yyss - 1; |
614 | yyvsp = yyvs; |
615 | #ifdef YYLSP_NEEDED |
616 | yylsp = yyls; |
617 | #endif |
618 | |
619 | /* Push a new state, which is found in yystate . */ |
620 | /* In all cases, when you get here, the value and location stacks |
621 | have just been pushed. so pushing a state here evens the stacks. */ |
622 | yynewstate: |
623 | |
624 | *++yyssp = yystate; |
625 | |
626 | if (yyssp >= yyss + yystacksize - 1) |
627 | { |
628 | /* Give user a chance to reallocate the stack */ |
629 | /* Use copies of these so that the &'s don't force the real ones into memory. */ |
630 | YYSTYPE *yyvs1 = yyvs; |
631 | short *yyss1 = yyss; |
632 | #ifdef YYLSP_NEEDED |
633 | YYLTYPE *yyls1 = yyls; |
634 | #endif |
635 | |
636 | /* Get the current used size of the three stacks, in elements. */ |
637 | int size = yyssp - yyss + 1; |
638 | |
639 | #ifdef yyoverflow |
640 | /* Each stack pointer address is followed by the size of |
641 | the data in use in that stack, in bytes. */ |
642 | #ifdef YYLSP_NEEDED |
643 | /* This used to be a conditional around just the two extra args, |
644 | but that might be undefined if yyoverflow is a macro. */ |
645 | yyoverflow("parser stack overflow", |
646 | &yyss1, size * sizeof (*yyssp), |
647 | &yyvs1, size * sizeof (*yyvsp), |
648 | &yyls1, size * sizeof (*yylsp), |
649 | &yystacksize); |
650 | #else |
651 | yyoverflow("parser stack overflow", |
652 | &yyss1, size * sizeof (*yyssp), |
653 | &yyvs1, size * sizeof (*yyvsp), |
654 | &yystacksize); |
655 | #endif |
656 | |
657 | yyss = yyss1; yyvs = yyvs1; |
658 | #ifdef YYLSP_NEEDED |
659 | yyls = yyls1; |
660 | #endif |
661 | #else /* no yyoverflow */ |
662 | /* Extend the stack our own way. */ |
663 | if (yystacksize >= YYMAXDEPTH) |
664 | { |
665 | yyerror("parser stack overflow"); |
666 | return 2; |
667 | } |
668 | yystacksize *= 2; |
669 | if (yystacksize > YYMAXDEPTH) |
670 | yystacksize = YYMAXDEPTH; |
671 | yyss = (short *) alloca (yystacksize * sizeof (*yyssp)); |
672 | #if defined(WNT) |
673 | __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp)); |
674 | #else |
675 | __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp)); |
676 | #endif |
677 | yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp)); |
678 | #if defined(WNT) |
679 | __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp)); |
680 | #else |
681 | __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp)); |
682 | #endif |
683 | #ifdef YYLSP_NEEDED |
684 | yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp)); |
685 | #if defined(WNT) |
686 | __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp)); |
687 | #else |
688 | __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp)); |
689 | #endif |
690 | #endif |
691 | #endif /* no yyoverflow */ |
692 | |
693 | yyssp = yyss + size - 1; |
694 | yyvsp = yyvs + size - 1; |
695 | #ifdef YYLSP_NEEDED |
696 | yylsp = yyls + size - 1; |
697 | #endif |
698 | |
699 | #if YYDEBUG != 0 |
700 | if (yydebug) |
701 | fprintf(stderr, "Stack size increased to %d\n", yystacksize); |
702 | #endif |
703 | |
704 | if (yyssp >= yyss + yystacksize - 1) |
705 | YYABORT; |
706 | } |
707 | |
708 | #if YYDEBUG != 0 |
709 | if (yydebug) |
710 | fprintf(stderr, "Entering state %d\n", yystate); |
711 | #endif |
712 | |
713 | goto yybackup; |
714 | yybackup: |
715 | |
716 | /* Do appropriate processing given the current state. */ |
717 | /* Read a lookahead token if we need one and don't already have one. */ |
718 | /* yyresume: */ |
719 | |
720 | /* First try to decide what to do without reference to lookahead token. */ |
721 | |
722 | yyn = yypact[yystate]; |
723 | if (yyn == YYFLAG) |
724 | goto yydefault; |
725 | |
726 | /* Not known => get a lookahead token if don't already have one. */ |
727 | |
728 | /* yychar is either YYEMPTY or YYEOF |
729 | or a valid token in external form. */ |
730 | |
731 | if (yychar == YYEMPTY) |
732 | { |
733 | #if YYDEBUG != 0 |
734 | if (yydebug) |
735 | fprintf(stderr, "Reading a token: "); |
736 | #endif |
737 | yychar = YYLEX; |
738 | } |
739 | |
740 | /* Convert token to internal form (in yychar1) for indexing tables with */ |
741 | |
742 | if (yychar <= 0) /* This means end of input. */ |
743 | { |
744 | yychar1 = 0; |
745 | yychar = YYEOF; /* Don't call YYLEX any more */ |
746 | |
747 | #if YYDEBUG != 0 |
748 | if (yydebug) |
749 | fprintf(stderr, "Now at end of input.\n"); |
750 | #endif |
751 | } |
752 | else |
753 | { |
754 | yychar1 = YYTRANSLATE(yychar); |
755 | |
756 | #if YYDEBUG != 0 |
757 | if (yydebug) |
758 | { |
759 | fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); |
760 | /* Give the individual parser a way to print the precise meaning |
761 | of a token, for further debugging info. */ |
762 | #ifdef YYPRINT |
763 | YYPRINT (stderr, yychar, yylval); |
764 | #endif |
765 | fprintf (stderr, ")\n"); |
766 | } |
767 | #endif |
768 | } |
769 | |
770 | yyn += yychar1; |
771 | if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) |
772 | goto yydefault; |
773 | |
774 | yyn = yytable[yyn]; |
775 | |
776 | /* yyn is what to do for this token type in this state. |
777 | Negative => reduce, -yyn is rule number. |
778 | Positive => shift, yyn is new state. |
779 | New state is final state => don't bother to shift, |
780 | just return success. |
781 | 0, or most negative number => error. */ |
782 | |
783 | if (yyn < 0) |
784 | { |
785 | if (yyn == YYFLAG) |
786 | goto yyerrlab; |
787 | yyn = -yyn; |
788 | goto yyreduce; |
789 | } |
790 | else if (yyn == 0) |
791 | goto yyerrlab; |
792 | |
793 | if (yyn == YYFINAL) |
794 | YYACCEPT; |
795 | |
796 | /* Shift the lookahead token. */ |
797 | |
798 | #if YYDEBUG != 0 |
799 | if (yydebug) |
800 | fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); |
801 | #endif |
802 | |
803 | /* Discard the token being shifted unless it is eof. */ |
804 | if (yychar != YYEOF) |
805 | yychar = YYEMPTY; |
806 | |
807 | *++yyvsp = yylval; |
808 | #ifdef YYLSP_NEEDED |
809 | *++yylsp = yylloc; |
810 | #endif |
811 | |
812 | /* count tokens shifted since error; after three, turn off error status. */ |
813 | if (yyerrstatus) yyerrstatus--; |
814 | |
815 | yystate = yyn; |
816 | goto yynewstate; |
817 | |
818 | /* Do the default action for the current state. */ |
819 | yydefault: |
820 | |
821 | yyn = yydefact[yystate]; |
822 | if (yyn == 0) |
823 | goto yyerrlab; |
824 | |
825 | /* Do a reduction. yyn is the number of a rule to reduce with. */ |
826 | yyreduce: |
827 | yylen = yyr2[yyn]; |
828 | if (yylen > 0) |
829 | yyval = yyvsp[1-yylen]; /* implement default value of the action */ |
830 | |
831 | #if YYDEBUG != 0 |
832 | if (yydebug) |
833 | { |
834 | int i; |
835 | |
836 | fprintf (stderr, "Reducing via rule %d (line %d), ", |
837 | yyn, yyrline[yyn]); |
838 | |
839 | /* Print the symbols being reduced, and their result. */ |
840 | for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) |
841 | fprintf (stderr, "%s ", yytname[yyrhs[i]]); |
842 | fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); |
843 | } |
844 | #endif |
845 | |
846 | |
847 | switch (yyn) { |
848 | |
849 | case 4: |
850 | #line 59 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
851 | {ExprIntrp_EndOfFuncDef();; |
852 | break;} |
853 | case 5: |
854 | #line 60 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
855 | {ExprIntrp_EndOfRelation();; |
856 | break;} |
857 | case 6: |
858 | #line 63 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
859 | {ExprIntrp_AssignVariable();; |
860 | break;} |
861 | case 7: |
862 | #line 63 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
863 | {ExprIntrp_EndOfAssign();; |
864 | break;} |
865 | case 8: |
866 | #line 66 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
867 | {ExprIntrp_Deassign();; |
868 | break;} |
869 | case 10: |
870 | #line 69 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
871 | {ExprIntrp_SumOperator();; |
872 | break;} |
873 | case 11: |
874 | #line 70 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
875 | {ExprIntrp_MinusOperator();; |
876 | break;} |
877 | case 12: |
878 | #line 71 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
879 | {ExprIntrp_ProductOperator();; |
880 | break;} |
881 | case 13: |
882 | #line 72 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
883 | {ExprIntrp_DivideOperator();; |
884 | break;} |
885 | case 14: |
886 | #line 73 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
887 | {ExprIntrp_ExpOperator();; |
888 | break;} |
889 | case 17: |
890 | #line 76 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
891 | {ExprIntrp_UnaryMinusOperator();; |
892 | break;} |
893 | case 25: |
894 | #line 89 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
895 | {ExprIntrp_VariableIdentifier();; |
896 | break;} |
897 | case 26: |
898 | #line 90 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
899 | {ExprIntrp_NumValue();; |
900 | break;} |
901 | case 27: |
902 | #line 93 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
903 | {ExprIntrp_EndFunction();; |
904 | break;} |
905 | case 28: |
906 | #line 94 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
907 | {ExprIntrp_EndDerFunction();; |
908 | break;} |
909 | case 29: |
910 | #line 95 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
911 | {ExprIntrp_EndDifferential();; |
912 | break;} |
913 | case 30: |
914 | #line 95 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
915 | {ExprIntrp_EndDiffFunction();; |
916 | break;} |
917 | case 31: |
918 | #line 98 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
919 | {ExprIntrp_EndFuncArg();; |
920 | break;} |
921 | case 32: |
922 | #line 99 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
923 | {ExprIntrp_NextFuncArg();; |
924 | break;} |
925 | case 34: |
926 | #line 102 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
927 | {ExprIntrp_StartFunction();; |
928 | break;} |
929 | case 35: |
930 | #line 105 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
931 | {ExprIntrp_DefineFunction();; |
932 | break;} |
933 | case 37: |
934 | #line 108 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
935 | {ExprIntrp_StartDerivate();; |
936 | break;} |
937 | case 38: |
938 | #line 108 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
939 | {ExprIntrp_EndDerivate();; |
940 | break;} |
941 | case 39: |
942 | #line 111 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
943 | {ExprIntrp_DiffVar();; |
944 | break;} |
945 | case 40: |
946 | #line 112 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
947 | {ExprIntrp_DiffDegree();; |
948 | break;} |
949 | case 41: |
950 | #line 112 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
951 | {ExprIntrp_VerDiffDegree();; |
952 | break;} |
953 | case 42: |
954 | #line 112 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
955 | {ExprIntrp_DiffDegreeVar();; |
956 | break;} |
957 | case 43: |
958 | #line 115 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
959 | {ExprIntrp_StartDifferential();; |
960 | break;} |
961 | case 45: |
962 | #line 119 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
963 | {ExprIntrp_StartFunction();; |
964 | break;} |
965 | case 47: |
966 | #line 122 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
967 | {ExprIntrp_EndFuncArg();; |
968 | break;} |
969 | case 48: |
970 | #line 123 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
971 | {ExprIntrp_NextFuncArg();; |
972 | break;} |
973 | case 50: |
974 | #line 126 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
975 | {ExprIntrp_VariableIdentifier();; |
976 | break;} |
977 | case 51: |
978 | #line 129 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
979 | {ExprIntrp_Derivation();; |
980 | break;} |
981 | case 52: |
982 | #line 129 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
983 | {ExprIntrp_EndDerivation();; |
984 | break;} |
985 | case 53: |
986 | #line 130 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
987 | {ExprIntrp_Derivation();; |
988 | break;} |
989 | case 54: |
990 | #line 130 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
991 | {ExprIntrp_DerivationValue();; |
992 | break;} |
993 | case 55: |
994 | #line 130 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
995 | {ExprIntrp_EndDerivation();; |
996 | break;} |
997 | case 56: |
998 | #line 133 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
999 | {ExprIntrp_ConstantIdentifier();; |
1000 | break;} |
1001 | case 57: |
1002 | #line 133 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
1003 | {ExprIntrp_ConstantDefinition();; |
1004 | break;} |
1005 | case 59: |
1006 | #line 136 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
1007 | {ExprIntrp_VariableIdentifier();; |
1008 | break;} |
1009 | case 60: |
1010 | #line 136 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
1011 | {ExprIntrp_NumValue();; |
1012 | break;} |
1013 | case 61: |
1014 | #line 136 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
1015 | {ExprIntrp_Sumator();; |
1016 | break;} |
1017 | case 62: |
1018 | #line 139 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
1019 | {ExprIntrp_VariableIdentifier();; |
1020 | break;} |
1021 | case 63: |
1022 | #line 139 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
1023 | {ExprIntrp_NumValue();; |
1024 | break;} |
1025 | case 64: |
1026 | #line 139 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
1027 | {ExprIntrp_Productor();; |
1028 | break;} |
1029 | case 68: |
1030 | #line 147 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |
1031 | {ExprIntrp_EndOfEqual();; |
1032 | break;} |
1033 | } |
1034 | /* the action file gets copied in in place of this dollarsign */ |
1035 | #line 442 "bison.simple" |
1036 | \f |
1037 | yyvsp -= yylen; |
1038 | yyssp -= yylen; |
1039 | #ifdef YYLSP_NEEDED |
1040 | yylsp -= yylen; |
1041 | #endif |
1042 | |
1043 | #if YYDEBUG != 0 |
1044 | if (yydebug) |
1045 | { |
1046 | short *ssp1 = yyss - 1; |
1047 | fprintf (stderr, "state stack now"); |
1048 | while (ssp1 != yyssp) |
1049 | fprintf (stderr, " %d", *++ssp1); |
1050 | fprintf (stderr, "\n"); |
1051 | } |
1052 | #endif |
1053 | |
1054 | *++yyvsp = yyval; |
1055 | |
1056 | #ifdef YYLSP_NEEDED |
1057 | yylsp++; |
1058 | if (yylen == 0) |
1059 | { |
1060 | yylsp->first_line = yylloc.first_line; |
1061 | yylsp->first_column = yylloc.first_column; |
1062 | yylsp->last_line = (yylsp-1)->last_line; |
1063 | yylsp->last_column = (yylsp-1)->last_column; |
1064 | yylsp->text = 0; |
1065 | } |
1066 | else |
1067 | { |
1068 | yylsp->last_line = (yylsp+yylen-1)->last_line; |
1069 | yylsp->last_column = (yylsp+yylen-1)->last_column; |
1070 | } |
1071 | #endif |
1072 | |
1073 | /* Now "shift" the result of the reduction. |
1074 | Determine what state that goes to, |
1075 | based on the state we popped back to |
1076 | and the rule number reduced by. */ |
1077 | |
1078 | yyn = yyr1[yyn]; |
1079 | |
1080 | yystate = yypgoto[yyn - YYNTBASE] + *yyssp; |
1081 | if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) |
1082 | yystate = yytable[yystate]; |
1083 | else |
1084 | yystate = yydefgoto[yyn - YYNTBASE]; |
1085 | |
1086 | goto yynewstate; |
1087 | |
1088 | yyerrlab: /* here on detecting error */ |
1089 | |
1090 | if (! yyerrstatus) |
1091 | /* If not already recovering from an error, report this error. */ |
1092 | { |
1093 | ++yynerrs; |
1094 | |
1095 | #ifdef YYERROR_VERBOSE |
1096 | yyn = yypact[yystate]; |
1097 | |
1098 | if (yyn > YYFLAG && yyn < YYLAST) |
1099 | { |
1100 | int size = 0; |
1101 | char *msg; |
1102 | int x, count; |
1103 | |
1104 | count = 0; |
1105 | /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ |
1106 | for (x = (yyn < 0 ? -yyn : 0); |
1107 | x < (sizeof(yytname) / sizeof(char *)); x++) |
1108 | if (yycheck[x + yyn] == x) |
1109 | size += strlen(yytname[x]) + 15, count++; |
1110 | msg = (char *) malloc(size + 15); |
1111 | if (msg != 0) |
1112 | { |
1113 | strcpy(msg, "parse error"); |
1114 | |
1115 | if (count < 5) |
1116 | { |
1117 | count = 0; |
1118 | for (x = (yyn < 0 ? -yyn : 0); |
1119 | x < (sizeof(yytname) / sizeof(char *)); x++) |
1120 | if (yycheck[x + yyn] == x) |
1121 | { |
1122 | strcat(msg, count == 0 ? ", expecting `" : " or `"); |
1123 | strcat(msg, yytname[x]); |
1124 | strcat(msg, "'"); |
1125 | count++; |
1126 | } |
1127 | } |
1128 | yyerror(msg); |
1129 | free(msg); |
1130 | } |
1131 | else |
1132 | yyerror ("parse error; also virtual memory exceeded"); |
1133 | } |
1134 | else |
1135 | #endif /* YYERROR_VERBOSE */ |
1136 | yyerror("parse error"); |
1137 | } |
1138 | |
1139 | goto yyerrlab1; |
1140 | yyerrlab1: /* here on error raised explicitly by an action */ |
1141 | |
1142 | if (yyerrstatus == 3) |
1143 | { |
1144 | /* if just tried and failed to reuse lookahead token after an error, discard it. */ |
1145 | |
1146 | /* return failure if at end of input */ |
1147 | if (yychar == YYEOF) |
1148 | YYABORT; |
1149 | |
1150 | #if YYDEBUG != 0 |
1151 | if (yydebug) |
1152 | fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); |
1153 | #endif |
1154 | |
1155 | yychar = YYEMPTY; |
1156 | } |
1157 | |
1158 | /* Else will try to reuse lookahead token |
1159 | after shifting the error token. */ |
1160 | |
1161 | yyerrstatus = 3; /* Each real token shifted decrements this */ |
1162 | |
1163 | goto yyerrhandle; |
1164 | |
1165 | yyerrdefault: /* current state does not do anything special for the error token. */ |
1166 | |
1167 | #if 0 |
1168 | /* This is wrong; only states that explicitly want error tokens |
1169 | should shift them. */ |
1170 | yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ |
1171 | if (yyn) goto yydefault; |
1172 | #endif |
1173 | |
1174 | yyerrpop: /* pop the current state because it cannot handle the error token */ |
1175 | |
1176 | if (yyssp == yyss) YYABORT; |
1177 | yyvsp--; |
1178 | yystate = *--yyssp; |
1179 | #ifdef YYLSP_NEEDED |
1180 | yylsp--; |
1181 | #endif |
1182 | |
1183 | #if YYDEBUG != 0 |
1184 | if (yydebug) |
1185 | { |
1186 | short *ssp1 = yyss - 1; |
1187 | fprintf (stderr, "Error: state stack now"); |
1188 | while (ssp1 != yyssp) |
1189 | fprintf (stderr, " %d", *++ssp1); |
1190 | fprintf (stderr, "\n"); |
1191 | } |
1192 | #endif |
1193 | |
1194 | yyerrhandle: |
1195 | |
1196 | yyn = yypact[yystate]; |
1197 | if (yyn == YYFLAG) |
1198 | goto yyerrdefault; |
1199 | |
1200 | yyn += YYTERROR; |
1201 | if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) |
1202 | goto yyerrdefault; |
1203 | |
1204 | yyn = yytable[yyn]; |
1205 | if (yyn < 0) |
1206 | { |
1207 | if (yyn == YYFLAG) |
1208 | goto yyerrpop; |
1209 | yyn = -yyn; |
1210 | goto yyreduce; |
1211 | } |
1212 | else if (yyn == 0) |
1213 | goto yyerrpop; |
1214 | |
1215 | if (yyn == YYFINAL) |
1216 | YYACCEPT; |
1217 | |
1218 | #if YYDEBUG != 0 |
1219 | if (yydebug) |
1220 | fprintf(stderr, "Shifting error token, "); |
1221 | #endif |
1222 | |
1223 | *++yyvsp = yylval; |
1224 | #ifdef YYLSP_NEEDED |
1225 | *++yylsp = yylloc; |
1226 | #endif |
1227 | |
1228 | yystate = yyn; |
1229 | goto yynewstate; |
1230 | } |
1231 | #line 150 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc" |