@@JclExprEval.pas
<GROUP ExprEval>
<TOPICORDER 100>
Summary:
  This unit contains three expression evaluators, each tailored for
  different usage patterns. It also contains the component objects, so that a
  customized expression evaluator can be assembled relatively easily.
Description:
  The key classes are TEvaluator, TCompiledEvaluator and
  TExpressionCompiler.
    *   For single evaluations of multiple expressions, use
        TEvaluator.
    *   For many evaluations of the same expression, use
        TCompiledEvaluator.
    *   For many evaluations of many expressions, use
        TExpressionCompiler.
  Customized evaluators can be put together from constituent parts.
Donator:
  Barry Kelly
Contributors:
  Barry Kelly
  Matthias Thoma
  Petr Vones
  Robert Marquardt
  Robert Rossmair
--------------------------------------------------------------------------------
@@cExprEvalHashSize
<GROUP ExprEval>
Summary:
  Initial size of internal hash lists created by TEasyEvaluator
  descendants, and also TExpressionCompiler.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@EJclExprEvalError
<GROUP ExprEval>
Summary:
  Exception class used by the expression evaluator.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TFloat
<GROUP ExprEval>
Summary:
  Floating-point type used by TLexer and TParser.Evaluate.
Donator:
  Barry Kelly
@@TFloat32
<GROUP ExprEval>
Summary:
  32-bit IEEE standard floating-point value.
Donator:
  Barry Kelly
@@PFloat32
<COMBINE TFloat32>
--------------------------------------------------------------------------------
@@TFloat64
<GROUP ExprEval>
Summary:
  64-bit IEEE standard floating-point value.
Donator:
  Barry Kelly
@@PFloat64
<COMBINE TFloat64>
--------------------------------------------------------------------------------
@@TFloat80
<GROUP ExprEval>
Summary:
  80-bit Intel extended precision floating-point value.
Donator:
  Barry Kelly
@@PFloat80
<COMBINE TFloat80>
--------------------------------------------------------------------------------
@@TFloatFunc
<GROUP ExprEval>
Summary:
  A function type taking no parameters.
Donator:
  Barry Kelly
@@TFloat32Func
<COMBINE TFloatFunc>
@@TFloat64Func
<COMBINE TFloatFunc>
@@TFloat80Func
<COMBINE TFloatFunc>
--------------------------------------------------------------------------------
@@TUnaryFunc
<GROUP ExprEval>
Summary:
  A function type taking a single parameter.
Donator:
  Barry Kelly
@@TUnary32Func
<COMBINE TUnaryFunc>
@@TUnary64Func
<COMBINE TUnaryFunc>
@@TUnary80Func
<COMBINE TUnaryFunc>
--------------------------------------------------------------------------------
@@TBinaryFunc
<GROUP ExprEval>
Summary:
  A function type taking two parameters.
Donator:
  Barry Kelly
@@TBinary32Func
<COMBINE TBinaryFunc>
@@TBinary64Func
<COMBINE TBinaryFunc>
@@TBinary80Func
<COMBINE TBinaryFunc>
--------------------------------------------------------------------------------
@@TTernaryFunc
<GROUP ExprEval>
Summary:
  A function type taking three parameters.
Donator:
  Barry Kelly
@@TTernary32Func
<COMBINE TTernaryFunc>
@@TTernary64Func
<COMBINE TTernaryFunc>
@@TTernary80Func
<COMBINE TTernaryFunc>
--------------------------------------------------------------------------------
@@TExprContext
<GROUP ExprEval>
Summary:
  Finds a symbol corresponding to an identifier.
Description:
  Expressions composed solely of numbers and operators may be
  evaluated quite easily, but to make an expression evaluator really
  useful requires that things like named constants, variables and
  functions be added as well.
  
  To allow a defined set of constants, variables and functions
  to be used in multiple evaluators (and mixed and matched according
  to need), the task of handling symbol resolution is devolved to
  an object known as a context.
  
  Contexts are not required to be flat; indeed, they are expected to
  be compound objects, which devolve to other, more specialized contexts
  to do actual resolution.
  
  As an example, consider the way names are resolved in Object Pascal.
  The set of valid symbols is initially defined by the System unit, and
  then added to with each unit named in the uses clause. When a method
  is being compiled, private, protected and public names come into the
  namespace; they aren't in effect with methods of other classes. In
  a similar way, contexts can be built up according to requirements.
Notes:
  Don't construct instances of TExprContext directly, since it is
  abstract; instead, construct a concrete descendant.
See also:
  TExprHashContext
  TExprSetContext
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprContext.Find
Summary:
  Finds a symbol corresponding to an identifier.
Parameters:
  s - The identifier of the symbol to find.
Result:
  Returns the symbol object, or nil if not found.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprHashContext
<GROUP ExprEval>
Summary:
  A context class that uses a hash map for its implementation.
Description:
  This is a concrete context class that uses a hash map for symbol
  lookup. The fact that it uses a hash for its implementation means that
  symbol lookup takes a constant time, i.e. it is independant of the
  actual number of symbols stored in the context; however, this
  guarantee depends on the internal hash map's internal table being
  large enough to minimize collisions.
Notes:
  Case sensitivity is also a concern; see the Create method.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprHashContext.Create
Summary:
  Creates an instance of THashContext.
Parameters:
  ACaseSensitive: Whether this context should be case sensitive or not.
  AHashSize: The hash size to pass on to the internal hash map structure.
Description:
  This constructs an instance of THashContext. The first
  parameter indicates case sensitivity; the meaning of the second
  parameter is slightly more subtle. It tells the context what
  value to pass on to the internal hash map's constructor. A large
  value will mean that the context will take up quite a bit of memory
  even when it is empty (4 bytes are added for every increase of 1
  in the hash size). For good performance, the hash should roughly
  be the expected average amount of items to be held in the hash.
  The performance degradation for too small hash tables is logarithmic,
  however, so only in pathalogical cases should this be a concern.
