blob: f279f8299821176faeee87f1ff744a2416f5080b [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2004-2008 Andras Schmidt, Andras Balogh, Istvan Rath and Daniel Varro
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Andras Schmidt, Andras Balogh, Istvan Rath - initial API and implementation
*******************************************************************************/
package org.eclipse.viatra2.interpreters;
import java.util.Map;
import org.eclipse.viatra2.errors.VPMRuntimeException;
import org.eclipse.viatra2.framework.IFramework;
/**
* @author Istvan Rath
*
*/
public interface ModelInterpreter {
/**
* Runs the machine or rule, which is represented by the passed object.
*
* @param fw
* Framework of VPM modeling
* @param machineOrRule
* machine or rule object to be run (should represent a model of a
* program/rule that can be interpreted by the interpreter.)
* @param parameters
* mapping from parameter names to parameter values. The types of
* acceptable parameters are determined by the concrete
* interpreter.
* @param pr
* the progress report callback
* @throws VPMRuntimeException
*/
public void run(IFramework fw, Object machineOrRule, Map<String, Object> parameters,
IProgressReport pr) throws VPMRuntimeException;
/**
* Returns the parameter names of the given program
*
* @param fw
* Framework of VPM modeling
* @param machineOrRule
* machine or rule to be asked (should represent a model of a program/rule
* that can be interpreted by the interpreter.
* @return array of parameter names
* @throws VPMRuntimeException
*/
public String[] getParameters(IFramework fw, Object machineOrRule)
throws VPMRuntimeException;
/**
* Returns whether the given machine instance can be runned by this
* interpreter.
*
* @param machineOrRule
* @param fw
* @return
*/
public boolean isRunnable(Object machineOrRule, IFramework fw);
}