Changeset c2da0a in git for Singular/libparse.l
- Timestamp:
- Apr 20, 1998, 12:05:55 PM (25 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a657104b677b4c461d018cbf3204d72d34ad66a9')
- Children:
- 365819b7d885a4cbf318e09a20d2ae8dce0b45a4
- Parents:
- b35b93807f117d1b5cb55df216eefd3920e0d91f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/libparse.l
rb35b93 rc2da0a 3 3 * Computer Algebra System SINGULAR * 4 4 ****************************************/ 5 /* $Id: libparse.l,v 1. 6 1998-04-16 08:12:55 pohlExp $ */5 /* $Id: libparse.l,v 1.7 1998-04-20 10:05:54 krueger Exp $ */ 6 6 #include <stdio.h> 7 7 #include <string.h> … … 21 21 # include "febase.h" 22 22 # include "mmemory.h" 23 # include "libparse.h"24 # endif23 #endif 24 #include "libparse.h" 25 25 26 26 #ifdef HAVE_LIBPARSER … … 40 40 int quote = 0; /* " */ 41 41 int offset = 0; 42 int p_static = 0;42 BOOLEAN p_static = FALSE; 43 43 int old_state = 0; 44 44 lib_cmds last_cmd = LP_NONE; … … 112 112 #ifdef STANDALONE_PARSER 113 113 procinfov pi; 114 procinfo *iiInitSingularProcinfo(procinfov pi, char *libname,115 char *procname, int line, long pos,116 int pstatic = 0);117 114 printpi(procinfov pi); 118 115 pi_clear(procinfov pi); … … 236 233 } 237 234 238 static { p_static= 1; }235 static { p_static=TRUE; } 239 236 240 237 (proc[ \t]+{name})|([ \t]proc[ \t]+{name}) { 241 238 char proc[256]; 242 239 BEGIN(pdef); 243 #if YYLPDEBUG 240 #if YYLPDEBUG > 0 244 241 printf("Newlib:%s\n", newlib); 245 242 #endif 246 243 #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, 253 250 current_pos(0), p_static); 254 251 #else STANDALONE_PARSER … … 271 268 yylplineno, current_pos(0), brace1, yytext); 272 269 #endif 273 p_static=0; 270 p_static=FALSE; 271 #ifndef STANDALONE_PARSER 274 272 } 273 #endif STANDALONE_PARSER 275 274 } 276 275 example { … … 546 545 547 546 \n { yylplineno++; } 548 ; { p_static = 0;547 ; { p_static = FALSE; 549 548 #if YYLPDEBUG 550 549 printf("%s", yytext); 551 550 #endif 552 551 } 553 . { p_static = 0;552 . { p_static = FALSE; 554 553 yylp_errno = YYLP_BAD_CHAR; 555 554 #if YYLPDEBUG … … 625 624 void copy_string(lp_modes mode) 626 625 { 626 #ifndef STANDALONE_PARSER 627 627 if((last_cmd == LP_INFO)&&(mode == GET_INFO)) { 628 628 long current_location = ftell(yylpin); … … 633 633 fseek(yylpin, current_location, SEEK_SET); 634 634 } 635 #endif /* STANDALONE_PARSER */ 635 636 } 636 637 … … 667 668 yylplex(argv[0], argv[0], &lib_style); 668 669 if(yylp_errno) { 669 printf("ERROR accured: ");670 printf("ERROR accured: [%d] ", yylp_errno); 670 671 printf(yylp_errlist[yylp_errno], yylplineno); 671 672 printf("\n");
Note: See TracChangeset
for help on using the changeset viewer.