Notes:
  It is fairly important that the hash size not be an even
  number; it's best if it is a prime number, although typically
  a power of 2 minus one does fairly well (e.g. 127, 2047, etc.).
See also:
  TStringHashMap
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprHashContext.Destroy
Summary:
  Destroys this instance. Use Free instead.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprHashContext.Add
Summary:
  Adds a symbol to this context.
Description:
  Once a symbol has been added, the context takes over ownership
  of it, and will free it when it is itself destroyed.
Parameters:
  ASymbol - The symbol object to add.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprHashContext.Remove
Summary:
  Removes a symbol from this context.
Description:
  The symbol object refered to by AName will be destroyed.
Parameters:
  AName - Symbol to remove and free.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSetContext
<GROUP ExprEval>
Summary:
  A compound context object for combining multiple contexts.
Description:
  A context class that contains a set of other contexts, which it
  searches in order, starting with the most recently added.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSetContext.Create
Summary:
  Constructs an instance.
Parameters:
  AOwnsContexts - Determines whether this context object
                  should free contexts when they are deleted. You can use
                  Extract to remove a context while keeping it intact.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSetContext.Destroy
Summary:
  Destroys the TExprSetContext instance. Use Free instead.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSetContext.Add
Summary:
  Adds a context to the set.
Parameters:
  AContext - Context to add to the set of contexts.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSetContext.Remove
Summary:
  Removes a context.
Parameters:
  AContext - Context to remove.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSetContext.Delete
Summary:
  Removes a context by index.
Parameters:
  AIndex - Index of context to remove.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSetContext.Extract
Summary:
  Removes a context without freeing it (if AOwnsContexts was
  passed as True in the constructor Create).
Parameters:
  AContext - Context to remove.
Result:
  Returns the context passed in (AContext).
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSetContext.Count
Summary:
  Returns the number of contexts held by this set.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSetContext.Contexts
Summary:
  Accesses an internal context by index.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSetContext.InternalList
Summary:
  Access to the internal list of contexts for advanced operations.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSym
<GROUP ExprEval>
Summary:
  Represents a symbol that may be found in an input stream.
Description:
  An instance of this class is responsible for turning input lexemes
  (from the lexer) into either a concrete result (Evaluate) or
  expression nodes (Compile).
  
  Because this class has state (properties like Lexer, EvalParser,
  CompileParser, NodeFactory), a symbol should never be used by
  two threads simultaneously. This design decision was taken to
  maximize ease of creating new symbols.
  
  It is, however, safe to implement recursive symbols (i.e. a symbol
  that calls itself, even though it might be through another evaluator
  with different Lexer etc.) because the state is saved before Evaluate
  or Compile is called, and restored afterwards.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSym.Create
Summary:
  Constructs a new instance.
Parameters:
  AIdent - Identifier token that should trigger this symbol.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSym.Evaluate
Summary:
  Evaluates this symbol.
Description:
  This method is called by an evaluating Parser when it finds this
  symbol in its stream. It should call methods of the lexer and parser
  and ultimately return a value that represents the value of this
  symbol. The Lexer is positioned at the first token following the
  symbol.
See also:
  TExprSym.Compile
  TExprSym.Lexer
  TExprSym.EvalParser
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSym.Compile
Summary: Compiles this symbol.
Description:
  This method is called by a compiling Parser when it finds this symbol
  in its stream. It should call methods of the lexer and parser
  and ultimately return an expression node that contains all the
  necessary state to evaluate this symbol at expression evaluation
  time. The Lexer is positioned at the first token following the
  symbol.
See also:
  TExprNode
  TExprSym.Evaluate
  TExprSym.Lexer
  TExprSym.CompileParser
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSym.Ident
Summary:
  Identifier token that should trigger this symbol.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSym.Lexer
Summary:
  The lexical analyser that found this symbol in its stream.
Description:
  This property is set by the parser when it finds this symbol in the
  input stream. This is done so that the Evaluate and Compile methods
  can perform things like reading parameters etc., when they work
  out their context.
See also:
  TExprSym.EvalParser
  TExprSym.CompileParser
  TExprSym.NodeFactory
  TExprLexer
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSym.CompileParser
Summary:
  The compile parser that found this symbol in its stream.
Description:
  This property is set by a compiling parser when it finds this
  symbol in its input stream. This is done so that the Compile method
  can perform things like reading parameters etc., when it gathers
  sufficient information for compilation.
See also:
  TExprSym.EvalParser
  TExprSym.Lexer
  TExprSym.NodeFactory
  TExprCompileParser
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSym.EvalParser
Summary:
  The evaluation parser that found this symbol in its stream.
Description:
  This property is set by an evaluating parser when it finds this
  symbol in its input stream. This is done so that the Evaluate method
  can perform things like reading parameters etc., when it gathers
  sufficient information for evaluation.
See also:
  TExprSym.CompileParser
  TExprSym.Lexer
  TExprSym.NodeFactory
  TExprEvalParser
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSym.NodeFactory
Summary:
  The expression node factory object for creating expression
  node instances.
Description:
  This property is set by a compiling parser when it finds this symbol
  in its input stream. It is set to nil for an evaluating stream, so
  it is only valid to use this property in the Compile method. It is
  should be used to construct expression nodes with sufficient state
  to calculate the value of this symbol at expression evaluation time.
See also:
  TExprSym.Lexer
  TExprSym.CompileParser
  TExprSym.Compile
  TExprNodeFactory
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprToken
<GROUP ExprEval>
Summary:
  The type of token found by TExprLexer.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprLexer
<GROUP ExprEval>
Summary:
  A lexical analyser.
