All Downloads are FREE. Search and download functionalities are using the official Maven repository.

astra.ast.visitor.ComponentStore Maven / Gradle / Ivy

There is a newer version: 1.4.3
Show newest version
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);
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy