Skip to content

TFPExprNode

Class for representing nodes in expression trees

Declaration

Source position: fpexprpars.pp line 113

type

  TFPExprNode = class(TObject)
  public
    procedure Check;
    procedure InitAggregate;
    procedure UpdateAggregate;
    class function IsAggregate : Boolean;
    function HasAggregate : Boolean;
    function NodeType : TResultType;
    function NodeValue : TFPExpressionResult;
    function AsString : AnsiString;
  end;

Description

This is the abstract base class for all nodes in the expression tree. Every element of a parsed expression (literals, variables, operators, functions) is represented by a class derived from TFPExprNode.

The class defines the common interface that all expression nodes must implement, including evaluation, type checking, and aggregate processing. It provides the foundation for building complex expression trees through composition of different node types.

Derived classes implement specific functionality for different types of expression elements such as arithmetic operations, function calls, variable references, and literal values.

Methods

Member Visibility Description
AsString public Get string representation of the expression node
Check public Validate the expression node for correctness
HasAggregate public Check if node tree contains any aggregate operations
InitAggregate public Initialize aggregate processing for the node
IsAggregate public Check if this node represents an aggregate operation
NodeType public Get the result type of this expression node
NodeValue public Get the evaluated value of this expression node
UpdateAggregate public Update aggregate calculations for the node
See all Methods