Module boxworks_lang::cst

source ·
Expand description

Box language concrete syntax tree (CST).

This module contains two representations of the Box CST.

The type Tree is an explicit representation of a CST. It consists of Rust vectors of function calls (FuncCall). These calls contain Rust vectors of arguments (Arg). Some of these arguments may, in turn, contain nested trees if the argument is a list type.

The explicit representation is easy to use, but is inefficient and makes using the CST a costly abstraction. The alternative representation is an iterator representation, based on two traits TreeIter and ArgsIter. With this representation, instead of materializing the CST at once with a type like a Tree, calling code instead iterates over the tree.

Structs§

  • An argument to a function.
  • A function call.
  • Explicit representation of a CST.

Enums§

Traits§

  • Iterator over the arguments of a function.
  • Iterator representation of a CST.

Functions§