Package org.eclipse.m2m.atl.engine.compiler

# Class AtlDefaultCompiler

java.lang.Object
org.eclipse.m2m.atl.engine.compiler.AtlDefaultCompiler

All Implemented Interfaces:
  `AtlStandaloneCompiler`

Direct Known Subclasses:
  `Atl2004Compiler`, `Atl2006Compiler`

public abstract class AtlDefaultCompiler extends Object implements AtlStandaloneCompiler
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
Constructor
Description
`AtlDefaultCompiler()`

## Method Summary

Modifier and Type
Method
Description
`final CompileTimeError[]`
`compile(InputStream in, String outputFileName)`
Compiles an ATL script and returns easily accessible error messages.
`final CompileTimeError[]`
`compile(Reader in, String outputFileName)`
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 URL`
`getCodegeneratorURL()`
Returns the URL of the ATL compiler transformation; to be implemented by concrete subclass.
`static OutputStream`
`getCompilationOutputStream()`
Allow to write the compilation result on an `OutputStream`.
`protected abstract URL`
`getSemanticAnalyzerURL()`
Returns 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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### AtlDefaultCompiler

public AtlDefaultCompiler()

## Method Details

### compile

public final CompileTimeError[] compile(InputStream in, String outputFileName)
Compiles an ATL script and returns easily accessible error messages.

Specified by:
  `compile` in interface `AtlStandaloneCompiler`
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:
  - `AtlStandaloneCompiler.compile(java.io.InputStream, java.lang.String)`

### compile

public final CompileTimeError[] compile(Reader in, String outputFileName)
Compiles an ATL script and returns easily accessible error messages.

Specified by:
  `compile` in interface `AtlStandaloneCompiler`
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:
  - `AtlStandaloneCompiler.compile(java.io.Reader, java.lang.String)`

### compileWithProblemModel

public org.eclipse.emf.ecore.EObject[] compileWithProblemModel(InputStream in, String outputFileName)
Compiles an ATL script and returns easily accessible error messages.

Specified by:
  `compileWithProblemModel` in interface `AtlStandaloneCompiler`
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:
  - `AtlStandaloneCompiler.compileWithProblemModel(java.io.InputStream, java.lang.String)`

### compileWithProblemModel

public org.eclipse.emf.ecore.EObject[] compileWithProblemModel(Reader in, String outputFileName)
Compiles an ATL script and returns easily accessible error messages.

Specified by:
  `compileWithProblemModel` in interface `AtlStandaloneCompiler`
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:
  - `AtlStandaloneCompiler.compileWithProblemModel(java.io.Reader, java.lang.String)`

### compileWithProblemModel

public org.eclipse.emf.ecore.EObject[] compileWithProblemModel(InputStream in, OutputStream outputStream)
Compiles an ATL script and returns easily accessible error messages.

Specified by:
  `compileWithProblemModel` in interface `AtlStandaloneCompiler`
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:
  - `AtlStandaloneCompiler.compileWithProblemModel(java.io.InputStream, java.io.OutputStream)`

### compileWithProblemModel

public org.eclipse.emf.ecore.EObject[] compileWithProblemModel(Reader in, OutputStream outputStream)
Compiles an ATL script and returns easily accessible error messages.

Specified by:
  `compileWithProblemModel` in interface `AtlStandaloneCompiler`
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:
  - `AtlStandaloneCompiler.compileWithProblemModel(java.io.Reader, java.io.OutputStream)`

### compileWithProblemModel

public org.eclipse.emf.ecore.EObject[] compileWithProblemModel(IModel atlModel, String outputFileName)
Compiles an ATL script and returns easily accessible error messages.

Specified by:
  `compileWithProblemModel` in interface `AtlStandaloneCompiler`
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:
  - `AtlStandaloneCompiler.compileWithProblemModel(org.eclipse.m2m.atl.core.IModel, java.lang.String)`

### compileWithProblemModel

public org.eclipse.emf.ecore.EObject[] compileWithProblemModel(IModel atlModel, OutputStream outputStream)
Compiles an ATL script and returns easily accessible error messages.

Specified by:
  `compileWithProblemModel` in interface `AtlStandaloneCompiler`
Parameters:
  `atlModel` - The atlModel.
  `outputStream` - the compilation ASM output stream
Returns:
  array of compiletime errors as EObjects (0 length if no errors)
See Also:
  - `AtlStandaloneCompiler.compileWithProblemModel(org.eclipse.m2m.atl.core.IModel, java.io.OutputStream)`

### getSemanticAnalyzerURL

protected abstract URL getSemanticAnalyzerURL()
Returns the ATL WFR URL (whatever that may be); to be implemented by concrete subclass.

Returns:
  the URL

### getCodegeneratorURL

protected abstract URL getCodegeneratorURL()
Returns the URL of the ATL compiler transformation; to be implemented by concrete subclass.

Returns:
  the URL of the compiler itself

### internalCompile

public org.eclipse.emf.ecore.EObject[] internalCompile(Reader in, String outputFileName)
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 Model
  `outputFileName` - The name of the file to which the ATL compiled program will be saved.
Returns:
  A List of EObject instance of Problem.
Throws:
  `ATLCoreException`
  `IOException`
  `ATLExecutionException`

### getCompilationOutputStream

public static OutputStream getCompilationOutputStream()
Allow to write the compilation result on an `OutputStream`.

Returns:
  returns the OutputStream previously set by the internalCompile method