Module org.kink_lang.kink
Class ParenContOptimizer
java.lang.Object
org.kink_lang.kink.internal.program.itree.SkeltonItreeVisitor<Itree>
org.kink_lang.kink.internal.program.itreeoptimize.BaseOptimizer
org.kink_lang.kink.internal.program.itreeoptimize.ParenContOptimizer
- All Implemented Interfaces:
Function<Itree,
,Itree> UnaryOperator<Itree>
,ItreeVisitor<Itree>
Optimizer which puts the continuation of a seq into the seq.
For example:
- (Foo Bar).Baz → (Foo Bar.Baz)
- (Foo Bar):Baz → (Foo Bar:Baz)
- (Foo Bar).baz → (Foo Bar.baz)
- (Foo Bar).baz[] → (Foo Bar.baz[])
- (Foo Bar)!! → (Foo Bar!!)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvisit
(DerefItree deref) Visits a deref itree.visit
(McallItree mcall) Visits a mcall itree.visit
(SymcallItree scall) Visits a symcall itree.visit
(VarrefItree varref) Visits a varref itree.Methods inherited from class org.kink_lang.kink.internal.program.itreeoptimize.BaseOptimizer
apply
Methods inherited from class org.kink_lang.kink.internal.program.itree.SkeltonItreeVisitor
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
-
Constructor Details
-
ParenContOptimizer
public ParenContOptimizer()
-
-
Method Details
-
visit
Description copied from interface:ItreeVisitor
Visits a deref itree.- Specified by:
visit
in interfaceItreeVisitor<Itree>
- Overrides:
visit
in classSkeltonItreeVisitor<Itree>
- Parameters:
deref
- the deref itree.- Returns:
- the result.
-
visit
Description copied from interface:ItreeVisitor
Visits a varref itree.- Specified by:
visit
in interfaceItreeVisitor<Itree>
- Overrides:
visit
in classSkeltonItreeVisitor<Itree>
- Parameters:
varref
- the varref itree.- Returns:
- the result.
-
visit
Description copied from interface:ItreeVisitor
Visits a mcall itree.- Specified by:
visit
in interfaceItreeVisitor<Itree>
- Overrides:
visit
in classSkeltonItreeVisitor<Itree>
- Parameters:
mcall
- the mcall itree.- Returns:
- the result.
-
visit
Description copied from interface:ItreeVisitor
Visits a symcall itree.- Specified by:
visit
in interfaceItreeVisitor<Itree>
- Overrides:
visit
in classSkeltonItreeVisitor<Itree>
- Parameters:
scall
- the symcall itree.- Returns:
- the result.
-