pg-format / specification

Formal specification of Property Graph Exchange Format and its serializations
https://pg-format.github.io/specification/
3 stars 0 forks source link

Add formal grammar #11

Open nichtich opened 1 month ago

nichtich commented 1 month ago

Question is whether to make it normative or not. Existing grammars to build on are at https://github.com/pg-format/pg-formatter/blob/main/docs/grammar.md (preferred ~but rule Edge needs to be adjusted by hand~) and at https://github.com/pg-format/pgraphs/blob/main/docs/pg-grammar.md

Names of symbols used in the grammar should be same as names used in the specification text, e.g. Identifier instead of ID.

nichtich commented 4 weeks ago

This has been done but needs to be proofread and tested whether the grammar fully matches the specification text. Maybe better fully convert the grammar to W3C EBNF and generate another parser from the source (see https://www.npmjs.com/package/ebnf and https://www.bottlecaps.de/rr/ui). In particular the END token and negative lookeahead operator need to be changed.