Description:
  An object of this class breaks up an input stream into lexemes -
  that is, it breaks down the input stream into tokens with two
  properties: type and content. The type describes what sort of
  token the current token is. The content gives further information
  about some tokens.

  For example, if the incoming stream is 'a + 03.60', then the lexical
  analyser will break it down into 3 tokens:
    * type (CurrTok): etIdentifier; content: TokenAsString = 'a'
    * type: etPlus; content: n/a
    * type: etNumber; content: TokenAsNumber = 3.6,
      also TokenAsString = '03.60'

  The token type is given by the CurrTok property, and the token
    content is given by the TokenAsString and TokenAsNumber properties.

  The current token is skipped and the next token loaded when the
  NextTok method is called. When the end of the input stream is
  found, CurrTok will be equal to etEof, and repeated calls of
  NextTok won't do anything (i.e. CurrTok will remain equal to etEof).
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprLexer.FCurrTok
Summary:
  NextTok should set as appropriate.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprLexer.FTokenAsNumber
Summary:
  NextTok should set as appropriate.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprLexer.FTokenAsString
Summary:
  NextTok should set as appropriate.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprLexer.Create
Summary:
  Constructs an instance and calls Reset.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprLexer.NextTok
Summary:
  Skips the current token and gets the next token.
Description:
  This method is called by Reset (and thus implicitly by Create), so
  it doesn't need to be called to get the first token in the stream.

  This method does the following jobs:
    * Skips whitespace
    * Determines token type from the first character after
      whitespace has been skipped
    * Reads in the rest of that token, based on the first character,
      possibly refining the token type based on further characters.
      For example, if '<' is read on the input stream, the token could
      be etLessThan, etNotEqual ('<>') or etLessEqual ('<=').
  
  After a call to this method, CurrTok will give the current token
  type, and TokenAsString and TokenAsNumber will give extra
  information as appropriate for the token type.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprLexer.Reset
Summary:
  Resets the position of the lexer to the start of its
  input stream.
Description:
  Overridden implementations should call this at the end of
  their implementations, because it calls NextTok by default.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprLexer.TokenAsString
Summary:
  String information about the current token if that is
  appropriate.
Description:
  This property is usually valid for tokens that don't have a fixed
  length, like etIdentifier and etNumber. It contains the text as
  found in the source stream, possibly after a little preprocessing
  (for instance, if the lexer supported strings, then this could
  return the string with control characters expanded). It is set by
  NextTok.
See also:
  NextTok
  TokenAsNumber
  CurrTok
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprLexer.TokenAsNumber
Summary:
  Number information about the current token if that is
  appropriate.
Description:
  This property is usually only valid for well-formed integer or
  floating-point numbers found in the source text. It is set by
  NextTok.
See also:
  NextTok
  TokenAsString
  CurrTok
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprLexer.CurrTok
Summary:
  The current token type.
Description:
  This contains the type of the token just read by NextTok.
See also:
  NextTok
  TokenAsString
  TokenAsNumber
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprNode
<GROUP ExprEval>
Summary:
  A node in an expression DAG (directed acyclic graph).
Description:
  This is the abstract object from which all expression DAG nodes
  descend. TExprNodeFactory has responsibility for constructing
  the correct class and acts as a container for TExprNode descendant
  instances.
Notes:
  Don't construct TExprNode objects directly; call the methods
  of a TExprNodeFactory instance.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprNode.Create
Summary:
  Constructs an instance.
Parameters:
  ADepList - A list of dependancies, nodes this expression node depends on.
Description:
  The dependancy list passed into this constructor should be the
  direct dependancies of this node.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprNode.Destroy
Summary:
  Destroys an instance. Use Free instead.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprNode.AddDep
Summary:
  Adds a dependancy.
Parameters:
  ADep - Dependancy to add.
Description:
  This method adds a dependancy to this node.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprNode.DepCount
Summary:
  Number of dependancies this node has.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprNode.Deps
Summary:
  Accesses a dependancy based on index.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprNode.DepList
Summary:
  Access to the internal dependancy list for advanced
  optimization strategies.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprNodeFactory
<GROUP ExprEval>
Summary:
  A factory class for TExprNode objects.
Description:
  When compiling an expression, the expression must be broken down
  into 'atomic' components, like add, subtract, load constant,
  load variable, call function etc. Because different compilation
  strategies may involve different atomic node classes, the task
  of atomic node construction is given to a separate factory object.
  This object should keep a list of all the nodes it has constructed,
  and act as an interface for the construction of new nodes.
  
  Concrete descendants of this factory should have a GenCode method
  that is specific to the implementation strategy. That GenCode method
  is a prime candidate for expression optimizations like common
  sub-expression elimination, constant sub-expression evaluation, etc.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprNodeFactory.LoadVar32
Summary:
  Loads the variable pointed to by ALoc.
Description:
  Generates a node that will load a variable from a pointer. The
  type is important, because variables of different types are of
  different sizes and have different formats.
Parameters:
  ALoc - Location of the variable to load.
Donator:
  Barry Kelly
@@TExprNodeFactory.LoadVar64
<COMBINE LoadVar32>
@@TExprNodeFactory.LoadVar80
<COMBINE LoadVar32>
--------------------------------------------------------------------------------
@@TExprNodeFactory.LoadConst32
Summary:
  Loads a constant value.
Description:
  Generates a node that will load a constant value. The type is
  important because less precision will mean faster evaluation.
Parameters:
  AValue - The value to load.
Donator:
  Barry Kelly
@@TExprNodeFactory.LoadConst64
<COMBINE LoadConst32> }
@@TExprNodeFactory.LoadConst80
<COMBINE LoadConst32> }
--------------------------------------------------------------------------------
@@TExprNodeFactory.CallFloatFunc
Summary:
  Calls a function.
