Skip to content

Commit

Permalink
Update ReadMe
Browse files Browse the repository at this point in the history
  • Loading branch information
ingydotnet committed Oct 26, 2020
1 parent 7bc2eab commit 1504782
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ yaml-grammar

# 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 starts by programmatically pulling out all of the rules, parsing them into data structures and storing the entire structured grammar data graph as YAML.
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.

From there that starting point, the grammar data is further formatted into various forms that should be useful in creating scanner/lexer/parser code in many programming languages.

Eventually this project aims to generate the scanner/lexer/parser code itself (for all the relevant languages).
# Generating Compliant Parsers

The generated code hopes to be completely correct since it is created directly from the YAML 1.2 definition.
The [YAML Reference Parser](https://github.com/yaml/yaml-reference-parser) project uses the YAML grammar from this repo to generate 100% compliant parsers.

0 comments on commit 1504782

Please sign in to comment.