https://github.com/yaml/yaml-grammar
https://github.com/yaml/yaml-grammar
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/yaml/yaml-grammar
- Owner: yaml
- Created: 2019-12-29T04:23:17.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-11-26T17:14:11.000Z (over 1 year ago)
- Last Synced: 2025-03-22T22:37:28.713Z (about 1 year ago)
- Language: Perl
- Size: 2.23 MB
- Stars: 80
- Watchers: 9
- Forks: 13
- Open Issues: 6
-
Metadata Files:
- Readme: ReadMe.md
Awesome Lists containing this project
README
yaml-grammar
============
[The YAML 1.2 Specification's Grammar Productions as YAML](https://github.com/yaml/yaml-grammar/blob/master/yaml-spec-1.2.yaml).
# Overview
The purpose of this project is present the YAML 1.2 Grammar as a machine readable and human comprehendable YAML file.
The [YAML 1.2 Spec](https://yaml.org/spec/1.2/spec.html) contains the formal grammar for YAML 1.2.
The 211 grammar rules are formatted into the web page's HTML along with lots of textual descriptions of the language and grammar.
The grammar uses a rare "Parameterized BNF" format, and some of the rule components are just textual comments indicating what should happen.
Fully comprehending the YAML grammar is quite an undertaking for most mortals.
Creating a fully compliant parser has proven [almost impossible](http://matrix.yaml.io/).
This project programmatically pulls out all of the rules, parsing them into data structures and storing the entire structured grammar data graph as YAML.
The YAML output is commented and pretty printed.
It is intended to be both a reference for people trying to understand the rules, and as a mechanism to automate the creation of YAML tools.
# Generating Compliant Parsers
The [YAML Reference Parser](https://github.com/yaml/yaml-reference-parser) project uses the YAML grammar from this repo to generate 100% compliant parsers.