=================================================================== RCS file: /home/cvs/OpenXM/src/kan96xx/Kan/stackmachine.c,v retrieving revision 1.33 retrieving revision 1.35 diff -u -p -r1.33 -r1.35 --- OpenXM/src/kan96xx/Kan/stackmachine.c 2005/07/18 10:55:16 1.33 +++ OpenXM/src/kan96xx/Kan/stackmachine.c 2006/02/02 04:16:49 1.35 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM/src/kan96xx/Kan/stackmachine.c,v 1.32 2005/07/03 11:08:54 ohara Exp $ */ +/* $OpenXM: OpenXM/src/kan96xx/Kan/stackmachine.c,v 1.34 2006/02/01 00:30:05 takayama Exp $ */ /* stackmachin.c */ #include @@ -89,6 +89,7 @@ int OXlockSaved = 0; char *UD_str; int UD_attr; +struct object *MsgStackTraceInArrayp = NULL; char *MsgStackTrace = NULL; char *MsgSourceTrace = NULL; @@ -1064,21 +1065,23 @@ int executeToken(token) return(0); /* normal exit.*/ } } - if (WarningMessageMode == 1 || WarningMessageMode == 2) { + { char tmpc[1024]; if (strlen(token.token) < 900) { sprintf(tmpc,"\n%%Warning: The identifier <<%s>> is not in the system dictionary\n%% nor in the user dictionaries. Push NullObject.\n",token.token); - }else {strcpy(tmpc,"Warning: identifier is not in the dictionaries.");} - pushErrorStack(KnewErrorPacket(SerialCurrent,-1,tmpc)); + }else {strcpy(tmpc,"\n%%Warning: identifier is not in the dictionaries.\n");} + if (WarningMessageMode == 1 || WarningMessageMode == 2) { + pushErrorStack(KnewErrorPacket(SerialCurrent,-1,tmpc)); + } + if (WarningMessageMode != 1) { + fprintf(Fstack,"%s",tmpc); + /*fprintf(Fstack,"(%d,%d)\n",h0,h1);*/ + } + if (Strict) { + errorStackmachine(tmpc); + } + Kpush(NullObject); } - if (WarningMessageMode != 1) { - fprintf(Fstack,"\n%%Warning: The identifier <<%s>> is not in the system dictionary\n%% nor in the user dictionaries. Push NullObject.\n",token.token); - /*fprintf(Fstack,"(%d,%d)\n",h0,h1);*/ - } - if (Strict) { - errorStackmachine("Warning: identifier is not in the dictionaries"); - } - Kpush(NullObject); } } } else if (token.kind == EXECUTABLE_STRING) { @@ -1149,6 +1152,7 @@ errorStackmachine(str) fprintf(stderr,str); } fprintf(stderr,"\n"); + MsgStackTraceInArrayp = traceNameStackToArrayp(); MsgStackTrace = traceShowStack(); MsgSourceTrace = traceShowScannerBuf(); } @@ -1395,6 +1399,10 @@ char *KSpopBinary(int *size) { return((char *)NULL); } +struct object KSnewObjectArray(int k) { + return newObjectArray(k); +} + int pushErrorStack(struct object obj) { if (CurrentOperandStack == &ErrorStack) { @@ -1633,6 +1641,17 @@ void traceClearStack(void) { char *tracePopName(void) { if (TraceNameStackp <= 0) return (char *) NULL; return TraceNameStack[--TraceNameStackp]; +} +struct object *traceNameStackToArrayp(void) { + int n,i; + struct object *op; + op = sGC_malloc(sizeof(struct object)); + n = TraceNameStackp; if (n < 0) n = 0; + *op = newObjectArray(n); + for (i=0; i