public abstract class Transformation
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
Transformation()
Transformation ctor for translation_unit triggered transformation.
|
protected |
Transformation(AnalyzedPragma directive)
Transformation ctor for directive triggered transformation.
|
Modifier and Type | Method and Description |
---|---|
boolean |
abortOnFailedAnalysis()
Tells whether the transformation should abort the translation if the
analysis fails.
|
abstract boolean |
analyze(XcodeProgram xcodeml,
Translator translator)
Analyze the possibility to apply the transformation.
|
abstract boolean |
canBeTransformedWith(XcodeProgram xcodeml,
Transformation other)
Check whether the current transformation can be transformed together with
the given transformation.
|
AnalyzedPragma |
getDirective()
Get the directive that triggered the transformation.
|
protected int |
getStartLine()
Get the line number where the pragma was found.
|
protected boolean |
isTransformed()
Get the information whether the transformation has been applied or not.
|
protected void |
setStartLine(int lineno)
Set the start line of the transformation.
|
abstract void |
transform(XcodeProgram xcodeml,
Translator translator,
Transformation other)
Apply the actual transformation.
|
protected void |
transformed()
Set the transformation as transformed.
|
protected Transformation()
protected Transformation(AnalyzedPragma directive)
directive
- The directive that triggered the transformation.public abstract boolean analyze(XcodeProgram xcodeml, Translator translator)
xcodeml
- The XcodeML on which the transformations are applied.translator
- The translator used to applied the transformations.public abstract boolean canBeTransformedWith(XcodeProgram xcodeml, Transformation other)
xcodeml
- The XcodeML on which the transformations are applied.other
- The other transformation part of the dependent transformation.DependentTransformationGroup
public boolean abortOnFailedAnalysis()
public abstract void transform(XcodeProgram xcodeml, Translator translator, Transformation other) throws java.lang.Exception
xcodeml
- The XcodeML on which the transformations are applied.translator
- The translator used to applied the transformations.other
- Only for dependent transformation. The other
transformation part of the transformation.IllegalTransformationException
- if the transformation cannot be
applied.java.lang.Exception
public AnalyzedPragma getDirective()
protected int getStartLine()
protected void setStartLine(int lineno)
lineno
- An positive integer value representing the line number.protected boolean isTransformed()
protected void transformed()