Changeset 6c8772 in git for modules/tools
- Timestamp:
- Apr 1, 1999, 12:03:24 AM (25 years ago)
- Branches:
- (u'spielwiese', 'd1b01e9d51ade4b46b745d3bada5c5f3696be3a8')
- Children:
- dcafdbfd5e7cf5689011aad6c9b81fd43bd118b1
- Parents:
- 740e1f7291b169d818475089a70366a328feb8d1
- Location:
- modules/tools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
modules/tools/misc.cc
r740e1f7 r6c8772 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: misc.cc,v 1. 4 1999-03-24 13:04:20krueger Exp $ */4 /* $Id: misc.cc,v 1.5 1999-03-31 22:03:22 krueger Exp $ */ 5 5 /* 6 6 * ABSTRACT: lib parsing … … 28 28 #define SYSTYP_HPUX10 3 29 29 30 #if 030 #if 1 31 31 # define logx printf 32 32 #else … … 75 75 if( strcmp(n, "SELF") == 0) { 76 76 tok = SELF_CMD; 77 logx("IsCmd: [%d] %s\n", tok, n); 78 return tok; 79 } 80 81 if( strcmp(n, "none") == 0) { 82 tok = NONE; 83 logx("IsCmd: [%d] %s\n", tok, n); 77 84 return tok; 78 85 } … … 225 232 } 226 233 module->revision = (char *)malloc(strlen(libnamebuf)+1); 227 strcpy(module->revision, libnamebuf); 234 memset(module->revision, '\0', strlen(libnamebuf)+1); 235 memcpy(module->revision, libnamebuf, strlen(libnamebuf)); 228 236 } 229 237 … … 257 265 258 266 /*========================================================================*/ 259 /* procdefv Add2proclist(procdefv pi, char *name)*/260 267 void Add2proclist( 261 268 moddefv module, … … 270 277 271 278 memset((void *)&pnew, '\0', sizeof(procdef)); 279 272 280 pnew.procname = (char *)malloc(strlen(name)+1); 273 281 if(pnew.procname==NULL) printf("Error 1\n"); 282 memset(pnew.procname, '\0', strlen(name)+1); 283 memcpy(pnew.procname, name, strlen(name)); 284 274 285 pnew.funcname = (char *)malloc(strlen(name)+1); 286 if(pnew.funcname==NULL) printf("Error 1\n"); 275 287 memset(pnew.funcname, '\0', strlen(name)+1); 276 memset(pnew.procname, '\0', strlen(name)+1); 288 memcpy(pnew.funcname, name, strlen(name)); 289 277 290 pnew.param = NULL; 278 291 (pnew).is_static = 0; 279 292 (pnew).paramcnt = 0; 280 strcpy(pnew.procname, name); 281 strcpy(pnew.funcname, name); 282 293 pnew.c_code = NULL; 294 283 295 pnew.return_val.name = (char *)malloc(strlen(ret_val)+1); 284 296 memset(pnew.return_val.name, '\0', strlen(ret_val)+1); … … 442 454 } 443 455 456 void gen_func_param_check( 457 FILE *fp, 458 procdefv pi, 459 int i 460 ) 461 { 462 fprintf(fp, " if(v==NULL) goto mod_%s_error;\n", pi->funcname); 463 fprintf(fp, " tok = v->Typ();\n"); 464 fprintf(fp, " if((index=iiTestConvert(tok, %s))==0)\n", 465 pi->param[i].typname); 466 fprintf(fp, " goto mod_%s_error;\n", pi->funcname); 467 fprintf(fp, " v_save = v->next;\n"); 468 fprintf(fp, " v->next = NULL;\n"); 469 fprintf(fp, " if(iiConvert(tok, %s, index, v, res%d))\n", 470 pi->param[i].typname, i); 471 fprintf(fp, " goto mod_%s_error;\n", pi->funcname); 472 fprintf(fp, " v = v_save;\n"); 473 } 474 444 475 void generate_function(procdefv pi, FILE *fp) 445 476 { … … 450 481 if(pi->paramcnt>0) { 451 482 if(pi->param[0].typ==SELF_CMD) { 483 if(pi->c_code != NULL) fprintf(fp, "%s\n", pi->c_code); 484 452 485 fprintf(fp, " return(%s(res,h));\n", pi->funcname); 453 486 fprintf(fp, "}\n\n"); 454 487 } 455 488 else { 456 fprintf(fp, " leftv v = h ;\n");489 fprintf(fp, " leftv v = h, v_save;\n"); 457 490 fprintf(fp, " int tok = NONE, index = 0;\n"); 458 491 for (i=0;i<pi->paramcnt; i++) … … 461 494 fprintf(fp, "\n"); 462 495 463 for (i=0;i<pi->paramcnt; i++) { 464 fprintf(fp, " if(v==NULL) goto mod_%s_error;\n", pi->funcname); 465 fprintf(fp, " tok = v->Typ();\n"); 466 fprintf(fp, " printf(\"test %d.1\\n\");\n", i); 467 fprintf(fp, " if((index=iiTestConvert(tok, %s))==0)\n", 468 pi->param[i].typname); 469 logx("==>'%s'\n", pi->param[i].typname); 470 fprintf(fp, " goto mod_%s_error;\n", pi->funcname); 471 fprintf(fp, " printf(\"test %d.2\\n\");\n", i); 472 fprintf(fp, " if(iiConvert(tok, %s, index, v, res%d))\n", 473 pi->param[i].typname, cnt); 474 fprintf(fp, " goto mod_%s_error;\n", pi->funcname); 475 fprintf(fp, " printf(\"test %d.3\\n\");\n", i); 476 fprintf(fp, " v = v->next;\n"); 477 } 496 if(pi->c_code != NULL) fprintf(fp, "%s\n", pi->c_code); 497 498 for (i=0;i<pi->paramcnt; i++) gen_func_param_check(fp, pi, i); 499 478 500 fprintf(fp, " if(v!=NULL) { tok = v->Typ(); goto mod_%s_error; }\n", 479 501 pi->funcname); 480 fprintf(fp, " printf(\"test before return\\n\");\n");481 502 482 503 fprintf(fp, "\n"); … … 513 534 } 514 535 } else { 515 fprintf(fp, " return(%s(res));\n}\n\n", pi->funcname); 536 switch( pi->return_val.typ) { 537 case SELF_CMD: 538 fprintf(fp, " return(%s(res));\n}\n\n", pi->funcname); 539 break; 540 541 case NONE: 542 fprintf(fp, " res->rtyp = %s;\n", pi->return_val.typname); 543 fprintf(fp, " res->data = NULL;\n"); 544 fprintf(fp, " %s();\n", pi->funcname); 545 fprintf(fp, " return FALSE;\n}\n\n"); 546 break; 547 548 default: 549 fprintf(fp, " res->rtyp = %s;\n", pi->return_val.typname); 550 fprintf(fp, " res->data = (void *)%s();\n", pi->funcname); 551 fprintf(fp, " return FALSE;\n}\n\n"); 552 } 553 516 554 } 517 555 … … 613 651 fprintf(fp, "CC\t= gcc\n"); 614 652 fprintf(fp, "CXX\t= gcc\n"); 615 fprintf(fp, "CFLAGS\t= -DNDEBUG - I. -I../include\n");653 fprintf(fp, "CFLAGS\t= -DNDEBUG -DBUILD_MODULE -I. -I../include\n"); 616 654 fprintf(fp, "#LD\t=\n"); 617 655 fprintf(fp, "\n"); -
modules/tools/modgen.h
r740e1f7 r6c8772 1 1 /* 2 * $Id: modgen.h,v 1. 3 1999-03-24 13:04:21krueger Exp $2 * $Id: modgen.h,v 1.4 1999-03-31 22:03:23 krueger Exp $ 3 3 * 4 4 */ … … 37 37 paramdefv param; 38 38 int paramcnt; 39 char *c_code; 39 40 }; 40 41 -
modules/tools/scanner.l
r740e1f7 r6c8772 3 3 * Computer Algebra System SINGULAR * 4 4 ****************************************/ 5 /* $Id: scanner.l,v 1. 3 1999-03-24 13:04:21krueger Exp $ */5 /* $Id: scanner.l,v 1.4 1999-03-31 22:03:23 krueger Exp $ */ 6 6 #include <stdio.h> 7 7 #include <string.h> … … 20 20 #include <tok.h> 21 21 22 #define DEBUG 0 23 24 # define YYLP_ERR_NONE 0 25 # define YYLP_DEF_BR2 1 26 # define YYLP_BODY_BR2 2 27 # define YYLP_BODY_BR3 3 28 # define YYLP_BODY_TMBR2 4 29 # define YYLP_BODY_TMBR3 5 30 # define YYLP_EX_BR2 6 31 # define YYLP_EX_BR3 7 32 # define YYLP_BAD_CHAR 8 33 # define YYLP_MISSQUOT 9 34 # define YYLP_MISS_BR1 10 35 # define YYLP_MISS_BR2 11 36 # define YYLP_MISS_BR3 12 37 22 38 const char sNoName[]="_"; 23 char my_yylinebuf[80]; 24 int old_state = 0; 39 int brace1 = 0; /* { } */ 40 int brace2 = 0; /* ( ) */ 41 int brace3 = 0; /* [ ] */ 42 int quote = 0; /* " */ 43 int offset = 0; 44 45 char my_yylinebuf[80]; 46 int *old_states = NULL; 47 int state_level = -1; 48 int state_max = 0; 25 49 int yylineno = 1; 26 50 int tok; … … 28 52 int traceit = 0; 29 53 moddef module_def; 54 int yylplineno = 1; 55 int yylp_errno = 0; 56 57 long C_start; 58 long C_end; 59 char c_codetype = 0; 60 #define C_CODE_NONE 0 61 #define C_CODE_PROC 1 62 #define C_CODE_MAIN 2 63 64 char string_type = 0; 65 #define STRING_NONE 0 66 #define STRING_INFO 1 67 #define STRING_VERS 2 68 long string_start = 0; 69 long string_end = 0; 70 71 char *yylp_buffer_start; 72 73 int libread(FILE* f, char* buf, int max_size); 74 int current_pos(int i); 75 int read_string(char **buffer, long *start, long end); 76 77 void push_state(int state, int new_state); 78 void pop_state(); 79 80 # undef YY_INPUT 81 # define YY_INPUT(buf,result,max_size) \ 82 if ( ((result = libread( (yyin), (char *) buf, max_size )) < 0 ) \ 83 && ferror( yyin ) ) \ 84 YY_FATAL_ERROR( "read in flex scanner failed" ); 85 30 86 31 87 extern "C" … … 52 108 tos ({taborspace}*) 53 109 eq (=|{tos}+=|=+{tos}|{tos}+=+{tos}) 110 tnl ([ \t\n]*) 111 col (;|{tos}+;) 112 eqnl ([ \t\n]*+=[ \t\n]*) 54 113 55 114 /* %start START */ … … 57 116 %x pdef 58 117 %x comment 118 %x procdef 119 %x ctext 120 %x string 121 %x cstring 59 122 60 123 %% 61 124 (\/\/[^\n]*)|(^#![^\n]*)|([ \t]) { } 62 \/\/* { old_state = YYSTATE; BEGIN(comment); }63 64 (module+{eq }+\"+{name}\") {125 \/\/* { push_state(YYSTATE, comment); } 126 127 (module+{eqnl}+{quote}+{name}+{quote}) { 65 128 char *buff = (char *)malloc(yyleng+4); 129 memset(buff, '\0', yyleng+4); 66 130 sscanf( yytext, "%*[^\"]\"%[^\"]\"", buff); 67 131 module_def.name = (char *)malloc(strlen(buff)+1); 68 strcpy(module_def.name, buff); 132 memset(module_def.name, '\0', strlen(buff)+1); 133 memcpy(module_def.name, buff, strlen(buff)); 69 134 strcat(buff, ".cc"); 70 Add2files(&module_def, buff);135 Add2files(&module_def, buff); 71 136 free(buff); 72 137 } 73 138 74 (version+{eq}+\"+{strings}\") { 75 char *buff = (char *)malloc(yyleng); 76 sscanf( yytext, "%*[^\"]\"%[^\"]\"", buff); 77 module_def.version = (char *)malloc(strlen(buff)+1); 78 strcpy(module_def.version, buff); 79 make_version(module_def.version, &module_def); 80 free(buff); 81 } 82 83 (helpfile+{eq}+\"+{fname}\") { 84 char *buff = (char *)malloc(yyleng); 139 (version+{eqnl}+{quote}+{strings}+{quote}) { 140 yyless(4); 141 string_type = STRING_VERS; 142 push_state(YYSTATE, cstring); 143 } 144 145 (helpfile+{eqnl}+{quote}+{fname}+{quote}) { 146 char *buff = (char *)malloc(yyleng+1); 147 memset(buff, '\0', yyleng+1); 85 148 sscanf( yytext, "%*[^\"]\"%[^\"]\"", buff); 86 149 module_def.helpfile = (char *)malloc(strlen(buff)+1); 87 strcpy(module_def.helpfile, buff); 150 memset(module_def.helpfile, '\0', strlen(buff)+1); 151 memcpy(module_def.helpfile, buff, strlen(buff)); 152 printf("==>HELP:'%s'\n", module_def.helpfile); 88 153 free(buff); 89 154 } 90 155 91 (cxxsource+{eq}+{fname}) { 92 char *buff = (char *)malloc(yyleng); 156 (cxxsource+{eqnl}+{fname}) { 157 char *buff = (char *)malloc(yyleng+1); 158 memset(buff, '\0', yyleng+1); 93 159 sscanf( yytext, "%*[^=]=%s", buff); 94 160 Add2files(&module_def,buff); … … 96 162 } 97 163 98 (info+{eq}+\"+{strings}\") { 99 char *buff = (char *)malloc(yyleng); 100 sscanf( yytext, "%*[^\"]\"%[^\"]\"", buff); 101 module_def.info = (char *)malloc(strlen(buff)+1); 102 strcpy(module_def.info, buff); 103 free(buff); 104 } 105 164 (info+{eqnl}+{quote}+{strings}+{quote}) { 165 yyless(4); 166 string_type = STRING_INFO; 167 push_state(YYSTATE, cstring); 168 } 169 170 <cstring>{quote} { quote++; push_state(YYSTATE, string); 171 string_start = current_pos(yyleng); } 172 <cstring>\n { yylplineno++; } 173 <cstring>{col} { 174 switch(string_type) { 175 case STRING_INFO: 176 read_string(&module_def.info, &string_start, string_end); 177 break; 178 179 case STRING_VERS: 180 read_string(&module_def.version, &string_start, string_end); 181 make_version(module_def.version, &module_def); 182 break; 183 } 184 string_type = STRING_NONE; 185 pop_state(); } 186 <cstring>. { } 187 188 189 190 (proc+{tos}+{name})|({tos}+proc+{tos}+{name}) { 191 char *proc = (char *)malloc(yyleng+1); 192 memset(proc, '\0', yyleng+1); 193 push_state(YYSTATE, pdef); 194 sscanf( yytext, "%*[^p]proc %s", proc); 195 if(strlen(proc)<1) sscanf( yytext, "proc %s", proc); 196 Add2proclist(&module_def, proc, "none", "NONE", NONE); 197 free(proc); 198 } 106 199 107 200 (proc+{tos}+{name}+{tos}+{name})|({tos}+proc+{tos}+{name}+{tos}+{name}) { 108 char proc[256], ret_val[256], n2[32]; 201 char *proc = (char *)malloc(yyleng+1); 202 char *ret_val = (char *)malloc(yyleng+1); 203 memset(proc, '\0', yyleng+1); 204 memset(ret_val, '\0', yyleng+1); 205 206 char n2[32]; 109 207 int cmd; 110 memset(proc, '\0', 256);111 memset(ret_val, '\0', 256);112 208 memset(n2, '\0', 32); 113 old_state = YYSTATE; 114 BEGIN(pdef); 209 push_state(YYSTATE, pdef); 115 210 sscanf( yytext, "%*[^p]proc %s %s", ret_val, proc); 116 211 if(strlen(proc)<1) sscanf( yytext, "proc %s %s", ret_val, proc); … … 121 216 Add2proclist(&module_def, proc, ret_val, 122 217 decl2str(tok,n2), tok); 123 else printf("proc '%s': Invalid return parameter %s.\n", 124 module_def.procs[module_def.proccnt-1].procname, 125 ret_val); 126 } 127 128 (proc+{tos}+{name})|({tos}+proc+{tos}+{name}) { 129 char proc[256]; 130 old_state = YYSTATE; 131 BEGIN(pdef); 132 proc[0]='\0'; 133 sscanf( yytext, "%*[^p]proc %s", proc); 134 if(strlen(proc)<1) sscanf( yytext, "proc %s", proc); 135 Add2proclist(&module_def, proc, "none", "NONE", 0); 218 else { 219 printf("proc '%s': Invalid return parameter %s.\n", 220 proc, ret_val); 221 Add2proclist(&module_def, proc, "none", 222 "NONE", NONE); 223 } 224 free(proc); 225 free(ret_val); 136 226 } 137 227 138 228 <pdef>[ \t] { } 139 <pdef>\( { 140 } 229 <pdef>"(" { } 141 230 <pdef>{name}+, { 142 231 char param[256], n2[32]; … … 152 241 param); 153 242 } 154 <pdef>{name}+\)+{eq}+{name} { 243 <pdef>{name}+")"+{tnl}+"{" { 244 char param[256], n2[32]; 245 int cmd; 246 BEGIN(procdef); 247 memset(param, '\0', 256); 248 memset(n2, '\0', 32); 249 sscanf( yytext, "%[^)])", param); 250 cmd = IsCmd(param, tok); 251 if(cmd!=0)AddParam(&module_def, 252 param, decl2str(tok,n2), tok); 253 else printf("proc '%s': Invalid parameter %s.\n", 254 module_def.procs[module_def.proccnt-1].procname, 255 param); 256 } 257 <pdef>")"+{tnl}+"{" { 258 BEGIN(procdef); 259 } 260 261 <pdef>"{" { 262 BEGIN(procdef); 263 } 264 265 <pdef>(")"+{eqnl}+{name})|({eq}+{name}) { 266 char funcname[256]; 267 pop_state(); 268 sscanf( yytext, "%*[^=]=%s", funcname); 269 if(strlen(funcname)<=0) 270 sscanf( yytext, "=%s", funcname); 271 free(module_def.procs[module_def.proccnt-1].funcname); 272 module_def.procs[module_def.proccnt-1].funcname = 273 (char *)malloc(strlen(funcname)+1); 274 memset(module_def.procs[module_def.proccnt-1].funcname, 275 '\0', strlen(funcname)+1); 276 memcpy(module_def.procs[module_def.proccnt-1].funcname, 277 funcname, strlen(funcname)); 278 } 279 280 <pdef>({name}+")"+{eqnl}+{name}) { 155 281 char param[256], n2[32],funcname[256]; 156 282 int cmd; 157 BEGIN(old_state);283 pop_state(); 158 284 memset(param, '\0', 256); 159 285 memset(n2, '\0', 32); … … 175 301 module_def.procs[module_def.proccnt-1].procname, param); 176 302 } 177 <pdef>\)+{eq}+{name}|{eq}+{tos}+{name} {178 char funcname[256];179 BEGIN(old_state);180 sscanf( yytext, "%*[^=]=%s", funcname);181 if(strlen(funcname)<=0)182 sscanf( yytext, "=%s", funcname);183 free(module_def.procs[module_def.proccnt-1].funcname);184 module_def.procs[module_def.proccnt-1].funcname =185 (char *)malloc(strlen(funcname)+1);186 memset(module_def.procs[module_def.proccnt-1].funcname,187 '\0', strlen(funcname)+1);188 memcpy(module_def.procs[module_def.proccnt-1].funcname,189 funcname, strlen(funcname));190 }191 303 192 304 <pdef>. { } 193 305 194 <comment>\*\/ { BEGIN(old_state); } 306 <procdef>"}" { pop_state(); } 307 <procdef>RETURN+{eqnl}+{name}+{col} { 308 printf("Return:\n");} 309 <procdef>function+{eqnl}+{name}+{col} { 310 char *funcname = (char *)malloc(yyleng+1); 311 memset(funcname, '\0', yyleng+1); 312 sscanf( yytext, "%*[^=]=%[^;];", funcname); 313 if(strlen(funcname)<=0) 314 sscanf( yytext, "=%[^;];", funcname); 315 free(module_def.procs[module_def.proccnt-1].funcname); 316 module_def.procs[module_def.proccnt-1].funcname = 317 (char *)malloc(strlen(funcname)+ 1); 318 memset(module_def.procs[module_def.proccnt-1].funcname, 319 '\0', strlen(funcname)+1); 320 memcpy(module_def.procs[module_def.proccnt-1].funcname, 321 funcname, strlen(funcname)); 322 } 323 324 <procdef>checkring+{col} { 325 printf("Do checkring\n"); } 326 <procdef>C+{eqnl}+"{" { 327 push_state(YYSTATE, ctext); 328 C_start=current_pos(yyleng); 329 yyless(yyleng-1); 330 c_codetype = C_CODE_PROC; 331 } 332 <procdef>. { printf("%s", yytext); } 333 334 <comment>\*\/ { pop_state(); } 195 335 <comment>\n { yylineno++; } 196 336 <comment>. { } 197 337 198 199 \n { yylineno++; } 200 \r { } 201 . { } 338 <ctext>({comment}[^\n]*) { } 339 <ctext>\/\/* { push_state(YYSTATE, comment); } 340 <ctext>{quote} { quote++; push_state(YYSTATE, string); } 341 <ctext>"{" { brace1++; } 342 <ctext>"}" { 343 brace1--; 344 if(brace2>0) { 345 yylp_errno = YYLP_BODY_BR2; 346 return(1); 347 } 348 if(brace3>0) { 349 yylp_errno = YYLP_BODY_BR3; 350 return(1); 351 } 352 if(brace1<=0) { 353 C_end = current_pos(yyleng)-1; 354 printf("Ctext: %d-%d\n", C_start, C_end); 355 switch(c_codetype) { 356 case C_CODE_PROC: 357 read_string(&(module_def.procs[module_def.proccnt-1].c_code), 358 &C_start, C_end); 359 break; 360 361 case C_CODE_MAIN: 362 break; 363 } 364 c_codetype = C_CODE_NONE; 365 pop_state(); 366 } 367 } 368 <ctext>"(" { brace2++; } 369 <ctext>")" { brace2--; 370 if(brace2<0) { 371 yylp_errno = YYLP_BODY_TMBR2; 372 return(1); 373 } 374 } 375 <ctext>"[" { brace3++; } 376 <ctext>"]" { brace3--; 377 if(brace3<0) { 378 yylp_errno = YYLP_BODY_TMBR3; 379 return(1); 380 } 381 } 382 <ctext>\n { yylineno++; } 383 <ctext>. { } 384 385 <string>{quote} { quote--; string_end = current_pos(yyleng)-1; pop_state(); } 386 <string>(\\\\)|(\\\") { } 387 <string>\n { yylplineno++; } 388 <string>. { } 389 390 391 C+{eqnl}+"{" { push_state(YYSTATE, ctext); 392 C_start=current_pos(yyleng); 393 yyless(yyleng-1); 394 } 395 \n { yylineno++; } 396 \r { } 397 . { } 202 398 203 399 %% … … 208 404 return 1; 209 405 } 406 } 407 408 int libread(FILE* f, char* buf, int max_size) 409 { int rc; 410 411 offset = ftell(f); 412 rc = fread( buf, 1, max_size, f ); 413 #if YYLPDEBUG >2 414 printf("fread: %d of %d\n", rc, max_size); 415 #endif 416 yylp_buffer_start = buf; 417 return rc; 418 } 419 420 int current_pos(int i) 421 { 422 return(i+offset+(int)(yytext-yylp_buffer_start)); 423 } 424 425 int read_string(char **p, long *start, long end) 426 { 427 char *buffer; 428 429 if(*start > 0 ) { 430 long len = end - *start; 431 if(len>=0) { 432 long cur = ftell(yyin); 433 buffer = (char *)malloc(len+1); 434 memset(buffer, '\0', len+1); 435 fseek(yyin, *start, SEEK_SET); 436 fread(buffer, 1, len, yyin); 437 fseek(yyin, cur, SEEK_SET); 438 *p = buffer; 439 } 440 *start = 0; 441 } 442 } 443 444 void push_state(int state, int new_state) 445 { 446 state_level++; 447 #if DEBUG 448 printf("====>PUSH to new state %d/%d l=%d\n", state, new_state, state_level); 449 #endif 450 if(state_level>=state_max) { 451 state_max++; 452 if(old_states == NULL) 453 old_states = (int *)malloc(sizeof(int)); 454 else { 455 old_states = (int *)realloc(old_states, state_max*sizeof(int)); 456 } 457 } 458 old_states[state_level] = state; 459 BEGIN(new_state); 460 } 461 462 void pop_state() 463 { 464 #if DEBUG 465 printf("====>Back to old state %d, l=%d\n", old_states[state_level], 466 state_level); 467 #endif 468 BEGIN(old_states[state_level]); 469 state_level--; 470 if(state_level<0) state_level = -1; 210 471 } 211 472 -
modules/tools/typmap.h
r740e1f7 r6c8772 9 9 void init_type_conv() 10 10 { 11 strcpy(type_conv[NONE], "none"); 12 strcpy(type_conv[NONE], "void"); 11 13 strcpy(type_conv[INT_CMD], "int"); 12 14 strcpy(type_conv[RING_CMD], "ring");
Note: See TracChangeset
for help on using the changeset viewer.