Changeset cc94b0a in git
- Timestamp:
- Mar 31, 1998, 11:00:50 AM (25 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- bc82d60fa171675a0c23a3e2051318500187aa39
- Parents:
- c9ea817ef59b4d9f8adaa507840ddb8ff4d4a945
- Location:
- Singular
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/ChangeLog
rc9ea817 rcc94b0a 1 Tue Mar 31 10:47:06 MET DST 1998 hannes 2 * feread.cc: fixed handling of empty history 3 * clapsing.cc: fixed gcd(0,..) and gcd(..,0) -> pOne() 4 * febase.h/febase.inc: renaming of scanner variables 5 ( yy_blocklineno, yy_noeof) 6 * febase.inc: increased speed in feReadLine 7 * minor changes in scanner/grammar/iparith.cc (example) 8 1 9 1998-03-27 Olaf Bachmann <obachman@mathematik.uni-kl.de> 2 10 -
Singular/clapsing.cc
rc9ea817 rcc94b0a 3 3 * Computer Algebra System SINGULAR * 4 4 ****************************************/ 5 // $Id: clapsing.cc,v 1.2 5 1998-02-17 15:07:51 obachmanExp $5 // $Id: clapsing.cc,v 1.26 1998-03-31 09:00:43 Singular Exp $ 6 6 /* 7 7 * ABSTRACT: interface between Singular and factory … … 26 26 poly singclap_gcd ( poly f, poly g ) 27 27 { 28 if ((f==NULL)||(g==NULL)) 29 return pOne(); 30 28 31 poly res=NULL; 29 32 -
Singular/febase.h
rc9ea817 rcc94b0a 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: febase.h,v 1. 8 1998-03-16 14:56:30 obachmanExp $ */6 /* $Id: febase.h,v 1.9 1998-03-31 09:00:43 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT … … 18 18 extern int si_echo, printlevel; 19 19 extern int pagelength, colmax; 20 extern int blocklineno; 20 extern int yy_blocklineno; 21 extern int yy_noeof; 21 22 extern char prompt_char; 22 23 #ifdef HAVE_TCL -
Singular/febase.inc
rc9ea817 rcc94b0a 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: febase.inc,v 1. 4 1998-03-02 15:22:48Singular Exp $ */4 /* $Id: febase.inc,v 1.5 1998-03-31 09:00:42 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: handling of 'voices' 7 7 */ 8 9 extern int noeof; 10 int blocklineno; // to get the lineno of the block start from scanner 8 #include <ctype.h> 9 10 int yy_noeof=0; // the scanner "state" 11 int yy_blocklineno; // to get the lineno of the block start from scanner 11 12 Voice *currentVoice = NULL; 12 FILE *feFilePending; /*temp. storage for grammar.y */13 FILE *feFilePending; /*temp. storage for grammar.y */ 13 14 14 15 static char * BT_name[]={"BT_none","BT_break","BT_proc","BT_example", … … 153 154 case BT_if: 154 155 case BT_else: 155 yylineno = blocklineno;156 yylineno = yy_blocklineno; 156 157 break; 157 158 case BT_break: 158 yylineno = blocklineno-1;159 yylineno = yy_blocklineno-1; 159 160 break; 160 161 //case BT_file: … … 320 321 else 321 322 { 322 currentVoice->prev->ifsw= BI_stdin;323 currentVoice->prev->ifsw=0; 323 324 } 324 325 if ((currentVoice->sw == BI_file) … … 432 433 { 433 434 // try to read from the buffer: 434 b[1] = '\0';435 // b[1] = '\0'; 435 436 if ((currentVoice->buffer!=NULL) 436 437 && (currentVoice->buffer[currentVoice->fptr]!='\0')) 437 438 { 438 439 NewBuff: 439 b[0]=currentVoice->buffer[currentVoice->fptr]; 440 int i=0; 441 int startfptr=currentVoice->fptr; 442 l--; 443 loop 444 { 445 char c= 446 b[i]=currentVoice->buffer[currentVoice->fptr]; 447 i++; 448 if ((c<' ') 449 || (c==';') 450 //|| (c=='(') 451 || (c==')') 452 || (c=='}') 453 || (c=='"') 454 || (c=='$')) break; 455 if (i>=l) break; 456 currentVoice->fptr++; 457 if(currentVoice->buffer[currentVoice->fptr]=='\0') break; 458 } 459 //b[0]=currentVoice->buffer[currentVoice->fptr]; 460 b[i]='\0'; 461 //b[1]='\0'; 440 462 if (currentVoice->sw==BI_buffer) 441 463 { 442 if (currentVoice->fptr==0) 464 //if (currentVoice->fptr==0) 465 if (startfptr==0) 443 466 { 444 467 char *anf=currentVoice->buffer; … … 453 476 FreeL((ADDRESS)s); 454 477 } 455 else if (/*(currentVoice->fptr>0) &&*/ 456 (currentVoice->buffer[currentVoice->fptr-1]=='\n')) 478 //else if (/*(currentVoice->fptr>0) &&*/ 479 //(currentVoice->buffer[currentVoice->fptr-1]=='\n')) 480 else if (/*(startfptr>0) &&*/ 481 (currentVoice->buffer[startfptr-1]=='\n')) 457 482 { 458 char *anf=currentVoice->buffer+currentVoice->fptr; 483 //char *anf=currentVoice->buffer+currentVoice->fptr; 484 char *anf=currentVoice->buffer+startfptr; 459 485 char *ss=strchr(anf,'\n'); 460 486 int len; … … 470 496 } 471 497 currentVoice->fptr++; 472 return 1; 498 return i; 499 //return 1; 473 500 } 474 501 // no buffer there or e-o-buffer or eoln: … … 514 541 /* else if (s==NULL) */ 515 542 { 516 switch( noeof)543 switch(yy_noeof) 517 544 { 518 545 case 0: -
Singular/feread.cc
rc9ea817 rcc94b0a 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: feread.cc,v 1. 8 1998-03-16 19:07:50 Singular Exp $ */4 /* $Id: feread.cc,v 1.9 1998-03-31 09:00:40 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: input from ttys, simulating fgets … … 668 668 669 669 /* try to read a history */ 670 using_history(); 670 671 read_history (".singular_hist"); 671 672 } … … 675 676 { 676 677 /* try to read a history */ 677 if(!feBatch && !fe_use_fgets )678 if(!feBatch && !fe_use_fgets && (history_total_bytes()!=0)) 678 679 write_history (".singular_hist"); 679 680 } -
Singular/grammar.y
rc9ea817 rcc94b0a 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: grammar.y,v 1.2 4 1998-03-11 12:03:40Singular Exp $ */4 /* $Id: grammar.y,v 1.25 1998-03-31 09:00:46 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: SINGULAR shell grammatik … … 1037 1037 } 1038 1038 } 1039 | EXAMPLE_CMD STRINGTOK1039 | EXAMPLE_CMD extendedid 1040 1040 { 1041 1041 singular_help($2,TRUE); -
Singular/iparith.cc
rc9ea817 rcc94b0a 154 154 { "else", 0, ELSE_CMD , ELSE_CMD}, 155 155 { "eval", 0, EVAL , EVAL}, 156 { "example", 0, EXAMPLE_CMD , EXAMPLE_CMD}, 156 157 { "execute", 0, EXECUTE_CMD , EXECUTE_CMD}, 157 158 { "export", 0, EXPORT_CMD , EXPORT_CMD}, … … 301 302 302 303 /* other reserved words:scanner.l */ 303 { "pause", 0, -1 , 0},304 { "pause", 2, -1 , 0}, 304 305 { "while", 0, -1 , 0}, 305 306 { "for", 0, -1 , 0}, 306 307 { "help", 0, -1 , 0}, 307 { "example", 0, -1 , 0},308 308 { "newline", 0, -1 , 0}, 309 309 { "exit", 0, -1 , 0}, … … 2184 2184 { 2185 2185 poly p=(poly)v->CopyD(); 2186 pCleardenom(p);2186 if (p!=NULL) pCleardenom(p); 2187 2187 res->data = (char *)p; 2188 2188 return FALSE; -
Singular/scanner.l
rc9ea817 rcc94b0a 3 3 * Computer Algebra System SINGULAR * 4 4 ****************************************/ 5 /* $Id: scanner.l,v 1. 9 1998-02-27 14:06:24 Singular Exp $ */5 /* $Id: scanner.l,v 1.10 1998-03-31 09:00:44 Singular Exp $ */ 6 6 #include <stdio.h> 7 7 #include <string.h> … … 19 19 #define ALLOC(a) Alloc((a)) 20 20 int yylineno = 0; 21 int noeof = 0;22 21 static int blocknest = 0; 23 22 extern char * yytext; … … 94 93 ^#![^\n]* { } 95 94 pause[ \t\n]*[\.;] { fePause(); } 96 while { blocknest = 0; noeof = noeof_brace; BEGIN(brace);95 while { blocknest = 0; yy_noeof = noeof_brace; BEGIN(brace); 97 96 return WHILE_CMD;} 98 for { blocknest = 0; noeof = noeof_brace; BEGIN(brace);97 for { blocknest = 0; yy_noeof = noeof_brace; BEGIN(brace); 99 98 return FOR_CMD;} 100 99 101 ("help"|"?")[ \t\n]* { noeof = noeof_asstring;100 ("help"|"?")[ \t\n]* { yy_noeof = noeof_asstring; 102 101 BEGIN(asstring); 103 102 return HELP_CMD; 104 }105 106 example[ \t\n]* { noeof = noeof_asstring;107 IsCmd("example",lvalp->i);108 BEGIN(asstring);109 return EXAMPLE_CMD;110 103 } 111 104 … … 113 106 char c; char *cp; 114 107 lvalp->name = mstrdup(iiProcName((char *)yytext,c,cp)); 115 noeof = noeof_procname;108 yy_noeof = noeof_procname; 116 109 blocknest = 1; 117 110 BEGIN(brace); … … 120 113 <asstring>[^;\n]+ { 121 114 lvalp->name = mstrdup((char *)yytext); 122 noeof = 0; BEGIN(INITIAL);115 yy_noeof = 0; BEGIN(INITIAL); 123 116 return STRINGTOK; 124 117 } 125 118 <asstring>; { 126 noeof = 0; BEGIN(INITIAL);119 yy_noeof = 0; BEGIN(INITIAL); 127 120 return *yytext; 128 121 } 129 122 130 123 <brace>"\"" { 131 noeof = noeof_string;124 yy_noeof = noeof_string; 132 125 BEGIN(bracestr); 133 126 yymore(); … … 145 138 if (--blocknest <= 0) 146 139 { 147 noeof = 0;140 yy_noeof = 0; 148 141 BEGIN(INITIAL); 149 142 lvalp->name = dupyytext(); … … 153 146 } 154 147 <bracestr>"\"" { 155 noeof = noeof_brace;148 yy_noeof = noeof_brace; 156 149 BEGIN(brace); 157 150 yymore(); … … 170 163 } 171 164 <bracket>")" { 172 noeof = 0; BEGIN(INITIAL);165 yy_noeof = 0; BEGIN(INITIAL); 173 166 return ')'; 174 167 } 175 168 176 169 "{" { 177 blocklineno = yylineno;170 yy_blocklineno = yylineno; 178 171 blocknest = 1; 179 noeof = noeof_block;172 yy_noeof = noeof_block; 180 173 BEGIN(block); 181 174 } 182 175 <block>"\"" { 183 noeof = noeof_string;176 yy_noeof = noeof_string; 184 177 BEGIN(blockstr); 185 178 yymore(); … … 189 182 <blockstr>"\\\"" { yymore(); } 190 183 <blockstr>"\"" { 191 noeof = noeof_block;184 yy_noeof = noeof_block; 192 185 BEGIN(block); 193 186 yymore(); … … 199 192 { 200 193 BEGIN(INITIAL); 201 noeof = 0;194 yy_noeof = 0; 202 195 lvalp->name = dupyytextNL(); 203 196 return BLOCKTOK; … … 205 198 yymore(); 206 199 } 207 "\"" { BEGIN(string); noeof = noeof_string;}200 "\"" { BEGIN(string); yy_noeof = noeof_string;} 208 201 ~ { return SYS_BREAK; } 209 202 <string>[^\"] { yymore(); } … … 212 205 <string>"\"" { 213 206 char * s; 214 noeof = 0;207 yy_noeof = 0; 215 208 BEGIN(INITIAL); 216 209 s = lvalp->name = dupyytext();
Note: See TracChangeset
for help on using the changeset viewer.