version 1.11, 2003/03/23 20:17:35 |
version 1.12, 2003/03/23 22:09:57 |
|
|
/* -*- mode: C; coding: euc-japan -*- */ |
/* -*- mode: C; coding: euc-japan -*- */ |
/* $OpenXM: OpenXM/src/ox_toolkit/parse.c,v 1.10 2003/02/03 23:13:23 ohara Exp $ */ |
/* $OpenXM: OpenXM/src/ox_toolkit/parse.c,v 1.11 2003/03/23 20:17:35 ohara Exp $ */ |
|
|
/* |
/* |
This module is a parser for OX/CMO expressions. |
This module is a parser for OX/CMO expressions. |
Line 333 static int parse_integer() |
|
Line 333 static int parse_integer() |
|
#if defined(WITH_GMP) |
#if defined(WITH_GMP) |
return mpz_get_si(parse_mpz_integer()); |
return mpz_get_si(parse_mpz_integer()); |
#else |
#else |
abort(); /* not implemented */ |
int sign = 1; |
|
int val; |
|
|
|
if (token == '+') { |
|
token = lex(); |
|
}else if (token == '-') { |
|
sign = -1; |
|
token = lex(); |
|
} |
|
|
|
if (token != T_DIGIT) { |
|
parse_error("no integer."); |
|
} |
|
val = sign*atoi(yylval.sym); |
|
#ifdef DEBUG |
|
free(yylval.sym); |
|
#endif |
|
token = lex(); |
|
return val; |
#endif |
#endif |
} |
} |
|
|