Changeset 1222 for trunk/src/kash/generated/arith.c
- Timestamp:
- Oct 8, 2007, 2:24:31 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kash/generated/arith.c
r1199 r1222 44 44 */ 45 45 46 #i nclude <sys/cdefs.h>46 #if 0 47 47 #ifndef lint 48 #if 049 48 static char sccsid[] = "@(#)arith.y 8.3 (Berkeley) 5/4/95"; 50 49 #else 51 50 __RCSID("$NetBSD: arith.y,v 1.17 2003/09/17 17:33:36 jmmv Exp $"); 52 #endif53 51 #endif /* not lint */ 52 #endif 54 53 55 54 #include <stdlib.h> … … 59 58 #include "output.h" 60 59 #include "memalloc.h" 61 60 #include "shinstance.h" 61 62 shinstance *arith_psh; 62 63 const char *arith_buf, *arith_startbuf; 63 64 … … 294 295 #define yystacksize YYSTACKSIZE 295 296 int 296 arith(s) 297 const char *s; 297 arith(shinstance *psh, const char *s) 298 298 { 299 299 long result; 300 300 301 INTOFF; 302 /* todo lock */ 303 arith_psh = psh; 301 304 arith_buf = arith_startbuf = s; 302 303 INTOFF;304 305 result = yyparse(); 305 306 arith_lex_reset(); /* reprime lex */ 307 arith_psh = NULL; 308 /* todo unlock */ 306 309 INTON; 307 310 … … 314 317 */ 315 318 int 316 expcmd(argc, argv) 317 int argc; 318 char **argv; 319 expcmd(shinstance *psh, int argc, char **argv) 319 320 { 320 321 const char *p; … … 344 345 p = ""; 345 346 346 i = arith(p );347 i = arith(psh, p); 347 348 348 349 out1fmt(psh, "%ld\n", i); … … 367 368 368 369 void 369 yyerror(s) 370 const char *s; 371 { 372 370 yyerror(const char *s) 371 { 372 shinstance *psh = arith_psh; 373 373 yyerrok; 374 374 yyclearin; 375 375 arith_lex_reset(); /* reprime lex */ 376 error("arithmetic expression: %s: \"%s\"", s, arith_startbuf); 376 /** @todo unlock */ 377 error(psh, "arithmetic expression: %s: \"%s\"", s, arith_startbuf); 377 378 /* NOTREACHED */ 378 379 } … … 382 383 #define YYERROR goto yyerrlab 383 384 #ifdef __cplusplus 384 extern "C" { 385 extern "C" { 385 386 char * getenv(); 386 387 int yylex();
Note:
See TracChangeset
for help on using the changeset viewer.