This pull request includes a first draft of a formal Chunks and Rules specification that defines the cognitive model and specifies the grammar for the underlying serialization format.
Some parts still need to be written, notably to define additional @ properties, and algorithms for the rule engine.
The grammar is defined in a separate folder that contains:
the actual ABNF grammar (chunks.abnf),
a chunks document parser module for APG (names apg-chunks.js) and tools to generate it
an HTML fragment (rr.html) that contains all the railroad diagrams for inclusion in the spec, and tools to generate this file (including a small tool to create an EBNF version of the grammar from the APG module since that is what the railroad generator ingests.
The specification directly includes the ABNF grammar file and the railroad diagrams.
To re-generate grammar files when chunks.abnf changes, all that should be needed is to run:
npm run update-grammar
The generation creates a couple of additional files that should not be committed in the repository (they are listed in .gitignore and thus will be automatically ignored).
The above command will only work provided that Node.js and Java are installed, and provided that a npm install command has been issued to install needed dependencies.
This pull request includes a first draft of a formal Chunks and Rules specification that defines the cognitive model and specifies the grammar for the underlying serialization format.
Some parts still need to be written, notably to define additional
@
properties, and algorithms for the rule engine.The grammar is defined in a separate folder that contains:
chunks.abnf
),apg-chunks.js
) and tools to generate itrr.html
) that contains all the railroad diagrams for inclusion in the spec, and tools to generate this file (including a small tool to create an EBNF version of the grammar from the APG module since that is what the railroad generator ingests.The specification directly includes the ABNF grammar file and the railroad diagrams.
To re-generate grammar files when
chunks.abnf
changes, all that should be needed is to run:The generation creates a couple of additional files that should not be committed in the repository (they are listed in
.gitignore
and thus will be automatically ignored).The above command will only work provided that Node.js and Java are installed, and provided that a
npm install
command has been issued to install needed dependencies.