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

TFPExpressionScanner

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

Class for tokenizing expression strings into parser tokens

Declaration

Source position: fpexprpars.pp line 67

type TFPExpressionScanner = class(TObject)

  FSource: AnsiString;

  LSource: Integer;

  FPos: Integer;

  FChar: PAnsiChar;

  FToken: AnsiString;

  FTokenType: TTokenType;

public

  constructor Create; virtual;

  

Create a new expression scanner

  function GetToken; virtual;

  

Get the next token from the source expression

  procedure AddOperatorAlias();

  procedure ClearOperatorAliases;

  property OperatorAliases []: TOperatorAlias; [r]

  property OperatorAliasCount: Integer; [r]

  property StringQuoteChar: AnsiChar; [rw]

  property IdentifierQuoteChar: AnsiChar; [rw]

  property Token: AnsiString; [r]

  

The text of the current token

  property TokenType: TTokenType; [r]

  

The type of the current token

  property Source: AnsiString; [rw]

  

The source expression string to scan

  property Pos: Integer; [r]

  

Current position in the source string

  property CurrentChar: AnsiChar; [r]

  

The current character being processed

end;

Inheritance

TFPExpressionScanner

  

Class for tokenizing expression strings into parser tokens

|

TObject

Description

The TFPExpressionScanner class performs lexical analysis on expression strings, breaking them into tokens that can be consumed by the expression parser. It handles the low-level details of character recognition, string parsing, and token classification.

The scanner recognizes all token types defined in TTokenType including operators, literals, identifiers, keywords, and delimiters.


Documentation generated on: Nov 14 2026 Report a problem on this page