Listing: 1 IMPLEMENTATION MODULE StrLogic; 2 (* 3 * REPERTOIRE 4 * Release 1.6 5 * By Charles Bradford and Cole Brecheen 6 * (c) Copyright 1985-1992 PMI 7 * Green Bay, Wisconsin 8 * All rights reserved 9 * (414) 468-6040 10 * 11 * $Header: D:/logfiles/mods/strlogic.mov 1.5 10 Mar 1991 15:33:48 coleb $ 12 * 13 *) 14 15 16 IMPORT ErrorManager; 17 IMPORT LowLevel; 18 IMPORT M2Strings; 19 IMPORT PosUtils; 20 IMPORT StrConv; 21 IMPORT StrEdit; 22 IMPORT SYSTEM; 23 24 VAR 25 Initialized : BOOLEAN; 26 27 PROCEDURE Init(); 28 BEGIN 29 IF Initialized THEN 30 RETURN; 31 ELSE 32 Initialized := TRUE; 33 END; 34 ErrorManager.Init(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 35 LowLevel.Init(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 36 M2Strings.Init(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 37 PosUtils.Init(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 38 StrConv.Init(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 39 StrEdit.Init(); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 40 41 DelimitingChars := ' ,()[].!?";'; ***** ^ undeclared identifier ***** ^ not supported yet 42 EmbeddedStrMatters := TRUE; ***** ^ undeclared identifier 43 CaseSensitive := FALSE; ***** ^ undeclared identifier 44 END Init; ***** ^ not supported yet 45 46 47 CONST 48 null = ''; 49 VAR 50 FatalError : BOOLEAN; 51 52 PROCEDURE SpotInside( TheSpot: CARDINAL; 53 TheStr: ARRAY OF CHAR ): BOOLEAN; ***** ^ not supported yet 54 BEGIN 55 IF FatalError THEN RETURN FALSE END; 56 IF TheSpot <= HIGH(TheStr) THEN ***** ^ undeclared identifier ***** ^ not supported yet 57 RETURN TRUE; 58 ELSE 59 RETURN FALSE; 60 END; 61 END SpotInside; ***** ^ not supported yet 62 63 64 PROCEDURE CharCount(TheChar : CHAR; VAR TheStr : ARRAY OF CHAR) ***** ^ not supported yet 65 : CARDINAL; 66 (*CharCount returns the number of TheChar's in TheStr. It is 67 used in StrLogic to detect possible omissions of brackets 68 and quotation marks, and should be deleted when a program 69 is complete.*) 70 BEGIN 71 RETURN PosUtils.ByteCount(M2Strings.Length(TheStr), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 72 TheChar, 73 SYSTEM.ADR(TheStr) ); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 74 END CharCount; ***** ^ not supported yet 75 76 77 PROCEDURE ExpressionTest(ObjectStr, 78 FormulaList: ARRAY OF CHAR): CARDINAL; ***** ^ not supported yet 79 CONST 80 ExpressionSeparator = '\'; 81 blank = ' '; 82 OrSymbol = '|'; 83 AndSymbol = '&'; 84 NotSymbol = '~'; 85 LftBracket = '['; 86 RtBracket = ']'; 87 ExpansionChar = '*'; 88 (*If FormulaList is more than zero bytes long, this routine 89 copies string-analysis expressions out of FormulaList one-by- 90 one. After it copies an expression it replaces the bytes it 91 formerly occupied in FormulaList with blanks. It keeps going 92 until FormulaList is all blank, or until one of the expressions 93 returns a TRUE. It returns the number of that expression, or 94 it returns 0 if none of the expressions are TRUE.*) 95 96 PROCEDURE ThisExpression(object, 97 formula : ARRAY OF CHAR) : BOOLEAN; ***** ^ not supported yet 98 (*ThisExpression is the routine that does the analysis of each 99 individual expression in the FormulaList.*) 100 101 TYPE 102 LogicSymbol = (NoSmblAtAll, OrSmbl, AndSmbl, NotSmbl, 103 lftbracket, rtbracket, ElementalStmt); 104 CONST 105 StackSize = 50; 106 TotalSmbls = 3; 107 VAR 108 OnePattern : ARRAY [0..40] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 109 SymbolCode : LogicSymbol; ***** ^ not supported yet 110 PrecedenceCount, OldFormulaPtr, OperatorStackPtr, 111 ElementStackPtr : CARDINAL; 112 ElementStack : ARRAY [1..StackSize] OF BOOLEAN; ***** ^ not supported yet ***** ^ not supported yet 113 OperatorStack : ARRAY [0..StackSize] OF CARDINAL; ***** ^ not supported yet ***** ^ not supported yet 114 (*Although it might look more elegant to make this an 115 array of LogicSymbol's, we can't do it because we need 116 to add numbers out of sequence to PrecedenceCount.*) 117 118 PROCEDURE ElementTest(VAR TheElement, 119 object : ARRAY OF CHAR) : BOOLEAN; ***** ^ not supported yet 120 (*ElementTest returns TRUE for the following statements about the 121 sentence "A red car just ran over your cat." 122 L < 60 123 [L means length in characters.] 124 L = 33 125 'red' < 5 126 "car" > 5 127 'car' = 7 128 'cat' > 'car' 129 W > 1 130 [W means words; represents number of DelimitingChars + 1] 131 W = 8 132 It returns FALSE for such statements as: 133 'dog' < 20 134 [In other words, the fact that Pos would return a 0 for the 135 string does not make the expression true. Both patterns in 136 an expression have to be there for it to be true.] 137 *) 138 TYPE 139 OperatorType = (NoOperator, EqualTo, UnequalTo, GreaterThan, 140 GreaterThanOrEqualTo, LessThan, LessThanOrEqualTo); 141 142 PROCEDURE GetOperator(VAR TheStr : ARRAY OF CHAR; ***** ^ not supported yet 143 VAR TheOperator : OperatorType; 144 VAR TheSpot : CARDINAL); 145 CONST 146 operators = '=#><'; ***** ^ not supported yet 147 VAR 148 QuoteMark : CHAR; 149 (*Used to keep track of whether our quote mark is 150 single or double.*) 151 OpSpot, lngth, ndx : CARDINAL; 152 InString : BOOLEAN; 153 BEGIN 154 (*GetOperator*) 155 IF FatalError THEN RETURN END; 156 lngth := M2Strings.Length(TheStr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 157 ndx := 0; 158 InString := FALSE; 159 QuoteMark := 0C; 160 TheSpot := 255; 161 TheOperator := NoOperator; ***** ^ not supported yet ***** ^ not supported yet 162 OpSpot := 5; 163 (*OpSpot was uninitialized in Release 1.4; fixed in 164 Release 1.5 thanks to Mike Smyth.*) 165 WHILE (ndx' : 203 TheOperator := GreaterThan; ***** ^ not supported yet ***** ^ not supported yet 204 | '<' : 205 TheOperator := LessThan; ***** ^ not supported yet ***** ^ not supported yet 206 ELSE 207 ErrorManager.WARN('TheSpot wrong in GetOperator.'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 208 INC(StrLogicErrorLevel); ***** ^ undeclared identifier ***** ^ undeclared identifier 209 FatalError := TRUE; 210 RETURN; 211 END; 212 IF TheStr[ndx+1]='=' THEN ***** ^ not supported yet ***** ^ not supported yet 213 INC(TheOperator); ***** ^ undeclared identifier ***** ^ not supported yet 214 (*TheOperator should now be either 215 GreaterThanOrEqualTo or LessThanOrEqualTo.*) 216 END; 217 END; 218 INC(ndx); ***** ^ undeclared identifier ***** ^ not supported yet 219 END; 220 IF TheOperator=NoOperator THEN ***** ^ not supported yet ***** ^ not supported yet 221 TheSpot := lngth; 222 ELSIF TheSpot = 0 THEN 223 ErrorManager.WARN('Operator cannot begin an expression.'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 224 INC(StrLogicErrorLevel); ***** ^ undeclared identifier ***** ^ undeclared identifier 225 FatalError := TRUE; 226 END; 227 END GetOperator; ***** ^ not supported yet 228 229 PROCEDURE PosOfOneTerm(ElementStr, ObjStr : ARRAY OF CHAR; ***** ^ not supported yet 230 spot1, spot2 : CARDINAL; 231 VAR missing : BOOLEAN) : CARDINAL; 232 VAR 233 lngth, tmp, ndx : CARDINAL; 234 TmpStr : ARRAY [0..80] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 235 BEGIN 236 (*PosOfOneTerm*) 237 IF FatalError THEN RETURN 0 END; 238 missing := FALSE; 239 M2Strings.Copy(ElementStr, spot1, spot2-spot1+1, TmpStr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 240 StrEdit.CutLeadingChars(blank, TmpStr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 241 IF (TmpStr[0]="'") OR (TmpStr[0]='"') THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 242 StrEdit.DeleteChar(TmpStr[0], TmpStr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 243 IF EmbeddedStrMatters THEN ***** ^ undeclared identifier 244 tmp := M2Strings.Pos(TmpStr,ObjStr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 245 IF NOT SpotInside(tmp,ObjStr) THEN ***** ^ not supported yet ***** ^ not supported yet 246 missing := TRUE; 247 END; 248 RETURN tmp; 249 ELSE 250 tmp := PosUtils.PosDelimited(TmpStr,ObjStr,DelimitingChars); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier 251 IF NOT SpotInside(tmp,ObjStr) THEN ***** ^ not supported yet ***** ^ not supported yet 252 missing := TRUE; 253 END; 254 RETURN tmp; 255 END; 256 ELSIF TmpStr[0]='L' THEN ***** ^ not supported yet ***** ^ not supported yet 257 RETURN M2Strings.Length(ObjStr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 258 ELSIF TmpStr[0]='W' THEN ***** ^ not supported yet ***** ^ not supported yet 259 (*Count delimiters and return 0 or delimiters + 1.*) 260 lngth := M2Strings.Length(ObjStr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 261 ndx := 0; 262 tmp := 0; 263 WHILE ndx0) OR (lngth>0) THEN 270 INC(tmp); ***** ^ undeclared identifier ***** ^ not supported yet 271 END; 272 RETURN tmp; 273 ELSIF ((TmpStr[0]>='0') AND (TmpStr[0]<='9')) THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 274 IF StrConv.StrToCardinal(TmpStr,0,tmp) THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 275 RETURN tmp; 276 ELSE 277 StrEdit.Append( TmpStr, '-- This did not convert correctly.'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 278 ErrorManager.WARN(TmpStr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 279 INC(StrLogicErrorLevel); ***** ^ undeclared identifier ***** ^ undeclared identifier 280 FatalError := TRUE; 281 RETURN 0; 282 END; 283 ELSE 284 StrEdit.Append( TmpStr, ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 285 ' -- Illegal term in this StrLogic formula.'); ***** ^ not supported yet 286 ErrorManager.WARN(TmpStr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 287 INC(StrLogicErrorLevel); ***** ^ undeclared identifier ***** ^ undeclared identifier 288 FatalError := TRUE; 289 RETURN 0; 290 END; 291 END PosOfOneTerm; ***** ^ not supported yet 292 VAR 293 FirstTerm, SecondTerm, OperatorSpot : CARDINAL; 294 TermMissing : BOOLEAN; 295 TheOperator : OperatorType; ***** ^ not supported yet 296 297 BEGIN 298 (*ElementTest*) 299 IF FatalError THEN RETURN FALSE END; 300 GetOperator(TheElement, TheOperator, OperatorSpot); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 301 IF FatalError THEN RETURN FALSE END; 302 (*GetOperator cuts blanks, finds operaters if there are any, 303 indicates what they are in TheOperator, and indicates where 304 they are in OperatorSpot.*) 305 FirstTerm := PosOfOneTerm(TheElement, ***** ^ not supported yet ***** ^ not supported yet 306 object, ***** ^ not supported yet 307 0, 308 OperatorSpot-1, 309 TermMissing); ***** ^ not supported yet 310 (*The terms we're talking about here can be simple strings 311 (e.g., 'red'), decimal numbers, or length ('L') or width 312 ('W') variables. PosOfOneTerm evaluates those things 313 and gives us back a numeric result based on them.*) 314 IF FatalError THEN RETURN FALSE END; 315 IF TermMissing THEN 316 RETURN FALSE; 317 END; 318 IF TheOperator#NoOperator THEN ***** ^ not supported yet ***** ^ not supported yet 319 IF (TheOperator=GreaterThanOrEqualTo) OR (TheOperator= ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 320 LessThanOrEqualTo) THEN ***** ^ not supported yet 321 INC(OperatorSpot); ***** ^ undeclared identifier ***** ^ not supported yet 322 (*We have to do this because those symbols are two 323 characters long, and we want OperatorSpot to 324 indicate the last character of the operator in the 325 next call to PosOfOneTerm.*) 326 END; 327 SecondTerm := PosOfOneTerm(TheElement, ***** ^ not supported yet ***** ^ not supported yet 328 object, ***** ^ not supported yet 329 OperatorSpot+1, 330 M2Strings.Length(TheElement), ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 331 TermMissing); ***** ^ not supported yet 332 IF FatalError THEN RETURN FALSE END; 333 IF TermMissing THEN 334 RETURN FALSE; 335 END; 336 END; 337 CASE TheOperator OF ***** ^ not supported yet 338 NoOperator : ***** ^ not supported yet 339 RETURN TRUE; 340 (*We know it's TRUE here because if the term had 341 been missing and there had been no operator, we 342 would have returned FALSE above in the IF TermMissing 343 statements.*) 344 | EqualTo : ***** ^ not supported yet 345 RETURN (FirstTerm=SecondTerm); 346 | UnequalTo : ***** ^ not supported yet 347 RETURN (FirstTerm#SecondTerm); 348 | GreaterThan : ***** ^ not supported yet 349 RETURN (FirstTerm>SecondTerm); 350 | GreaterThanOrEqualTo : ***** ^ not supported yet 351 RETURN (FirstTerm>=SecondTerm); 352 | LessThan : ***** ^ not supported yet 353 RETURN (FirstTerm= FormulaLength) 435 OR (TheOperator#ElementalStmt); ***** ^ not supported yet ***** ^ not supported yet 436 IF ElementFound THEN 437 IF TheOperator # ElementalStmt THEN ***** ^ not supported yet ***** ^ not supported yet 438 DEC(FormulaPtr); ***** ^ undeclared identifier ***** ^ not supported yet 439 (*We DEC this because the INC at the 440 end of the loop makes it point to the character 441 AFTER the next one to be processed. FormulaPtr 442 is always supposed to be sitting on the next 443 character.*) 444 TheOperator := ElementalStmt; ***** ^ not supported yet ***** ^ not supported yet 445 (*We set this back to ElementalStmt because the 446 process of searching for the end of the statement 447 messed up the value of TheOperator.*) 448 END; 449 M2Strings.Copy(formula, OldFormulaPtr, ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 450 (FormulaPtr-OldFormulaPtr), TheElement); ***** ^ not supported yet 451 END; 452 OldFormulaPtr := FormulaPtr; 453 (*OldFormulaPtr gets updated in preparation for next call 454 to GetSymbolFromFormula.*) 455 END; 456 END GetSymbolFromFormula; ***** ^ not supported yet 457 458 PROCEDURE PrecedenceOf(logicsymbol : LogicSymbol) : CARDINAL; 459 BEGIN 460 IF FatalError THEN RETURN 0 END; 461 CASE logicsymbol OF ***** ^ not supported yet 462 NoSmblAtAll : ***** ^ not supported yet 463 RETURN (0); 464 | OrSmbl : ***** ^ not supported yet 465 RETURN (1); 466 | AndSmbl : ***** ^ not supported yet 467 RETURN (2); 468 | NotSmbl : ***** ^ not supported yet 469 RETURN (3); 470 | lftbracket : ***** ^ not supported yet 471 RETURN (4); 472 | rtbracket : ***** ^ not supported yet 473 RETURN (5); 474 ELSE 475 ErrorManager.WARN('PrecedenceOf got a weird LogicSymbol.'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 476 INC(StrLogicErrorLevel); ***** ^ undeclared identifier ***** ^ undeclared identifier 477 FatalError := TRUE; 478 RETURN 0; 479 END; 480 END PrecedenceOf; ***** ^ not supported yet 481 482 PROCEDURE ResolveStacks(); 483 VAR 484 Element : BOOLEAN; 485 BEGIN 486 (*ResolveStacks*) 487 IF FatalError THEN RETURN END; 488 WHILE (OperatorStackPtr>0) AND (OperatorStack[ ***** ^ not supported yet 489 OperatorStackPtr]>=PrecedenceOf(SymbolCode)+ ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 490 PrecedenceCount) DO 491 IF FatalError THEN RETURN END; 492 Element := ElementStack[ElementStackPtr]; ***** ^ not supported yet ***** ^ not supported yet 493 (*ElementStack is a stack of booleans.*) 494 CASE OperatorStack[OperatorStackPtr] MOD TotalSmbls OF ***** ^ not supported yet ***** ^ not supported yet 495 1 : 496 DEC(ElementStackPtr); ***** ^ undeclared identifier ***** ^ not supported yet 497 Element := Element OR ElementStack[ElementStackPtr]; ***** ^ not supported yet ***** ^ not supported yet 498 | 2 : 499 DEC(ElementStackPtr); ***** ^ undeclared identifier ***** ^ not supported yet 500 Element := Element AND ElementStack[ElementStackPtr]; ***** ^ not supported yet ***** ^ not supported yet 501 | 0, 3 : 502 Element := NOT Element; 503 ELSE 504 ErrorManager.WARN('Something strange in the OperatorStack.'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 505 INC(StrLogicErrorLevel); ***** ^ undeclared identifier ***** ^ undeclared identifier 506 FatalError := TRUE; 507 RETURN; 508 END; 509 ElementStack[ElementStackPtr] := Element; ***** ^ not supported yet ***** ^ not supported yet 510 DEC(OperatorStackPtr); ***** ^ undeclared identifier ***** ^ not supported yet 511 END; 512 END ResolveStacks; ***** ^ not supported yet 513 514 PROCEDURE AddToElementStack(TheElement : ARRAY OF CHAR); ***** ^ not supported yet 515 (*ElementStack is actually an array of booleans. 516 AddToElementStack puts a TRUE or a FALSE in the ElementStack, 517 depending on the presence or absence of TheElement in object.*) 518 VAR 519 tmp : BOOLEAN; 520 BEGIN 521 (*AddToElementStack*) 522 IF FatalError THEN RETURN END; 523 INC(ElementStackPtr); ***** ^ undeclared identifier ***** ^ not supported yet 524 IF ElementStackPtr>StackSize THEN 525 ErrorManager.WARN("Stack overflow in StrLogic."); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 526 INC(StrLogicErrorLevel); ***** ^ undeclared identifier ***** ^ undeclared identifier 527 FatalError := TRUE; 528 RETURN; 529 END; 530 tmp := ElementTest(TheElement,object); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 531 IF FatalError THEN RETURN END; 532 ElementStack[ElementStackPtr] := tmp; ***** ^ not supported yet ***** ^ not supported yet 533 END AddToElementStack; ***** ^ not supported yet 534 535 PROCEDURE AddToOperatorStack(symbol : LogicSymbol); 536 VAR 537 tmp : CARDINAL; 538 BEGIN 539 (*AddToOperatorStack*) 540 IF FatalError THEN RETURN END; 541 INC(OperatorStackPtr); ***** ^ undeclared identifier ***** ^ not supported yet 542 tmp := PrecedenceOf(symbol)+PrecedenceCount; ***** ^ not supported yet ***** ^ not supported yet 543 IF FatalError THEN RETURN END; 544 OperatorStack[OperatorStackPtr] := tmp; ***** ^ not supported yet ***** ^ not supported yet 545 END AddToOperatorStack; ***** ^ not supported yet 546 547 BEGIN 548 (*ThisExpression*) 549 IF FatalError THEN RETURN FALSE END; 550 StrEdit.CrunchBlanks(object); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 551 StrEdit.CrunchBlanks(formula); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 552 IF NOT CaseSensitive THEN ***** ^ undeclared identifier 553 StrEdit.CAPstr(object); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 554 StrEdit.CAPstr(formula); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 555 END; 556 OperatorStackPtr := 0; 557 OperatorStack[OperatorStackPtr] := 0; ***** ^ not supported yet ***** ^ not supported yet 558 ElementStackPtr := 0; 559 PrecedenceCount := 0; 560 OldFormulaPtr := 0; 561 (*OldFormulaPtr should always point to 562 the first character of the next pattern 563 in the formula that needs to be processed.*) 564 GetSymbolFromFormula(OnePattern, SymbolCode); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 565 IF SymbolCode=NoSmblAtAll THEN ***** ^ not supported yet ***** ^ not supported yet 566 RETURN FALSE; 567 ELSE 568 REPEAT 569 CASE SymbolCode OF ***** ^ not supported yet 570 ElementalStmt : ***** ^ not supported yet 571 AddToElementStack(OnePattern); ***** ^ not supported yet ***** ^ not supported yet 572 IF FatalError THEN RETURN FALSE END; 573 | OrSmbl, AndSmbl, NotSmbl : ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 574 ResolveStacks(); ***** ^ not supported yet ***** ^ not supported yet 575 IF FatalError THEN RETURN FALSE END; 576 AddToOperatorStack(SymbolCode); ***** ^ not supported yet ***** ^ not supported yet 577 | lftbracket : ***** ^ not supported yet 578 INC(PrecedenceCount, TotalSmbls); ***** ^ undeclared identifier ***** ^ not supported yet 579 | rtbracket : ***** ^ not supported yet 580 DEC(PrecedenceCount, TotalSmbls); ***** ^ undeclared identifier ***** ^ not supported yet 581 | NoSmblAtAll : ***** ^ not supported yet 582 ELSE 583 ErrorManager.WARN('SymbolCode probably not set.'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 584 INC(StrLogicErrorLevel); ***** ^ undeclared identifier ***** ^ undeclared identifier 585 FatalError := TRUE; 586 RETURN FALSE; 587 END; 588 (*case*) 589 GetSymbolFromFormula(OnePattern, SymbolCode); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 590 UNTIL SymbolCode=NoSmblAtAll; ***** ^ not supported yet ***** ^ not supported yet 591 ResolveStacks(); ***** ^ not supported yet ***** ^ not supported yet 592 IF FatalError THEN RETURN FALSE END; 593 IF ElementStackPtr<>1 THEN 594 ErrorManager.WARN('ThisExpression error.'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 595 INC(StrLogicErrorLevel); ***** ^ undeclared identifier ***** ^ undeclared identifier 596 FatalError := TRUE; 597 RETURN FALSE; 598 END; 599 RETURN (ElementStack[1]); ***** ^ not supported yet ***** ^ not supported yet 600 END; 601 END ThisExpression; ***** ^ not supported yet 602 VAR 603 ExpressionIdentifier, EndOfIdentifier, StartOfExpr, EndOfExpr, 604 lngth, FormulaNumber : CARDINAL; 605 TempExpr : ARRAY [0..255] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 606 BEGIN 607 (*ExpressionTest*) 608 FatalError := FALSE; 609 StrLogicErrorLevel := 0; ***** ^ undeclared identifier 610 lngth := M2Strings.Length(FormulaList); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 611 IF lngth=0 THEN 612 RETURN 0; 613 END; 614 FormulaNumber := 1; 615 StrEdit.AssignStr(null, TempExpr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 616 REPEAT 617 StartOfExpr := CARDINAL( 618 LowLevel.ScanNE(lngth, blank, SYSTEM.ADR(FormulaList))); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 619 (*If there are no leading blanks, StartOfExpr will be 0.*) 620 IF FormulaList[StartOfExpr]=ExpressionSeparator THEN ***** ^ not supported yet ***** ^ not supported yet 621 FormulaList[StartOfExpr] := blank; ***** ^ not supported yet ***** ^ not supported yet 622 (*We have to do this to remove any leading backslash. 623 We do it in a loop to make sure that StartOfExpr gets 624 off on the right foot, but an incidental result is 625 that all leading null expressions will be ignored.*) 626 END; 627 UNTIL FormulaList[StartOfExpr]#blank; ***** ^ not supported yet ***** ^ not supported yet 628 EndOfExpr := CARDINAL(LowLevel.ScanEQ(lngth, ***** ^ not supported yet ***** ^ not supported yet 629 ExpressionSeparator,SYSTEM.ADR(FormulaList))); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 630 (*If there's no ExpressionSeparator, EndOfExpr will equal lngth.*) 631 WHILE (StartOfExpr+1)