Changeset 6a51ef in git
- Timestamp:
- Mar 6, 1998, 12:50:38 PM (26 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 4746528ffa8e871bd9c3aa620c4ab7f24f71117d
- Parents:
- 33d539f008d9a3378ddd72d9aee94ad96fd8adcd
- Location:
- Singular
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/Makefile.in
r33d539 r6a51ef 96 96 mpsr_Put.cc mpsr_PutPoly.cc mpsr_Tok.cc mpsr_GetPoly.cc \ 97 97 mpsr_Get.cc mpsr_GetMisc.cc mpsr_Error.cc \ 98 ndbm.cc spSpolyLoop.cc 98 ndbm.cc spSpolyLoop.cc libparse.cc 99 99 100 100 CSOURCES=mmalloc.c mmallocb.c mmallocs.c mmblock.c mmheap.c mmspec.c mmutil.c weight0.c 101 101 102 SOURCES=${CSOURCES} ${CXXSOURCES} grammar.y scanner.l 102 SOURCES=${CSOURCES} ${CXXSOURCES} grammar.y scanner.l libparse.l 103 103 104 104 HEADERS=algmap.h hutil.h lists.h stairc.h attrib.h ideals.h \ … … 142 142 algmap.o clapconv.o clapmem.o clapsing.o claptmpl.o\ 143 143 mpsr_Error.o mpsr_Put.o mpsr_PutPoly.o mpsr_GetPoly.o \ 144 mpsr_Get.o mpsr_GetMisc.o ndbm.o spSpolyLoop.o 144 mpsr_Get.o mpsr_GetMisc.o ndbm.o spSpolyLoop.o libparse.o 145 145 146 146 ## … … 165 165 166 166 Singular: mod2.h Makefile version.h scanner.cc ${OBJS} iparith.o \ 167 mpsr_Tok.o tesths.cc167 mpsr_Tok.o tesths.cc libparse.cc 168 168 ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${DEFS} -o Singular \ 169 169 tesths.cc iparith.o mpsr_Tok.o ${OBJS} ${LDFLAGS} ${LIBS} … … 174 174 tesths.cc iparith.o mpsr_Tok.o \ 175 175 ${OBJS} ${STATIC_LDFLAGS} ${LDFLAGS} ${LIBS} 176 177 libparse: libparse_main.o utils.o 178 ${CXX} -o libparse libparse_main.o utils.o 179 180 libparse_main.o: libparse.cc 181 ${CXX} -c -o libparse_main.o libparse.cc -DSTANDALONE_PARSER 176 182 177 183 iparith.o mpsr_Tok.o : iparith.inc mpsr_Tok.inc … … 198 204 fi 199 205 206 libparse.cc: libparse.l 207 ${LEX} -I -Pyylp -olibparse.cc libparse.l 208 200 209 version.h: ${SOURCES} ${HEADERS} Makefile.in mod2.h.in configure.in 201 210 echo "#define SINGULAR_VERSION_ID " `date '+%y%m%d%H'` >version.h … … 365 374 mpsr_Error.og mpsr_Put.og mpsr_PutPoly.og mpsr_GetPoly.og \ 366 375 mpsr_Get.og mpsr_GetMisc.og \ 367 ndbm.og spSpolyLoop.og 376 ndbm.og spSpolyLoop.og libparse.og 368 377 369 378 OBJG2= mmalloc.og mmallocb.og mmallocs.og mmblock.og mmheap.og \ … … 429 438 mpsr_Error.op mpsr_Put.op mpsr_PutPoly.op mpsr_GetPoly.op \ 430 439 mpsr_Get.op mpsr_GetMisc.op \ 431 ndbm.op spSpolyLoop.op 440 ndbm.op spSpolyLoop.op libparse.op 432 441 433 442 OBJP2= mmalloc.op mmallocb.op mmallocs.op mmblock.op mmheap.op \ -
Singular/iplib.cc
r33d539 r6a51ef 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: iplib.cc,v 1.1 0 1998-02-27 14:06:18 Singular Exp $ */4 /* $Id: iplib.cc,v 1.11 1998-03-06 11:50:37 krueger Exp $ */ 5 5 /* 6 6 * ABSTRACT: interpreter: LIB and help … … 22 22 #include "lists.h" 23 23 24 procinfo *iiInitSingularProcinfo(procinfo *pi, char *libname, 25 char *procname, int line, long pos);24 procinfo *iiInitSingularProcinfo(procinfo *pi, char *libname, char *procname, 25 int line, long pos, BOOLEAN pstatic=FALSE); 26 26 char *iiConvName(char *p); 27 #ifdef HAVE_LIBPARSER 28 int yylplex(char *libname, char *libfile); 29 void yylprestart (FILE *input_file ); 30 int current_pos(int i=0); 31 extern int yylp_errno; 32 extern int yylplineno; 33 extern char *yylp_errlist[]; 34 void print_init(); 35 void reinit_yylp(); 36 libstackv library_stack; 37 #endif 27 38 28 39 /*2 … … 136 147 if(part==1) 137 148 { // load proc part 138 fgets(buf, sizeof(buf), fp); 149 procbuflen = pi->data.s.def_end - pi->data.s.proc_start; 150 //fgets(buf, sizeof(buf), fp); 151 fread( buf, procbuflen, 1, fp); 139 152 char ct; 140 153 char *e; … … 474 487 } 475 488 489 #ifdef HAVE_LIBPARSER 490 extern FILE *yylpin; 491 libstackv ls_start = library_stack; 492 493 yylpin = fp; 494 # if YYLPDEBUG > 1 495 print_init(); 496 # endif 497 yylplex(newlib, libnamebuf); 498 if(yylp_errno) { 499 Werror("Library %s: ERROR occured: in line %d, %d.", newlib, yylplineno, 500 current_pos(0)); 501 Werror(yylp_errlist[yylp_errno], yylplineno); 502 Werror("Cannot load library,... aborting."); 503 reinit_yylp(); 504 fclose( yylpin ); 505 FreeL((ADDRESS)newlib); 506 return TRUE; 507 } 508 reinit_yylp(); 509 fclose( yylpin ); 510 { 511 libstackv ls; 512 for(ls = library_stack; (ls != NULL) && (ls != ls_start); ) { 513 if(ls->to_be_done) { 514 //Print("// Processing id %d LIB:%s\n", ls->cnt, ls->get()); 515 ls->to_be_done=FALSE; 516 iiLibCmd(ls->get()); 517 ls = ls->pop(newlib); 518 //Print("Done\n"); 519 } 520 } 521 #if 0 522 Print("--------------------\n"); 523 for(ls = library_stack; ls != NULL; ls = ls->next) { 524 Print("%s: LIB-stack:(%d), %s %s\n", newlib, ls->cnt, ls->get(), 525 ls->to_be_done ? "not loaded" : "loaded"); 526 } 527 Print("--------------------\n"); 528 #endif 529 } 530 #else /* HAVE_LIBPARSER */ 476 531 // processing head section 477 532 if (fgets( buf, sizeof(buf), fp)) … … 499 554 } 500 555 } 501 502 556 503 557 #define IN_HEADER 1 … … 609 663 } while (fgets( buf, sizeof(buf), fp)); 610 664 fclose( fp ); 665 611 666 //if (h!=NULL) IDPROC(h) = pi; 612 667 if (BVERBOSE(V_DEBUG_LIB)) … … 619 674 Warn("LIB `%s` has no version flag",newlib); 620 675 } 676 #endif /* HAVE_LIBPARSER */ 621 677 FreeL((ADDRESS)newlib); 622 678 return FALSE; 623 679 } 624 680 625 procinfo *iiInitSingularProcinfo(procinfov pi, char *libname, 626 char *procname, int line, long pos)681 procinfo *iiInitSingularProcinfo(procinfov pi, char *libname, char *procname, 682 int line, long pos, BOOLEAN pstatic=FALSE) 627 683 { 628 684 pi->libname = mstrdup(libname); … … 636 692 pi->language = LANG_SINGULAR; 637 693 pi->ref = 1; 694 pi->is_static = pstatic; 638 695 pi->data.s.proc_start = pos; 639 696 pi->data.s.help_start = 0L; … … 708 765 return(buf); 709 766 } 767 /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 768 #ifdef HAVE_LIBPARSER 769 void libstack::push(char *p, char *libname) 770 { 771 idhdl hl = idroot->get("LIB",0); 772 libstackv lp; 773 char *f = NULL; 774 if(hl!=NULL) f = strstr(IDSTRING(hl),libname); 775 if( (hl==NULL) || (f == NULL)) { 776 for(lp = this;lp!=NULL;lp=lp->next) { 777 if(strcmp(lp->get(), libname)==0) break; 778 } 779 if(lp==NULL) { 780 libstackv ls = (libstack *)Alloc0(sizeof(libstack)); 781 ls->next = this; 782 ls->libname = mstrdup(libname); 783 ls->to_be_done = TRUE; 784 if(this != NULL) ls->cnt = this->cnt+1; else ls->cnt = 0; 785 library_stack = ls; 786 } 787 } 788 } 789 790 libstackv libstack::pop(char *p) 791 { 792 libstackv ls = this; 793 //FreeL(ls->libname); 794 library_stack = ls->next; 795 Free((ADDRESS)ls, sizeof(libstack)); 796 return(library_stack); 797 } 798 799 #endif /* HAVE_LIBPARSER */ 800 /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ -
Singular/mod2.h.in
r33d539 r6a51ef 117 117 #define INIT_BUG 118 118 119 /* Define to use new namespaces techniks */ 120 #undef HAVE_NAMESPACES 121 122 /* Define to use scanner when loading libraries */ 123 #define HAVE_LIBPARSER 124 119 125 /*#define PROFILING*/ 120 126 #ifdef PROFILING … … 188 194 /* define YYDEBUG 1 for debugging bison texts, 0 otherwise */ 189 195 #define YYDEBUG 0 196 197 #ifndef HAVE_LIBPARSER 198 # undef YYLPDEBUG 199 #else 200 # define YYLPDEBUG 0 201 #endif 190 202 191 203 #ifndef FALSE -
Singular/structs.h
r33d539 r6a51ef 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: structs.h,v 1. 8 1998-02-27 14:06:26 Singular Exp $ */6 /* $Id: structs.h,v 1.9 1998-03-06 11:50:38 krueger Exp $ */ 7 7 /* 8 8 * ABSTRACT … … 156 156 #endif 157 157 158 #ifdef HAVE_LIBPARSER 159 #ifdef __cplusplus 160 class libstack; 161 typedef libstack * libstackv; 162 #endif 163 #endif /* HAVE_LIBPARSER */ 164 158 165 #endif 159 166 -
Singular/subexpr.h
r33d539 r6a51ef 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: subexpr.h,v 1. 4 1998-01-16 14:29:58 krueger Exp $ */6 /* $Id: subexpr.h,v 1.5 1998-03-06 11:50:38 krueger Exp $ */ 7 7 /* 8 8 * ABSTRACT: handling of leftv … … 92 92 public: 93 93 long proc_start; // position where proc is starting 94 long def_end; // position where proc header is ending 94 95 long help_start; // position where help is starting 95 96 long body_start; // position where proc-body is starting … … 129 130 language_defs language; 130 131 short ref; 132 char is_static; // if set, proc not accessible for user 131 133 procinfodata data; 132 134 }; … … 140 142 char *piProcinfo(procinfov pi, char *request); 141 143 void piShowProcinfo(procinfov pi, char *txt); 144 #ifdef HAVE_LIBPARSER 145 class libstack 146 { 147 public: 148 libstackv next; 149 char *libname; 150 BOOLEAN to_be_done; 151 int cnt; 152 void push(char *p, char * libname); 153 libstackv pop(char *p); 154 inline char *get() { return(libname); } 155 }; 156 #endif /* HAVE_LIBPARSER */ 142 157 #endif
Note: See TracChangeset
for help on using the changeset viewer.