Grammar is a language for making languages.
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
.
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.
Yes! The Tree Language Designer is an online tool for writing Grammar code to build languages right in your browser.
The following major features are likely to be added to a future version of Grammar:
https://
imports and perhaps something like node_modules://
type website
certain parsers would come into/out of scope.inScope
implementation may undergo a refactor to allow for further future possibilities. For example, we may want to consider alternate approaches to inScope
than the current inheritance system.Here's a list of the notable changes in Grammar:
NodeTypeDefinitions
ending in Node
it is now ParserDefinitions
ending in Parser
getX()
have been changed to getters like get x()
.//
commentstodo
comments. Use // todo
insteadtooling
keyword. Use // tooling
instead