Description:
  Generates a node that will call a function, possibly with
  parameters. There are 4 basic types of functions directly supported
  here: no parameters (Float*), 1 parameter (Unary*), 2 parameters
  (Binary*) and 3 parameters (Ternary*).
Donator:
  Barry Kelly
@@TExprNodeFactory.CallFloat32Func
<COMBINE CallFloatFunc>
@@TExprNodeFactory.CallFloat64Func
<COMBINE CallFloatFunc>
@@TExprNodeFactory.CallFloat80Func
<COMBINE CallFloatFunc>
@@TExprNodeFactory.CallUnaryFunc
<COMBINE CallFloatFunc>
@@TExprNodeFactory.CallUnary32Func
<COMBINE CallFloatFunc>
@@TExprNodeFactory.CallUnary64Func
<COMBINE CallFloatFunc>
@@TExprNodeFactory.CallUnary80Func
<COMBINE CallFloatFunc>
@@TExprNodeFactory.CallBinaryFunc
<COMBINE CallFloatFunc>
@@TExprNodeFactory.CallBinary32Func
<COMBINE CallFloatFunc>
@@TExprNodeFactory.CallBinary64Func
<COMBINE CallFloatFunc>
@@TExprNodeFactory.CallBinary80Func
<COMBINE CallFloatFunc>
@@TExprNodeFactory.CallTernaryFunc
<COMBINE CallFloatFunc>
@@TExprNodeFactory.CallTernary32Func
<COMBINE CallFloatFunc>
@@TExprNodeFactory.CallTernary64Func
<COMBINE CallFloatFunc>
@@TExprNodeFactory.CallTernary80Func
<COMBINE CallFloatFunc>
--------------------------------------------------------------------------------
@@TExprNodeFactory.Add
Summary:
  Performs an arithmetic operation.
Description:
  These functions generate nodes that perform an arithmetic operation
  on their operands.
Donator:
  Barry Kelly
@@TExprNodeFactory.Subtract
<COMBINE Add>
@@TExprNodeFactory.Multiply
<COMBINE Add>
@@TExprNodeFactory.Divide
<COMBINE Add>
@@TExprNodeFactory.Negate
<COMBINE Add>
--------------------------------------------------------------------------------
@@TExprNodeFactory.Compare
Summary:
  Performs a comparison.
Description:
  Compare returns a node that evaluates to -1, 0, or 1 depending on
  whether ALeft is less than, equal to, or greater than ARight,
  respectively.
Parameters:
  ALeft - Left side of comparison.
  ARight - Right side of comparison.
Result:
  Returns a node that represents this comparison.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprNodeFactory.LoadVar@PFloat32
Summary:
  Overloaded declarations for auto-selection of correct
  function in code.
Description:
  These functions should auto-select the correct function for
  the input variable in code, making it more maintainable.
Donator:
  Barry Kelly
@@TExprNodeFactory.LoadVar@PFloat64
<COMBINE TExprNodeFactory.LoadVar@PFloat32>
@@TExprNodeFactory.LoadVar@PFloat80
<COMBINE TExprNodeFactory.LoadVar@PFloat32>
@@TExprNodeFactory.LoadConst@TFloat32
<COMBINE TExprNodeFactory.LoadVar@PFloat32>
@@TExprNodeFactory.LoadConst@TFloat64
<COMBINE TExprNodeFactory.LoadVar@PFloat32>
@@TExprNodeFactory.LoadConst@TFloat80
<COMBINE TExprNodeFactory.LoadVar@PFloat32>
--------------------------------------------------------------------------------
@@TExprCompileParser
<GROUP ExprEval>
Summary:
  A compiling parser.
Description:
  This is a compiling parser. It analyses the input stream of tokens
  from its lexer using a grammar and builds a graph of nodes that
  contains enough information to be converted into a high-speed
  evaluation structure, or possibly even machine code.

  The key methods are Create and Compile.
See also:
  TExprEvalParser
  TExprLexer
  TExprSym
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprCompileParser.Create
Summary:
  Constructs an instance.
Parameters:
  ALexer       - The source of tokens to use. It doesn't take ownership of the lexer.
  ANodeFactory - The factory object to use for creating expression
                 nodes. It doesn't take ownership of the factory.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprCompileParser.Compile
Summary:
  Compiles an expression from the lexical source.
Description:
  This method compiles the expression by descending through its
  grammatical methods, starting with CompileExpr.
Result:
  Returns the top-level expression node.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprCompileParser.Lexer
Summary:
  The source of tokens for this parser.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprCompileParser.NodeFactory
Summary:
  The node factory object that constructs concrete node types.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprCompileParser.Context
Summary:
  The context object used for symbol lookup.
Description:
  This property gives the context object that will be used for
  symbol lookup. Whenever an identifier is found in the input
  stream, the context will be searched (with TContext.Find), and the
  symbol found will have its TExprSym.Compile
  method called. If no symbol is found or the Context property is nil,
  then an exception will be raised.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprCompileParser.CompileExprLevel0
Summary: 
 Compiles relational operators and uses CompileExprLevel1.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprCompileParser.CompileExprLevel1
Summary:
  Compiles +, -, etc and uses CompileExprLevel2.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprCompileParser.CompileExprLevel2
Summary:
  Compiles *, /, etc and uses CompileExprLevel3.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprCompileParser.CompileExprLevel3
Summary:
  Compiles unary negate etc, and uses CompileFactor.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprCompileParser.CompileFactor
Summary:
  Compiles subexpressions (i.e. '(' & ')'), numbers, but defers
  identifiers to CompileIdentFactor.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprCompileParser.CompileIdentFactor
Summary:
  Looks up the symbol corresponding to an identifier and
  returns its compilation.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprEvalParser
<GROUP ExprEval>
Summary:
  An evaluating parser.
Description:
  This is an evaluating parser. It evaluates the result of an expression
  as it grammatically analyses the input stream of tokens from its lexer.
  It returns a floating-point value.
