Changeset 014db1 in git
- Timestamp:
- Mar 30, 2000, 8:36:10 AM (24 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- bfe96e9898a9834b6a5f05048683eae6cdb49819
- Parents:
- affa29dcb41cb5f7503fc879b96bdfde32dc955d
- Location:
- modules/modgen
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/modgen/creat_top.cc
raffa29 r014db1 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: creat_top.cc,v 1. 9 2000-03-29 13:56:26krueger Exp $ */4 /* $Id: creat_top.cc,v 1.10 2000-03-30 06:35:44 krueger Exp $ */ 5 5 /* 6 6 * ABSTRACT: lib parsing … … 133 133 return -1; 134 134 } 135 printf("Creating %s, ", filename);fflush(stdout);135 if(trace)printf("Creating %s, ", filename);fflush(stdout); 136 136 mod_write_header(module->modfp, module->name, 'c'); 137 137 mod_copy_tmp(module->modfp, module->fmtfp); 138 printf(" done.\n");fflush(stdout);138 if(trace)printf("\n");fflush(stdout); 139 139 fclose(module->fmtfp); 140 140 if(create_tmpfile(module)) return -1; … … 143 143 if(module->fmtfp2 == NULL) { printf("Cannot write HELP\n"); return -1; } 144 144 if(module->fmtfp3 == NULL) { printf("Cannot write EXAMPLE\n"); return -1; } 145 printf("%p %p %p\n", module->fmtfp, module->fmtfp2, module->fmtfp3);146 147 145 148 146 strcpy(filename, build_filename(module, module->name, 2)); … … 152 150 return -1; 153 151 } 154 printf("Creating %s, ", filename);fflush(stdout);152 if(trace)printf("Creating %s, ", filename);fflush(stdout); 155 153 mod_write_header(module->modfp_h, module->name, 'h'); 154 if(trace)printf("\n");fflush(stdout); 156 155 157 156 //free(filename); -
modules/modgen/grammar.y
raffa29 r014db1 1 1 /* 2 * $Id: grammar.y,v 1.1 0 2000-03-29 14:29:11krueger Exp $2 * $Id: grammar.y,v 1.11 2000-03-30 06:35:44 krueger Exp $ 3 3 */ 4 4 … … 21 21 extern moddef module_def; 22 22 extern int yylineno; 23 extern int do_create_makefile; 23 24 24 25 extern int init_modgen(moddef *module_def, char *filename); … … 84 85 goal: part1 sect2 sect2end code 85 86 { 86 printf("Finish modules\n");87 if(trace)printf("Finish modules\n"); 87 88 return 0; 88 89 } … … 91 92 part1: initmod sect1 sect1end 92 93 { 93 mod_create_makefile(&module_def);94 if(do_create_makefile)mod_create_makefile(&module_def); 94 95 if(write_intro(&module_def)) { 95 myyyerror("Error while creating files\n"); 96 return 1; 96 return(myyyerror("Error while creating files\n")); 97 97 } 98 98 }; … … 116 116 { 117 117 memset(&procedure_decl, 0, sizeof(procdef)); 118 printf("End of section %d\n", sectnum-1);118 if(debug>2)printf("End of section %d\n", sectnum-1); 119 119 } 120 120 ; 121 121 122 122 expr: NAME '=' MSTRINGTOK 123 { var_token vt; 123 { 124 var_token vt; 125 int rc = 0; 124 126 void (*write_cmd)(moddefv module, var_token type = VAR_NONE, 125 127 idtyp t, void *arg1 = NULL, void *arg2 = NULL); … … 134 136 } 135 137 else { 136 myyyerror("Line %d: Unknown variable '%s' in section %d\n",138 rc=myyyerror("Line %d: Unknown variable '%s' in section %d\n", 137 139 yylineno, $1, sectnum); 138 140 } … … 143 145 } 144 146 else { 145 myyyerror("Line %d: Unknown variable '%s' in section %d\n",147 rc=myyyerror("Line %d: Unknown variable '%s' in section %d\n", 146 148 yylineno, $1, sectnum); 147 149 } … … 152 154 free($1); 153 155 free($3.string); 156 if(rc)return(rc); 154 157 } 155 158 | NAME '=' FILENAME … … 208 211 } 209 212 | NAME '=' BOOLTOK 210 { var_token vt; 213 { 214 var_token vt; 215 int rc = 0; 211 216 void (*write_cmd)(moddefv module, var_token type = VAR_NONE, 212 217 idtyp t, void *arg1 = NULL, void *arg2 = NULL); … … 217 222 } 218 223 else { 219 myyyerror("Line %d: Unknown variable '%s' in section %d\n",224 rc=myyyerror("Line %d: Unknown variable '%s' in section %d\n", 220 225 yylineno, $1, sectnum); 221 226 } … … 226 231 } 227 232 else { 228 myyyerror("Line %d: Unknown variable '%s' in section %d\n",233 rc=myyyerror("Line %d: Unknown variable '%s' in section %d\n", 229 234 yylineno, $1, sectnum); 230 235 } … … 234 239 } 235 240 free($1); 241 if(rc)return(rc); 236 242 } 237 243 ; … … 239 245 files: FILENAME ',' FILENAME 240 246 { 241 printf(">>>>>>>>files '%s' , '%s'\n", $1, $3);247 if(debug>2)printf(">>>>>>>>files '%s' , '%s'\n", $1, $3); 242 248 Add2files(&module_def, $1); 243 249 Add2files(&module_def, $3); … … 254 260 { 255 261 write_finish_functions(&module_def, &procedure_decl); 256 printf("End of section %d\n", sectnum-1);262 if(debug>2)printf("End of section %d\n", sectnum-1); 257 263 } 258 264 ; … … 262 268 procdef: procdecl proccode 263 269 { 264 printf("PROCDEF:\n");270 if(debug>2)printf("PROCDEF:\n"); 265 271 } 266 272 | procdecl proccode procdeclexample 267 273 { 268 printf("PROCDEF mit example:\n");274 if(debug>2)printf("PROCDEF mit example:\n"); 269 275 fflush(module_def.fmtfp); 270 276 } … … 286 292 free($2); 287 293 if(write_singular_procedures(&module_def, &procedure_decl)) 288 myyyerror("Error while creating bin-file\n");294 return(myyyerror("Error while creating bin-file\n")); 289 295 } 290 296 | STATICTOK PROCDECLTOK NAME … … 294 300 free($3); 295 301 if(write_singular_procedures(&module_def, &procedure_decl)) 296 myyyerror("Error while creating bin-file\n");302 return(myyyerror("Error while creating bin-file\n")); 297 303 }; 298 304 … … 315 321 funcdecl1: NAME 316 322 { 317 printf("funcdecl1-1\n");323 if(debug>2)printf("funcdecl1-1\n"); 318 324 init_proc(&procedure_decl, $1, NULL, yylineno); 319 325 free($1); … … 321 327 | VARTYPETOK NAME 322 328 { 323 printf("funcdecl1-2\n");329 if(debug>2)printf("funcdecl1-2\n"); 324 330 init_proc(&procedure_decl, $2, &$1, yylineno); 325 331 free($2); … … 327 333 | STATICTOK NAME 328 334 { 329 printf("funcdecl1-3\n");335 if(debug>2)printf("funcdecl1-3\n"); 330 336 init_proc(&procedure_decl, $2, NULL, yylineno); 331 337 free($2); … … 334 340 | STATICTOK VARTYPETOK NAME 335 341 { 336 printf("funcdecl1-4\n");342 if(debug>2)printf("funcdecl1-4\n"); 337 343 init_proc(&procedure_decl, $3, &$2, yylineno); 338 344 free($3); … … 345 351 procedure_decl.help_string = $1.string; 346 352 procedure_decl.lineno_other = $1.lineno; 347 printf("\t\thelp at %d\n", yylineno);353 if(debug>2)printf("\t\thelp at %d\n", yylineno); 348 354 write_help(&module_def, &procedure_decl); 349 355 } … … 377 383 { 378 384 if(procedure_decl.procname == NULL) { 379 myyyerror("example without proc-declaration at line %d\n",380 yylineno) ;381 } 382 printf("Example at %d\n", yylineno);385 return(myyyerror("example without proc-declaration at line %d\n", 386 yylineno)); 387 } 388 if(debug>2)printf("Example at %d\n", yylineno); 383 389 procedure_decl.lineno_other = yylineno; 384 390 }; … … 414 420 switch(vt=checkcmd($2, &write_cmd, CMDT_SINGLE, 0)) { 415 421 case CMD_NONE: 416 myyyerror("Line %d: Unknown command '%s' in section %d\n",417 yylineno, $2, sectnum) ;422 return(myyyerror("Line %d: Unknown command '%s' in section %d\n", 423 yylineno, $2, sectnum)); 418 424 break; 419 425 case CMD_BADSYNTAX: 420 myyyerror("Line %d: bad syntax of command '%s' in section %d\n",421 yylineno, $2, sectnum) ;426 return(myyyerror("Line %d: bad syntax of command '%s' in section %d\n", 427 yylineno, $2, sectnum)); 422 428 break; 423 429 default: … … 433 439 switch(vt=checkcmd($2, &write_cmd, CMDT_0, 1)) { 434 440 case CMD_NONE: 435 myyyerror("Line %d: Unknown command '%s' in section %d\n",436 yylineno, $2, sectnum) ;441 return(myyyerror("Line %d: Unknown command '%s' in section %d\n", 442 yylineno, $2, sectnum)); 437 443 break; 438 444 case CMD_BADSYNTAX: 439 myyyerror("Line %d: bad syntax of command '%s' in section %d\n",440 yylineno, $2, sectnum) ;445 return(myyyerror("Line %d: bad syntax of command '%s' in section %d\n", 446 yylineno, $2, sectnum)); 441 447 break; 442 448 default: … … 453 459 switch(vt=checkcmd($2, &write_cmd, CMDT_ANY, 1)) { 454 460 case CMD_NONE: 455 myyyerror("Line %d: Unknown command '%s' in section %d\n",456 yylineno, $2, sectnum) ;461 return(myyyerror("Line %d: Unknown command '%s' in section %d\n", 462 yylineno, $2, sectnum)); 457 463 break; 458 464 case CMD_BADSYNTAX: 459 myyyerror("Line %d: bad syntax of command '%s' in section %d\n",460 yylineno, $2, sectnum) ;465 return(myyyerror("Line %d: bad syntax of command '%s' in section %d\n", 466 yylineno, $2, sectnum)); 461 467 break; 462 468 default: … … 472 478 switch(vt=checkcmd($2, &write_cmd, CMDT_ANY, 1)) { 473 479 case CMD_NONE: 474 myyyerror("Line %d: Unknown command '%s' in section %d\n",475 yylineno, $2, sectnum) ;480 return(myyyerror("Line %d: Unknown command '%s' in section %d\n", 481 yylineno, $2, sectnum)); 476 482 break; 477 483 case CMD_BADSYNTAX: 478 myyyerror("Line %d: bad syntax of command '%s' in section %d\n",479 yylineno, $2, sectnum) ;484 return(myyyerror("Line %d: bad syntax of command '%s' in section %d\n", 485 yylineno, $2, sectnum)); 480 486 break; 481 487 default: … … 491 497 switch(vt=checkcmd($2, &write_cmd, CMDT_EQ, 0)) { 492 498 case CMD_NONE: 493 myyyerror("Line %d: Unknown command '%s' in section %d\n",494 yylineno, $2, sectnum) ;499 return(myyyerror("Line %d: Unknown command '%s' in section %d\n", 500 yylineno, $2, sectnum)); 495 501 break; 496 502 case CMD_BADSYNTAX: 497 myyyerror("Line %d: bad syntax of command '%s' in section %d\n",498 yylineno, $2, sectnum) ;503 return(myyyerror("Line %d: bad syntax of command '%s' in section %d\n", 504 yylineno, $2, sectnum)); 499 505 break; 500 506 default: … … 506 512 identifier: NAME 507 513 { 508 printf("### ID ### Name %s\n", $1);514 if(debug>2)printf("### ID ### Name %s\n", $1); 509 515 $$ = $1; 510 516 } … … 512 518 { 513 519 int len = strlen($$) + strlen($3) + 2; 514 printf("### ID ### Name %s\n", $3);520 if(debug>2)printf("### ID ### Name %s\n", $3); 515 521 $$ = (char *)realloc($$, len); 516 522 strcat($$, "::"); … … 520 526 arglist: NAME 521 527 { 522 printf("### ARGS %s\n", $1);528 if(debug>2)printf("### ARGS %s\n", $1); 523 529 } 524 530 | arglist ',' NAME 525 531 { 526 printf("### ARGS %s\n", $3);532 if(debug>2)printf("### ARGS %s\n", $3); 527 533 }; 528 534 529 535 sgtypelist: VARTYPETOK NAME 530 536 { 531 printf("\tsgtypelist %s %s\n", $1.name, $2);537 if(debug>2)printf("\tsgtypelist %s %s\n", $1.name, $2); 532 538 write_singular_parameter(&module_def, yylineno, $1.name, $2); 533 539 free($1.name); … … 536 542 | VARTYPETOK '#' 537 543 { 538 printf("\tsgtypelist %s %s\n", $1.name, $2);544 if(debug>2)printf("\tsgtypelist %s %s\n", $1.name, $2); 539 545 write_singular_parameter(&module_def, yylineno, $1.name, "#"); 540 546 free($1.name); … … 542 548 | sgtypelist ',' VARTYPETOK NAME 543 549 { 544 printf("\tsgtypelist next %s %s\n", $3.name, $4);550 if(debug>2)printf("\tsgtypelist next %s %s\n", $3.name, $4); 545 551 write_singular_parameter(&module_def, yylineno, $3.name, $4); 546 552 free($3.name); … … 549 555 | sgtypelist ',' VARTYPETOK '#' 550 556 { 551 printf("\tsgtypelist next %s %s\n", $3.name, $4);557 if(debug>2)printf("\tsgtypelist next %s %s\n", $3.name, $4); 552 558 write_singular_parameter(&module_def, yylineno, $3.name, "#"); 553 559 free($3.name); … … 563 569 { 564 570 if(check_reseverd($2)) 565 myyyerror("Line %d: variablename '%s' is reserved\n",566 yylineno, $2) ;571 return(myyyerror("Line %d: variablename '%s' is reserved\n", 572 yylineno, $2)); 567 573 AddParam(&procedure_decl, &$1, $2); 568 574 free($1.name); free($2); … … 576 582 { 577 583 if(check_reseverd($4)) 578 myyyerror("Line %d: variablename '%s' is reserved\n",579 yylineno, $4) ;584 return(myyyerror("Line %d: variablename '%s' is reserved\n", 585 yylineno, $4)); 580 586 AddParam(&procedure_decl, &$3, $4); 581 587 free($3.name); free($4); -
modules/modgen/makefile.cc
raffa29 r014db1 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: makefile.cc,v 1. 4 2000-03-29 13:56:27krueger Exp $ */4 /* $Id: makefile.cc,v 1.5 2000-03-30 06:35:44 krueger Exp $ */ 5 5 /* 6 6 * ABSTRACT: lib parsing … … 47 47 int i; 48 48 49 printf("Creating Makefile ...");fflush(stdout);49 if(trace)printf("Creating Makefile ...");fflush(stdout); 50 50 write_header(fp, module->name, "#"); 51 51 build_head_section(fp, module); … … 71 71 72 72 fclose(fp); 73 printf(" done.\n");73 if(trace)printf(" done.\n"); 74 74 } 75 75 -
modules/modgen/misc.cc
raffa29 r014db1 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: misc.cc,v 1. 8 2000-03-29 09:31:41krueger Exp $ */4 /* $Id: misc.cc,v 1.9 2000-03-30 06:35:45 krueger Exp $ */ 5 5 /* 6 6 * ABSTRACT: lib parsing … … 129 129 if(cmds[i].alias==2) 130 130 { 131 printf("outdated identifier `%s` used - please change your code",131 if(trace)printf("outdated identifier `%s` used - please change your code", 132 132 cmds[i].name); 133 133 cmds[i].alias=1; … … 174 174 default: strcpy(name,"(null)"); 175 175 } 176 #if 0177 printf("[%d=%s]", n, name);178 fflush(stdout);179 #endif180 176 return(name); 181 177 } 182 183 #if 0184 static int iiTabIndex(const jjValCmdTab dArithTab, const int len, const int op)185 {186 int a=0;187 int e=len;188 int p=len/2;189 while ( a!=e)190 {191 if (op==dArithTab[p].cmd) return dArithTab[p].start;192 else if (op<dArithTab[p].cmd)193 { e=p; p=a+(e-a)/2;}194 else195 { a=p; p=p+(e-p)/2; }196 }197 return -1;198 }199 #endif200 178 201 179 /*========================================================================*/ … … 239 217 } 240 218 219 /*========================================================================*/ 241 220 struct valid_vars_def { 242 221 char *name; … … 273 252 } 274 253 254 /*========================================================================*/ 275 255 void write_main_variable( 276 256 moddefv module, … … 284 264 module->filename); 285 265 } 286 287 266 288 267 /*========================================================================*/ … … 568 547 strcpy(type_conv[], ""); 569 548 strcpy(type_conv[], ""); 570 */571 549 printf("[%d] %s\n", INT_CMD, type_conv[INT_CMD]); 572 550 printf("[%d] %s\n", MODUL_CMD, type_conv[MODUL_CMD]); … … 574 552 printf("[%d] %s\n", LINK_CMD, type_conv[LINK_CMD]); 575 553 printf("[%d] %s\n", PACKAGE_CMD, type_conv[PACKAGE_CMD]); 576 / **/577 } 578 579 /*========================================================================*/ 554 / **/ 555 } 556 557 /*========================================================================*/ -
modules/modgen/modgen.h
raffa29 r014db1 1 1 /* 2 * $Id: modgen.h,v 1.1 0 2000-03-29 13:56:27krueger Exp $2 * $Id: modgen.h,v 1.11 2000-03-30 06:36:10 krueger Exp $ 3 3 * 4 4 */ … … 125 125 */ 126 126 extern int modlineno; /* lineno within module */ 127 extern int debug; 128 extern int trace; 127 129 128 130 extern int IsCmd(char *n, int & tok); 129 131 extern char * decl2str(int n, char *name); 130 132 131 extern voidmyyyerror(char *fmt, ...);133 extern int myyyerror(char *fmt, ...); 132 134 133 135 -
modules/modgen/proc.cc
raffa29 r014db1 1 1 /* 2 * $Id: proc.cc,v 1.1 1 2000-03-29 13:56:27krueger Exp $2 * $Id: proc.cc,v 1.12 2000-03-30 06:35:45 krueger Exp $ 3 3 */ 4 4 … … 12 12 #include "typmap.h" 13 13 14 extern int trace;15 14 16 15 #if 1 … … 39 38 if( proc == NULL ) return; 40 39 41 if(trace) printf("\ tcreating '%s'...", proc->procname); fflush(stdout);40 if(trace) printf("\n\tcreating '%s'...", proc->procname); fflush(stdout); 42 41 fprintf(module->modfp, "#line %d \"%s\"\n", proc->lineno, module->filename); 43 42 modlineno+=1; … … 59 58 modlineno+=1; 60 59 61 #if 062 if(proc->help_string!=NULL) {63 printf("WRITE HELP\n");64 fprintf(module->fmtfp2, " 1-enter_id(\"%s\",", proc->procname);65 fprintf(module->fmtfp2, " \"%s\", STRING_CMD);\n", proc->help_string);66 }67 if(proc->example_string!=NULL) {68 printf("WRITE EXAMPLE\n");69 fprintf(module->fmtfp3, " 1-enter_id(\"%s\",", proc->procname);70 fprintf(module->fmtfp3, " \"%s\", STRING_CMD);\n",71 proc->example_string);72 }73 #endif74 60 fprintf(module->modfp, "\n"); 75 61 modlineno+=1; … … 115 101 } 116 102 for (i=0;i<pi->paramcnt; i++) { 117 fprintf(fp, "%s res%d", type_conv[pi->param[i].typ], i);103 fprintf(fp, "%s %s%d", type_conv[pi->param[i].typ], i); 118 104 if(i<pi->paramcnt-1) fprintf(fp, ", "); 119 105 } … … 135 121 fprintf(module->fmtfp, " leftv v = h, v_save;\n"); 136 122 fprintf(module->fmtfp, " int tok = NONE, index = 0;\n"); 137 for (i=0;i<pi->paramcnt; i++) 123 for (i=0;i<pi->paramcnt; i++) { 138 124 fprintf(module->fmtfp, 139 " sleftv s%s; leftv %s = &s%s;\n", pi->param[i].varname,125 " sleftv s%s; leftv z%s = &s%s;\n", pi->param[i].varname, 140 126 pi->param[i].varname, pi->param[i].varname); 127 fprintf(module->fmtfp, " %s %s;\n", type_conv[pi->param[i].typ], 128 pi->param[i].varname); 129 } 130 141 131 fprintf(module->fmtfp, "#line %d \"%s\"\n", yylineno, module->filename); 142 132 fprintf(module->fmtfp, "\n"); … … 145 135 } 146 136 147 137 /*========================================================================*/ 148 138 void write_function_typecheck( 149 139 moddefv module, … … 159 149 } 160 150 151 /*========================================================================*/ 161 152 void write_function_result( 162 153 moddefv module, … … 170 161 } 171 162 163 /*========================================================================*/ 172 164 void write_function_return( 173 165 moddefv module, … … 181 173 if( pi->funcname != NULL ) free(pi->funcname); 182 174 pi->funcname = strdup((char *)arg); 183 printf("CMD: return(%s)\n", arg);175 if(debug>2)printf("CMD: return(%s)\n", arg); 184 176 185 177 /* write function declaration to header file */ … … 200 192 fprintf(module->modfp_h, ");\n\n"); 201 193 } 202 else printf("CMD: return()\n");194 else if(debug>2)printf("CMD: return()\n"); 203 195 204 196 fprintf(module->fmtfp, "#line %d \"%s\"\n", yylineno, module->filename); … … 214 206 int i; 215 207 216 printf("\nWriting return-block\n");208 if(trace)printf("\n\t\tsingular command block..."); 217 209 fprintf(module->fmtfp, "#line @d \"%s.cc\"\n", module->name); 218 210 fprintf(module->fmtfp, "/* code for running singular commands */\n"); … … 248 240 int cnt = 0, i; 249 241 250 printf("header..."); fflush(stdout);242 if(trace)printf("\n\t\theader..."); fflush(stdout); 251 243 252 244 fprintf(fmtfp, "#line %d \"%s\"\n", pi->lineno, module->filename); … … 276 268 if(!pi->flags.declaration_done) return; 277 269 278 printf("type check..."); fflush(stdout);270 if(trace)printf("type check..."); fflush(stdout); 279 271 280 272 if(pi->paramcnt>0) { … … 322 314 mod_copy_tmp(module->modfp, module->fmtfp); 323 315 fprintf(module->modfp, "#line %d \"%s.cc\"\n", modlineno++, module->name); 324 printf(" done.\n");fflush(stdout);316 if(trace)printf(" done.\n");fflush(stdout); 325 317 fclose(module->fmtfp); 326 318 fclose(module->fmtfp2); … … 344 336 fprintf(fp, " v_save = v->next;\n"); 345 337 fprintf(fp, " v->next = NULL;\n"); 346 fprintf(fp, " if(iiConvert(tok, %s, index, v, %s))\n",338 fprintf(fp, " if(iiConvert(tok, %s, index, v, z%s))\n", 347 339 pi->param[i].typname, pi->param[i].varname); 348 340 fprintf(fp, " goto mod_%s_error;\n", pi->procname); 349 341 fprintf(fp, " v = v_save;\n"); 342 fprintf(fp, " %s = (%s)z%s->Data();\n", pi->param[i].varname, 343 type_conv[pi->param[i].typ], pi->param[i].varname); 344 350 345 } 351 346 … … 367 362 int i; 368 363 369 printf("\nWriting return-block\n");364 if(trace)printf("\n\t\treturn block..."); 370 365 371 printf("### RETURN: '%s' '%s' '%d'\n", pi->return_val.name,366 if(debug>2)printf("### RETURN: '%s' '%s' '%d'\n", pi->return_val.name, 372 367 pi->return_val.typname, pi->return_val.typ); 373 368 fprintf(module->fmtfp, "#line @d \"%s.cc\"\n", module->name); … … 405 400 fprintf(fmtfp, " res->data = (void *)%s(", pi->funcname); 406 401 for (i=0;i<pi->paramcnt; i++) { 407 fprintf(fmtfp, "(%s) %s->Data()", 408 type_conv[pi->param[i].typ], pi->param[i].varname); 402 fprintf(fmtfp, "%s", pi->param[i].varname); 403 // fprintf(fmtfp, "(%s) %s->Data()", 404 // type_conv[pi->param[i].typ], pi->param[i].varname); 409 405 if(i<pi->paramcnt-1) fprintf(fmtfp, ", "); 410 406 } … … 439 435 if(pi->paramcnt>0) { 440 436 if(pi->flags.typecheck_done) { 441 printf("error handling..."); fflush(stdout);437 if(trace)printf("\n\t\terror handling..."); fflush(stdout); 442 438 fprintf(module->fmtfp, " mod_%s_error:\n", pi->procname); 443 439 fprintf(module->fmtfp, " Werror(\"%s(`%%s`) is not supported\", Tok2Cmdname(tok));\n", … … 514 510 return -1; 515 511 } 516 printf("Creating %s, ", filename);fflush(stdout);512 if(trace)printf("Creating %s, ", filename);fflush(stdout); 517 513 518 514 //free(filename); -
modules/modgen/proc_setup.cc
raffa29 r014db1 1 1 /* 2 * $Id: proc_setup.cc,v 1. 4 2000-02-14 21:44:40krueger Exp $2 * $Id: proc_setup.cc,v 1.5 2000-03-30 06:35:45 krueger Exp $ 3 3 */ 4 4 … … 102 102 paramcnt = p->paramcnt; 103 103 if(varname == NULL) { 104 snprintf(typname, sizeof(typname), " res%d", paramcnt);104 snprintf(typname, sizeof(typname), "arg%d", paramcnt); 105 105 pnew.varname = strdup(typname); 106 106 } else pnew.varname = strdup(varname); -
modules/modgen/scanner.l
raffa29 r014db1 3 3 * Computer Algebra System SINGULAR * 4 4 ****************************************/ 5 /* $Id: scanner.l,v 1. 9 2000-03-29 09:31:43krueger Exp $ */5 /* $Id: scanner.l,v 1.10 2000-03-30 06:35:45 krueger Exp $ */ 6 6 #include <stdio.h> 7 7 #include <string.h> … … 315 315 .*(\n?) { lvalp->name = yytext; return CODEPART; } 316 316 317 <<EOF>> { sectnum = 0; printf("XXXX\n");317 <<EOF>> { sectnum = 0; 318 318 return SECT3END; 319 319 /*yyterminate();*/ -
modules/modgen/utils.cc
raffa29 r014db1 1 1 /* 2 * $Id: utils.cc,v 1. 7 2000-03-29 13:56:27krueger Exp $2 * $Id: utils.cc,v 1.8 2000-03-30 06:35:46 krueger Exp $ 3 3 */ 4 4 … … 59 59 60 60 memset(tmpfile, '\0', sizeof(tmpfile)); 61 snprintf(tmpfile, sizeof(tmpfile), " tmp/modgen.tmpXXXXXX");61 snprintf(tmpfile, sizeof(tmpfile), "modgen.tmpXXXXXX"); 62 62 mktemp(tmpfile); 63 63 64 printf("create_tmpfile (%d\n", which);64 if(debug)printf("create_tmpfile '%s'\n", tmpfile ); 65 65 66 66 if (close(creat(tmpfile, 0600)) < 0) { … … 74 74 } 75 75 76 printf("2)create_tmpfile (%d\n", which );77 76 switch(which) { 78 77 case 0: module_def->fmtfp = fp; break; … … 116 115 117 116 /*========================================================================*/ 118 voidmyyyerror(117 int myyyerror( 119 118 char *fmt, ... 120 119 ) … … 124 123 vprintf(fmt, ap); 125 124 va_end(ap); 125 return 1; 126 126 }
Note: See TracChangeset
for help on using the changeset viewer.