Table of Contents

TDelphiCodeGenerator Class

Generates Delphi (Object Pascal) source code from a code DOM representation.

Remarks

TDelphiCodeGenerator takes a TCodeUnit object graph and produces formatted Delphi source code as a string. It supports generation of units, type declarations, methods, properties, statements, and other language constructs.

Syntax

Unit: Bcl.Code.DelphiGenerator

TDelphiCodeGenerator = class(TObject);

Methods

Name Description
GenerateCodeFromUnit Generates Delphi source code from a TCodeUnit object graph.
IsReservedWord Returns True if the specified string is a Delphi reserved word.

Properties

Name Description
LineBeforeComplex​Members Gets or sets whether a blank line is inserted before members that have comments or attributes.
ReservedWordMode Gets or sets how reserved words used as identifiers are handled in the output.
SortMembers Gets or sets whether type members are sorted alphabetically by name.
SortUnits Gets or sets whether uses clause units are sorted alphabetically.
StructureStatements Gets or sets whether statements are output with structured formatting and semicolons.