See also:
  TExprCompileParser
  TExprLexer
  TExprSym
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprEvalParser.Create
Summary:
  Constructs an instance.
Parameters:
  ALexer - The source of tokens to use. It doesn't take ownership of the lexer.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprEvalParser.Evaluate
Summary:
  Evaluates an expression from the lexical source.
Description:
  This method evaluates the expression by descending through its
  grammatical methods, starting with EvalExpr.
Returns:
  The result of the evaluation.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprEvalParser.Lexer
Summary:
  The source of tokens for this parser.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprEvalParser.Context
Summary:
  The context object used for symbol lookup.
Description:
  This property gives the context object that will be used for
  symbol lookup. Whenever an identifier is found in the input
  stream, the context will be searched (with TContext.Find), and
  the symbol found will have its TExprSym.Evaluate
  method called. If no symbol is found or the Context property is nil,
  then an exception will be raised.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprEvalParser.EvalExprLevel0
Summary:
  Evaluates relational operators and uses EvalExprLevel1.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprEvalParser.EvalExprLevel1
Summary:
  Evaluates +, -, etc and uses EvalExprLevel2.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprEvalParser.EvalExprLevel2
Summary:
  Evaluates *, /, etc and uses EvalExprLevel3.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprEvalParser.EvalExprLevel3
Summary:
  Evaluates unary negate etc, and uses EvalFactor.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprEvalParser.EvalFactor
Summary:
  Evaluates subexpressions (i.e. '(' & ')'), numbers, but defers
  identifiers to EvalIdentFactor.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprEvalParser.EvalIdentFactor
Summary: Looks up the symbol corresponding to an identifier and
  returns its evaluation.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSimpleLexer
<GROUP ExprEval>
Summary:
  A simple expression lexical analyser.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSimpleLexer.FCurrPos
Summary:
  Current position in buffer.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSimpleLexer.FBuf
Summary:
  Buffer containing expression.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSimpleLexer.SetBuf
Summary:
  Sets a new buffer and calls Reset.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSimpleLexer.Create
Summary:
  Constructs an instance with a buffer ABuf.
Parameters:
  ABuf - A string containing an expression.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprSimpleLexer.Buf
Summary:
  Buffer to read expression from.
Description:
  Set this to change the source text the lexer extracts its tokens
  from. When it is set, the property setter calls the Reset method,
  so the lexer will be in a valid state to serve tokens.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprVirtMachOp
<GROUP ExprEval>
Summary:
  An operation that can be executed by a TExprVirtMach instance.
Description:
  TExprVirtMachOp is the kernel of TExprVirtMach's operation. The
  containing class (TExprVirtMach) is just that - a container, and
  it just executes the instructions in order to do work.
  
  Each instruction has a virtual Execute method, which should read
  input from somewhere and write output to somewhere else. Typically,
  the input is a series of pointers to floating-point variables, and
  the output is to one or more member variables. The output acts as
  input for instructions further on in the execution stream; for this
  mechanism to work, the inputs of downstream instructions must be
  'wired' to the outputs of upstream instructions.
See also:
  TExprVirtMach
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprVirtMachOp.FOutput
Summary:
  The actual variable this operation will write its output to.
Description:
  This is the internal storage variable this operation will write
  its output to. Operations that use this operation for input should
  take the address of this variable (through the OutputLoc property)
  to get the result of evaluating this operation.
  
  It is protected to allow easy (and fast) access for descendants.
See also:
  OutputLoc
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprVirtMachOp.Execute
Summary:
  Executes this instruction.
Description:
  This method executes this instruction, reading from its inputs
  and writing to its output location. It returns False to terminate
  the execution sequence early; usually it returns True.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprVirtMachOp.OutputLoc
Summary:
  The address to which this operation will write its output to.
See also:
  FOutput
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprVirtMach
<GROUP ExprEval>
Summary:
  A virtual machine for evaluating expressions relatively quickly.
See also:
  TExprVirtMachNodeFactory, TExprVirtMachOp
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprVirtMach.Create
Summary:
  Constructs an instance.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprVirtMach.Destroy
Summary:
  Destroys an instance. Use Free instead.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprVirtMach.Add
Summary:
  Adds an operation to the end of the list of operations.
Parameters:
  AOp - The operation to add.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprVirtMach.AddConst
Summary:
  Adds a constant to the constant list.
Parameters:
  AOp - The constant to add.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprVirtMach.Clear
Summary:
  Clears any stored code.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprVirtMach.Execute
Summary:
  Executes the stored code and returns the result.
Description:
  This method executes the stored instructions in order starting
  at the beginning until it either runs out of instructions or it
  encounters a halt instruction.
Result:
  Returns the value output by the last instruction executed (the result).
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprVirtMachNodeFactory
<GROUP ExprEval>
Summary:
  A node factory for virtual machine instructions.
Description:
  This is a factory class for the default virtual machine.
See also:
  TExprVirtMach
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprVirtMachNodeFactory.Create
Summary:
  Constructs an instance.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprVirtMachNodeFactory.Destroy
Summary:
  Destroys an instance. Use Free instead.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprVirtMachNodeFactory.GenCode
Summary:
  Generates code for a virtual machine.
Description:
  This method converts the internal node DAG into instructions for
  the virtual machine passed in.
Parameters:
  AVirtMach - The virtual machine to generate code for.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprConstSym
<GROUP ExprEval>
Summary:
  Symbol for a constant of type TFloat.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprConstSym.Create
Summary:
  Constructs an instance.
Parameters:
  AIdent - Identifier for this constant.
  AValue - Value this identifier should evaluate to.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprConst32Sym
<GROUP ExprEval>
Summary:
  Symbol for a constant of type TFloat32.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprConst64Sym
