The src/desugar Directory

Namespace desugar, delivered during TC-D and TC-EXTS. Desugar string comparisons and for loops.

File: local.am (src/desugar/)

This is a Makefile configuration relative to the src/desugar/ directory. It is responsible for the integration into the libtc library with everything exported from the desugar module, and the linkage of the directory’s unit tests in the test-suite.

File: libdesugar.* (src/desugar/)

The interface of the desugar module. It exports the desugar and bounds_checks_add procedures, as well as their raw counterparts which does not compute bindings and types and bind_and_types_check which computes both.

File: tasks.* (src/desugar/)

Tasks related to the desugar module (see: The src/task Directory).


File: desugar-visitor.* (src/desugar/)

The desugar::DesugarVisitor visitor. Removes constructs that can be considered as syntactic sugar using other language constructs. For instance, turns for loops into while loops, string comparisons into function calls. Inherits from astclone::Cloner, so the desugared AST is a modified copy of the initial tree.


File: bounds-checking-visitor.* (src/desugar/)

Given at TC-EXTS. The desugar::BoundsCheckingVisitor visitor adds dynamic array bounds checks while duplicating an AST. Inherits from astclone::Cloner, so the result is a modified copy of the input AST.


File: test-*.cc (src/desugar/)

Unit tests.