#ast-parser #sky-spark #output

axon_parseast_parser

A library to parse the output of SkySpark's parseAst function

16 releases (7 breaking)

0.8.0 Jul 27, 2021
0.6.2 Jan 7, 2021
0.6.0 Dec 27, 2020

#50 in #ast-parser


Used in axon_parser

MIT license

25KB
667 lines

Axon parseAst Parser

Parses the output of SkySpark's parseAst function.

Usage

  1. Get the string output of SkySpark's parseAst function.
    • For example, run read(func and name == "yourFunction")->src.parseAst().toAxonCode().
  2. Use this library's parse function on that string.

Why parse the output of parseAst, instead of parsing Axon itself?

  1. It's substantially more involved to parse Axon, instead of parseAst's output.
    • We can parse parseAst output in under 200 lines of LALRPOP grammar.
  2. Axon appears to be an ambiguous language to parse (at least LALRPOP was claiming it was ambiguous).

Dependencies

~3.5–6.5MB
~107K SLoC