Since JetBrains announced in November a new technology it had under development, it hasn’t said much about it… until today. The company has announced the Nitra framework is now open source.
“We’ve been busy building the foundations to a project that we want to see as the basis for a lot of future work here at JetBrains,” wrote JetBrains technical evangelist Matt Ellis on the company’s blog. “Now that we feel we’ve reached a minimum viable feature set, as well as a good architectural base for future development, we’re very happy to take the next steps on our roadmap and release Nitra as an open-source project.”
(Related: Project Nitra’s first look)
According to JetBrains, Nitra makes the process of studying, learning and implementing a new language easier, and it allows a much faster turnaround when providing support for new languages and frameworks. With Nitra, developers can focus on things like analysis and fixing issues in code.
Nitra is a language that describes grammars as well as the abstract syntax trees to represent them. It also compiles the grammars into parsers, and generates the classes needed to navigate and represent the abstract syntax tree, according to JetBrains. It also provides a set of language services that use the grammar in order to provide automatic syntax highlighting, brace matching and outlining. Its grammars are extensible and reusable.
“While we’re making Nitra open source today, this should not be considered an end-user preview,” wrote Ellis. “It’s a low-level language toolkit, and if you want to use it, expect to get your hands dirty.”
According to JetBrains, Nitra supports:
1. “Grammars to define lexerless parsers and ASTs that can be extended at compile time or runtime, supporting composition of languages, or languages with extensible syntax, such as Nemerle”
2. “A command-line tool to compile grammars into an assembly containing the parser and the AST classes (grammars can also be compiled inside Visual Studio)”
3. “A Windows application to load and test grammars”
4. “A Visual Studio language service that uses Nitra to parse files and provide automatic syntax highlighting, outlining and brace matching. Current work is to increase the automatic support here to include go to declarations, find usages and rename refactorings.”