Skip to content

Unofficial, community-driven language specification for the Delphi programming language (Object Pascal) — including lexical rules, grammar, and semantic details.

License

Notifications You must be signed in to change notification settings

radprogrammer/delphi-language-spec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Delphi Language Specification

License Status: Draft

Overview

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.

DLS Logo

Goals

  • 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.

Structure

├── 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

Contributing

Contributions are welcome! Please:

  1. Open an issue to discuss proposed changes (lexical rules, grammar, semantics).
  2. Submit a pull request with edits to the relevant spec/*.md files.
  3. Ensure any changes to keywords, operators, or literals are reflected in data/lexical.json.

PR Template Checklist

  • 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.

About

Unofficial, community-driven language specification for the Delphi programming language (Object Pascal) — including lexical rules, grammar, and semantic details.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages