version 1.19, 2001/12/21 08:23:15 |
version 1.20, 2002/09/09 12:23:51 |
|
|
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* |
* |
* $OpenXM: OpenXM_contrib2/asir2000/parse/lex.c,v 1.18 2001/10/09 01:36:24 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/parse/lex.c,v 1.19 2001/12/21 08:23:15 noro Exp $ |
*/ |
*/ |
#include <ctype.h> |
#include <ctype.h> |
#include "ca.h" |
#include "ca.h" |
|
|
N n,n1; |
N n,n1; |
Q q; |
Q q; |
Obj r; |
Obj r; |
|
int floatingpoint = 0; |
|
double dbl; |
|
Real real; |
|
double atof(); |
|
extern int bigfloat; |
|
|
|
|
/* initialize buffer pointers */ |
/* initialize buffer pointers */ |
nbuf = nbuf0; tbuf = tbuf0; |
nbuf = nbuf0; tbuf = tbuf0; |
|
|
REALLOC_NBUF nbuf[i++] = c; |
REALLOC_NBUF nbuf[i++] = c; |
READ_DIGIT_NBUF |
READ_DIGIT_NBUF |
if ( c == '.' ) { |
if ( c == '.' ) { |
double dbl; |
floatingpoint = 1; |
Real real; |
|
double atof(); |
|
extern int bigfloat; |
|
|
|
REALLOC_NBUF nbuf[i++] = c; |
REALLOC_NBUF nbuf[i++] = c; |
READ_DIGIT_NBUF |
READ_DIGIT_NBUF |
|
|
Ungetc(c); |
Ungetc(c); |
READ_DIGIT_NBUF |
READ_DIGIT_NBUF |
} |
} |
|
} else if ( c == 'e' ) { |
|
floatingpoint = 1; |
|
REALLOC_NBUF nbuf[i++] = c; |
|
c = Getc(); |
|
if ( (c == '+') || (c == '-') ) { |
|
REALLOC_NBUF nbuf[i++] = c; |
|
} else |
|
Ungetc(c); |
|
READ_DIGIT_NBUF |
|
} |
|
if ( floatingpoint ) { |
Ungetc(c); REALLOC_NBUF nbuf[i] = 0; |
Ungetc(c); REALLOC_NBUF nbuf[i] = 0; |
#if PARI |
#if PARI |
if ( !bigfloat ) { |
if ( !bigfloat ) { |