This repository provides a structured, version-controlled specification of the Delphi programming language. It is community-driven and unofficial, but designed to complement Embarcadero’s official documentation with a normative, open, and maintained specification.
- Provide a canonical, open reference for the Delphi language.
- Capture lexical rules, grammar, and semantics in a structured way.
- Enable tool authors (parsers, linters, formatters) to rely on a machine-readable spec.
- Maintain historical versions and track changes across Delphi releases.
├── spec/
│ ├── 01-lexical.md # identifiers, keywords, literals, operators, and compiler directives
│ ├── 02-directives.md # conditional compilation and compiler options
│ ├── 03-grammar-ebnf.md # complete grammar of the Delphi language
│ ├── 04-semantics-types.md # built-in and user-defined types
│ ├── 05-semantics-generics.md # generic types and constraints
│ ├── 06-semantics-classes.md # class declarations, inheritance, visibility
│ ├── 07-semantics-expressions.md # operator precedence and evaluation
│ ├── 08-semantics-statements.md # control flow, blocks, procedures
│ ├── 09-attributes-and-helpers.md # metadata and helper types
│ ├── 10-operator-resolution.md # overload resolution rules
│ └── 11-managed-types-and-rtlifetimes.md # memory management and finalization
├── data/
│ └── lexical.json # machine-readable tables for keywords, operators, literals
├── grammar/
│ └── Delphi.ebnf # machine-readable grammar file
├── tools/
│ └── linter/ # Spec checker (TODO: More tests)
│ more to come...
└── README.md
Contributions are welcome! Please:
- Open an issue to discuss proposed changes (lexical rules, grammar, semantics).
- Submit a pull request with edits to the relevant
spec/*.md
files. - Ensure any changes to keywords, operators, or literals are reflected in
data/lexical.json
.
- Mark change as Normative (alters language rules) or Informative (examples, notes).
- Update
/data/lexical.json
if tokens/keywords/literals are changed. - Update examples to reflect changes.
This project is currently not affiliated with or endorsed by Embarcadero Technologies. “Delphi” is a trademark of Embarcadero.