Skip to content

TFPUnaryOperator

Internally used class for unary operations with single operand

Declaration

Source position: fpexprpars.pp line 365

type

  TFPUnaryOperator = class(TFPExprNode)
  public
    constructor Create;
    destructor Destroy;
    procedure InitAggregate;
    procedure UpdateAggregate;
    function HasAggregate : Boolean;
    procedure Check;
    property Operand: TFPExprNode; {r}
  end;

Description

TFPUnaryOperator is the base class for all unary operations in the expression parser. Unary operations take a single operand and perform some operation to produce a result. It extends TFPExprNode to provide the foundation for all single-operand operations.

The class manages the operand node and provides common functionality such as aggregate handling, validation, and resource management that is shared by all unary operations.

Derived classes implement specific operations such as logical NOT, numeric negation, and type conversions. Each operation defines its own evaluation logic while leveraging the common unary operation infrastructure.

This class is used internally by the TFPExpressionParser class to construct an AST (Abstract Syntax Tree). There is normally no need for you to use or instantiate this class directly.

Properties

Member Visibility Description
Operand read only public The operand expression of the unary operator
See all Properties

Methods

Member Visibility Description
Check public Validate the unary operator for correctness
Create public Create unary operator with operand
Destroy public Destroy unary operator and free resources
HasAggregate public Check if unary operator contains aggregates
InitAggregate public Initialize aggregate processing for unary operator
UpdateAggregate public Update aggregate calculations for unary operator
See all Methods

See also

Name Description
TFPExprNode Class for representing nodes in expression trees