First-class Visual Studio tooling for .Gram,
a source generator that compiles grammars into strongly typed C# parsers with no runtime
parser engine.
Write grammars where they belong
Use standalone .gram files or embed a grammar directly in a C# [Gram] attribute.
The extension understands both forms and keeps navigation connected to the generated C# API.
[Gram("""
Number : @int = digits: ['0'..'9']+ => @(int.Parse(digits))
parse Number as ParseNumber
""")]
public static partial class Numbers;
Editor features
Theme-aware syntax highlighting and live diagnostics
Completion, signature help, and Quick Info
Brace matching, folding, and an alphabetical rule navigation list
Go To Definition, Find All References, reference highlighting, and Rename
Navigation between grammar declarations and generated C# symbols
Embedded DSL highlighting and diagnostics through StringSyntax
Responsive background analysis for large grammar files
Generated parsers, ordinary C#
.Gram performs grammar analysis at build time and emits the parser into your assembly.
The generated code can expose Parse, TryParse, and Find APIs, produce strongly typed
results, specialize one grammar into several parsers, read from TextReader, and recover
from malformed record-oriented input.