public class CodeGenAnalyzer
extends java.lang.Object
Pass 1: AS2CGAnalysisVisitor
Each AS Element is converted to a CGElement
This conversion creates objects such as CGLibraryOperationCallEXp that are more atuned to CG
and provides a tree that can be rewritten by optimizations.
Pass 2: CGPreAnalysisVisitor
Traversal of the CG containment tree performs
constant folding
Pass N-2: CG2JavaPreVisitor
Traversal of the CG containment tree prepares for Java CG by
gathering imports
Pass N-1: CommonSubexpressionEliminator
Traversal of the CG tree to share common terms and remove dead code
Pass N: CG2JavaVisitor
Traversal of the CG containment tree emits code
Modifier and Type | Field and Description |
---|---|
protected CGBoolean |
cgFalse |
protected CGNull |
cgNull |
protected CGBoolean |
cgTrue |
protected CodeGenerator |
codeGenerator |
protected NameManager |
nameManager |
Constructor and Description |
---|
CodeGenAnalyzer(CodeGenerator codeGenerator) |
@NonNull protected final CodeGenerator codeGenerator
@NonNull protected final NameManager nameManager
public CodeGenAnalyzer(@NonNull CodeGenerator codeGenerator)
@NonNull public CGConstantExp createCGConstantExp(@NonNull OCLExpression element, @NonNull CGConstant constant)
@NonNull public CGExecutorOperation createExecutorOperation(@NonNull Operation asOperation)
@NonNull public CGExecutorProperty createExecutorOppositeProperty(@NonNull Property asProperty)
@NonNull public CGExecutorProperty createExecutorProperty(@NonNull Property asProperty)
@NonNull public CGExecutorShadowPart createExecutorShadowPart(@NonNull Property asProperty)
@NonNull public CGExecutorType createExecutorType(@NonNull Type asType)
@NonNull public CodeGenerator getCodeGenerator()
@NonNull public CGElementId getElementId(@NonNull ElementId elementId)
@NonNull public CGValuedElement getExpression(@Nullable CGValuedElement cgExpression)
@NonNull public CGInvalid getInvalid(java.lang.String messageTemplate, java.lang.Object... bindings)
@NonNull public NameManager getNameManager()
@NonNull public CGUnlimited getUnlimited()
@NonNull public CGValuedElement replace(@NonNull CGValuedElement oldElement, @NonNull CGValuedElement newElement, java.lang.String messageTemplate, java.lang.Object... bindings)
public void setConstant(@NonNull CGValuedElement oldElement, @NonNull CGValuedElement aConstant)
public void setExplicitNames(@NonNull CGValuedElement cgValue, @Nullable java.lang.Object anObject)
public void setNames(@NonNull CGValuedElement cgValue, @NonNull java.lang.Object anObject)