/******************************************************************************** | |
* Copyright (c) 2004-2008 Peter Pasztor, Akos Horvath, Gergely Varro, 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: | |
* Peter Pasztor, Akos Horvath, Gergely Varro, Istvan Rath - initial API and implementation | |
*******************************************************************************/ | |
package org.eclipse.viatra2.gtasm.interpreter.extension; | |
import java.util.Map; | |
import org.eclipse.viatra2.core.IModelSpace; | |
import org.eclipse.viatra2.gtasm.interpreter.exception.ViatraTransformationException; | |
import org.eclipse.viatra2.gtasmmodel.gtasm.metamodel.asm.definitions.Variable; | |
/** | |
* A nativeASMRule is a Java method which can be called directly from a | |
* VTCL program instead of its vtcl equivalent (using the @native annotation). | |
* Its ID is the fully qualified name of the asm rule | |
* @author Akos Horvath | |
*/ | |
public interface INativeASMRule { | |
/** This function will be called by the GTASM interpreter instead of the ASM rule invocation. | |
* @param msp The model space of the invocation context | |
* @param params The variable to term mapping table. All return parameters will have to added to the map | |
* @return true if the execution succeeded false in all other case which will indicate the same behaviour as in case of the ASM rule failure | |
* @throws ViatraTransformationException | |
*/ | |
public Boolean invoke(IModelSpace msp, Map<Variable,Object> params) | |
throws ViatraTransformationException; | |
/** | |
* The name of the native ASM rule. | |
*/ | |
public String getName(); | |
/** | |
* The unique ID of the native ASM rule. Has to be the FQN of the ASM rule that it will replace | |
*/ | |
public String getID(); | |
/** | |
* The textual description of the ASM rule. | |
*/ | |
public String getDescription(); | |
} |