public class CodeGenAnalyzer
extends java.lang.Object
Pass 1: Pivot2CGAnalysisVisitor
Each Pivot 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-1: CG2JavaPreVisitor
Traversal of the CG containment tree prepares for Java CG by
gathering imports
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
@NonNull protected final CGBoolean cgFalse
@NonNull protected final CGBoolean cgTrue
@NonNull protected final CGNull cgNull
public CodeGenAnalyzer(@NonNull CodeGenerator codeGenerator)
public void analyze(@NonNull CGElement cgRoot)
@NonNull public CGConstantExp createCGConstantExp(@NonNull OCLExpression element, @NonNull CGConstant constant)
@NonNull protected CGBoolean createCGBoolean(boolean booleanValue)
@NonNull protected CGNull createCGNull()
@NonNull public CodeGenerator getCodeGenerator()
@NonNull public CGBoolean getBoolean(boolean aBoolean)
@NonNull public CGElementId getElementId(@NonNull ElementId elementId)
@NonNull public CGExecutorOperation getExecutorOperation(@NonNull Operation pivotOperation)
@NonNull public CGExecutorOperation getExecutorOperation(@NonNull OperationId operationId)
@NonNull public CGExecutorConstructorPart getExecutorConstructorPart(@NonNull Property pivotProperty)
@NonNull public CGExecutorConstructorPart getExecutorConstructorPart(@NonNull PropertyId propertyId)
@NonNull public CGExecutorProperty getExecutorProperty(@NonNull Property pivotProperty)
@NonNull public CGExecutorProperty getExecutorProperty(@NonNull PropertyId propertyId)
@NonNull public CGValuedElement getExpression(@Nullable CGValuedElement cgExpression)
@NonNull public CGInfinity getInfinity()
@NonNull public CGInteger getInteger(@NonNull java.lang.Number aNumber)
@NonNull public CGInvalid getInvalid()
@NonNull public CGInvalid getInvalid(java.lang.String messageTemplate, java.lang.Object... bindings)
@NonNull public CGNull getNull()
@NonNull public CGReal getReal(@NonNull java.lang.Number aNumber)
@NonNull public CGString getString(@NonNull java.lang.String aString)
@NonNull public NameManager getNameManager()
public void setConstant(@NonNull CGValuedElement oldElement, @Nullable CGValuedElement aConstant)
public void setExplicitNames(@NonNull CGValuedElement cgValue, @Nullable java.lang.Object anObject)
public void setNames(@NonNull CGValuedElement cgValue, @NonNull java.lang.Object anObject)