version 1.16, 2001/10/09 01:36:24 |
version 1.20, 2003/02/14 22:29:18 |
|
|
* 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/eval.c,v 1.15 2001/09/20 04:08:21 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/parse/eval.c,v 1.19 2002/12/11 10:54:12 saito Exp $ |
*/ |
*/ |
#include <ctype.h> |
#include <ctype.h> |
#include "ca.h" |
#include "ca.h" |
|
|
#include "parse.h" |
#include "parse.h" |
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/stat.h> |
#include <sys/stat.h> |
#if PARI |
#if defined(PARI) |
#include "genpari.h" |
#include "genpari.h" |
#endif |
#endif |
|
|
extern jmp_buf timer_env; |
extern JMP_BUF timer_env; |
|
|
int f_break,f_return,f_continue; |
int f_break,f_return,f_continue; |
int evalstatline; |
int evalstatline; |
Line 182 pointer eval(FNODE f) |
|
Line 182 pointer eval(FNODE f) |
|
expired = (Obj)eval((FNODE)FA2(f)); |
expired = (Obj)eval((FNODE)FA2(f)); |
set_timer(interval); |
set_timer(interval); |
savepvs(); |
savepvs(); |
if ( !setjmp(timer_env) ) |
if ( !SETJMP(timer_env) ) |
val = eval((FNODE)FA1(f)); |
val = eval((FNODE)FA1(f)); |
else { |
else { |
val = (pointer)expired; |
val = (pointer)expired; |
Line 350 pointer evalstat(SNODE f) |
|
Line 350 pointer evalstat(SNODE f) |
|
case S_BP: |
case S_BP: |
if ( !nextbp && (!FA1(f) || eval((FNODE)FA1(f))) ) { |
if ( !nextbp && (!FA1(f) || eval((FNODE)FA1(f))) ) { |
if ( (FNODE)FA2(f) ) { |
if ( (FNODE)FA2(f) ) { |
#if PARI |
#if defined(PARI) |
pari_outfile = stderr; |
pari_outfile = stderr; |
#endif |
#endif |
asir_out = stderr; |
asir_out = stderr; |
printexpr(CO,eval((FNODE)FA2(f))); |
printexpr(CO,eval((FNODE)FA2(f))); |
putc('\n',asir_out); fflush(asir_out); |
putc('\n',asir_out); fflush(asir_out); |
#if PARI |
#if defined(PARI) |
pari_outfile = stdout; |
pari_outfile = stdout; |
#endif |
#endif |
asir_out = stdout; |
asir_out = stdout; |
Line 456 pointer evalf(FUNC f,FNODE a,FNODE opt) |
|
Line 456 pointer evalf(FUNC f,FNODE a,FNODE opt) |
|
NODE tn,sn,opts,opt1; |
NODE tn,sn,opts,opt1; |
VS pvs; |
VS pvs; |
char errbuf[BUFSIZ]; |
char errbuf[BUFSIZ]; |
static int stack_size; |
static unsigned int stack_size; |
static void *stack_base; |
static void *stack_base; |
|
|
if ( f->id == A_UNDEF ) { |
if ( f->id == A_UNDEF ) { |
Line 490 pointer evalf(FUNC f,FNODE a,FNODE opt) |
|
Line 490 pointer evalf(FUNC f,FNODE a,FNODE opt) |
|
break; |
break; |
case A_USR: |
case A_USR: |
/* stack check */ |
/* stack check */ |
#if !defined(VISUAL) |
#if !defined(VISUAL) && !defined(__CYGWIN__) |
if ( !stack_size ) { |
if ( !stack_size ) { |
struct rlimit rl; |
struct rlimit rl; |
getrlimit(RLIMIT_STACK,&rl); |
getrlimit(RLIMIT_STACK,&rl); |