Grammar: A language for making languages

What is Grammar?

Grammar is a language for making languages.

Can you show me an example?

Below is some code written in Grammar to create a simple language called Panda.

pandaParser root catchAllParser expressionParser operatorCell enum + - intCell expressionParser cells operatorCell catchAllCellType intCell

The Grammar code can generate a parser that parses statements like + 1 2 5 10 and - 10 2.

What is a longer description?

Grammar is a Tree Language for generating parsers for other Tree Languages. The parsers not only allow parsing of those languages but also can include code written in a host language (such as Javascript) for compiling and/or runtime interpreting of these languages.

Can I try it online?

Yes! The Tree Language Designer is an online tool for writing Grammar code to build languages right in your browser.

Grammar Roadmap

The following major features are likely to be added to a future version of Grammar:

Import statements

Dependent Types

Union Cell Types

Pattern Matching


Positional Parsers

LSP Support

BNF Parsing

Upgrading to CodeMirror Version 6

Grammar Release Notes

Here's a list of the notable changes in Grammar:

6.0.0 2023-4-2

5.0.0 2023-3-30

4.0.0 2023-3-28

View source