00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #define _RULEPSR_SOURCE_
00027
00028 #include "setup.h"
00029
00030 #if DEFRULE_CONSTRUCT
00031
00032 #include <stdio.h>
00033 #define _STDIO_INCLUDED_
00034 #include <string.h>
00035
00036 #include "analysis.h"
00037 #include "constant.h"
00038 #include "constrct.h"
00039 #include "cstrcpsr.h"
00040 #include "cstrnchk.h"
00041 #include "cstrnops.h"
00042 #include "engine.h"
00043 #include "envrnmnt.h"
00044 #include "exprnpsr.h"
00045 #include "incrrset.h"
00046 #include "memalloc.h"
00047 #include "pattern.h"
00048 #include "prccode.h"
00049 #include "prcdrpsr.h"
00050 #include "router.h"
00051 #include "rulebld.h"
00052 #include "rulebsc.h"
00053 #include "rulecstr.h"
00054 #include "ruledef.h"
00055 #include "ruledlt.h"
00056 #include "rulelhs.h"
00057 #include "scanner.h"
00058 #include "symbol.h"
00059 #include "watch.h"
00060
00061 #include "lgcldpnd.h"
00062
00063 #if DEFTEMPLATE_CONSTRUCT
00064 #include "tmpltfun.h"
00065 #endif
00066
00067 #if BLOAD || BLOAD_ONLY || BLOAD_AND_BSAVE
00068 #include "bload.h"
00069 #endif
00070
00071 #include "rulepsr.h"
00072
00073
00074
00075
00076
00077 #if (! RUN_TIME) && (! BLOAD_ONLY)
00078 static struct expr *ParseRuleRHS(void *,char *);
00079 static int ReplaceRHSVariable(void *,struct expr *,void *);
00080 static struct defrule *ProcessRuleLHS(void *,struct lhsParseNode *,struct expr *,SYMBOL_HN *,int *);
00081 static struct defrule *CreateNewDisjunct(void *,SYMBOL_HN *,int,struct expr *,
00082 int,unsigned,struct joinNode *);
00083 static int RuleComplexity(void *,struct lhsParseNode *);
00084 static int ExpressionComplexity(void *,struct expr *);
00085 static int LogicalAnalysis(void *,struct lhsParseNode *);
00086 static void AddToDefruleList(struct defrule *);
00087 #if DEVELOPER && DEBUGGING_FUNCTIONS
00088 static void DumpRuleAnalysis(void *,struct lhsParseNode *);
00089 #endif
00090 #endif
00091
00092
00093
00094
00095
00096
00097 globle int ParseDefrule(
00098 void *theEnv,
00099 char *readSource)
00100 {
00101 #if (MAC_MCW || WIN_MCW) && (RUN_TIME || BLOAD_ONLY)
00102 #pragma unused(theEnv,readSource)
00103 #endif
00104
00105 #if (! RUN_TIME) && (! BLOAD_ONLY)
00106 SYMBOL_HN *ruleName;
00107 struct lhsParseNode *theLHS;
00108 struct expr *actions;
00109 struct token theToken;
00110 struct defrule *topDisjunct, *tempPtr;
00111 struct defruleModule *theModuleItem;
00112 int error;
00113
00114
00115
00116
00117
00118
00119
00120 SetPPBufferStatus(theEnv,ON);
00121 FlushPPBuffer(theEnv);
00122 SavePPBuffer(theEnv,"(defrule ");
00123
00124
00125
00126
00127
00128 #if BLOAD || BLOAD_ONLY || BLOAD_AND_BSAVE
00129 if ((Bloaded(theEnv) == TRUE) && (! ConstructData(theEnv)->CheckSyntaxMode))
00130 {
00131 CannotLoadWithBloadMessage(theEnv,"defrule");
00132 return(TRUE);
00133 }
00134 #endif
00135
00136
00137
00138
00139
00140
00141 #if DEBUGGING_FUNCTIONS
00142 DefruleData(theEnv)->DeletedRuleDebugFlags = 0;
00143 #endif
00144
00145 ruleName = GetConstructNameAndComment(theEnv,readSource,&theToken,"defrule",
00146 EnvFindDefrule,EnvUndefrule,"*",FALSE,
00147 TRUE,TRUE);
00148
00149 if (ruleName == NULL) return(TRUE);
00150
00151
00152
00153
00154
00155 theLHS = ParseRuleLHS(theEnv,readSource,&theToken,ValueToString(ruleName),&error);
00156 if (error)
00157 {
00158 ReturnPackedExpression(theEnv,PatternData(theEnv)->SalienceExpression);
00159 PatternData(theEnv)->SalienceExpression = NULL;
00160 return(TRUE);
00161 }
00162
00163
00164
00165
00166
00167 ClearParsedBindNames(theEnv);
00168 ExpressionData(theEnv)->ReturnContext = TRUE;
00169 actions = ParseRuleRHS(theEnv,readSource);
00170
00171 if (actions == NULL)
00172 {
00173 ReturnPackedExpression(theEnv,PatternData(theEnv)->SalienceExpression);
00174 PatternData(theEnv)->SalienceExpression = NULL;
00175 ReturnLHSParseNodes(theEnv,theLHS);
00176 return(TRUE);
00177 }
00178
00179
00180
00181
00182
00183 topDisjunct = ProcessRuleLHS(theEnv,theLHS,actions,ruleName,&error);
00184
00185 ReturnExpression(theEnv,actions);
00186 ClearParsedBindNames(theEnv);
00187 ReturnLHSParseNodes(theEnv,theLHS);
00188
00189 if (error)
00190 {
00191 ReturnPackedExpression(theEnv,PatternData(theEnv)->SalienceExpression);
00192 PatternData(theEnv)->SalienceExpression = NULL;
00193 return(TRUE);
00194 }
00195
00196
00197
00198
00199
00200
00201 if (ConstructData(theEnv)->CheckSyntaxMode)
00202 {
00203 ReturnPackedExpression(theEnv,PatternData(theEnv)->SalienceExpression);
00204 PatternData(theEnv)->SalienceExpression = NULL;
00205 return(FALSE);
00206 }
00207
00208 PatternData(theEnv)->SalienceExpression = NULL;
00209
00210
00211
00212
00213
00214 SavePPBuffer(theEnv,"\n");
00215 if (EnvGetConserveMemory(theEnv) == TRUE)
00216 { topDisjunct->header.ppForm = NULL; }
00217 else
00218 { topDisjunct->header.ppForm = CopyPPBuffer(theEnv); }
00219
00220
00221
00222
00223
00224 theModuleItem = (struct defruleModule *)
00225 GetModuleItem(theEnv,NULL,FindModuleItem(theEnv,"defrule")->moduleIndex);
00226
00227 for (tempPtr = topDisjunct; tempPtr != NULL; tempPtr = tempPtr->disjunct)
00228 {
00229 tempPtr->header.whichModule = (struct defmoduleItemHeader *) theModuleItem;
00230 tempPtr->header.ppForm = topDisjunct->header.ppForm;
00231 }
00232
00233
00234
00235
00236
00237 AddToDefruleList(topDisjunct);
00238
00239
00240
00241
00242
00243 #if DEBUGGING_FUNCTIONS
00244 if (BitwiseTest(DefruleData(theEnv)->DeletedRuleDebugFlags,0))
00245 { EnvSetBreak(theEnv,topDisjunct); }
00246 if (BitwiseTest(DefruleData(theEnv)->DeletedRuleDebugFlags,1) || EnvGetWatchItem(theEnv,"activations"))
00247 { EnvSetDefruleWatchActivations(theEnv,ON,(void *) topDisjunct); }
00248 if (BitwiseTest(DefruleData(theEnv)->DeletedRuleDebugFlags,2) || EnvGetWatchItem(theEnv,"rules"))
00249 { EnvSetDefruleWatchFirings(theEnv,ON,(void *) topDisjunct); }
00250 #endif
00251
00252
00253
00254
00255
00256 IncrementalReset(theEnv,topDisjunct);
00257
00258
00259
00260
00261
00262 #endif
00263 return(FALSE);
00264 }
00265
00266 #if (! RUN_TIME) && (! BLOAD_ONLY)
00267
00268
00269
00270
00271 static struct defrule *ProcessRuleLHS(
00272 void *theEnv,
00273 struct lhsParseNode *theLHS,
00274 struct expr *actions,
00275 SYMBOL_HN *ruleName,
00276 int *error)
00277 {
00278 struct lhsParseNode *tempNode = NULL;
00279 struct defrule *topDisjunct = NULL, *currentDisjunct, *lastDisjunct = NULL;
00280 struct expr *newActions, *packPtr;
00281 int logicalJoin;
00282 int localVarCnt;
00283 int complexity;
00284 struct joinNode *lastJoin;
00285 intBool emptyLHS;
00286
00287
00288
00289
00290
00291 *error = FALSE;
00292
00293
00294
00295
00296
00297
00298
00299 if (theLHS == NULL)
00300 { emptyLHS = TRUE; }
00301 else
00302 {
00303 emptyLHS = FALSE;
00304 if (theLHS->type == OR_CE) theLHS = theLHS->right;
00305 }
00306
00307
00308
00309
00310
00311 localVarCnt = CountParsedBindNames(theEnv);
00312
00313 while ((theLHS != NULL) || (emptyLHS == TRUE))
00314 {
00315
00316
00317
00318
00319 if (emptyLHS)
00320 { tempNode = NULL; }
00321 else
00322 {
00323 if (theLHS->type == AND_CE) tempNode = theLHS->right;
00324 else if (theLHS->type == PATTERN_CE) tempNode = theLHS;
00325 }
00326
00327 if (VariableAnalysis(theEnv,tempNode))
00328 {
00329 *error = TRUE;
00330 ReturnDefrule(theEnv,topDisjunct);
00331 return(NULL);
00332 }
00333
00334
00335
00336
00337
00338 if (PostPatternAnalysis(theEnv,tempNode))
00339 {
00340 *error = TRUE;
00341 ReturnDefrule(theEnv,topDisjunct);
00342 return(NULL);
00343 }
00344
00345
00346
00347
00348
00349 #if DEVELOPER && DEBUGGING_FUNCTIONS
00350 if (EnvGetWatchItem(theEnv,"rule-analysis"))
00351 { DumpRuleAnalysis(theEnv,tempNode); }
00352 #endif
00353
00354
00355
00356
00357
00358
00359 if ((logicalJoin = LogicalAnalysis(theEnv,tempNode)) < 0)
00360 {
00361 *error = TRUE;
00362 ReturnDefrule(theEnv,topDisjunct);
00363 return(NULL);
00364 }
00365
00366
00367
00368
00369
00370 if (CheckRHSForConstraintErrors(theEnv,actions,tempNode))
00371 {
00372 *error = TRUE;
00373 ReturnDefrule(theEnv,topDisjunct);
00374 return(NULL);
00375 }
00376
00377
00378
00379
00380
00381
00382 newActions = CopyExpression(theEnv,actions);
00383 if (ReplaceProcVars(theEnv,"RHS of defrule",newActions,NULL,NULL,
00384 ReplaceRHSVariable,(void *) tempNode))
00385 {
00386 *error = TRUE;
00387 ReturnDefrule(theEnv,topDisjunct);
00388 ReturnExpression(theEnv,newActions);
00389 return(NULL);
00390 }
00391
00392
00393
00394
00395
00396
00397 if (ConstructData(theEnv)->CheckSyntaxMode)
00398 {
00399 ReturnExpression(theEnv,newActions);
00400 if (emptyLHS)
00401 { emptyLHS = FALSE; }
00402 else
00403 { theLHS = theLHS->bottom; }
00404 continue;
00405 }
00406
00407
00408
00409
00410
00411 ExpressionInstall(theEnv,newActions);
00412 packPtr = PackExpression(theEnv,newActions);
00413 ReturnExpression(theEnv,newActions);
00414
00415
00416
00417
00418
00419 lastJoin = ConstructJoins(theEnv,logicalJoin,tempNode,1);
00420
00421
00422
00423
00424
00425 complexity = RuleComplexity(theEnv,tempNode);
00426
00427
00428
00429
00430
00431
00432 currentDisjunct = CreateNewDisjunct(theEnv,ruleName,localVarCnt,packPtr,complexity,
00433 (unsigned) logicalJoin,lastJoin);
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444 if (topDisjunct == NULL)
00445 {
00446 topDisjunct = currentDisjunct;
00447 ExpressionInstall(theEnv,topDisjunct->dynamicSalience);
00448 }
00449 else lastDisjunct->disjunct = currentDisjunct;
00450
00451
00452
00453
00454
00455 lastDisjunct = currentDisjunct;
00456
00457 if (emptyLHS)
00458 { emptyLHS = FALSE; }
00459 else
00460 { theLHS = theLHS->bottom; }
00461 }
00462
00463 return(topDisjunct);
00464 }
00465
00466
00467
00468
00469 static struct defrule *CreateNewDisjunct(
00470 void *theEnv,
00471 SYMBOL_HN *ruleName,
00472 int localVarCnt,
00473 struct expr *theActions,
00474 int complexity,
00475 unsigned logicalJoin,
00476 struct joinNode *lastJoin)
00477 {
00478 struct joinNode *tempJoin;
00479 struct defrule *newDisjunct;
00480
00481
00482
00483
00484
00485 newDisjunct = get_struct(theEnv,defrule);
00486 newDisjunct->header.ppForm = NULL;
00487 newDisjunct->header.next = NULL;
00488 newDisjunct->header.usrData = NULL;
00489 newDisjunct->logicalJoin = NULL;
00490 newDisjunct->disjunct = NULL;
00491 newDisjunct->header.name = ruleName;
00492 IncrementSymbolCount(newDisjunct->header.name);
00493 newDisjunct->actions = theActions;
00494 newDisjunct->salience = PatternData(theEnv)->GlobalSalience;
00495 newDisjunct->afterBreakpoint = 0;
00496 newDisjunct->watchActivation = 0;
00497 newDisjunct->watchFiring = 0;
00498 newDisjunct->executing = 0;
00499 newDisjunct->complexity = complexity;
00500 newDisjunct->autoFocus = PatternData(theEnv)->GlobalAutoFocus;
00501 newDisjunct->dynamicSalience = PatternData(theEnv)->SalienceExpression;
00502 newDisjunct->localVarCnt = localVarCnt;
00503
00504
00505
00506
00507
00508 newDisjunct->header.whichModule =
00509 (struct defmoduleItemHeader *)
00510 GetModuleItem(theEnv,NULL,FindModuleItem(theEnv,"defrule")->moduleIndex);
00511
00512
00513
00514
00515
00516 lastJoin->ruleToActivate = newDisjunct;
00517 newDisjunct->lastJoin = lastJoin;
00518
00519
00520
00521
00522
00523 tempJoin = lastJoin;
00524 while (tempJoin != NULL)
00525 {
00526 if (tempJoin->depth == logicalJoin)
00527 {
00528 newDisjunct->logicalJoin = tempJoin;
00529 tempJoin->logicalJoin = TRUE;
00530 }
00531 tempJoin = tempJoin->lastLevel;
00532 }
00533
00534
00535
00536
00537
00538 return(newDisjunct);
00539 }
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549 static int ReplaceRHSVariable(
00550 void *theEnv,
00551 struct expr *list,
00552 void *VtheLHS)
00553 {
00554 struct lhsParseNode *theVariable;
00555
00556
00557
00558
00559
00560 #if DEFTEMPLATE_CONSTRUCT
00561 if (list->type == FCALL)
00562 {
00563 if (list->value == (void *) FindFunction(theEnv,"modify"))
00564 {
00565 if (UpdateModifyDuplicate(theEnv,list,"modify",VtheLHS) == FALSE)
00566 return(-1);
00567 }
00568 else if (list->value == (void *) FindFunction(theEnv,"duplicate"))
00569 {
00570 if (UpdateModifyDuplicate(theEnv,list,"duplicate",VtheLHS) == FALSE)
00571 return(-1);
00572 }
00573
00574 return(0);
00575 }
00576
00577 #endif
00578
00579 if ((list->type != SF_VARIABLE) && (list->type != MF_VARIABLE))
00580 { return(FALSE); }
00581
00582
00583
00584
00585
00586 theVariable = FindVariable((SYMBOL_HN *) list->value,(struct lhsParseNode *) VtheLHS);
00587 if (theVariable == NULL) return(FALSE);
00588
00589
00590
00591
00592
00593
00594 if (theVariable->patternType != NULL)
00595 { (*theVariable->patternType->replaceGetJNValueFunction)(theEnv,list,theVariable,LHS); }
00596 else
00597 { return(FALSE); }
00598
00599
00600
00601
00602
00603 return(TRUE);
00604 }
00605
00606
00607
00608
00609
00610 static struct expr *ParseRuleRHS(
00611 void *theEnv,
00612 char *readSource)
00613 {
00614 struct expr *actions;
00615 struct token theToken;
00616
00617
00618
00619
00620
00621 SavePPBuffer(theEnv,"\n ");
00622 SetIndentDepth(theEnv,3);
00623
00624 actions = GroupActions(theEnv,readSource,&theToken,TRUE,NULL,FALSE);
00625
00626 if (actions == NULL) return(NULL);
00627
00628
00629
00630
00631
00632 PPBackup(theEnv);
00633 PPBackup(theEnv);
00634 SavePPBuffer(theEnv,theToken.printForm);
00635
00636
00637
00638
00639
00640 if (theToken.type != RPAREN)
00641 {
00642 SyntaxErrorMessage(theEnv,"defrule");
00643 ReturnExpression(theEnv,actions);
00644 return(NULL);
00645 }
00646
00647
00648
00649
00650
00651 return(actions);
00652 }
00653
00654
00655
00656
00657
00658 static int RuleComplexity(
00659 void *theEnv,
00660 struct lhsParseNode *theLHS)
00661 {
00662 struct lhsParseNode *thePattern, *tempPattern;
00663 int complexity = 0;
00664
00665 while (theLHS != NULL)
00666 {
00667 complexity += 1;
00668 complexity += ExpressionComplexity(theEnv,theLHS->networkTest);
00669 thePattern = theLHS->right;
00670 while (thePattern != NULL)
00671 {
00672 if (thePattern->multifieldSlot)
00673 {
00674 tempPattern = thePattern->bottom;
00675 while (tempPattern != NULL)
00676 {
00677 complexity += ExpressionComplexity(theEnv,tempPattern->networkTest);
00678 tempPattern = tempPattern->right;
00679 }
00680 }
00681 else
00682 { complexity += ExpressionComplexity(theEnv,thePattern->networkTest); }
00683 thePattern = thePattern->right;
00684 }
00685 theLHS = theLHS->bottom;
00686 }
00687
00688 return(complexity);
00689 }
00690
00691
00692
00693
00694 static int ExpressionComplexity(
00695 void *theEnv,
00696 struct expr *exprPtr)
00697 {
00698 int complexity = 0;
00699
00700 while (exprPtr != NULL)
00701 {
00702 if (exprPtr->type == FCALL)
00703 {
00704
00705
00706
00707
00708
00709 if ((exprPtr->value == ExpressionData(theEnv)->PTR_AND) ||
00710 (exprPtr->value == ExpressionData(theEnv)->PTR_NOT) ||
00711 (exprPtr->value == ExpressionData(theEnv)->PTR_OR))
00712 { complexity += ExpressionComplexity(theEnv,exprPtr->argList); }
00713
00714
00715
00716
00717
00718
00719 else
00720 { complexity++; }
00721 }
00722 else if ((EvaluationData(theEnv)->PrimitivesArray[exprPtr->type] != NULL) ?
00723 EvaluationData(theEnv)->PrimitivesArray[exprPtr->type]->addsToRuleComplexity : FALSE)
00724 { complexity++; }
00725
00726 exprPtr = exprPtr->nextArg;
00727 }
00728
00729 return(complexity);
00730 }
00731
00732
00733
00734
00735
00736 static int LogicalAnalysis(
00737 void *theEnv,
00738 struct lhsParseNode *patternList)
00739 {
00740 int firstLogical, logicalsFound = FALSE, logicalJoin = 1;
00741 int gap = FALSE;
00742
00743 if (patternList == NULL) return(0);
00744
00745 firstLogical = patternList->logical;
00746
00747
00748
00749
00750
00751 for (;
00752 patternList != NULL;
00753 patternList = patternList->bottom)
00754 {
00755
00756
00757
00758
00759
00760 if ((patternList->type != PATTERN_CE) || (patternList->endNandDepth != 1))
00761 { continue; }
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771 if (patternList->logical == FALSE)
00772 {
00773 gap = TRUE;
00774 continue;
00775 }
00776
00777
00778
00779
00780
00781
00782
00783 if (! firstLogical)
00784 {
00785 PrintErrorID(theEnv,"RULEPSR",1,TRUE);
00786 EnvPrintRouter(theEnv,WERROR,"Logical CEs must be placed first in a rule\n");
00787 return(-1);
00788 }
00789
00790
00791
00792
00793
00794
00795
00796 if (gap)
00797 {
00798 PrintErrorID(theEnv,"RULEPSR",2,TRUE);
00799 EnvPrintRouter(theEnv,WERROR,"Gaps may not exist between logical CEs\n");
00800 return(-1);
00801 }
00802
00803
00804
00805
00806
00807 logicalJoin++;
00808 logicalsFound = TRUE;
00809 }
00810
00811
00812
00813
00814
00815
00816
00817 if (logicalsFound) return(logicalJoin);
00818
00819
00820
00821
00822
00823
00824 return(0);
00825 }
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837 globle struct lhsParseNode *FindVariable(
00838 SYMBOL_HN *name,
00839 struct lhsParseNode *theLHS)
00840 {
00841 struct lhsParseNode *theFields, *tmpFields = NULL;
00842 struct lhsParseNode *theReturnValue = NULL;
00843
00844
00845
00846
00847
00848 for (;
00849 theLHS != NULL;
00850 theLHS = theLHS->bottom)
00851 {
00852
00853
00854
00855
00856
00857
00858 if ((theLHS->type != PATTERN_CE) ||
00859 (theLHS->negated == TRUE) ||
00860 (theLHS->exists == TRUE) ||
00861 (theLHS->beginNandDepth > 1))
00862 { continue; }
00863
00864
00865
00866
00867
00868 if (theLHS->value == (void *) name)
00869 { theReturnValue = theLHS; }
00870
00871
00872
00873
00874
00875 theFields = theLHS->right;
00876 while (theFields != NULL)
00877 {
00878
00879
00880
00881
00882 if (theFields->multifieldSlot)
00883 {
00884 tmpFields = theFields;
00885 theFields = theFields->bottom;
00886 }
00887
00888
00889
00890
00891
00892
00893 if (theFields == NULL)
00894 { }
00895 else if (((theFields->type == SF_VARIABLE) ||
00896 (theFields->type == MF_VARIABLE)) &&
00897 (theFields->value == (void *) name))
00898 { theReturnValue = theFields; }
00899
00900
00901
00902
00903
00904 if (theFields == NULL)
00905 {
00906 theFields = tmpFields;
00907 tmpFields = NULL;
00908 }
00909 else if ((theFields->right == NULL) && (tmpFields != NULL))
00910 {
00911 theFields = tmpFields;
00912 tmpFields = NULL;
00913 }
00914 theFields = theFields->right;
00915 }
00916 }
00917
00918
00919
00920
00921
00922
00923 return(theReturnValue);
00924 }
00925
00926
00927
00928
00929 static void AddToDefruleList(
00930 struct defrule *rulePtr)
00931 {
00932 struct defrule *tempRule;
00933 struct defruleModule *theModuleItem;
00934
00935 theModuleItem = (struct defruleModule *) rulePtr->header.whichModule;
00936
00937 if (theModuleItem->header.lastItem == NULL)
00938 { theModuleItem->header.firstItem = (struct constructHeader *) rulePtr; }
00939 else
00940 {
00941 tempRule = (struct defrule *) theModuleItem->header.lastItem;
00942 while (tempRule != NULL)
00943 {
00944 tempRule->header.next = (struct constructHeader *) rulePtr;
00945 tempRule = tempRule->disjunct;
00946 }
00947 }
00948
00949 theModuleItem->header.lastItem = (struct constructHeader *) rulePtr;
00950 }
00951
00952 #if DEVELOPER && DEBUGGING_FUNCTIONS
00953
00954
00955
00956
00957 static void DumpRuleAnalysis(
00958 void *theEnv,
00959 struct lhsParseNode *tempNode)
00960 {
00961 struct lhsParseNode *traceNode;
00962 char buffer[20];
00963
00964 EnvPrintRouter(theEnv,WDISPLAY,"\n");
00965 for (traceNode = tempNode; traceNode != NULL; traceNode = traceNode->bottom)
00966 {
00967 if (! traceNode->userCE)
00968 { continue; }
00969
00970 gensprintf(buffer,"CE %2d: ",traceNode->whichCE);
00971 EnvPrintRouter(theEnv,WDISPLAY,buffer);
00972 PrintExpression(theEnv,WDISPLAY,traceNode->networkTest);
00973 EnvPrintRouter(theEnv,WDISPLAY,"\n");
00974
00975 if (traceNode->externalNetworkTest != NULL)
00976 {
00977 EnvPrintRouter(theEnv,WDISPLAY," ET: ");
00978 PrintExpression(theEnv,WDISPLAY,traceNode->externalNetworkTest);
00979 EnvPrintRouter(theEnv,WDISPLAY,"\n");
00980 }
00981
00982 if (traceNode->secondaryNetworkTest != NULL)
00983 {
00984 EnvPrintRouter(theEnv,WDISPLAY," ST: ");
00985 PrintExpression(theEnv,WDISPLAY,traceNode->secondaryNetworkTest);
00986 EnvPrintRouter(theEnv,WDISPLAY,"\n");
00987 }
00988
00989 if (traceNode->externalRightHash != NULL)
00990 {
00991 EnvPrintRouter(theEnv,WDISPLAY," EB: ");
00992 PrintExpression(theEnv,WDISPLAY,traceNode->externalRightHash);
00993 EnvPrintRouter(theEnv,WDISPLAY,"\n");
00994 }
00995
00996 if (traceNode->externalLeftHash != NULL)
00997 {
00998 EnvPrintRouter(theEnv,WDISPLAY," EH: ");
00999 PrintExpression(theEnv,WDISPLAY,traceNode->externalLeftHash);
01000 EnvPrintRouter(theEnv,WDISPLAY,"\n");
01001 }
01002
01003 if (traceNode->leftHash != NULL)
01004 {
01005 EnvPrintRouter(theEnv,WDISPLAY," LH: ");
01006 PrintExpression(theEnv,WDISPLAY,traceNode->leftHash);
01007 EnvPrintRouter(theEnv,WDISPLAY,"\n");
01008 }
01009
01010 if (traceNode->rightHash != NULL)
01011 {
01012 EnvPrintRouter(theEnv,WDISPLAY," RH: ");
01013 PrintExpression(theEnv,WDISPLAY,traceNode->rightHash);
01014 EnvPrintRouter(theEnv,WDISPLAY,"\n");
01015 }
01016
01017 if (traceNode->betaHash != NULL)
01018 {
01019 EnvPrintRouter(theEnv,WDISPLAY," BH: ");
01020 PrintExpression(theEnv,WDISPLAY,traceNode->betaHash);
01021 EnvPrintRouter(theEnv,WDISPLAY,"\n");
01022 }
01023 }
01024 }
01025 #endif
01026
01027 #endif
01028
01029 #endif
01030