BuiltInTransformVisitor should be used with a depth first positional walk over a term to compile. On leaving each
term, that is in a post-fix order, if the term is a functor, the built-in transformation function is applied to it.
If the built-in applies a transformation to a functor, it is substituted within its parent for the built-in.
| Responsibilities || Collaborations
| Substitute built-ins into a term to compile.|
Holds the built in transformation function.
Creates the visitor with the supplied interner, symbol table and traverser.
interner The name interner.
symbolTable The compiler symbol table.
traverser The positional context traverser.
builtInTransform The built-in transformation function.
super(interner, symbolTable, traverser);
Applies the built-in transform during a post-fix visit of a term.
functor The functor to visit.
if (functor != transformed)
if (parentTerm instanceof Clause)
parentClause.getBody()[pos] = builtInFunctor;
else if (parentTerm instanceof Functor)