public final class AlphaNormalize extends Visitor.Identity
Morally this is equivalent to the following (on non-underscore bindings):
input.increment("_").substitute(name, 0, Expr.Constants.UNDERSCORE).decrement(name);
The implementation here is necessary to fit the visitor API.
Note that this visitor maintains internal state and instances should not be reused.
Visitor.Constant<A>, Visitor.Identity, Visitor.NoPrepareEvents<A>, Visitor.Property| Constructor and Description |
|---|
AlphaNormalize() |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(java.lang.String name,
Expr type) |
Expr |
onIdentifier(Expr self,
java.lang.String name,
long index) |
Expr |
onLambda(java.lang.String name,
Expr type,
Expr result) |
Expr |
onLet(java.util.List<Expr.LetBinding<Expr>> bindings,
Expr body) |
Expr |
onPi(java.lang.String name,
Expr type,
Expr result) |
onAnnotated, onApplication, onAssert, onBuiltIn, onClasspathImport, onDate, onDouble, onEmptyList, onEnvImport, onFieldAccess, onIf, onInteger, onLocalImport, onMerge, onMissingImport, onNatural, onNonEmptyList, onNote, onOperatorApplication, onProjection, onProjectionByType, onRecord, onRecordType, onRemoteImport, onText, onTime, onTimeZone, onToMap, onUnionType, onWithflattenToMapLists, prepareAnnotated, prepareApplication, prepareAssert, prepareEmptyList, prepareFieldAccess, prepareIf, prepareLambda, prepareLet, prepareLetBinding, prepareMerge, prepareNonEmptyList, prepareNonEmptyListElement, prepareOperatorApplication, preparePi, prepareProjection, prepareProjectionByType, prepareProjectionByType, prepareRecord, prepareRecordField, prepareRecordType, prepareRecordTypeField, prepareRemoteImport, prepareText, prepareTextPart, prepareToMap, prepareUnionType, prepareUnionTypeField, prepareWith, prepareWithValue, sortFieldspublic Expr onIdentifier(Expr self, java.lang.String name, long index)
onIdentifier in interface Visitor<Expr>onIdentifier in class Visitor.Identitypublic void bind(java.lang.String name,
Expr type)
public Expr onLambda(java.lang.String name, Expr type, Expr result)
onLambda in interface Visitor<Expr>onLambda in class Visitor.Identitypublic Expr onPi(java.lang.String name, Expr type, Expr result)
onPi in interface Visitor<Expr>onPi in class Visitor.Identitypublic Expr onLet(java.util.List<Expr.LetBinding<Expr>> bindings, Expr body)
onLet in interface Visitor<Expr>onLet in class Visitor.Identity