Class AtlDefaultCompiler
java.lang.Object
org.eclipse.m2m.atl.engine.compiler.AtlDefaultCompiler
- All Implemented Interfaces:
AtlStandaloneCompiler
- Direct Known Subclasses:
Atl2004Compiler,Atl2006Compiler
Default implementation of methods necessary for all ATL compilers. Attention: This class MUST NOT reference
any types of the platform (e.g. IFile), because it must be usable stand-alone, without Eclipse, too.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal CompileTimeError[]compile(InputStream in, String outputFileName) Compiles an ATL script and returns easily accessible error messages.final CompileTimeError[]Compiles an ATL script and returns easily accessible error messages.org.eclipse.emf.ecore.EObject[]compileWithProblemModel(InputStream in, OutputStream outputStream) Compiles an ATL script and returns easily accessible error messages.org.eclipse.emf.ecore.EObject[]compileWithProblemModel(InputStream in, String outputFileName) Compiles an ATL script and returns easily accessible error messages.org.eclipse.emf.ecore.EObject[]compileWithProblemModel(Reader in, OutputStream outputStream) Compiles an ATL script and returns easily accessible error messages.org.eclipse.emf.ecore.EObject[]compileWithProblemModel(Reader in, String outputFileName) Compiles an ATL script and returns easily accessible error messages.org.eclipse.emf.ecore.EObject[]compileWithProblemModel(IModel atlModel, OutputStream outputStream) Compiles an ATL script and returns easily accessible error messages.org.eclipse.emf.ecore.EObject[]compileWithProblemModel(IModel atlModel, String outputFileName) Compiles an ATL script and returns easily accessible error messages.protected abstract URLReturns the URL of the ATL compiler transformation; to be implemented by concrete subclass.static OutputStreamAllow to write the compilation result on anOutputStream.protected abstract URLReturns the ATL WFR URL (whatever that may be); to be implemented by concrete subclass.org.eclipse.emf.ecore.EObject[]internalCompile(Reader in, String outputFileName) Compiles an ATL source file.org.eclipse.emf.ecore.EObject[]internalCompile(IModel atlmodel, String outputFileName) Compiles an ATL model.
-
Constructor Details
-
AtlDefaultCompiler
public AtlDefaultCompiler()
-
-
Method Details
-
compile
Compiles an ATL script and returns easily accessible error messages.- Specified by:
compilein interfaceAtlStandaloneCompiler- Parameters:
in- The InputStream to get atl source from.outputFileName- Name of the file to which the ATL compiled program will be saved.- Returns:
- array of compiletime errors (0 length if no errors)
- See Also:
-
compile
Compiles an ATL script and returns easily accessible error messages.- Specified by:
compilein interfaceAtlStandaloneCompiler- Parameters:
in- The Reader to get atl source from.outputFileName- Name of the file to which the ATL compiled program will be saved.- Returns:
- array of compiletime errors (0 length if no errors)
- See Also:
-
compileWithProblemModel
public org.eclipse.emf.ecore.EObject[] compileWithProblemModel(InputStream in, String outputFileName) Compiles an ATL script and returns easily accessible error messages.- Specified by:
compileWithProblemModelin interfaceAtlStandaloneCompiler- Parameters:
in- The InputStream to get atl source from.outputFileName- Name of the file to which the ATL compiled program will be saved.- Returns:
- array of compiletime errors as EObjects (0 length if no errors)
- See Also:
-
compileWithProblemModel
Compiles an ATL script and returns easily accessible error messages.- Specified by:
compileWithProblemModelin interfaceAtlStandaloneCompiler- Parameters:
in- The Reader to get atl source from.outputFileName- Name of the file to which the ATL compiled program will be saved.- Returns:
- array of compiletime errors as EObjects (0 length if no errors)
- See Also:
-
compileWithProblemModel
public org.eclipse.emf.ecore.EObject[] compileWithProblemModel(InputStream in, OutputStream outputStream) Compiles an ATL script and returns easily accessible error messages.- Specified by:
compileWithProblemModelin interfaceAtlStandaloneCompiler- Parameters:
in- The InputStream to get atl source from.outputStream- the compilation ASM output stream- Returns:
- array of compiletime errors as EObjects (0 length if no errors)
- See Also:
-
compileWithProblemModel
public org.eclipse.emf.ecore.EObject[] compileWithProblemModel(Reader in, OutputStream outputStream) Compiles an ATL script and returns easily accessible error messages.- Specified by:
compileWithProblemModelin interfaceAtlStandaloneCompiler- Parameters:
in- The Reader to get atl source from.outputStream- the compilation ASM output stream- Returns:
- array of compiletime errors as EObjects (0 length if no errors)
- See Also:
-
compileWithProblemModel
public org.eclipse.emf.ecore.EObject[] compileWithProblemModel(IModel atlModel, String outputFileName) Compiles an ATL script and returns easily accessible error messages.- Specified by:
compileWithProblemModelin interfaceAtlStandaloneCompiler- Parameters:
atlModel- The atlModel.outputFileName- Name of the file to which the ATL compiled program will be saved.- Returns:
- array of compiletime errors as EObjects (0 length if no errors)
- See Also:
-
compileWithProblemModel
public org.eclipse.emf.ecore.EObject[] compileWithProblemModel(IModel atlModel, OutputStream outputStream) Compiles an ATL script and returns easily accessible error messages.- Specified by:
compileWithProblemModelin interfaceAtlStandaloneCompiler- Parameters:
atlModel- The atlModel.outputStream- the compilation ASM output stream- Returns:
- array of compiletime errors as EObjects (0 length if no errors)
- See Also:
-
getSemanticAnalyzerURL
Returns the ATL WFR URL (whatever that may be); to be implemented by concrete subclass.- Returns:
- the URL
-
getCodegeneratorURL
Returns the URL of the ATL compiler transformation; to be implemented by concrete subclass.- Returns:
- the URL of the compiler itself
-
internalCompile
Compiles an ATL source file.- Parameters:
in- The InputStream to get atl source from.outputFileName- The name of the file to which the ATL compiled program will be saved.- Returns:
- A List of EObject instance of Problem.
-
internalCompile
public org.eclipse.emf.ecore.EObject[] internalCompile(IModel atlmodel, String outputFileName) throws ATLCoreException, IOException, ATLExecutionException Compiles an ATL model.- Parameters:
atlmodel- The atl ModeloutputFileName- The name of the file to which the ATL compiled program will be saved.- Returns:
- A List of EObject instance of Problem.
- Throws:
ATLCoreExceptionIOExceptionATLExecutionException
-
getCompilationOutputStream
Allow to write the compilation result on anOutputStream.- Returns:
- returns the OutputStream previously set by the internalCompile method
-