<GROUP ExprEval>
Summary:
  Symbol for a constant of type TFloat64.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprConst80Sym
<GROUP ExprEval>
Summary:
  Symbol for a constant of type TFloat80.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprVar32Sym
<GROUP ExprEval>
Summary:
  This class evaluates and / or compiles code for a 32-bit FP variable.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprVar32Sym.Create
Summary:
  Constructs a symbol representing a 32-bit FP variable.
Parameters:
  AIdent - Name of the variable.
  ALoc - Address of the variable.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprVar64Sym
<GROUP ExprEval>
Summary:
  This class evaluates and / or compiles code for a 64-bit FP variable.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprVar64Sym.Create
Summary:
  Constructs a symbol representing a 64-bit FP variable.
Parameters:
  AIdent - Name of the variable.
  ALoc - Address of the variable.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprVar80Sym
<GROUP ExprEval>
Summary:
  This class evaluates and / or compiles code for an 80-bit FP variable.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprVar80Sym.Create
Summary:
  Constructs a symbol representing an 80-bit FP variable.
Parameters:
  AIdent - Name of the variable.
  ALoc - Address of the variable.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprAbstractFuncSym
<GROUP ExprEval>
Summary:
  A helper ancestor for function symbols.
Description:
  This is a useful class to use as an ancestor for function symbols
  because it has protected methods to read parameters.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprAbstractFuncSym.EvalFirstArg
Summary:
  Evaluates the first argument using the EvalParser.
Description:
  This method will raise an exception if there is a missing '(' or
  missing first argument.
Result:
  Returns the evaluation of the first argument.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprAbstractFuncSym.EvalNextArg
Summary:
  Evaluates a second or subsequent argument using EvalParser.
Description:
  This method will raise an exception if there is a missing ',' or
  missing argument after the comma.
Result:
  Returns the evaluation of the next argument.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprAbstractFuncSym.CompileFirstArg
Summary:
  Compiles the first argument using the CompileParser.
Description:
  This method will raise an exception if there is a missing '(' or
  missing first argument.
Result:
  Returns the compiled node for the first argument.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprAbstractFuncSym.CompileNextArg
Summary:
  Compiles a second or subsequent argument using CompileParser.
Description:
  This method will raise an exception if there is a missing ',' or
  missing argument after the comma.
Result:
  Returns the compiled node for the next argument.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprAbstractFuncSym.EndArgs
Summary:
  Reads in the end of an argument list.
Description:
  This method will raise an exception if the current token isn't ')'.
  After checking, it skips the right parenthesis.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprFuncSym
<GROUP ExprEval>
Summary:
  Function symbol for TFloatFunc.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprFuncSym.Create
Summary:
  Constructs an instance.
Parameters:
  AIdent - Identifier for this function.
  AFunc - Function that evaluates this symbol.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprFloat32FuncSym
<GROUP ExprEval>
Summary:
  Function symbol for TFloat32Func.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprFloat32FuncSym.Create
Summary:
  Constructs an instance.
Parameters:
  AIdent - Identifier for this function.
  AFunc - Function that evaluates this symbol.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprFloat64FuncSym
<GROUP ExprEval>
Summary:
  Function symbol for TFloat64Func.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprFloat64FuncSym.Create
Summary:
  Constructs an instance.
Parameters:
  AIdent - Identifier for this function.
  AFunc - Function that evaluates this symbol.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprFloat80FuncSym
<GROUP ExprEval>
Summary:
  Function symbol for TFloat80Func.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprFloat80FuncSym.Create
Summary:
  Constructs an instance.
Parameters:
  AIdent - Identifier for this function.
  AFunc - Function that evaluates this symbol.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprUnaryFuncSym
<GROUP ExprEval>
Summary:
  Function symbol for TUnaryFunc.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprUnaryFuncSym.Create
Summary:
  Constructs an instance.
Parameters:
  AIdent - Identifier for this function.
  AFunc - Function that evaluates this symbol.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprUnary32FuncSym
<GROUP ExprEval>
Summary:
  Function symbol for TUnary32Func.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprUnary32FuncSym.Create
Summary:
  Constructs an instance.
Parameters:
  AIdent - Identifier for this function.
  AFunc - Function that evaluates this symbol.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprUnary64FuncSym
<GROUP ExprEval>
Summary:
  Function symbol for TUnary64Func.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprUnary64FuncSym.Create
Summary:
  Constructs an instance.
Parameters:
  AIdent - Identifier for this function.
  AFunc - Function that evaluates this symbol.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprUnary80FuncSym
<GROUP ExprEval>
Summary:
  Function symbol for TUnary80Func.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprUnary80FuncSym.Create
Summary:
  Constructs an instance.
Parameters:
  AIdent - Identifier for this function.
  AFunc - Function that evaluates this symbol.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprBinaryFuncSym
<GROUP ExprEval>
Summary:
  Function symbol for TBinaryFunc.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprBinaryFuncSym.Create
Summary:
  Constructs an instance.
Parameters:
  AIdent - Identifier for this function.
  AFunc - Function that evaluates this symbol.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprBinary32FuncSym
<GROUP ExprEval>
Summary:
  Function symbol for TBinary32Func.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprBinary32FuncSym.Create
Summary:
  Constructs an instance.
Parameters:
  AIdent - Identifier for this function.
  AFunc - Function that evaluates this symbol.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprBinary64FuncSym
<GROUP ExprEval>
Summary:
  Function symbol for TBinary64Func.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprBinary64FuncSym.Create
Summary:
  Constructs an instance.
Parameters:
  AIdent - Identifier for this function.
  AFunc - Function that evaluates this symbol.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprBinary80FuncSym
<GROUP ExprEval>
Summary:
  Function symbol for TBinary80Func.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprBinary80FuncSym.Create
Summary:
  Constructs an instance.
