Unit 'fpexprpars' Package
[Overview][Constants][Types][Classes][Procedures and functions][Index] [#fcl]

TFPExpressionParser

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Class for parsing and evaluating mathematical expressions

Declaration

Source position: fpexprpars.pp line 726

type TFPExpressionParser = class(TComponent)

public

  constructor Create(); override;

  

Create expression parser instance

  destructor Destroy; override;

  

Destroy expression parser and free resources

  function IdentifierByName(); virtual;

  

Get identifier definition by name

  procedure Clear;

  

Clear the current expression

  procedure EvaluateExpression();

  

Evaluate the expression and return result

  procedure ExtractIdentifierNames();

  function ExtractNode();

  

Extract expression node from result

  function Evaluate;

  

Evaluate the current expression

  function ResultType;

  

Get the result type of the expression

  function HasAggregate;

  

Check if expression contains aggregates

  procedure InitAggregate;

  

Initialize aggregate calculation

  procedure UpdateAggregate;

  

Update aggregate calculation with value

  property AsFloat: TExprFloat; [r]

  

Expression result as floating point value

  property AsCurrency: Currency; [r]

  

Expression result as currency value

  property AsInteger: Int64; [r]

  

Expression result as integer value

  property AsString: AnsiString; [r]

  

Expression result as string value

  property AsBoolean: Boolean; [r]

  

Expression result as boolean value

  property AsDateTime: TDateTime; [r]

  

Expression result as date/time value

published

  property Expression: Ansistring; [rw]

  

Expression string to be evaluated

  property Identifiers: TFPExprIdentifierDefs; [rw]

  

Collection of identifiers and their values

  property BuiltIns: TBuiltInCategories; [rw]

  

Manager for built-in functions and constants

end;

Inheritance

TFPExpressionParser

  

Class for parsing and evaluating mathematical expressions

|

TComponent

|

TPersistent,IUnknown,IInterfaceComponentReference

|

TObject,IFPObserved

Description

This is the main expression parser class that provides comprehensive functionality for parsing and evaluating mathematical expressions.

The parser handles the complete expression evaluation pipeline from tokenization through parsing to evaluation, supporting complex expressions with proper operator precedence, parentheses, function calls, and variable references.

Key features include built-in mathematical functions, string operations, date/time handling, boolean logic, comparison operations, and extensibility through custom functions and variables.

See also

TExprBuiltInManager

  

Class for managing built-in functions and variables in expressions


Documentation generated on: Dec 15 2025