Aether.Eval (Ichor v0.2.0)

Copy Markdown View Source

The semantic half of Aether's front-end: turns an Aether.Reader.Grammar CST into a fully resolved Aether.Grammar, with every body already Grammar.IR.

(Not to be confused with Ichor.Actions.evaluate/5, which evaluates parsed input through a grammar's own actions -- this evaluates grammar source, already read into a CST by Aether.Reader, into Grammar.IR.)

Owns everything that needs more than one definition's worth of context: predefined-token (DIGIT/ALPHA/ALNUM/SPACE/HEX) override-before-use tracking (uses can be implicit -- a POSIX class item, a regex escape, an auto-spliced default skip token -- which is exactly why this can't be checked while merely reading syntax), case-insensitivity resolution, character-class/regex desugaring, inline-literal auto-promotion to anonymous tokens, @skip splicing, and the final @root/@skip validation.

Summary

Functions

Builds a fully resolved Aether.Grammar from reader_grammar.

Functions

build(rg)

@spec build(Aether.Reader.Grammar.t()) ::
  {:ok, Aether.Grammar.t()} | {:error, Ichor.Error.t()}

Builds a fully resolved Aether.Grammar from reader_grammar.