a parser generator that makes nice trees
Based on PEG.js, arz is a parser generator that makes "nice" parse trees without a need to define parser actions. It uses your PEG grammar to derive a type for your syntax and parsers that produce instances of that type. The resulting parse tree has names and structure taken from your PEG grammar and should ideally not require any additional processing. Currently it outputs F# code but other languages are possible in theory.
npm install --save nasser/arz
npx arz file.peg
This writes a standalone F# module named Generated
to standard out.
Running with the arithmetic PEGjs example produces these results.
Very early. I am using it for some language projects, but it may well break for you.
The goal of this parser generator is to make the nicest trees possible, so it is named after the nicest tree I know, the Lebanese Cedar 🇱🇧. Cedar in Arabic is أرز, pronounced arz.
Copyright (c) 2020 Ramsey Nasser. Available under the MIT license.