Skip to content

TFPConstExpression

Internally used class for constant value expressions

Declaration

Source position: fpexprpars.pp line 472

type

  TFPConstExpression = class(TFPExprNode)
  public
    constructor CreateString;
    constructor CreateInteger;
    constructor CreateDateTime;
    constructor CreateFloat;
    constructor CreateBoolean;
    constructor CreateCurrency;
    procedure Check;
    function NodeType : TResultType;
    procedure GetNodeValue;
    function AsString : AnsiString;
    property ConstValue: TFPExpressionResult; {r}
  end;

Description

The TFPConstExpression class represents constant literal values in expressions, storing fixed values that do not change during expression evaluation. It provides the foundation for all literal constants including strings, integers, floats, booleans, and date/time values.

Constant expressions are the leaf nodes of expression trees that provide actual data values rather than computed results. They are essential building blocks that supply the raw data that other expression nodes operate on.

The class handles various data types through different constructor methods and provides type-safe storage and retrieval of constant values during expression evaluation.

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
ConstValue read only public The constant value stored in the expression
See all Properties

Methods

Member Visibility Description
AsString public Get string representation of constant expression
Check public Validate the constant expression
CreateBoolean public Create constant expression with boolean value
CreateCurrency public Create constant expression with currency value
CreateDateTime public Create constant expression with datetime value
CreateFloat public Create constant expression with float value
CreateInteger public Create constant expression with integer value
CreateString public Create constant expression with string value
GetNodeValue public Get the constant value
NodeType public Get the result type for constant expressions
See all Methods

See also

Name Description
TFPExprNode Class for representing nodes in expression trees