2 Copyright (c) 1999-2012 OPEN CASCADE SAS
4 The content of this file is subject to the Open CASCADE Technology Public
5 License Version 6.5 (the "License"). You may not use the content of this file
6 except in compliance with the License. Please obtain a copy of the License
7 at http://www.opencascade.org and read it completely before using this file.
9 The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
10 main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 The Original Code and all software distributed under the License is
13 distributed on an "AS IS" basis, without warranty of any kind, and the
14 Initial Developer hereby disclaims all such warranties, including without
15 limitation, any warranties of merchantability, fitness for a particular
16 purpose or non-infringement. Please see the License for the specific terms
17 and conditions governing the rights and limitations under the License.
21 /* A Bison parser, made from j:/kas/c40/ros/src/exprintrp/exprintrp.yacc
22 by GNU Bison version 1.25
25 #define YYBISON 1 /* Identify Bison output. */
27 #define yyparse ExprIntrpparse
28 #define yylex ExprIntrplex
29 #define yyerror ExprIntrperror
30 #define yylval ExprIntrplval
31 #define yychar ExprIntrpchar
32 #define yydebug ExprIntrpdebug
33 #define yynerrs ExprIntrpnerrs
39 #define PARENTHESIS 263
41 #define ENDPARENTHESIS 265
42 #define ENDBRACKET 266
44 #define IDENTIFIER 268
46 #define DIFFERENTIAL 270
50 #define DEASSIGNKEY 274
52 #define RELSEPARATOR 276
57 #line 1 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
59 extern void ExprIntrp_EndOfFuncDef();
60 extern void ExprIntrp_EndOfRelation();
61 extern void ExprIntrp_AssignVariable();
62 extern void ExprIntrp_EndOfAssign();
63 extern void ExprIntrp_Deassign();
64 extern void ExprIntrp_SumOperator();
65 extern void ExprIntrp_MinusOperator();
66 extern void ExprIntrp_ProductOperator();
67 extern void ExprIntrp_DivideOperator();
68 extern void ExprIntrp_ExpOperator();
69 extern void ExprIntrp_UnaryMinusOperator();
70 extern void ExprIntrp_VariableIdentifier();
71 extern void ExprIntrp_NumValue();
72 extern void ExprIntrp_EndFunction();
73 extern void ExprIntrp_EndDerFunction();
74 extern void ExprIntrp_EndDifferential();
75 extern void ExprIntrp_EndDiffFunction();
76 extern void ExprIntrp_EndFuncArg();
77 extern void ExprIntrp_NextFuncArg();
78 extern void ExprIntrp_StartFunction();
79 extern void ExprIntrp_DefineFunction();
80 extern void ExprIntrp_StartDerivate();
81 extern void ExprIntrp_EndDerivate();
82 extern void ExprIntrp_DiffVar();
83 extern void ExprIntrp_DiffDegree();
84 extern void ExprIntrp_VerDiffDegree();
85 extern void ExprIntrp_DiffDegreeVar();
86 extern void ExprIntrp_StartDifferential();
87 extern void ExprIntrp_StartFunction();
88 extern void ExprIntrp_EndFuncArg();
89 extern void ExprIntrp_NextFuncArg();
90 extern void ExprIntrp_VariableIdentifier();
91 extern void ExprIntrp_Derivation();
92 extern void ExprIntrp_EndDerivation();
93 extern void ExprIntrp_DerivationValue();
94 extern void ExprIntrp_ConstantIdentifier();
95 extern void ExprIntrp_ConstantDefinition();
96 extern void ExprIntrp_VariableIdentifier();
97 extern void ExprIntrp_NumValue();
98 extern void ExprIntrp_Sumator();
99 extern void ExprIntrp_VariableIdentifier();
100 extern void ExprIntrp_Productor();
101 extern void ExprIntrp_EndOfEqual();
102 #line 52 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
118 #define YYFLAG -32768
121 #define YYTRANSLATE(x) ((unsigned)(x) <= 279 ? yytranslate[x] : 67)
123 static const char yytranslate[] = { 0,
124 2, 2, 2, 2, 2, 2, 2, 2, 2, 25,
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, 2, 2, 2, 2, 2,
131 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
132 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
133 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
134 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
135 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
136 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
137 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
138 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
139 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
140 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
141 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
142 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
143 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
144 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
145 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
146 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
147 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
148 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
149 2, 2, 2, 2, 2, 1, 2, 3, 4, 5,
150 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
151 16, 17, 18, 19, 20, 21, 22, 23, 24
155 static const short yyprhs[] = { 0,
156 0, 2, 4, 6, 8, 10, 11, 16, 17, 23,
157 27, 31, 35, 39, 43, 47, 51, 54, 56, 58,
158 60, 62, 64, 66, 68, 70, 72, 77, 82, 83,
159 89, 91, 92, 97, 99, 100, 105, 106, 110, 116,
160 117, 118, 128, 130, 132, 133, 139, 141, 142, 147,
161 149, 150, 158, 159, 160, 171, 172, 173, 182, 183,
162 184, 199, 200, 201, 216, 218, 222, 226
165 static const short yyrhs[] = { 31,
166 0, 27, 0, 29, 0, 39, 0, 65, 0, 0,
167 13, 28, 18, 31, 0, 0, 19, 9, 13, 30,
168 11, 0, 31, 3, 31, 0, 31, 4, 31, 0,
169 31, 7, 31, 0, 31, 5, 31, 0, 31, 6,
170 31, 0, 8, 31, 10, 0, 9, 31, 11, 0,
171 4, 31, 0, 32, 0, 52, 0, 56, 0, 59,
172 0, 62, 0, 33, 0, 34, 0, 13, 0, 12,
173 0, 38, 8, 36, 10, 0, 41, 8, 36, 10,
174 0, 0, 43, 35, 8, 36, 10, 0, 31, 0,
175 0, 31, 14, 37, 36, 0, 13, 0, 0, 47,
176 40, 18, 31, 0, 0, 13, 42, 16, 0, 15,
177 46, 5, 15, 13, 0, 0, 0, 15, 12, 44,
178 46, 5, 15, 12, 45, 13, 0, 13, 0, 43,
179 0, 0, 13, 48, 9, 49, 11, 0, 51, 0,
180 0, 51, 14, 50, 49, 0, 13, 0, 0, 17,
181 9, 31, 14, 13, 53, 11, 0, 0, 0, 17,
182 9, 31, 14, 13, 54, 14, 12, 55, 11, 0,
183 0, 0, 22, 9, 13, 57, 14, 12, 58, 11,
184 0, 0, 0, 23, 9, 31, 14, 13, 60, 14,
185 31, 14, 31, 14, 12, 61, 11, 0, 0, 0,
186 24, 9, 31, 14, 13, 63, 14, 31, 14, 31,
187 14, 12, 64, 11, 0, 66, 0, 66, 21, 65,
188 0, 66, 25, 65, 0, 31, 20, 31, 0
194 static const short yyrline[] = { 0,
195 56, 57, 58, 59, 60, 63, 63, 66, 67, 69,
196 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
197 80, 81, 84, 85, 89, 90, 93, 94, 95, 95,
198 98, 99, 100, 102, 105, 105, 108, 108, 111, 112,
199 112, 112, 115, 116, 119, 119, 122, 123, 124, 126,
200 129, 129, 130, 130, 130, 133, 133, 134, 136, 136,
201 136, 139, 139, 139, 142, 143, 144, 147
206 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
208 static const char * const yytname[] = { "$","error","$undefined.","SUMOP",
209 "MINUSOP","DIVIDEOP","EXPOP","MULTOP","PARENTHESIS","BRACKET","ENDPARENTHESIS",
210 "ENDBRACKET","VALUE","IDENTIFIER","COMMA","DIFFERENTIAL","DERIVATE","DERIVKEY",
211 "ASSIGNOP","DEASSIGNKEY","EQUALOP","RELSEPARATOR","CONSTKEY","SUMKEY","PRODKEY",
212 "'\\n'","exprentry","Assignment","@1","Deassignment","@2","GenExpr","SingleExpr",
213 "Single","Function","@3","ListGenExpr","@4","funcident","FunctionDefinition",
214 "@5","DerFunctionId","@6","DiffFuncId","@7","@8","DiffId","FunctionDef","@9",
215 "ListArg","@10","unarg","Derivation","@11","@12","@13","ConstantDefinition",
216 "@14","@15","Sumator","@16","@17","Productor","@18","@19","RelationList","SingleRelation", NULL
220 static const short yyr1[] = { 0,
221 26, 26, 26, 26, 26, 28, 27, 30, 29, 31,
222 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
223 31, 31, 32, 32, 33, 33, 34, 34, 35, 34,
224 36, 37, 36, 38, 40, 39, 42, 41, 43, 44,
225 45, 43, 46, 46, 48, 47, 49, 50, 49, 51,
226 53, 52, 54, 55, 52, 57, 58, 56, 60, 61,
227 59, 63, 64, 62, 65, 65, 65, 66
230 static const short yyr2[] = { 0,
231 1, 1, 1, 1, 1, 0, 4, 0, 5, 3,
232 3, 3, 3, 3, 3, 3, 2, 1, 1, 1,
233 1, 1, 1, 1, 1, 1, 4, 4, 0, 5,
234 1, 0, 4, 1, 0, 4, 0, 3, 5, 0,
235 0, 9, 1, 1, 0, 5, 1, 0, 4, 1,
236 0, 7, 0, 0, 10, 0, 0, 8, 0, 0,
237 14, 0, 0, 14, 1, 3, 3, 3
240 static const short yydefact[] = { 0,
241 0, 0, 0, 26, 25, 0, 0, 0, 0, 0,
242 0, 2, 3, 1, 18, 23, 24, 0, 4, 0,
243 29, 35, 19, 20, 21, 22, 5, 65, 25, 17,
244 0, 0, 0, 0, 0, 40, 43, 44, 0, 0,
245 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
246 0, 0, 0, 0, 0, 0, 15, 16, 0, 38,
247 0, 0, 0, 0, 8, 56, 0, 0, 10, 11,
248 13, 14, 12, 68, 31, 0, 0, 0, 0, 0,
249 66, 67, 7, 50, 0, 47, 0, 0, 0, 0,
250 0, 0, 0, 32, 27, 28, 0, 36, 46, 48,
251 0, 39, 51, 9, 0, 59, 62, 0, 30, 0,
252 0, 0, 0, 57, 0, 0, 33, 49, 41, 52,
253 0, 0, 0, 0, 0, 54, 58, 0, 0, 42,
254 0, 0, 0, 55, 0, 0, 0, 0, 60, 63,
255 0, 0, 61, 64, 0, 0, 0
258 static const short yydefgoto[] = { 145,
259 12, 33, 13, 90, 75, 15, 16, 17, 53, 76,
260 108, 18, 19, 54, 20, 34, 21, 62, 125, 39,
261 22, 35, 85, 110, 86, 23, 112, 113, 131, 24,
262 91, 122, 25, 115, 141, 26, 116, 142, 27, 28
265 static const short yypact[] = { 2,
266 54, 54, 54,-32768, 4, 60, 9, 18, 20, 24,
267 30,-32768,-32768, 31,-32768,-32768,-32768, 8,-32768, 49,
268 -32768,-32768,-32768,-32768,-32768,-32768,-32768, 7, 15, 47,
269 161, 152, -10, 48, 56,-32768,-32768,-32768, 63, 54,
270 57, 61, 54, 54, 54, 54, 54, 54, 54, 54,
271 54, 54, 84, 72, 54, 54,-32768,-32768, 54,-32768,
272 80, -6, 79, 77,-32768,-32768, 82, 94, 47, 47,
273 89,-32768, 89, 169, 99, 97, 100, 54, 54, 31,
274 -32768,-32768, 169,-32768, 98, 105, 106, 107, 108, 101,
275 117, 109, 121,-32768,-32768,-32768, 125, 169,-32768,-32768,
276 133,-32768, 122,-32768, 138,-32768,-32768, 54,-32768, 80,
277 139, 141, 146,-32768, 147, 148,-32768,-32768,-32768,-32768,
278 157, 142, 54, 54, 164,-32768,-32768, 111, 123,-32768,
279 159, 54, 54,-32768, 135, 140, 166, 167,-32768,-32768,
280 170, 171,-32768,-32768, 180, 183,-32768
283 static const short yypgoto[] = {-32768,
284 -32768,-32768,-32768,-32768, 0,-32768,-32768,-32768,-32768, -48,
285 -32768,-32768,-32768,-32768,-32768,-32768, -1,-32768,-32768, 124,
286 -32768,-32768, 74,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
287 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -14,-32768
294 static const short yytable[] = { 14,
295 30, 31, 32, 77, 38, 1, 37, 59, 6, 2,
296 3, -34, -45, 4, 5, 51, 6, 40, 7, -37,
297 8, -6, -34, 9, 10, 11, 41, 55, 42, 97,
298 -37, 56, 43, 45, 46, 47, 48, 49, 44, 64,
299 81, 82, 67, 68, 69, 70, 71, 72, 73, 74,
300 50, 47, 48, 49, 80, 80, 52, 1, 83, 117,
301 38, 2, 3, 60, 61, 4, 29, 63, 6, 65,
302 7, 36, 37, 66, 6, 9, 10, 11, 98, 45,
303 46, 47, 48, 49, 45, 46, 47, 48, 49, 79,
304 89, 78, 84, 88, 48, 92, 45, 46, 47, 48,
305 49, 45, 46, 47, 48, 49, 95, 93, 99, 96,
306 101, 104, 94, 45, 46, 47, 48, 49, 100, 102,
307 103, 106, 128, 129, 132, 45, 46, 47, 48, 49,
308 105, 135, 136, 107, 109, -53, 133, 45, 46, 47,
309 48, 49, 45, 46, 47, 48, 49, 111, 137, 114,
310 119, 120, 127, 138, 45, 46, 47, 48, 49, 121,
311 123, 124, 58, 45, 46, 47, 48, 49, 126, 134,
312 57, 45, 46, 47, 48, 49, 130, 139, 140, 146,
313 143, 144, 147, 118, 0, 87
316 static const short yycheck[] = { 0,
317 1, 2, 3, 52, 6, 4, 13, 18, 15, 8,
318 9, 8, 9, 12, 13, 8, 15, 9, 17, 16,
319 19, 18, 8, 22, 23, 24, 9, 21, 9, 78,
320 16, 25, 9, 3, 4, 5, 6, 7, 9, 40,
321 55, 56, 43, 44, 45, 46, 47, 48, 49, 50,
322 20, 5, 6, 7, 55, 56, 8, 4, 59, 108,
323 62, 8, 9, 16, 9, 12, 13, 5, 15, 13,
324 17, 12, 13, 13, 15, 22, 23, 24, 79, 3,
325 4, 5, 6, 7, 3, 4, 5, 6, 7, 18,
326 14, 8, 13, 15, 6, 14, 3, 4, 5, 6,
327 7, 3, 4, 5, 6, 7, 10, 14, 11, 10,
328 5, 11, 14, 3, 4, 5, 6, 7, 14, 13,
329 13, 13, 123, 124, 14, 3, 4, 5, 6, 7,
330 14, 132, 133, 13, 10, 14, 14, 3, 4, 5,
331 6, 7, 3, 4, 5, 6, 7, 15, 14, 12,
332 12, 11, 11, 14, 3, 4, 5, 6, 7, 14,
333 14, 14, 11, 3, 4, 5, 6, 7, 12, 11,
334 10, 3, 4, 5, 6, 7, 13, 12, 12, 0,
335 11, 11, 0, 110, -1, 62
337 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
338 #line 3 "bison.simple"
340 /* Skeleton output parser for bison,
341 Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman
343 This program is free software; you can redistribute it and/or modify
344 it under the terms of the GNU General Public License as published by
345 the Free Software Foundation; either version 1, or (at your option)
348 This program is distributed in the hope that it will be useful,
349 but WITHOUT ANY WARRANTY; without even the implied warranty of
350 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
351 GNU General Public License for more details.
353 You should have received a copy of the GNU General Public License
354 along with this program; if not, write to the Free Software
355 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
360 #define alloca __builtin_alloca
361 #else /* not GNU C. */
362 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
364 #else /* not sparc */
365 #if ( defined( MSDOS ) || defined( WNT ) ) && !defined (__TURBOC__)
367 #else /* not MSDOS, or __TURBOC__ */
371 #else /* not MSDOS, __TURBOC__, or _AIX */
374 #define alloca malloc
376 #endif /* not _AIX */
377 #endif /* not MSDOS, or __TURBOC__ */
378 #endif /* not sparc. */
379 #endif /* not GNU C. */
380 #endif /* alloca not defined. */
382 /* This is the parser code that is written into each bison parser
383 when the %semantic_parser declaration is not specified in the grammar.
384 It was written by Richard Stallman by simplifying the hairy parser
385 used when %semantic_parser is specified. */
387 /* Note: there must be only one dollar sign in this file.
388 It is replaced by the list of actions, each action
389 as one case of the switch. */
391 #define yyerrok (yyerrstatus = 0)
392 #define yyclearin (yychar = YYEMPTY)
395 #define YYACCEPT return(0)
396 #define YYABORT return(1)
397 #define YYERROR goto yyerrlab1
398 /* Like YYERROR except do call yyerror.
399 This remains here temporarily to ease the
400 transition to the new meaning of YYERROR, for GCC.
401 Once GCC version 2 has supplanted version 1, this can go. */
402 #define YYFAIL goto yyerrlab
403 #define YYRECOVERING() (!!yyerrstatus)
404 #define YYBACKUP(token, value) \
406 if (yychar == YYEMPTY && yylen == 1) \
407 { yychar = (token), yylval = (value); \
408 yychar1 = YYTRANSLATE (yychar); \
413 { yyerror ("syntax error: cannot back up"); YYERROR; } \
417 #define YYERRCODE 256
420 #define YYLEX yylex()
426 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
428 #define YYLEX yylex(&yylval, &yylloc)
430 #else /* not YYLSP_NEEDED */
432 #define YYLEX yylex(&yylval, YYLEX_PARAM)
434 #define YYLEX yylex(&yylval)
436 #endif /* not YYLSP_NEEDED */
439 /* If nonreentrant, generate the variables here */
443 int yychar; /* the lookahead symbol */
444 YYSTYPE yylval; /* the semantic value of the */
445 /* lookahead symbol */
448 YYLTYPE yylloc; /* location data for the lookahead */
452 int yynerrs; /* number of parse errors so far */
453 #endif /* not YYPURE */
456 int yydebug; /* nonzero means print parse trace */
457 /* Since this is uninitialized, it does not stop multiple parsers
461 /* YYINITDEPTH indicates the initial size of the parser's stacks */
464 #define YYINITDEPTH 200
467 /* YYMAXDEPTH is the maximum size the stacks can grow to
468 (effective only if the built-in stack extension method is used). */
475 #define YYMAXDEPTH 10000
478 /* Prevent warning if -Wstrict-prototypes. */
483 #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
485 #define __yy_bcopy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT)
486 #else /* not GNU C or C++ */
487 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
489 #else /* not GNU C or C++ */
492 /* This is the most reliable way to avoid incompatibilities
493 in available built-in functions on various systems. */
496 __yy_bcopy (__from, __to, __count)
501 __yy_memcpy (to, from, count)
508 register char *f = __from;
509 register char *t = __to;
510 register int i = __count;
512 register char *f = from;
513 register char *t = to;
514 register int i = count;
520 #else /* __cplusplus */
522 /* This is the most reliable way to avoid incompatibilities
523 in available built-in functions on various systems. */
526 __yy_bcopy (char *__from, char *__to, int __count)
528 __yy_memcpy (char *to, char *from, int count)
532 register char *f = __from;
533 register char *t = __to;
534 register int i = __count;
536 register char *f = from;
537 register char *t = to;
538 register int i = count;
548 #line 196 "/PRODUCTS/flexbis-253-125/share/bison.simple"
550 /* The user can define YYPARSE_PARAM as the name of an argument to be passed
551 into yyparse. The argument should have type void *.
552 It should actually point to an object.
553 Grammar actions can access the variable by casting it
554 to the proper pointer type. */
558 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
559 #define YYPARSE_PARAM_DECL
560 #else /* not __cplusplus */
561 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
562 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
563 #endif /* not __cplusplus */
564 #else /* not YYPARSE_PARAM */
565 #define YYPARSE_PARAM_ARG
566 #define YYPARSE_PARAM_DECL
567 #endif /* not YYPARSE_PARAM */
573 yyparse(YYPARSE_PARAM_ARG)
577 register int yystate;
579 register short *yyssp;
580 register YYSTYPE *yyvsp;
581 int yyerrstatus; /* number of tokens to shift before error messages enabled */
582 int yychar1 = 0; /* lookahead token as an internal (translated) token number */
584 short yyssa[YYINITDEPTH]; /* the state stack */
585 YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
587 short *yyss = yyssa; /* refer to the stacks thru separate pointers */
588 YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
591 YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
592 YYLTYPE *yyls = yylsa;
595 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
597 #define YYPOPSTACK (yyvsp--, yyssp--)
600 int yystacksize = YYINITDEPTH;
611 YYSTYPE yyval; /* the variable used to return */
612 /* semantic values from the action */
619 fprintf(stderr, "Starting parse\n");
625 yychar = YYEMPTY; /* Cause a token to be read. */
627 /* Initialize stack pointers.
628 Waste one element of value and location stack
629 so that they stay on the same level as the state stack.
630 The wasted elements are never initialized. */
638 /* Push a new state, which is found in yystate . */
639 /* In all cases, when you get here, the value and location stacks
640 have just been pushed. so pushing a state here evens the stacks. */
645 if (yyssp >= yyss + yystacksize - 1)
647 /* Give user a chance to reallocate the stack */
648 /* Use copies of these so that the &'s don't force the real ones into memory. */
649 YYSTYPE *yyvs1 = yyvs;
652 YYLTYPE *yyls1 = yyls;
655 /* Get the current used size of the three stacks, in elements. */
656 int size = yyssp - yyss + 1;
659 /* Each stack pointer address is followed by the size of
660 the data in use in that stack, in bytes. */
662 /* This used to be a conditional around just the two extra args,
663 but that might be undefined if yyoverflow is a macro. */
664 yyoverflow("parser stack overflow",
665 &yyss1, size * sizeof (*yyssp),
666 &yyvs1, size * sizeof (*yyvsp),
667 &yyls1, size * sizeof (*yylsp),
670 yyoverflow("parser stack overflow",
671 &yyss1, size * sizeof (*yyssp),
672 &yyvs1, size * sizeof (*yyvsp),
676 yyss = yyss1; yyvs = yyvs1;
680 #else /* no yyoverflow */
681 /* Extend the stack our own way. */
682 if (yystacksize >= YYMAXDEPTH)
684 yyerror("parser stack overflow");
688 if (yystacksize > YYMAXDEPTH)
689 yystacksize = YYMAXDEPTH;
690 yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
692 __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
694 __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp));
696 yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
698 __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
700 __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp));
703 yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
705 __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
707 __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp));
710 #endif /* no yyoverflow */
712 yyssp = yyss + size - 1;
713 yyvsp = yyvs + size - 1;
715 yylsp = yyls + size - 1;
720 fprintf(stderr, "Stack size increased to %d\n", yystacksize);
723 if (yyssp >= yyss + yystacksize - 1)
729 fprintf(stderr, "Entering state %d\n", yystate);
735 /* Do appropriate processing given the current state. */
736 /* Read a lookahead token if we need one and don't already have one. */
739 /* First try to decide what to do without reference to lookahead token. */
741 yyn = yypact[yystate];
745 /* Not known => get a lookahead token if don't already have one. */
747 /* yychar is either YYEMPTY or YYEOF
748 or a valid token in external form. */
750 if (yychar == YYEMPTY)
754 fprintf(stderr, "Reading a token: ");
759 /* Convert token to internal form (in yychar1) for indexing tables with */
761 if (yychar <= 0) /* This means end of input. */
764 yychar = YYEOF; /* Don't call YYLEX any more */
768 fprintf(stderr, "Now at end of input.\n");
773 yychar1 = YYTRANSLATE(yychar);
778 fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
779 /* Give the individual parser a way to print the precise meaning
780 of a token, for further debugging info. */
782 YYPRINT (stderr, yychar, yylval);
784 fprintf (stderr, ")\n");
790 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
795 /* yyn is what to do for this token type in this state.
796 Negative => reduce, -yyn is rule number.
797 Positive => shift, yyn is new state.
798 New state is final state => don't bother to shift,
800 0, or most negative number => error. */
815 /* Shift the lookahead token. */
819 fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
822 /* Discard the token being shifted unless it is eof. */
831 /* count tokens shifted since error; after three, turn off error status. */
832 if (yyerrstatus) yyerrstatus--;
837 /* Do the default action for the current state. */
840 yyn = yydefact[yystate];
844 /* Do a reduction. yyn is the number of a rule to reduce with. */
848 yyval = yyvsp[1-yylen]; /* implement default value of the action */
855 fprintf (stderr, "Reducing via rule %d (line %d), ",
858 /* Print the symbols being reduced, and their result. */
859 for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
860 fprintf (stderr, "%s ", yytname[yyrhs[i]]);
861 fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
869 #line 59 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
870 {ExprIntrp_EndOfFuncDef();;
873 #line 60 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
874 {ExprIntrp_EndOfRelation();;
877 #line 63 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
878 {ExprIntrp_AssignVariable();;
881 #line 63 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
882 {ExprIntrp_EndOfAssign();;
885 #line 66 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
886 {ExprIntrp_Deassign();;
889 #line 69 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
890 {ExprIntrp_SumOperator();;
893 #line 70 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
894 {ExprIntrp_MinusOperator();;
897 #line 71 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
898 {ExprIntrp_ProductOperator();;
901 #line 72 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
902 {ExprIntrp_DivideOperator();;
905 #line 73 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
906 {ExprIntrp_ExpOperator();;
909 #line 76 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
910 {ExprIntrp_UnaryMinusOperator();;
913 #line 89 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
914 {ExprIntrp_VariableIdentifier();;
917 #line 90 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
918 {ExprIntrp_NumValue();;
921 #line 93 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
922 {ExprIntrp_EndFunction();;
925 #line 94 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
926 {ExprIntrp_EndDerFunction();;
929 #line 95 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
930 {ExprIntrp_EndDifferential();;
933 #line 95 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
934 {ExprIntrp_EndDiffFunction();;
937 #line 98 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
938 {ExprIntrp_EndFuncArg();;
941 #line 99 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
942 {ExprIntrp_NextFuncArg();;
945 #line 102 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
946 {ExprIntrp_StartFunction();;
949 #line 105 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
950 {ExprIntrp_DefineFunction();;
953 #line 108 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
954 {ExprIntrp_StartDerivate();;
957 #line 108 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
958 {ExprIntrp_EndDerivate();;
961 #line 111 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
962 {ExprIntrp_DiffVar();;
965 #line 112 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
966 {ExprIntrp_DiffDegree();;
969 #line 112 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
970 {ExprIntrp_VerDiffDegree();;
973 #line 112 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
974 {ExprIntrp_DiffDegreeVar();;
977 #line 115 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
978 {ExprIntrp_StartDifferential();;
981 #line 119 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
982 {ExprIntrp_StartFunction();;
985 #line 122 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
986 {ExprIntrp_EndFuncArg();;
989 #line 123 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
990 {ExprIntrp_NextFuncArg();;
993 #line 126 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
994 {ExprIntrp_VariableIdentifier();;
997 #line 129 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
998 {ExprIntrp_Derivation();;
1001 #line 129 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
1002 {ExprIntrp_EndDerivation();;
1005 #line 130 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
1006 {ExprIntrp_Derivation();;
1009 #line 130 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
1010 {ExprIntrp_DerivationValue();;
1013 #line 130 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
1014 {ExprIntrp_EndDerivation();;
1017 #line 133 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
1018 {ExprIntrp_ConstantIdentifier();;
1021 #line 133 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
1022 {ExprIntrp_ConstantDefinition();;
1025 #line 136 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
1026 {ExprIntrp_VariableIdentifier();;
1029 #line 136 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
1030 {ExprIntrp_NumValue();;
1033 #line 136 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
1034 {ExprIntrp_Sumator();;
1037 #line 139 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
1038 {ExprIntrp_VariableIdentifier();;
1041 #line 139 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
1042 {ExprIntrp_NumValue();;
1045 #line 139 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
1046 {ExprIntrp_Productor();;
1049 #line 147 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"
1050 {ExprIntrp_EndOfEqual();;
1053 /* the action file gets copied in in place of this dollarsign */
1054 #line 442 "bison.simple"
1065 short *ssp1 = yyss - 1;
1066 fprintf (stderr, "state stack now");
1067 while (ssp1 != yyssp)
1068 fprintf (stderr, " %d", *++ssp1);
1069 fprintf (stderr, "\n");
1079 yylsp->first_line = yylloc.first_line;
1080 yylsp->first_column = yylloc.first_column;
1081 yylsp->last_line = (yylsp-1)->last_line;
1082 yylsp->last_column = (yylsp-1)->last_column;
1087 yylsp->last_line = (yylsp+yylen-1)->last_line;
1088 yylsp->last_column = (yylsp+yylen-1)->last_column;
1092 /* Now "shift" the result of the reduction.
1093 Determine what state that goes to,
1094 based on the state we popped back to
1095 and the rule number reduced by. */
1099 yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
1100 if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1101 yystate = yytable[yystate];
1103 yystate = yydefgoto[yyn - YYNTBASE];
1107 yyerrlab: /* here on detecting error */
1110 /* If not already recovering from an error, report this error. */
1114 #ifdef YYERROR_VERBOSE
1115 yyn = yypact[yystate];
1117 if (yyn > YYFLAG && yyn < YYLAST)
1124 /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
1125 for (x = (yyn < 0 ? -yyn : 0);
1126 x < (sizeof(yytname) / sizeof(char *)); x++)
1127 if (yycheck[x + yyn] == x)
1128 size += strlen(yytname[x]) + 15, count++;
1129 msg = (char *) malloc(size + 15);
1132 strcpy(msg, "parse error");
1137 for (x = (yyn < 0 ? -yyn : 0);
1138 x < (sizeof(yytname) / sizeof(char *)); x++)
1139 if (yycheck[x + yyn] == x)
1141 strcat(msg, count == 0 ? ", expecting `" : " or `");
1142 strcat(msg, yytname[x]);
1151 yyerror ("parse error; also virtual memory exceeded");
1154 #endif /* YYERROR_VERBOSE */
1155 yyerror("parse error");
1159 yyerrlab1: /* here on error raised explicitly by an action */
1161 if (yyerrstatus == 3)
1163 /* if just tried and failed to reuse lookahead token after an error, discard it. */
1165 /* return failure if at end of input */
1166 if (yychar == YYEOF)
1171 fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
1177 /* Else will try to reuse lookahead token
1178 after shifting the error token. */
1180 yyerrstatus = 3; /* Each real token shifted decrements this */
1184 yyerrdefault: /* current state does not do anything special for the error token. */
1187 /* This is wrong; only states that explicitly want error tokens
1188 should shift them. */
1189 yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
1190 if (yyn) goto yydefault;
1193 yyerrpop: /* pop the current state because it cannot handle the error token */
1195 if (yyssp == yyss) YYABORT;
1205 short *ssp1 = yyss - 1;
1206 fprintf (stderr, "Error: state stack now");
1207 while (ssp1 != yyssp)
1208 fprintf (stderr, " %d", *++ssp1);
1209 fprintf (stderr, "\n");
1215 yyn = yypact[yystate];
1220 if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
1239 fprintf(stderr, "Shifting error token, ");
1250 #line 150 "j:/kas/c40/ros/src/exprintrp/exprintrp.yacc"