Sign in Join
FPDoc Onlineexperiment

TFPExpressionParser class

In unit fpExprPars

Class for parsing and evaluating mathematical expressions

Declaration

pascal
TFPExpressionParser = class(TComponent)

Inheritance

  1. TFPExpressionParser
  2. TComponent
  3. TPersistent
  4. TObject

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

Properties

Scannerprotected
ExprNodeprotected
Dirtyprotected
ExtractingIdentifiersprotected
AsFloatpublicExpression result as floating point value
AsCurrencypublicExpression result as currency value
AsIntegerpublicExpression result as integer value
AsStringpublicExpression result as string value
AsBooleanpublicExpression result as boolean value
AsDateTimepublicExpression result as date/time value
ExpressionpublishedExpression string to be evaluated
IdentifierspublishedCollection of identifiers and their values
BuiltInspublishedManager for built-in functions and constants

Methods

ParserErrorprotected
SetExpressionprotected
CheckResultTypeprotected
CheckResultTypesprotected
ConvertNodeprotected
BuiltinsManagerprotected
Level1protected
Level2protected
Level3protected
Level4protected
Level5protected
Level6protected
Level7protected
Primitiveprotected
GetTokenprotected
TokenTypeprotected
CurrentTokenprotected
CreateHashListprotected
CreatepublicCreate expression parser instance
DestroypublicDestroy expression parser and free resources
IdentifierByNamepublicGet identifier definition by name
ClearpublicClear the current expression
EvaluateExpressionpublicEvaluate the expression and return result
ExtractIdentifierNamespublic
ExtractNodepublicExtract expression node from result
EvaluatepublicEvaluate the current expression
ResultTypepublicGet the result type of the expression
HasAggregatepublicCheck if expression contains aggregates
InitAggregatepublicInitialize aggregate calculation
UpdateAggregatepublicUpdate aggregate calculation with value

Inherited

From TComponent (74)

_AddRef _Release BeforeDestruction CanObserve ChangeName ComObject ComponentCount ComponentIndex Components ComponentState ComponentStyle DefineProperties DesignInfo DestroyComponents Destroying ExecuteAction FindComponent FreeNotification FreeOnRelease GetChildOwner GetChildParent GetChildren GetDeltaStreams GetEnumerator GetIDsOfNames GetNamePath GetObservers GetOwner GetParentComponent GetTypeInfo GetTypeInfoCount HasParent iicrGetComponent InsertComponent Invoke IsImplementorOf Loaded Loading Name Notification ObserverAdded Observers OnGetDeltaStreams Owner PaletteCreated QueryInterface ReadDeltaState ReadDeltaStream ReadState ReferenceInterface RemoveComponent RemoveFreeNotification RemoveFreeNotifications SafeCallException SetAncestor SetChildOrder SetDesigning SetDesignInstance SetInline SetName SetParentComponent SetSubComponent Tag ToString TToStringNameMode UpdateAction Updated UpdateRegistry Updating ValidateContainer ValidateInsert ValidateRename VCLComObject WriteState

From TPersistent (5)

Assign AssignTo FPOAttachObserver FPODetachObserver FPONotifyObservers

From TObject (37)

AfterConstruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName StringMessageTable SystemHasExtendedRTTI UnitName

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.