Parameters:
  AIdent - Identifier for this function.
  AFunc - Function that evaluates this symbol.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprTernaryFuncSym
<GROUP ExprEval>
Summary:
  Function symbol for TTernaryFunc.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprTernaryFuncSym.Create
Summary:
  Constructs an instance.
Parameters:
  AIdent - Identifier for this function.
  AFunc - Function that evaluates this symbol.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprTernary32FuncSym
<GROUP ExprEval>
Summary:
  Function symbol for TTernary32Func.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprTernary32FuncSym.Create
Summary:
  Constructs an instance.
Parameters:
  AIdent - Identifier for this function.
  AFunc - Function that evaluates this symbol.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprTernary64FuncSym
<GROUP ExprEval>
Summary:
  Function symbol for TTernary64Func.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprTernary64FuncSym.Create
Summary:
  Constructs an instance.
Parameters:
  AIdent - Identifier for this function.
  AFunc - Function that evaluates this symbol.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprTernary80FuncSym
<GROUP ExprEval>
Summary:
  Function symbol for TTernary80Func.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExprTernary80FuncSym.Create
Summary:
  Constructs an instance.
Parameters:
  AIdent - Identifier for this function.
  AFunc - Function that evaluates this symbol.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TEasyEvaluator
<GROUP ExprEval>
Summary:
  This is an abstract class that provides friendly methods for
  adding constanst, variables, functions and external contexts.
Description:
  This is an abstract class provided so that symbols can be added
  to descendants' internal contexts with minimum hassle. Use a concrete
  descendant, like TEvaluator or TCompiledEvaluator instead.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TEasyEvaluator.InternalContextSet
Summary:
  Provides protected access to the internal context set.
Description:
  This is provided so that descendants can set their parser's Context
  property.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TEasyEvaluator.Create
Summary:
  Creates an instance.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TEasyEvaluator.Destroy
Summary:
  Destroys an instance. Use Free instead.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TEasyEvaluator.AddVar@string@TFloat32
Summary:
  Adds a variable.
Description:
  Adds a variable to the internal context. Whenever the variable
  is found in an expression, its current value will be inserted.
Parameters:
  AName - Identifier of variable to add.
  AVar - Location of variable to add.
Notes:
  An assumption that may be made by optimizing compilers is that
  functions don't modify variables, and that functions may be called
  in any order.

  Any variables added using these methods will override
  identifiers of the same name in external contexts added through
  ExtContextSet.
Donator:
  Barry Kelly
@@TEasyEvaluator.AddVar@string@TFloat64
<COMBINE TEasyEvaluator.AddVar@string@TFloat32>
@@TEasyEvaluator.AddVar@string@TFloat80
<COMBINE TEasyEvaluator.AddVar@string@TFloat32>
--------------------------------------------------------------------------------
@@TEasyEvaluator.AddConst@string@TFloat32
Summary:
  Adds a constant.
Description:
  Adds a constant to the internal context. Constants are different
  from variables because sub-expressions made entirely from
  constants may be evaluated only once (at compile time), and that
  value used for all subsequent evaluations.
Parameters:
  AName - Identifier for the constant.
  AConst - Value of constant.
Notes:
  Any constants added using these methods will override
  identifiers of the same name in external contexts added through
  ExtContextSet.
Donator:
  Barry Kelly
@@TEasyEvaluator.AddConst@string@TFloat64
<COMBINE TEasyEvaluator.AddConst@string@TFloat32>
@@TEasyEvaluator.AddConst@string@TFloat80
<COMBINE TEasyEvaluator.AddConst@string@TFloat32>
--------------------------------------------------------------------------------
@@TEasyEvaluator.AddFunc@string@TFloat32Func
Summary:
  Adds a function.
Description:
  Adds a function to the internal context. Multiple calls to the
  same function with the same parameters might be resolved to
  a single call during common sub-expression elimination (CSE)
  optimization. A possible workaround would be to add a fake extra
  parameter and pass in different constant for each distinct call.
Parameters:
  AName - Identifier for the function.
  AFunc - Function pointer that evaluates the function.
Notes:
  Any functions added using these methods will override
  identifiers of the same name in external contexts added through
  ExtContextSet.
Donator:
  Barry Kelly
@@TEasyEvaluator.AddFunc@string@TFloat64Func
<COMBINE TEasyEvaluator.AddFunc@string@TFloat32Func>
@@TEasyEvaluator.AddFunc@string@TFloat80Func
<COMBINE TEasyEvaluator.AddFunc@string@TFloat32Func>
@@TEasyEvaluator.AddFunc@string@TFloat64Func
<COMBINE TEasyEvaluator.AddFunc@string@TFloat32Func>
@@TEasyEvaluator.AddFunc@string@TUnary32Func
<COMBINE TEasyEvaluator.AddFunc@string@TFloat32Func>
@@TEasyEvaluator.AddFunc@string@TUnary64Func
<COMBINE TEasyEvaluator.AddFunc@string@TFloat32Func>
@@TEasyEvaluator.AddFunc@string@TUnary80Func
<COMBINE TEasyEvaluator.AddFunc@string@TFloat32Func>
@@TEasyEvaluator.AddFunc@string@TBinary32Func
<COMBINE TEasyEvaluator.AddFunc@string@TFloat32Func>
@@TEasyEvaluator.AddFunc@string@TBinary64Func
<COMBINE TEasyEvaluator.AddFunc@string@TFloat32Func>
@@TEasyEvaluator.AddFunc@string@TBinary80Func
<COMBINE TEasyEvaluator.AddFunc@string@TFloat32Func>
@@TEasyEvaluator.AddFunc@string@TTernary32Func
<COMBINE TEasyEvaluator.AddFunc@string@TFloat32Func>
@@TEasyEvaluator.AddFunc@string@TTernary64Func
<COMBINE TEasyEvaluator.AddFunc@string@TFloat32Func>
@@TEasyEvaluator.AddFunc@string@TTernary80Func
<COMBINE TEasyEvaluator.AddFunc@string@TFloat32Func>
--------------------------------------------------------------------------------
@@TEasyEvaluator.Remove
Summary:
  Removes an identifier from the internal context.
