nets-parser

NETS is an experimental project that provides a common way to configure, run and integrate parsers, locally and in the cloud. It includes concepts from Extended Backus Naur Form (EBNF), ISO/IEC 14977, Parser Expression Grammars (PEGs), Abstract Syntax Trees (ASTs) represented as DOMs, pipelines and grammar libraries. It is an open source project for anyone to use and contribute to. For more information goto http://www.nets3.com.

Usage no npm install needed!

<script type="module">
  import netsParser from 'https://cdn.skypack.dev/nets-parser';
</script>

README

Introduction

NETS is an experimental project that provides a common way to configure, run and integrate parsers, locally and in the cloud. It includes concepts from Extended Backus Naur Form (EBNF), ISO/IEC 14977, Parser Expression Grammars (PEGs), Abstract Syntax Trees (ASTs) represented as DOMs, pipelines and grammar libraries. It is an open source project for anyone to use and contribute to. For more information goto http://www.nets3.com.

Download and Installation

To download and install use npm.

npm -install nets-parser

The node_modules/nets-parser folder contains the executables and libraries required to run NETS on all supported platforms including:

  • macos-x86-64
  • linux-x86-64
  • wasm-wasi-32
  • wasm-node-32
  • wasm-web-32

Configuration

Update the paths in nets-parser.js when using the wasm-node-32 build. If required add the node_modules/nets-parser folder to the PATH.

Executables and scripts are contained in the node_modules/nets-parser root folder. Tests are contained in the tests subfolder.

Dependencies

Native executables depend on system libraries. Use lld nets-parser to determine these on Linux or otool -L nets-parser on MacOS. Platform version dependencies are undocumented at present.

The wasm-wasi-32 build depends on a Web Assembly (WASM) and Web Aassembly System Interface (WASI) runtime such as Wasmtime. The wasm-node-32 build depends on Node > v12.x. The wasm-web-32 build depends on a WASM capable web browser.

Running

Native Executable

Nets parser is started from the command line by invoking the nets-parser executable.

> nets-parser-macos-x86-64-v1.0d [arguments]

nets-parser-macos-x86-64-v1.0d is the executable file name on MacOS for the x86 64 bit architrecture, in debug mode.

NodeJS Executable

Nets parser requires Node to run the wasm-node executable. A helper JavaScript program nets-parser.js is used for node. (Update the paths in nets-parser.js when using the wasm-node-32 build).

node nets-parser.js -- [arguments]

Nets Command line arguments are added after the double dash --.

Wasmtime Executable

Nets parser requires Wasmtime to run the wasm-wasi executable. Nets requires wasmtime permission to directories for working files, temporary files and the wasm executable. Nets Command line arguments are added after the double dash --.

> wasmttime nets-parser-wasi.wasm --dir=. --dir=/tmp --dir=${path to nets-parser-debug.wasm} -- [arguments]

Running Tests

TBD

Version

This is NETS v1.0 published 26th January 2021.

  • Initial support for macos-x86-64, wasm-wasi-32, wasm-node-32 and wasm-web-32 architectures
  • Initial feature set including ISO 14977, EBNF, PEG, Grammar XML, pipelines, input/output semantics, abstract syntax trees, logging, breakpoints, single byte characters, wide characters, echo, production terminals, predicates
  • Internal libraries ctype, utility, compress, encrypt, command
  • External libraries encrypt and iconv

Changelog

No previous versions

Contributions

Contributions to NETS are welcome. Please contact us if you would like access to the source code repository hosted on Bitbucket.

Contact

If you would like to contact the project owner please emailto:timnelms@nets3.com.

License

NETS is published under an open source license. If you would like more details please contact me.