  TParser is a component specialised in parsing and evaluating
mathematical expressions specified at runtime. It's performance
is remarkable - only 40-80% slower than similar compiled expression -
and it is by far the fastest parser on the freeware market.

  The programming interface is simple:
  - specify values for predefined variables in properties 
     A,B,C,D,E,X,Y or T;
  - specify expression to be evaluated in Expression property;
  - retrieve computed value in Value property. 

  Example:
    Parser1.X := 100;
    Parser1.Y := 200;
    Parser1.Expression := 'sin(x)*cos(y)';
    Result := Parser1.Value;

  Should you have to compute several values of the
same expression with different sets of variables, specify the
expression once - as this operation is time consuming - and
assign new values for variables and retrieve Value property as many
times as you wish. 

  Example:
    for i := 1 to 100 do
    begin
      Parser1.X := i;
      Result := Parser1.Value;
    end;

  You can add however variables of your own by
specifying their names and values with method SetVariable or
accessing them via a property (variable names are not case-
sensitive).

  Example (the following lines are all equivalent):

    Parser1.Variable['Test'] := 100;
    test := Parser1.Variable['Test'];

    Ptest : PFloat;

      Parser1.SetVariable('Test', 100);
      test := Parser1.GetVariable('Test');

      Ptest := SetVariable('Test', 100);
      Ptest^ := 200; { set 'Test' = 200 }    
      test := Ptest^;

  There is no limit for expression size in the 32bit version, 
while the 16bit version has a restriction of 255 characters.


  Predefined variables:
    PI
  
  Accepted operators: + , - , * , / , ^ , MOD, DIV
  [ MOD and DIV implicitly perform a trunc() on their operands ]

  The following functions are supported; it doesn't matter
  if you use lower or upper case:

    MIN, MAX,
    COS, SIN, SINH, COSH, EXP, LN, ARCTAN,
    SQRT, ABS,
    HEAV (heav(x) is =1 for x>0 and =0 for x<=0),
    SIGN (sign(x) is 1 for x>1, 0 for x=0, -1 for x<0),
    ZERO (zero(x) is 0 for x=0, 1 for x<>0),
    PH (ph(x) = x - 2*pi*round(x/2/pi))
    RND (RND(x) = x * Random)

  Adding your own functions is easy, too.
  Either use 

    AddFunctionOneParam   or
    AddFunctionTwoParam

  if you do not want to create a new class, or create a new
  class, inheriting from TParser and add your functions to
  the lists, as demonstrated in TParser.Create.



  Use and modification of TParser is entirely free, provided
that you preserve the following credits. Of course, it is 
at your own risk.



  Credits

  This component is based on original parser Pars7 developed by
Renate Schaaf (schaaf@math.usu.edu). Pars7 was fast indeed, but
somehow restricted to scientific purposes due to the limited
number of predefined variables. Unfortunately, Pars7 was quite 
stack hungry and had several elusive bugs while deallocating 
expression tree.
  Now dressed as a component, TParser has low stack demands even in
its 16 bit version, accepts practically an unlimited number of
variables, and several parts of builder code were entirely rewritten
for the sake of clarity.
  I would greatly appreciate suggestions, bug reports, any feed-back
that might contribute to further improve TParser's speed and 
functionality.

    Alin Flaider, aflaidar@datalog.ro


  Some changes have been made to TParser by

    Stefan Hoffmeister (Stefan.Hoffmeister@Uni-Passau.de).

  These have been documented in the component source code.