public class CodeGenAnalyzer extends 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
Constructor and Description |
---|
CodeGenAnalyzer(CodeGenerator codeGenerator) |
public CodeGenAnalyzer(CodeGenerator codeGenerator)
public void analyze(CGElement cgRoot)
public CGValuedElement createCGConstantExp(CGConstant cgConstant)
public CGConstantExp createCGConstantExp(OCLExpression element, CGConstant cgConstant)
public CGExecutorOperation createExecutorOperation(Operation asOperation)
public CGExecutorProperty createExecutorOppositeProperty(Property asProperty)
public CGExecutorProperty createExecutorProperty(Property asProperty)
public CGExecutorShadowPart createExecutorShadowPart(Property asProperty)
public CGExecutorType createExecutorType(Type asType)
public CGBoolean getBoolean(boolean aBoolean)
public CodeGenerator getCodeGenerator()
public CGElementId getElementId(ElementId elementId)
public CGValuedElement getExpression(CGValuedElement cgExpression)
public CGInvalid getInvalid()
public CGNull getNull()
public NameManager getNameManager()
public CGUnlimited getUnlimited()
public CGValuedElement replace(CGValuedElement oldElement, CGValuedElement newElement, String messageTemplate, Object... bindings)
public void setConstant(CGValuedElement oldElement, CGValuedElement aConstant)
public void setExplicitNames(CGValuedElement cgValue, Object anObject)
public void setNames(CGValuedElement cgValue, Object anObject)
Copyright © 2005, 2018 IBM Corporation and others. All Rights Reserved.