| /******************************************************************************* |
| * 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.codegen; |
| |
| import org.eclipse.viatra2.errors.VPMRuntimeException; |
| import org.eclipse.viatra2.framework.IFramework; |
| |
| /** |
| * This is the interface of code output. Code generator GTASM programs write |
| * code on the code output (this is the standard output of GTASM programs). All |
| * strings are written on the code output as an atomic step. In other words the |
| * code output is not buffered, so code output can be controlled for example by |
| * prefixes. |
| * |
| * @author Andras Balogh, istvan |
| * |
| * Modified by Istvan Rath on 2008.07.30: - init(l,p) -> init(fw) |
| * |
| */ |
| public interface CodeOutputPlugin { |
| |
| /** |
| * Initializes the code output formatter. |
| * |
| * @param l |
| * - System logger |
| * @param p |
| * - VPMProperties supplied by the user |
| */ |
| |
| public void init(IFramework fw); |
| |
| /** |
| * The plugin starts the work (opens files, etc.) This method is called by |
| * the Viatra framework, if the code generation begins. |
| */ |
| public void beginWork(); |
| |
| /** |
| * The plugin finishes the work (closes files, etc.) This method is called by |
| * the Viatra framework if the code generation is finished. (eg. after an |
| * ASM stops) |
| * |
| */ |
| public void endWork(); |
| |
| /** |
| * Prints out the code supplied in the parameter according to the settings |
| * of the plugin. |
| * |
| * @param s |
| * The code to be written out. |
| */ |
| public void codeOut(String s) throws VPMRuntimeException; |
| /** |
| * Prints out the code supplied in the parameter according to the settings |
| * of the plugin and the mode string given. |
| * |
| * @param s |
| * The code to be written out. |
| */ |
| // public void codeOut(String uri,String s, String mode);
|
| } |