version 1.24, 2004/09/12 08:55:36 |
version 1.25, 2004/09/12 10:22:50 |
|
|
/* $OpenXM: OpenXM/src/kan96xx/Kan/stackmachine.c,v 1.23 2004/09/12 01:53:11 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/kan96xx/Kan/stackmachine.c,v 1.24 2004/09/12 08:55:36 takayama Exp $ */ |
/* stackmachin.c */ |
/* stackmachin.c */ |
|
|
#include <stdio.h> |
#include <stdio.h> |
Line 981 int executeToken(token) |
|
Line 981 int executeToken(token) |
|
if (ob.tag >= 0) { |
if (ob.tag >= 0) { |
/* there is a definition in the user dictionary */ |
/* there is a definition in the user dictionary */ |
if (ob.tag == SexecutableArray) { |
if (ob.tag == SexecutableArray) { |
status = executeExecutableArray(ob,token.token); |
status = executeExecutableArray(ob,token.token,0); |
if ((status & STATUS_BREAK) || (status < 0)) return status; |
if ((status & STATUS_BREAK) || (status < 0)) return status; |
}else { |
}else { |
Kpush(ob); |
Kpush(ob); |
Line 1595 char *traceShowStack(void) { |
|
Line 1595 char *traceShowStack(void) { |
|
/* |
/* |
if (fname != NULL) fname is pushed to the trace stack. |
if (fname != NULL) fname is pushed to the trace stack. |
*/ |
*/ |
int executeExecutableArray(struct object ob,char *fname) { |
int executeExecutableArray(struct object ob,char *fname,int withGotoP) { |
struct tokens *tokenArray; |
struct tokens *tokenArray; |
int size,i; |
int size,i; |
int status; |
int status; |
Line 1611 int executeExecutableArray(struct object ob,char *fnam |
|
Line 1611 int executeExecutableArray(struct object ob,char *fnam |
|
size = ob.rc.ival; |
size = ob.rc.ival; |
for (i=0; i<size; i++) { |
for (i=0; i<size; i++) { |
status = executeToken(tokenArray[i]); |
status = executeToken(tokenArray[i]); |
if ((status & STATUS_BREAK) || (status < 0) || GotoP) { |
if ((status & STATUS_BREAK) || (status < 0) || (withGotoP && GotoP)) { |
if (fname != NULL) tracePopName(); |
if (fname != NULL) tracePopName(); |
return(status); |
return(status); |
} |
} |
Line 1624 int executeExecutableArray(struct object ob,char *fnam |
|
Line 1624 int executeExecutableArray(struct object ob,char *fnam |
|
}else if (infixOn) { |
}else if (infixOn) { |
infixOn = 0; |
infixOn = 0; |
status = executeToken(infixToken); |
status = executeToken(infixToken); |
if ((status & STATUS_BREAK) || (status < 0) || GotoP) { |
if ((status & STATUS_BREAK) || (status < 0) || (withGotoP && GotoP)) { |
if (fname != NULL) tracePopName(); |
if (fname != NULL) tracePopName(); |
return(status); |
return(status); |
} |
} |