https://github.com/abock/dotlang
.NET Standard library for parsing and generating Graphviz DOT files.
https://github.com/abock/dotlang
abstract-syntax-tree ast dot dot-language dotnet dotnet-standard graphviz lexing parsing
Last synced: about 2 months ago
JSON representation
.NET Standard library for parsing and generating Graphviz DOT files.
- Host: GitHub
- URL: https://github.com/abock/dotlang
- Owner: abock
- License: mit
- Created: 2019-11-15T03:51:33.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-26T16:20:54.000Z (over 5 years ago)
- Last Synced: 2025-07-15T05:23:28.626Z (3 months ago)
- Topics: abstract-syntax-tree, ast, dot, dot-language, dotnet, dotnet-standard, graphviz, lexing, parsing
- Language: C#
- Homepage: https://abock.github.io/dotlang
- Size: 521 KB
- Stars: 22
- Watchers: 4
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# DotLang: DOT Language Library for .NET
[](https://github.com/abock/dotlang/actions?query=workflow%3A%22.NET+Core%22)
[](https://www.nuget.org/packages/Graphviz.DotLanguage/)
[](LICENSE)DotLang provides a full fidelity lexer, recursive descent parser, and
abstract syntax tree for the [Graphviz][graphviz] [DOT Language][dot-lang],
written in modern C# 8.0. It is available as a `netstandard2.0` library.## Resources
* [DotLang API Documentation](https://abock.github.io/dotlang)
## Goals
The primary goal of this project is to ultimately provide a language
service for Visual Studio that provides rich syntactic and semantic
analysis of Graphviz DOT files: syntax highlighting, semantic
completion, and Quick Info tooltips.To support this goal, the lexer and parser are written with inspiration
from [Roslyn][roslyn]: nothing is ever discarded, and the produced AST
can be run through a `SyntaxVisitor` to produce output DOT source code
that is identical to its input.### Anti-Goals
Notably, DotLang does _not_ aspire to actually render [Graphviz][graphviz]
graphs. There are plenty of tools for this already.## Contribute
DotLang is a .NET Standard 2.0 project and can be built with the latest
stable Visual Studio, Visual Studio for Mac, or the .NET Core toolchain.### Common commands to run when developing:
* `dotnet build`
* `dotnet test`
* `dotnet pack`
* `dotnet msbuild /t:UpdateDocs`## TODO
- Actual diagnostics
- Currently the parser just throws/bails
- Language service
- Would be awesome to leverage XML/HTML projection buffers for `XmlLiteralToken`[graphviz]: https://graphviz.gitlab.io/
[dot-lang]: https://graphviz.gitlab.io/_pages/doc/info/lang.html
[roslyn]: https://github.com/dotnet/roslyn