The generator guide
How to use the DotGram generator: the package, the classes a grammar is attached to, the files it is
kept in, the build properties, the command-line tool, what to do when something is wrong, and the
diagnostics. The notation a grammar is written in is the language guide;
the specification of both is syntax.md.
| Page | What it covers |
|---|---|
| 1. Setting up | the package, adding it to a project, a first parser, older frameworks |
| 2. The host class and its attributes | [Gram], its options, [GramParserVariant], [GramInclude], the attributes for editors |
| 3. Grammar files | .gram files: listing them, how a host finds its file, what a file decides |
| 4. MSBuild properties | the generation report, trace builds, the compiler server's cache |
| 5. The command-line tool | dotnet dotgram: generating outside the build, keeping the files current |
| 6. When something is wrong | symptoms, causes and what to do |
| 7. Diagnostics | reading GRAM messages and deciding what each does to a build |
Every example on these pages is compiled through the generator, and run where the page shows what it
answers, by tests/DotGram.Tests/GeneratorGuideTests.cs.