An ABNF parser written in WebAssembly [Work in Progress]
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lucas Hinderberger 42146eefaa Interface for parsing into AST 2 months ago
build Empty WebAssembly Module 3 months ago
src Interface for parsing into AST 2 months ago
tests Skeleton for tests 2 months ago
.gitignore Adding license header to .gitignore 3 months ago
LICENSE Removing clarification that I believe to be redundant 3 months ago Minor adjustments to unit testing setup 3 months ago
jsdoc-config.json First Draft of high-level JavaScript inteface (without AST) 3 months ago
package-lock.json EBNF -> ABNF 3 months ago
package.json Minor adjustments to unit testing setup 3 months ago


An ABNF parser written in WebAssembly

This is an incomplete Work in Progress


This software aims to be a parser for the Augmented Backus Naur Form meta language, as described in the Internet Standard RFC5234 and RFC7405.

Once it’s finished, it’s use cases might include serving as a high performance basis for compilers, interpreters, syntax visualisation tools or interactive documentation.


Currently, abnf.wasm is not fit for practical use.

The abnf.wasm parser will provide two interfaces that can be used to integrate abnf.wasm into your application:

  • a low-level callback interface that operates on WebAssembly module level and
  • a high-level JavaScript interface that wraps the callbacks for JavaScript and optionally includes functionality to build an abstract syntax tree

The low-level interface is documented right in the abnf.wat source file’s import section.

The high-level JavaScript interface is documented using JSDoc annotations. See the section Building the Documentation for details.


There are no run-time dependencies.

For development, testing and packaging, you will need the wat2wasm tool from The WebAssembly Binary Toolkit in addition to the devDependencies defined in package.json.

For building the documentation as described below, you need the JSDoc tool installed.

Running the unit tests

To run the unit tests, use

npm test

When opening the project in an IDE, you might have to adjust your Jest test plugin to use the npm test command, as it currently supplies additional parameters to node for being able to test ES6 modules.

Once full ES6 Module support is available and enabled in Node by default, that should no longer be necessary.

Building the Documentation

You can generate the API documentation for the JavaScript interface using the JSDoc tool and the jsdoc-conf.json file at the root of the source tree.

Simply run

jsdoc -c jsdoc-config.json

and the API documentation for the JavaScript interface should appear in build/doc.

Warning: Please note that the generated documentation will contain parts of whatever template you choose (or what is set up by default in your JSDoc tool), thus additional licensing terms may apply to the generated documentation files.


The abnf.wasm software package is licensed under the MPLv2 license.

For details, look into the LICENSE file in the root of the source code distribution of this software.