home *** CD-ROM | disk | FTP | other *** search
/ Math Solutions 1995 October / Math_Solutions_CD-ROM_Walnut_Creek_October_1995.iso / pc / mac / graphing / dynamicm / dynamicm.int < prev    next >
Encoding:
Text File  |  1993-04-15  |  926 b   |  48 lines

  1. unit DynamicMath;
  2.  
  3. { Dynamic Math. A library to parse and interpret formulas during }
  4. { the programs execution time  }
  5. {}
  6. { © 1993 by Christian Franz }
  7.  
  8. interface
  9.  
  10.     const
  11.  
  12.         eClsExpected = -1; (* ")" expected *)
  13.         eOpnExpected = -2; (* "(" expected *)
  14.         eUnknownSymbol = -3; (* unknown function *)
  15.  
  16. {$PUSH}
  17. {$J+}
  18.  
  19.     type
  20.     (* The Item object is just defined so your  *)
  21.     (* compiler doesn't gag on the Formula      *)
  22.     (* definition. Don't change or even use it! *)
  23.         Item = object (* don't ever mess with me *)
  24.                 thevalue: real;
  25.                 negate: boolean;
  26.                 function evaluate: real; (* no you don't *)
  27.             end;
  28.  
  29.         Formula = object
  30.                 structure: Item;
  31.                 function evaluate (x, y: real): real;
  32.         (* call me to evaluate parsed function *)
  33.             end;
  34.  
  35.     var
  36.         gPos: integer;
  37.  
  38. {$J-}
  39. {POP}
  40.  
  41.  
  42.     procedure Str2Text (s: Str255; var t: CharsHandle);
  43.  
  44.     function Parse (text: CharsHandle; var theFormula: Formula): Integer;
  45.  
  46. implementation
  47.  
  48. end.