Changeset f17cd1 in git for modules/modgen


Ignore:
Timestamp:
Jun 18, 2002, 5:09:16 PM (22 years ago)
Author:
Anne Frühbis-Krüger <anne@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'd08f5f0bb3329b8ca19f23b74cb1473686415c3a')
Children:
8d0ebb05ab67ecb2a04fea0b9f2de8d43a9a0aac
Parents:
d36ac2f0dc68d5175d2da41e14b758395a5e14a6
Message:
*anne: preliminary changes - necessary for HAVE_NS instead of NAMESPACES
       still need a lot of cleaning-up
       (just to fix the a first stage which works)


git-svn-id: file:///usr/local/Singular/svn/trunk@6160 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
modules/modgen
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • modules/modgen/creat_top.cc

    rd36ac2 rf17cd1  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: creat_top.cc,v 1.13 2001-05-23 20:14:20 anne Exp $ */
     4/* $Id: creat_top.cc,v 1.14 2002-06-18 15:09:15 anne Exp $ */
    55/*
    66* ABSTRACT: lib parsing
     
    5151  fprintf(fp, "  idhdl h;\n");
    5252  fprintf(fp, "\n");
    53   fprintf(fp, "  h=enterid(omStrDup(name),0, t, &IDROOT, TRUE/*FALSE*/);\n");
     53  fprintf(fp, "  h=enterid(omStrDup(name),0, t, &(basePack->idroot), TRUE/*FALSE*/);\n");
    5454  fprintf(fp, "  if(h!=NULL) {\n");
    5555  fprintf(fp, "     switch(t) {\n");
    56   fprintf(fp, "         case STRING_CMD: IDSTRING(h) = omStrDup(value);break;\n");
     56  fprintf(fp, "         case STRING_CMD: \n");
     57  fprintf(fp, "              omFree(IDSTRING(h));\n");
     58  fprintf(fp, "              IDSTRING(h) = omStrDup(value);\n");
     59  fprintf(fp, "              break;\n");
    5760  fprintf(fp, "         case PACKAGE_CMD: break;\n");
    5861  fprintf(fp, "         case PROC_CMD: break;\n");
     
    6669
    6770/*========================================================================*/
     71/* SINGULAR procedures sollen nicht in modules geladen werden!!
     72   DAS HIER FLIEGT RAUS
    6873void write_add_singular_proc(FILE *fp)
    6974{
     
    7580  fprintf(fp, "  h = enter_id(procname, NULL, PROC_CMD);\n");
    7681  fprintf(fp, "  if(h == NULL) return NULL;\n");
     82  fprintf(fp, "\n");
     83  fprintf(fp, "  IDDATA(h)=(char *) pi;\n");
    7784  fprintf(fp, "\n");
    7885//  fprintf(fp, "  pi->libname = omStrDup(libname);\n");
     
    99106  modlineno+=30;
    100107}
     108  BIS HIERHIN FLIEGT ES RAUS
     109*/
    101110
    102111/*========================================================================*/
     
    111120  fprintf(fp, "int mod_init(int(*iiAddCproc)())\n{\n");
    112121  fprintf(fp, "  idhdl h;\n");
     122/* HIER MUSS ERST ZUARBEIT VON HANS KOMMEN
    113123  fprintf(fp, "  idhdl helphdl = enter_id(\"Help\", NULL, PACKAGE_CMD);\n");
    114124  fprintf(fp, "  idhdl examplehdl = enter_id(\"Example\", NULL, PACKAGE_CMD);\n\n");
     
    121131  fprintf(fp, "     Warn(\"Cannot create example-package\\n\");\n");
    122132  fprintf(fp, "   else fill_example_package(examplehdl);\n");
     133   BIS HIERHIN ZUARBEIT VON HANS NOETIG
     134*/
    123135}
    124136
  • modules/modgen/grammar.y

    rd36ac2 rf17cd1  
    11/*
    2  * $Id: grammar.y,v 1.15 2000-11-09 21:58:13 krueger Exp $
     2 * $Id: grammar.y,v 1.16 2002-06-18 15:09:15 anne Exp $
    33 */
    44
     
    1010#include <stdarg.h>
    1111#include <string.h>
    12 #include <limits.h>
     12#include <mylimits.h>
    1313
    1414#include <mod2.h>
  • modules/modgen/main.cc

    rd36ac2 rf17cd1  
    88#include <stdarg.h>
    99#include <string.h>
    10 #include <limits.h>
     10#include <mylimits.h>
    1111#include <unistd.h>
    1212#include <getopt.h>
  • modules/modgen/misc.cc

    rd36ac2 rf17cd1  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: misc.cc,v 1.13 2001-05-23 20:13:02 anne Exp $ */
     4/* $Id: misc.cc,v 1.14 2002-06-18 15:09:16 anne Exp $ */
    55/*
    66* ABSTRACT: lib parsing
     
    462462  write_header(fp, module);
    463463  fprintf(fp, "#line %d \"%s.cc\"\n", modlineno++, module);
    464   fprintf(fp, "#include <stdlib.h>\n");
    465   fprintf(fp, "#include <stdio.h>\n");
    466   fprintf(fp, "#include <string.h>\n");
    467   fprintf(fp, "#include <ctype.h>\n");
    468   fprintf(fp, "%s\n", DYNAinclude[systyp]);
    469   fprintf(fp, "\n");
    470   fprintf(fp, "#include <locals.h>\n");
    471   fprintf(fp, "#include <omalloc.h>\n");
    472464  if(what != 'h') {
     465    fprintf(fp, "#include <stdlib.h>\n");
     466    fprintf(fp, "#include <stdio.h>\n");
     467    fprintf(fp, "#include <string.h>\n");
     468    fprintf(fp, "#include <ctype.h>\n");
     469    fprintf(fp, "%s\n", DYNAinclude[systyp]);
     470    fprintf(fp, "\n");
     471    fprintf(fp, "#include <mod2.h>\n");
     472    fprintf(fp, "#include <tok.h>\n");
     473    fprintf(fp, "#include <structs.h>\n");
     474    fprintf(fp, "#include <ipid.h>\n\n");
     475    fprintf(fp, "#include <locals.h>\n");
     476    fprintf(fp, "#include <omalloc.h>\n");
    473477    fprintf(fp, "#include \"%s.h\"\n", module);
    474478    modlineno+=8;
     
    478482    fprintf(fp, "\n");    modlineno+=1;
    479483    fprintf(fp, "#line %d \"%s.cc\"\n", modlineno++, module);
     484/* DAS HIER FLIEGT RAUS
    480485    write_add_singular_proc(fp);
    481486    fprintf(fp, "\n");
     487   BIS HIER HIN
     488*/
    482489   
     490/* HIER FEHLT ZUARBEIT VON HANS
    483491    fprintf(fp, "void fill_help_package(idhdl pl);\n");
    484492    fprintf(fp, "void fill_example_package(idhdl pl);\n");
     493   BIS HIER
     494*/
    485495    modlineno+=3;
    486496  }
     
    492502void write_header(FILE *fp, char *module, char *comment)
    493503{
    494   fprintf(fp, "%s/*\n%s * This was automaticly generated by modgen\n",
     504  fprintf(fp, "%s/*\n%s * This was automatically generated by modgen\n",
    495505          comment, comment);
    496506  fprintf(fp, "%s * version %s\n", comment, MOD_GEN_VERSION);
  • modules/modgen/proc.cc

    rd36ac2 rf17cd1  
    11/*
    2  * $Id: proc.cc,v 1.16 2001-02-01 13:05:03 krueger Exp $
     2 * $Id: proc.cc,v 1.17 2002-06-18 15:09:16 anne Exp $
    33 */
    44
     
    364364  fprintf(module->modfp, "#line %d \"%s.cc\"\n", modlineno++, module->name);
    365365  fprintf(module->modfp, "/* Help section */\n");
    366   fprintf(module->modfp, "void fill_help_package(idhdl pl) {\n");
    367   fprintf(module->modfp, "  namespaceroot->push(IDPACKAGE(pl), IDID(pl));\n");
    368   modlineno+=3;
    369   mod_copy_tmp(module->modfp, module->fmtfp2);
    370   fprintf(module->modfp, "#line %d \"%s.cc\"\n", modlineno++, module->name);
    371   fprintf(module->modfp, "  namespaceroot->pop();\n");
    372   fprintf(module->modfp, "}  /* End of Help section */\n\n");
    373   modlineno+=3;
    374 
    375   fprintf(module->modfp, "/* Example section */\n");
    376   fprintf(module->modfp, "void fill_example_package(idhdl pl) {\n");
    377   fprintf(module->modfp, "  namespaceroot->push(IDPACKAGE(pl), IDID(pl));\n");
    378   modlineno+=3;
    379   mod_copy_tmp(module->modfp, module->fmtfp3);
    380   fprintf(module->modfp, "#line %d \"%s.cc\"\n", modlineno++, module->name);
    381   fprintf(module->modfp, "  namespaceroot->pop();\n");
    382   fprintf(module->modfp, "} /* End of Example section */\n\n");
    383   modlineno+=2;
     366//  fprintf(module->modfp, "void fill_help_package(idhdl pl) {\n");
     367//  fprintf(module->modfp, "  namespaceroot->push(IDPACKAGE(pl), IDID(pl));\n");
     368//  modlineno+=3;
     369//  mod_copy_tmp(module->modfp, module->fmtfp2);
     370//  fprintf(module->modfp, "#line %d \"%s.cc\"\n", modlineno++, module->name);
     371//  fprintf(module->modfp, "  namespaceroot->pop();\n");
     372//  fprintf(module->modfp, "}  /* End of Help section */\n\n");
     373//  modlineno+=3;
     374
     375//  fprintf(module->modfp, "/* Example section */\n");
     376//  fprintf(module->modfp, "void fill_example_package(idhdl pl) {\n");
     377//  fprintf(module->modfp, "  namespaceroot->push(IDPACKAGE(pl), IDID(pl));\n");
     378//  modlineno+=3;
     379//  mod_copy_tmp(module->modfp, module->fmtfp3);
     380//  fprintf(module->modfp, "#line %d \"%s.cc\"\n", modlineno++, module->name);
     381//  fprintf(module->modfp, "  namespaceroot->pop();\n");
     382//  fprintf(module->modfp, "} /* End of Example section */\n\n");
     383//  modlineno+=2;
    384384
    385385  mod_copy_tmp(module->modfp, module->fmtfp);
Note: See TracChangeset for help on using the changeset viewer.