Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

delphi-language-spec

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

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

# Delphi Language Specification

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

pascal
????????? 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.