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 |
|---|---|
| IsReservedWord | Returns True if the specified string is a Delphi reserved word. |
| GenerateCodeFromUnit | Generates Delphi source code from a TCodeUnit object graph. |
Properties
| Name | Description |
|---|---|
| SortMembers | Gets or sets whether type members are sorted alphabetically by name. |
| SortUnits | Gets or sets whether uses clause units are sorted alphabetically. |
| LineBeforeComplexMembers | Gets or sets whether a blank line is inserted before members that have comments or attributes. |
| StructureStatements | Gets or sets whether statements are output with structured formatting and semicolons. |
| ReservedWordMode | Gets or sets how reserved words used as identifiers are handled in the output. |