Changeset c2da0a in git


Ignore:
Timestamp:
Apr 20, 1998, 12:05:55 PM (26 years ago)
Author:
Kai Krüger <krueger@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
365819b7d885a4cbf318e09a20d2ae8dce0b45a4
Parents:
b35b93807f117d1b5cb55df216eefd3920e0d91f
Message:
Bug fixes for libparse


git-svn-id: file:///usr/local/Singular/svn/trunk@1398 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • Singular/libparse.h

    rb35b93 rc2da0a  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: libparse.h,v 1.3 1998-04-06 16:27:19 krueger Exp $ */
     6/* $Id: libparse.h,v 1.4 1998-04-20 10:05:53 krueger Exp $ */
    77/*
    88* ABSTRACT: lib parsing
    99*/
    10 #include "subexpr.h"
     10#ifndef STANDALONE_PARSER
     11#  include "subexpr.h"
     12#endif
    1113typedef enum { LOAD_LIB, GET_INFO } lp_modes;
    1214typedef enum { OLD_LIBSTYLE, NEW_LIBSTYLE } lib_style_types;
  • Singular/libparse.l

    rb35b93 rc2da0a  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 /* $Id: libparse.l,v 1.6 1998-04-16 08:12:55 pohl Exp $ */
     5/* $Id: libparse.l,v 1.7 1998-04-20 10:05:54 krueger Exp $ */
    66#include <stdio.h>
    77#include <string.h>
     
    2121#  include "febase.h"
    2222#  include "mmemory.h"
    23 #  include "libparse.h"
    24 #endif
     23#endif
     24#include "libparse.h"
    2525
    2626#ifdef HAVE_LIBPARSER
     
    4040int quote  = 0;  /* " */
    4141int offset = 0;
    42 int p_static = 0;
     42BOOLEAN p_static = FALSE;
    4343int old_state = 0;
    4444lib_cmds last_cmd = LP_NONE;
     
    112112#ifdef STANDALONE_PARSER
    113113procinfov pi;
    114 procinfo *iiInitSingularProcinfo(procinfov pi, char *libname,
    115                                  char *procname, int line, long pos,
    116                                  int pstatic = 0);
    117114printpi(procinfov pi);
    118115pi_clear(procinfov pi);
     
    236233           }
    237234
    238 static     { p_static=1; }
     235static     { p_static=TRUE; }
    239236
    240237(proc[ \t]+{name})|([ \t]proc[ \t]+{name}) {
    241238             char proc[256];
    242239             BEGIN(pdef);
    243 #if YYLPDEBUG
     240#if YYLPDEBUG > 0
    244241             printf("Newlib:%s\n", newlib);
    245242#endif
    246243#ifdef STANDALONE_PARSER
    247              if ( pi != NULL ) {
    248                printpi(pi);
    249                pi_clear(pi);
    250              }
    251              pi = (procinfo *)malloc(sizeof(procinfo));
    252              iiInitSingularProcinfo(pi, newlib, yytext+5, yylplineno,
     244               if ( pi != NULL ) {
     245                 printpi(pi);
     246                 pi_clear(pi);
     247               }
     248               pi = (procinfo *)malloc(sizeof(procinfo));
     249               iiInitSingularProcinfo(pi, newlib, yytext+5, yylplineno,
    253250                                        current_pos(0), p_static);
    254251#else STANDALONE_PARSER
     
    271268                      yylplineno, current_pos(0), brace1, yytext);
    272269#endif
    273                p_static=0;
     270               p_static=FALSE;
     271#ifndef STANDALONE_PARSER
    274272             }
     273#endif STANDALONE_PARSER
    275274           }
    276275example    {
     
    546545
    547546\n                       { yylplineno++; }
    548 ;                        { p_static = 0;
     547;                        { p_static = FALSE;
    549548#if YYLPDEBUG
    550549                            printf("%s", yytext);
    551550#endif
    552551                         }
    553 .                        { p_static = 0;
     552.                        { p_static = FALSE;
    554553                           yylp_errno = YYLP_BAD_CHAR;
    555554#if YYLPDEBUG
     
    625624void copy_string(lp_modes mode)
    626625{
     626#ifndef STANDALONE_PARSER
    627627  if((last_cmd == LP_INFO)&&(mode == GET_INFO)) {
    628628    long current_location = ftell(yylpin);
     
    633633    fseek(yylpin, current_location, SEEK_SET);
    634634  }
     635#endif /* STANDALONE_PARSER */
    635636}
    636637
     
    667668  yylplex(argv[0], argv[0], &lib_style);
    668669  if(yylp_errno) {
    669     printf("ERROR accured: ");
     670    printf("ERROR accured: [%d] ", yylp_errno);
    670671    printf(yylp_errlist[yylp_errno], yylplineno);
    671672    printf("\n");
  • Singular/utils.cc

    rb35b93 rc2da0a  
    99procinfo *iiInitSingularProcinfo(procinfov pi, char *libname,
    1010                                 char *procname, int line, long pos,
    11                                  int pstatic = 0)
     11                                 BOOLEAN pstatic = FALSE)
    1212{
    1313  pi->libname = (char *)malloc(strlen(libname)+1);
  • Singular/utils.h

    rb35b93 rc2da0a  
    11/*
    22 */
     3
     4typedef short BOOLEAN;
     5
     6#ifndef FALSE
     7#define FALSE       0
     8#endif
     9
     10#ifndef TRUE
     11#define TRUE        1
     12#endif
    313
    414class procinfo;
Note: See TracChangeset for help on using the changeset viewer.