This package includes a transformer that renames all identifiers of a program, and also does some semantic checking.
A core data structure used is Env, representing the context scope of expressions. Env
is a generic type. For alpha transformer, the context data is a mapping from the original variable names to unique names; so we define NameEnv
as Env[string, string]
.
During the traversal of the abstract semantic tree, we create a new NameEnv
when a new scope is entered.
- The alpha module of min-caml.
- The alpha_transform package of gocaml.
- The ASTChangeNames object of mlc compiler.