Skip to content
Marcelo Cantos edited this page Jan 9, 2020 · 4 revisions

ωBNF: The ultimate grammar behind Arr.ai's dynamic parsing system

Arr.ai will soon sport a dynamic runtime parsing system based on a grammar notation called ωBNF. This allows grammars to be entered into Arr.ai and used to create data structures via sugared syntax. If that doesn't make much sense, here's an example. The following snippet of code looks like XML:

{%xml:
<city id="123">
  <name>Melbourne</name>
  <country>Australia</name>
</city>
%}

But it's really syntactic sugar for something resembling the following Arr.ai syntax:

["city", (id: "123"),
    ["name", "Melbourne"],
    ["country", "Australia"],
]

The ωBNF grammar is implemented at https://github.com/arr-ai/wbnf and documented at https://github.com/arr-ai/wbnf/wiki/.

Clone this wiki locally