.Gram language support
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;
A coding agent can write the grammar for you: every DotGram package ships a SKILL.md
written for agents. Describe your format, point the agent at the skill, and the generator's
diagnostics tell it what to fix.
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.
Learn more
The extension does not collect telemetry and does not communicate with external services.