00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #define _FACTPRT_SOURCE_
00022
00023 #include <stdio.h>
00024 #define _STDIO_INCLUDED_
00025
00026 #include "setup.h"
00027
00028 #if DEFTEMPLATE_CONSTRUCT && DEFRULE_CONSTRUCT
00029
00030 #include "envrnmnt.h"
00031 #include "symbol.h"
00032 #include "router.h"
00033 #include "factgen.h"
00034
00035 #include "factprt.h"
00036
00037
00038
00039
00040
00041 #if WIN_BTC && (! DEVELOPER)
00042 #pragma argsused
00043 #endif
00044 globle void PrintFactJNCompVars1(
00045 void *theEnv,
00046 char *logicalName,
00047 void *theValue)
00048 {
00049 #if DEVELOPER
00050 struct factCompVarsJN1Call *hack;
00051
00052 hack = (struct factCompVarsJN1Call *) ValueToBitMap(theValue);
00053 EnvPrintRouter(theEnv,logicalName,"(fact-jn-cmp-vars1 ");
00054 if (hack->pass) EnvPrintRouter(theEnv,logicalName,"= ");
00055 else EnvPrintRouter(theEnv,logicalName,"<> ");
00056
00057 EnvPrintRouter(theEnv,logicalName,"p");
00058 PrintLongInteger(theEnv,logicalName,(long long) hack->pattern1);
00059
00060 if (hack->p1lhs)
00061 { EnvPrintRouter(theEnv,logicalName," L"); }
00062 else if (hack->p1rhs)
00063 { EnvPrintRouter(theEnv,logicalName," R"); }
00064
00065 EnvPrintRouter(theEnv,logicalName," s");
00066 PrintLongInteger(theEnv,logicalName,(long long) hack->slot1);
00067
00068 EnvPrintRouter(theEnv,logicalName," p");
00069 PrintLongInteger(theEnv,logicalName,(long long) hack->pattern2);
00070
00071 if (hack->p2lhs)
00072 { EnvPrintRouter(theEnv,logicalName," L"); }
00073 else if (hack->p2rhs)
00074 { EnvPrintRouter(theEnv,logicalName," R"); }
00075
00076 EnvPrintRouter(theEnv,logicalName," s");
00077 PrintLongInteger(theEnv,logicalName,(long long) hack->slot2);
00078 EnvPrintRouter(theEnv,logicalName,")");
00079 #else
00080 #if MAC_MCW || WIN_MCW || MAC_XCD
00081 #pragma unused(theEnv)
00082 #pragma unused(logicalName)
00083 #pragma unused(theValue)
00084 #endif
00085 #endif
00086 }
00087
00088
00089
00090
00091
00092 #if WIN_BTC && (! DEVELOPER)
00093 #pragma argsused
00094 #endif
00095 globle void PrintFactJNCompVars2(
00096 void *theEnv,
00097 char *logicalName,
00098 void *theValue)
00099 {
00100 #if DEVELOPER
00101 struct factCompVarsJN2Call *hack;
00102
00103 hack = (struct factCompVarsJN2Call *) ValueToBitMap(theValue);
00104 EnvPrintRouter(theEnv,logicalName,"(fact-jn-cmp-vars2 ");
00105 if (hack->pass) EnvPrintRouter(theEnv,logicalName,"= ");
00106 else EnvPrintRouter(theEnv,logicalName,"<> ");
00107
00108 EnvPrintRouter(theEnv,logicalName,"p");
00109 PrintLongInteger(theEnv,logicalName,(long long) hack->pattern1);
00110
00111 if (hack->p1lhs)
00112 { EnvPrintRouter(theEnv,logicalName," L"); }
00113 else if (hack->p1rhs)
00114 { EnvPrintRouter(theEnv,logicalName," R"); }
00115
00116 EnvPrintRouter(theEnv,logicalName," s");
00117 PrintLongInteger(theEnv,logicalName,(long long) hack->slot1);
00118
00119 if (hack->fromBeginning1) EnvPrintRouter(theEnv,logicalName, " b");
00120 else EnvPrintRouter(theEnv,logicalName," e");
00121
00122 EnvPrintRouter(theEnv,logicalName," f");
00123 PrintLongInteger(theEnv,logicalName,(long long) hack->offset1);
00124
00125 EnvPrintRouter(theEnv,logicalName," p");
00126 PrintLongInteger(theEnv,logicalName,(long long) hack->pattern2);
00127
00128 if (hack->p2lhs)
00129 { EnvPrintRouter(theEnv,logicalName," L"); }
00130 else if (hack->p2rhs)
00131 { EnvPrintRouter(theEnv,logicalName," R"); }
00132
00133 EnvPrintRouter(theEnv,logicalName," s");
00134 PrintLongInteger(theEnv,logicalName,(long long) hack->slot2);
00135
00136 if (hack->fromBeginning2) EnvPrintRouter(theEnv,logicalName," b");
00137 else EnvPrintRouter(theEnv,logicalName," e");
00138
00139 EnvPrintRouter(theEnv,logicalName," f");
00140 PrintLongInteger(theEnv,logicalName,(long long) hack->offset2);
00141 EnvPrintRouter(theEnv,logicalName,")");
00142 #else
00143 #if MAC_MCW || WIN_MCW || MAC_XCD
00144 #pragma unused(theEnv)
00145 #pragma unused(logicalName)
00146 #pragma unused(theValue)
00147 #endif
00148 #endif
00149 }
00150
00151
00152
00153
00154
00155 #if WIN_BTC && (! DEVELOPER)
00156 #pragma argsused
00157 #endif
00158 globle void PrintFactPNCompVars1(
00159 void *theEnv,
00160 char *logicalName,
00161 void *theValue)
00162 {
00163 #if DEVELOPER
00164 struct factCompVarsPN1Call *hack;
00165
00166 hack = (struct factCompVarsPN1Call *) ValueToBitMap(theValue);
00167 EnvPrintRouter(theEnv,logicalName,"(fact-pn-cmp-vars ");
00168 if (hack->pass) EnvPrintRouter(theEnv,logicalName,"p ");
00169 else EnvPrintRouter(theEnv,logicalName,"n ");
00170 PrintLongInteger(theEnv,logicalName,(long long) hack->field1);
00171 EnvPrintRouter(theEnv,logicalName," ");
00172 PrintLongInteger(theEnv,logicalName,(long long) hack->field2);
00173 EnvPrintRouter(theEnv,logicalName,")");
00174 #else
00175 #if MAC_MCW || WIN_MCW || MAC_XCD
00176 #pragma unused(theEnv)
00177 #pragma unused(logicalName)
00178 #pragma unused(theValue)
00179 #endif
00180 #endif
00181 }
00182
00183
00184
00185
00186
00187 #if WIN_BTC && (! DEVELOPER)
00188 #pragma argsused
00189 #endif
00190 globle void PrintFactSlotLength(
00191 void *theEnv,
00192 char *logicalName,
00193 void *theValue)
00194 {
00195 #if DEVELOPER
00196 struct factCheckLengthPNCall *hack;
00197
00198 hack = (struct factCheckLengthPNCall *) ValueToBitMap(theValue);
00199
00200 EnvPrintRouter(theEnv,logicalName,"(slot-length ");
00201 PrintLongInteger(theEnv,logicalName,(long long) hack->whichSlot);
00202 EnvPrintRouter(theEnv,logicalName," ");
00203 if (hack->exactly) EnvPrintRouter(theEnv,logicalName,"= ");
00204 else EnvPrintRouter(theEnv,logicalName,">= ");
00205 PrintLongInteger(theEnv,logicalName,(long long) hack->minLength);
00206 EnvPrintRouter(theEnv,logicalName,")");
00207 #else
00208 #if MAC_MCW || WIN_MCW || MAC_XCD
00209 #pragma unused(theEnv)
00210 #pragma unused(logicalName)
00211 #pragma unused(theValue)
00212 #endif
00213 #endif
00214 }
00215
00216
00217
00218
00219
00220 #if WIN_BTC && (! DEVELOPER)
00221 #pragma argsused
00222 #endif
00223 globle void PrintFactJNGetVar1(
00224 void *theEnv,
00225 char *logicalName,
00226 void *theValue)
00227 {
00228 #if DEVELOPER
00229 struct factGetVarJN1Call *hack;
00230
00231 hack = (struct factGetVarJN1Call *) ValueToBitMap(theValue);
00232 EnvPrintRouter(theEnv,logicalName,"(fact-jn-getvar-1 ");
00233 if (hack->factAddress) EnvPrintRouter(theEnv,logicalName,"t ");
00234 else EnvPrintRouter(theEnv,logicalName,"f ");
00235 if (hack->allFields) EnvPrintRouter(theEnv,logicalName,"t ");
00236 else EnvPrintRouter(theEnv,logicalName,"f ");
00237
00238 EnvPrintRouter(theEnv,logicalName,"p");
00239 PrintLongInteger(theEnv,logicalName,(long long) hack->whichPattern + 1);
00240 EnvPrintRouter(theEnv,logicalName," ");
00241 PrintLongInteger(theEnv,logicalName,(long long) hack->whichField);
00242 EnvPrintRouter(theEnv,logicalName," s");
00243 PrintLongInteger(theEnv,logicalName,(long long) hack->whichSlot);
00244
00245 if (hack->lhs)
00246 { EnvPrintRouter(theEnv,logicalName," L"); }
00247 else if (hack->rhs)
00248 { EnvPrintRouter(theEnv,logicalName," R"); }
00249 EnvPrintRouter(theEnv,logicalName,")");
00250 #else
00251 #if MAC_MCW || WIN_MCW || MAC_XCD
00252 #pragma unused(theEnv)
00253 #pragma unused(logicalName)
00254 #pragma unused(theValue)
00255 #endif
00256 #endif
00257 }
00258
00259
00260
00261
00262
00263 #if WIN_BTC && (! DEVELOPER)
00264 #pragma argsused
00265 #endif
00266 globle void PrintFactJNGetVar2(
00267 void *theEnv,
00268 char *logicalName,
00269 void *theValue)
00270 {
00271 #if DEVELOPER
00272 struct factGetVarJN2Call *hack;
00273
00274 hack = (struct factGetVarJN2Call *) ValueToBitMap(theValue);
00275 EnvPrintRouter(theEnv,logicalName,"(fact-jn-getvar-2");
00276
00277 EnvPrintRouter(theEnv,logicalName," p");
00278 PrintLongInteger(theEnv,logicalName,(long long) hack->whichPattern + 1);
00279 EnvPrintRouter(theEnv,logicalName," s");
00280 PrintLongInteger(theEnv,logicalName,(long long) hack->whichSlot);
00281 if (hack->lhs)
00282 { EnvPrintRouter(theEnv,logicalName," L"); }
00283 else if (hack->rhs)
00284 { EnvPrintRouter(theEnv,logicalName," R"); }
00285 EnvPrintRouter(theEnv,logicalName,")");
00286 #else
00287 #if MAC_MCW || WIN_MCW || MAC_XCD
00288 #pragma unused(theEnv)
00289 #pragma unused(logicalName)
00290 #pragma unused(theValue)
00291 #endif
00292 #endif
00293 }
00294
00295
00296
00297
00298
00299 #if WIN_BTC && (! DEVELOPER)
00300 #pragma argsused
00301 #endif
00302 globle void PrintFactJNGetVar3(
00303 void *theEnv,
00304 char *logicalName,
00305 void *theValue)
00306 {
00307 #if DEVELOPER
00308 struct factGetVarJN3Call *hack;
00309
00310 hack = (struct factGetVarJN3Call *) ValueToBitMap(theValue);
00311 EnvPrintRouter(theEnv,logicalName,"(fact-jn-getvar-3 ");
00312 if (hack->fromBeginning) EnvPrintRouter(theEnv,logicalName,"t ");
00313 else EnvPrintRouter(theEnv,logicalName,"f ");
00314 if (hack->fromEnd) EnvPrintRouter(theEnv,logicalName,"t ");
00315 else EnvPrintRouter(theEnv,logicalName,"f ");
00316
00317 PrintLongInteger(theEnv,logicalName,(long long) hack->beginOffset);
00318 EnvPrintRouter(theEnv,logicalName," ");
00319 PrintLongInteger(theEnv,logicalName,(long long) hack->endOffset);
00320 EnvPrintRouter(theEnv,logicalName," ");
00321 PrintLongInteger(theEnv,logicalName,(long long) hack->whichSlot);
00322
00323 EnvPrintRouter(theEnv,logicalName," p");
00324 PrintLongInteger(theEnv,logicalName,(long long) hack->whichPattern + 1);
00325
00326 if (hack->lhs)
00327 { EnvPrintRouter(theEnv,logicalName," L"); }
00328 else if (hack->rhs)
00329 { EnvPrintRouter(theEnv,logicalName," R"); }
00330
00331 EnvPrintRouter(theEnv,logicalName,")");
00332 #else
00333 #if MAC_MCW || WIN_MCW || MAC_XCD
00334 #pragma unused(theEnv)
00335 #pragma unused(logicalName)
00336 #pragma unused(theValue)
00337 #endif
00338 #endif
00339 }
00340
00341
00342
00343
00344
00345 #if WIN_BTC && (! DEVELOPER)
00346 #pragma argsused
00347 #endif
00348 globle void PrintFactPNGetVar1(
00349 void *theEnv,
00350 char *logicalName,
00351 void *theValue)
00352 {
00353 #if DEVELOPER
00354 struct factGetVarPN1Call *hack;
00355
00356 hack = (struct factGetVarPN1Call *) ValueToBitMap(theValue);
00357 EnvPrintRouter(theEnv,logicalName,"(fact-pn-getvar-1 ");
00358 if (hack->factAddress) EnvPrintRouter(theEnv,logicalName,"t ");
00359 else EnvPrintRouter(theEnv,logicalName,"f ");
00360 if (hack->allFields) EnvPrintRouter(theEnv,logicalName,"t F");
00361 else EnvPrintRouter(theEnv,logicalName,"f F");
00362
00363 PrintLongInteger(theEnv,logicalName,(long long) hack->whichField);
00364 EnvPrintRouter(theEnv,logicalName," S");
00365 PrintLongInteger(theEnv,logicalName,(long long) hack->whichSlot);
00366 EnvPrintRouter(theEnv,logicalName,")");
00367 #else
00368 #if MAC_MCW || WIN_MCW || MAC_XCD
00369 #pragma unused(theEnv)
00370 #pragma unused(logicalName)
00371 #pragma unused(theValue)
00372 #endif
00373 #endif
00374 }
00375
00376
00377
00378
00379
00380 #if WIN_BTC && (! DEVELOPER)
00381 #pragma argsused
00382 #endif
00383 globle void PrintFactPNGetVar2(
00384 void *theEnv,
00385 char *logicalName,
00386 void *theValue)
00387 {
00388 #if DEVELOPER
00389 struct factGetVarPN2Call *hack;
00390
00391 hack = (struct factGetVarPN2Call *) ValueToBitMap(theValue);;
00392 EnvPrintRouter(theEnv,logicalName,"(fact-pn-getvar-2 S");
00393 PrintLongInteger(theEnv,logicalName,(long long) hack->whichSlot);
00394 EnvPrintRouter(theEnv,logicalName,")");
00395 #else
00396 #if MAC_MCW || WIN_MCW || MAC_XCD
00397 #pragma unused(theEnv)
00398 #pragma unused(logicalName)
00399 #pragma unused(theValue)
00400 #endif
00401 #endif
00402 }
00403
00404
00405
00406
00407
00408 #if WIN_BTC && (! DEVELOPER)
00409 #pragma argsused
00410 #endif
00411 globle void PrintFactPNGetVar3(
00412 void *theEnv,
00413 char *logicalName,
00414 void *theValue)
00415 {
00416 #if DEVELOPER
00417 struct factGetVarPN3Call *hack;
00418
00419 hack = (struct factGetVarPN3Call *) ValueToBitMap(theValue);
00420 EnvPrintRouter(theEnv,logicalName,"(fact-pn-getvar-3 ");
00421
00422 if (hack->fromBeginning) EnvPrintRouter(theEnv,logicalName,"t ");
00423 else EnvPrintRouter(theEnv,logicalName,"f ");
00424 if (hack->fromEnd) EnvPrintRouter(theEnv,logicalName,"t B");
00425 else EnvPrintRouter(theEnv,logicalName,"f B");
00426
00427 PrintLongInteger(theEnv,logicalName,(long long) hack->beginOffset);
00428 EnvPrintRouter(theEnv,logicalName," E");
00429 PrintLongInteger(theEnv,logicalName,(long long) hack->endOffset);
00430 EnvPrintRouter(theEnv,logicalName," S");
00431 PrintLongInteger(theEnv,logicalName,(long long) hack->whichSlot);
00432 EnvPrintRouter(theEnv,logicalName,")");
00433 #else
00434 #if MAC_MCW || WIN_MCW || MAC_XCD
00435 #pragma unused(theEnv)
00436 #pragma unused(logicalName)
00437 #pragma unused(theValue)
00438 #endif
00439 #endif
00440 }
00441
00442
00443
00444
00445
00446 #if WIN_BTC && (! DEVELOPER)
00447 #pragma argsused
00448 #endif
00449 globle void PrintFactPNConstant1(
00450 void *theEnv,
00451 char *logicalName,
00452 void *theValue)
00453 {
00454 #if DEVELOPER
00455 struct factConstantPN1Call *hack;
00456
00457 hack = (struct factConstantPN1Call *) ValueToBitMap(theValue);
00458
00459 EnvPrintRouter(theEnv,logicalName,"(fact-pn-constant1 ");
00460
00461 PrintLongInteger(theEnv,logicalName,(long long) hack->whichSlot);
00462
00463 if (hack->testForEquality) EnvPrintRouter(theEnv,logicalName," = ");
00464 else EnvPrintRouter(theEnv,logicalName," != ");
00465
00466 PrintAtom(theEnv,logicalName,GetFirstArgument()->type,GetFirstArgument()->value);
00467 EnvPrintRouter(theEnv,logicalName,")");
00468 #else
00469 #if MAC_MCW || WIN_MCW || MAC_XCD
00470 #pragma unused(theEnv)
00471 #pragma unused(logicalName)
00472 #pragma unused(theValue)
00473 #endif
00474 #endif
00475 }
00476
00477
00478
00479
00480
00481 #if WIN_BTC && (! DEVELOPER)
00482 #pragma argsused
00483 #endif
00484 globle void PrintFactPNConstant2(
00485 void *theEnv,
00486 char *logicalName,
00487 void *theValue)
00488 {
00489 #if DEVELOPER
00490 struct factConstantPN2Call *hack;
00491
00492 hack = (struct factConstantPN2Call *) ValueToBitMap(theValue);
00493
00494 EnvPrintRouter(theEnv,logicalName,"(fact-pn-constant2 ");
00495
00496 PrintLongInteger(theEnv,logicalName,(long long) hack->whichSlot);
00497
00498 EnvPrintRouter(theEnv,logicalName," ");
00499
00500 PrintLongInteger(theEnv,logicalName,(long long) hack->offset);
00501
00502 if (hack->testForEquality) EnvPrintRouter(theEnv,logicalName," = ");
00503 else EnvPrintRouter(theEnv,logicalName," != ");
00504
00505 PrintAtom(theEnv,logicalName,GetFirstArgument()->type,GetFirstArgument()->value);
00506 EnvPrintRouter(theEnv,logicalName,")");
00507 #else
00508 #if MAC_MCW || WIN_MCW || MAC_XCD
00509 #pragma unused(theEnv)
00510 #pragma unused(logicalName)
00511 #pragma unused(theValue)
00512 #endif
00513 #endif
00514 }
00515
00516 #endif
00517
00518