PEG4DOT
Parsing Expression Grammar (PEG, also PEG.js) for GraphViz DOT file format.
The GraphViz DOT file format as of the year 2020 has some inconsistencies. Details and the derivation of PEG can be found in PEG4DOT-Notes.html.
dot.pegjs semantics are not exactly the same as dot.peg. This dot.pegjs has small optimizations. To make it a validating parser follow the comments inside dot.pegjs. GrammKit autogenerated railroad diagram of dot.pegjs can be found in dot.pegjs.html. An example of using dot.pegjs (compiled as dot.js) can be found in https://github.com/obermann/vismm.
Resources
PEG.js Grammar Syntax and Semantics
PEG.js online parser generator for JavaScript
PEGSH - A Free Online PEG Syntax Highlighter
Graphviz abstract grammar defining the DOT language
Prior Art
https://github.com/siefkenj/dotgraph
https://github.com/anvaka/dotparser
https://github.com/magjac/graphviz-visual-editor
https://github.com/dagrejs/graphlib-dot