This repository is a collection of formal grammar examples written for phplrt v4.
Important
These grammars are examples, not reference implementations. Each is checked against the samples shipped next to it, which is a long way from covering the language it describes: a grammar may read something the language forbids, refuse something the language allows, or lag behind the version it was written from.
Do not treat one as a specification, and do not rely on one in production without reading it first. We keep improving them, and issues and pull requests pointing at a case that is read wrongly are welcome.
The root directory name is the all-lowercase name of the language or file format
parsed by the grammar. For example, json, json5, graphql, c, etc.
The src/ directory contains a set of shared helper classes.
The tests/ directory contains a set of tests to validate the grammar for
correctness.
- Composer Version Constraint
- Doctrine Annotations
- DQL (Doctrine Query Language)
- PP Grammar (Hoa)
- PP2 Grammar (phplrt)
- PP3 Grammar (phplrt)
- Hoa Ruler
- Hoa Math
- Go! AOP Pointcut
- JMS Serializer Type
- PCRE (Hoa PHPStan Fork)
- PHQL (Phalcon)
- Praspel
- PHPDoc Types (PHPStan)
- PHPDoc Types (PSR-5)
- PHPDoc Types (TypeLang)
Please note that some code examples are taken from the ANTLR v4 repository and adapted for phplrt v4. The repository does not contain a license, but ANTLR is distributed under the BSD license.