Description:
  This method removes an identifier from the internal context and
  frees its associated symbol.
Parameters:
  AName - Identifier to remove.
Notes:
  This is the only way to remove a single identifier from the
  internal context (call Clear to remove all identifiers).
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TEasyEvaluator.Clear
Summary:
  Clears all identifiers from the internal context.
Description:
  This method clears the internal context of symbols. It doesn't
  affect any contexts added through ExtContextSet.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TEasyEvaluator.ExtContextSet
Summary:
  A set of external contexts that are looked up after the internal context.
Description:
  This property allows the addition of multiple utility contexts
  to this expression evaluator. Things like function libraries,
  variable sets, constant libraries etc. may be added using methods
  of this property.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TEvaluator
<GROUP ExprEval>
Summary:
  Quick evaluator shell object.
Description:
  This is an encapsulation of a simple lexer and an evaluating
  parser. It evaluates while parsing, and it doesn't store any
  compiled expression. This means it evaluates quite quickly, but
  isn't very fast for repeated evaluations of the same expression.
Example:
  Create a new project, remove the default form and replace the contents
  of the project file with this:
<code>
  uses SysUtils, JclExprEval, Dialogs;

  function MyAdder(X, Y: Double): Double;
  begin
    Result := X + Y + 0.12;
  end;

  var
    evaluator: TEvaluator;
    X: Double;
    Y: Extended;
  begin
    evaluator := TEvaluator.Create;
    try
      evaluator.AddVar('X', X);
      evaluator.AddVar('Y', Y);
      evaluator.AddFunc('MyAdder', MyAdder);

      X := 3.5;
      Y := 0.7;
      ShowMessage(Format('Delphi says: %.4g',
        [MyAdder(X, Y)]));
      ShowMessage(Format('TEvaluator says: %.4g',
        [evaluator.Evaluate('MyAdder(X, Y)')]));
    finally
      evaluator.Free;
    end;
  end.
</code>
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TEvaluator.Create
Summary:
  Constructs an instance.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TEvaluator.Destroy
Summary:
  Destroys an instance. Use Free instead.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TEvaluator.Evaluate
Summary:
  Evaluates an expression.
Description:
  This sets the lexer source to AExpr, and calls the parser's
  TExprEvalParser.Evaluate method.
Parameters:
  AExpr - The expression to evaluate.
Result:
 Returns the result of the evaluation.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TCompiledEvaluator
<GROUP ExprEval>
Summary:
  An evaluator that first compiles an expression into an
  intermediate form, then evaluates it on demand.
Description:
  This evaluator is suitable for applications like graphing, where
  there is just one expression which is constantly evaluated with
  variables and/or functions changing value. It takes longer to
  compile than TEvaluator does to evaluate, but once compiled is
  much faster.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TCompiledEvaluator.Create
Summary:
  Constructs an instance.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TCompiledEvaluator.Compile
Summary:
  Compiles an expression.
Parameters:
  AExpr - The expression to compile.
Description:
  Compiles the expression given by AExpr, and stores its compiled
  state internally, so that it can be evaluated quickly.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TCompiledEvaluator.Evaluate
Summary:
  Evaluates the internal compiled expression.
Description:
  Executes the internal compiled state, and returns the evaluation.
  If there was an error while compiling, or the object is just after
  being created, it returns zero.
Result:
  The result of the evaluation.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TCompiledExpression
<GROUP ExprEval>
Summary:
  A compiled expression, which may be called directly to evaluate.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExpressionCompiler
<GROUP ExprEval>
Summary:
  An expression compiler, for multiple expressions.
Description:
  This is a multiple expression compiler. It compiles expressions into
  function pointers, so that the function pointer can be called as if
  it were an ordinary Delphi function. It takes longer to compile an
  expression than TEvaluator does to evaluate, but once compiled it is
  much faster at evaluating.
  
  It is suitable for spreadsheet-like applications, where there may
  be thousands of functions, all of which have to be evaluated
  quickly and repeatedly.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExpressionCompiler.Create
Summary:
  Constructs an instance.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExpressionCompiler.Compile
Summary:
  Compiles an expression into a function pointer.
Description:
  This method compiles the given expression into an internal
  representation (a reference to which is kept internally), and
  returns a function pointer that evaluates the expression
  whenever called.
  
  Because a reference is kept internally, to free the expression
  (and thus release its resources), either the Remove or Delete
  methods must be called. Calling Clear will free all expressions,
  as will freeing this compiler.
Parameters:
  AExpr - Expression to compile.
Result:
  Returns a function pointer which, when called, will evaluate the result of
  the expression and return it.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExpressionCompiler.Remove
Summary:
  Frees a compiled expression.
Description:
  Remove frees the expression into which AExpr was compiled. AExpr is
  used as a string to look up a hash map, so it should be identical
  to the string passed in to Compile.
Parameters:
  AExpr - Expression to remove.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExpressionCompiler.Delete
Summary:
  Frees a compiled expression.
Description:
  Delete frees the expression referenced by ACompiledExpression.
Parameters:
  ACompiledExpression - Expression to remove.
Donator:
  Barry Kelly
--------------------------------------------------------------------------------
@@TExpressionCompiler.Clear
Summary:
  Clears all compiled expressions.
Description:
  This method frees all internal compiled expressions; this will
  invalidate any remaining compiled expression function pointers,
  and subsequntly calling one of these remaining function pointers
  will result in undefined behaviour (probably an access violation).
Donator:
  Barry Kelly
--------------------------------------------------------------------------------