astra.statement.MaintainBlock Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of astra-interpreter Show documentation
Show all versions of astra-interpreter Show documentation
Core interpreter artifact for the ASTRA Language
package astra.statement;
import astra.core.Agent;
import astra.core.Agent.Promise;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import astra.core.Intention;
import astra.formula.Formula;
import astra.reasoner.util.ContextEvaluateVisitor;
import astra.term.Term;
public class MaintainBlock extends AbstractStatement {
Statement statement;
Formula formula;
public MaintainBlock(String clazz, int[] data, Formula formula, Statement statement) {
this.setLocation(clazz, data[0], data[1], data[2], data[3]);
this.formula = formula;
this.statement = statement;
}
public StatementHandler getStatementHandler() {
return new AbstractStatementHandler() {
int state = 0;
Promise promise;
public boolean execute(final Intention intention) {
switch (state) {
case 0:
intention.makePromise(promise = new Promise(true) {
List