org.snapscript.tree.InstructionResolver Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of snap-all Show documentation
Show all versions of snap-all Show documentation
Dynamic scripting for the JVM
package org.snapscript.tree;
import java.util.Map;
import org.snapscript.core.Context;
public class InstructionResolver implements OperationResolver {
private volatile Map operations;
private volatile InstructionBuilder builder;
public InstructionResolver(Context context, String file) {
this.builder = new InstructionBuilder(context, file);
}
@Override
public Operation resolve(String name) throws Exception {
if(operations == null) {
operations = builder.create();
}
return operations.get(name);
}
}