astra.ast.visitor.ComponentStore Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of astra-compiler Show documentation
Show all versions of astra-compiler Show documentation
Core compiler artifact for the ASTRA Language
package astra.ast.visitor;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import astra.ast.core.ParseException;
import astra.ast.element.ModuleElement;
import astra.ast.formula.GoalFormula;
public class ComponentStore {
public ComponentStore() {
signatures.add("formula:true");
signatures.add("formula:false");
// events.add(e)
}
public Set signatures = new HashSet<>();
public Set types = new HashSet<>();
public Set events = new HashSet<>();
public Map modules = new HashMap<>();
public Set plans = new HashSet<>();
public void checkForEvent(GoalFormula formula) throws ParseException {
// System.out.println("events: " + events);
if (!events.contains("update:+:"+formula.toSignature())) {
// REM: This condition is now commented out because
// -goal events are failure events.
// && !events.contains("update:-:"+formula.toSignature())) {
throw new ParseException("No rule has been declared to handle the goal: " + formula, formula);
}
}
}