Changeset 6be769 in git
- Timestamp:
- May 9, 1998, 4:34:33 PM (25 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 7cdf52894508b5af568db20ad09389a32ccca531
- Parents:
- 4d6a4d8ac279c490518dc0c8d688532d047ca93a
- Location:
- Singular
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/iplib.cc
r4d6a4d r6be769 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: iplib.cc,v 1.2 3 1998-05-05 13:46:37krueger Exp $ */4 /* $Id: iplib.cc,v 1.24 1998-05-09 14:34:29 krueger Exp $ */ 5 5 /* 6 6 * ABSTRACT: interpreter: LIB and help … … 140 140 if(part==0) 141 141 { // load help string 142 procbuflen = pi->data.s.body_start - pi->data.s.proc_start; 142 long head = pi->data.s.def_end - pi->data.s.proc_start; 143 procbuflen = pi->data.s.help_end - pi->data.s.help_start; 143 144 //Print("Help=%ld-%ld=%d\n", pi->data.s.body_start, 144 145 // pi->data.s.proc_start, procbuflen); 145 s = (char *)AllocL(procbuflen); 146 myfread(s, procbuflen, 1, fp); 147 s[procbuflen] = '\0'; 146 s = (char *)AllocL(procbuflen+head+2); 147 myfread(s, head, 1, fp); 148 s[head] = '\n'; 149 fseek(fp, pi->data.s.help_start, SEEK_SET); 150 myfread(s+head+1, procbuflen, 1, fp); 151 s[procbuflen+head+1] = '\n'; 152 s[procbuflen+head+2] = '\0'; 148 153 return(s); 149 154 } … … 718 723 pi->data.s.proc_start = pos; 719 724 pi->data.s.help_start = 0L; 725 pi->data.s.help_end = 0L; 720 726 pi->data.s.body_start = 0L; 721 727 pi->data.s.body_end = 0L; -
Singular/libparse.l
r4d6a4d r6be769 3 3 * Computer Algebra System SINGULAR * 4 4 ****************************************/ 5 /* $Id: libparse.l,v 1.2 0 1998-05-07 08:20:32krueger Exp $ */5 /* $Id: libparse.l,v 1.21 1998-05-09 14:34:31 krueger Exp $ */ 6 6 #include <stdio.h> 7 7 #include <string.h> … … 133 133 if ( mode == LOAD_LIB) pi->data.s.def_end = p; 134 134 # define SET_HELP_START(mode, pi, p) \ 135 if ( mode == LOAD_LIB) pi->data.s.help_start = p; \ 135 if ( mode == LOAD_LIB) pi->data.s.help_start = p; 136 137 # define SET_HELP_END(mode, pi, p) \ 138 if ( mode == LOAD_LIB) pi->data.s.help_end = p; 136 139 137 140 # define SET_BODY_START(mode, pi, l, p) \ … … 289 292 printf("// PROCEDURE '%s' status: %s, ", proc, 290 293 p_static ? "local" : "global"); 291 printf("starting at line %d,%d: (%d).\n",292 yylplineno, current_pos(0), brace1);294 printf("starting at line %d,%d: definition end: %d (%d).\n", 295 yylplineno, current_pos(0), pi->data.s.def_end, brace1); 293 296 } 294 297 #endif … … 491 494 <poldhelp>{escbrack} { } 492 495 <poldhelp>"{" { 496 SET_HELP_END(mode, pi, current_pos(0)); 493 497 brace1++; BEGIN(pbody); 494 if(lpverbose) 498 if(lpverbose) { 499 printf("// HELP from %d to %d\n", 500 pi->data.s.help_start, pi->data.s.help_end); 495 501 printf("// BODY at line %d,%d (%d)\n", yylplineno, 496 502 current_pos(0), brace1); 503 } 497 504 #if YYLPDEBUG > 1 498 505 printf("BEGIN(pbody){=%d, (=%d, [=%d\n", brace1, brace2, brace3); … … 514 521 <phelp>"{" { 515 522 brace1++; BEGIN(pbody); 516 if(lpverbose) 523 if(lpverbose) { 524 printf("// HELP from %d to %d\n", 525 pi->data.s.help_start, pi->data.s.help_end); 517 526 printf("// BODY at line %d,%d (%d)\n", yylplineno, 518 527 current_pos(0), brace1); 528 } 519 529 #if YYLPDEBUG > 1 520 530 printf("BEGIN(pbody){=%d, (=%d, [=%d\n", brace1, brace2, brace3); … … 596 606 copy_string(mode); 597 607 last_cmd = LP_NONE; 608 if(old_state==phelp) 609 SET_HELP_END(mode, pi, current_pos(0)); 598 610 BEGIN(old_state); /* printf("%s", yytext); */ 599 611 } … … 759 771 lib_style_types lib_style; 760 772 main_init(argc, argv); 773 if(yyin == NULL) { 774 printf("No library found to parse.\n"); 775 exit(1); 776 } 777 761 778 if(lpverbose)printf("Verbose level=%d\n", lpverbose); 762 779 if(check)printf("Reporting most possible annomalies.\n"); -
Singular/subexpr.h
r4d6a4d r6be769 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: subexpr.h,v 1. 5 1998-03-06 11:50:38krueger Exp $ */6 /* $Id: subexpr.h,v 1.6 1998-05-09 14:34:32 krueger Exp $ */ 7 7 /* 8 8 * ABSTRACT: handling of leftv … … 94 94 long def_end; // position where proc header is ending 95 95 long help_start; // position where help is starting 96 long help_end; // position where help is starting 96 97 long body_start; // position where proc-body is starting 97 98 long body_end; // position where proc-body is ending -
Singular/utils.cc
r4d6a4d r6be769 17 17 18 18 while((c=getopt(argc, argv, "d:sf:"))>=0) { 19 20 19 switch(c) 21 20 { 22 21 case 'd': 23 22 lpverbose = 1; 24 sscanf(optarg, "%d", &lpverbose); 23 if(isdigit(argv[optind-1][0])) sscanf(optarg, "%d", &lpverbose); 24 else optind--; 25 25 break; 26 26 case 'f': file = argv[optind-1]; 27 // printf("opening:%d %s\n", optind, file);28 27 break; 29 28 case 's': … … 32 31 case -1 : printf("no such option:%s\n", argv[optind]); 33 32 break; 34 default: printf("no such option.%x, % s\n", c&0xff, argv[optind]);33 default: printf("no such option.%x, %c %s\n", c&0xff, c, argv[optind]); 35 34 } 36 35 } 37 38 if(file!=NULL) 36 if(file!=NULL) { 39 37 yylpin = fopen( file, "rb" ); 40 else 41 yylpin = stdin; 38 printf("Checking library '%s'\n", file); 39 } else { 40 while(argc>optind && yylpin==NULL) { 41 yylpin = fopen( argv[optind], "rb" ); 42 if(yylpin!=NULL) printf("Checking library '%s'\n", argv[optind]); 43 else optind++; 44 } 45 } 42 46 } 43 47 … … 101 105 pi->data.s.body_end = pi->data.s.proc_end; 102 106 107 if(lpverbose) printf("// "); 103 108 printf( "%c %-15s %20s ", pi->is_static ? 'l' : 'g', pi->libname, 104 109 pi->procname); -
Singular/utils.h
r4d6a4d r6be769 21 21 long def_end; // position where proc header is ending 22 22 long help_start; // position where help is starting 23 long help_end; // position where help is starting 23 24 long body_start; // position where proc-body is starting 24 25 long body_end; // position where proc-body is ending
Note: See TracChangeset
for help on using the changeset viewer.