org.snapscript.tree.define.InstanceFieldFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of snap Show documentation
Show all versions of snap Show documentation
Dynamic scripting for the JVM
package org.snapscript.tree.define;
import org.snapscript.core.Evaluation;
import org.snapscript.core.Result;
import org.snapscript.core.Scope;
import org.snapscript.core.Type;
import org.snapscript.core.TypeFactory;
public class InstanceFieldFactory extends TypeFactory {
private final Evaluation evaluation;
public InstanceFieldFactory(Evaluation evaluation){
this.evaluation = evaluation;
}
@Override
public Result compile(Scope scope, Type type) throws Exception {
if(evaluation != null) {
evaluation.compile(scope);
}
return Result.getNormal();
}
@Override
public Result execute(Scope scope, Type type) throws Exception {
if(evaluation != null) {
evaluation.evaluate(scope, null);
}
return Result.getNormal();
}
}