|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.ocl.examples.codegen.analyzer.CodeGenAnalyzer
public class CodeGenAnalyzer
A CodeGenAnalyzer performs the analysis of a Pivot AST in preparation for code generation.
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
| Field Summary | |
|---|---|
protected CGBoolean |
cgFalse
|
protected CGNull |
cgNull
|
protected CGBoolean |
cgTrue
|
protected CodeGenerator |
codeGenerator
|
protected NameManager |
nameManager
|
| Constructor Summary | |
|---|---|
CodeGenAnalyzer(CodeGenerator codeGenerator)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
@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
| Constructor Detail |
|---|
public CodeGenAnalyzer(@NonNull
CodeGenerator codeGenerator)
| Method Detail |
|---|
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 CGExecutorConstructorPart createExecutorConstructorPart(@NonNull
Property asProperty)
@NonNull
public CGExecutorOperation createExecutorOperation(@NonNull
Operation asOperation)
@NonNull
public CGExecutorProperty createExecutorOppositeProperty(@NonNull
Property asProperty)
@NonNull
public CGExecutorProperty createExecutorProperty(@NonNull
Property asProperty)
@NonNull
public CGExecutorType createExecutorType(@NonNull
Type asType)
@NonNull public CodeGenerator getCodeGenerator()
@NonNull public CGBoolean getBoolean(boolean aBoolean)
@NonNull
public CGElementId getElementId(@NonNull
ElementId elementId)
@NonNull
public CGValuedElement getExpression(@Nullable
CGValuedElement cgExpression)
@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()
@NonNull
public CGTypeId getTypeId(@NonNull
TypeId typeId)
@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)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||