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

CompilerRuntime.ProgramFunction Maven / Gradle / Ivy

There is a newer version: 1.7.3
Show newest version
package CompilerRuntime;

import java.util.List;

import org.coreasm.engine.absstorage.MapFunction;
import org.coreasm.engine.absstorage.Element;
import org.coreasm.engine.absstorage.ElementList;

public class ProgramFunction extends MapFunction {
	@Override
	public Element getValue(List args) {
		ElementList el;
		if (args instanceof ElementList)
			el = (ElementList)args;
		else
			el = ElementList.create(args);
		Element temp = table.get(el);
		if (temp == null) 
			return defaultValue;
		else{
			if(temp instanceof CompilerRuntime.Rule){
				return ((CompilerRuntime.Rule) temp).getCopy();
			}
			return temp;
		}
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy