org.eclipse.ocl.examples.xtext.base.cs2pivot
Class BaseCS2Pivot

java.lang.Object
  extended by org.eclipse.emf.ecore.util.EcoreUtil
      extended by org.eclipse.ocl.examples.pivot.utilities.AbstractConversion
          extended by org.eclipse.ocl.examples.xtext.base.cs2pivot.CS2Pivot
              extended by org.eclipse.ocl.examples.xtext.base.cs2pivot.BaseCS2Pivot
All Implemented Interfaces:
org.eclipse.emf.common.notify.Adapter, org.eclipse.emf.common.notify.Adapter.Internal, MetaModelManagedAdapter, MetaModelManagerListener
Direct Known Subclasses:
EssentialOCLCS2Pivot

public class BaseCS2Pivot
extends CS2Pivot

BaseCST2Pivot provides an extensible conversion from CS models to the pivot model.

Conversion/update occurs in five passes.

Pass 1: updateDeclarers()
the package/class/property/template parameter CS composition hierarchy is replicated in the pivot hierarchy
requests for unreferable declarations are accumulated in queuedDefiners.
requests for specialization are accumulated in queuedBindings.
requests for references are accumulated in queuedReferencers.
all unspecialized pivot elements have correct attributes and composed children
all unspecialized pivot nameable elements appear in moniker2pivotMap.

Pass 2: updateDefiners()
the feature/annotation/detail CS composition hierarchy is replicated in the pivot hierarchy
requests for specialization are accumulated in queuedBindings.
requests for references are accumulated in queuedReferencers.
all unspecialized pivot elements have correct attributes and composed children
all unspecialized pivot nameable elements appear in moniker2pivotMap.

Pass 3: updateReferencers()
the expression CS composition hierarchy is replicated in the pivot hierarchy
requests for resolvers are accumulated in queuedResolvers.

Pass 4: updateSpecializations()
a unique pivot specialization is created/updated from each distinct CS specialization.
further requests for references are accumulated in queuedReferencers.
all pivot elements have correct attributes and composed children
all pivot nameable elements appear in moniker2pivotMap.
all specialized elements have correct signature, formal references

Pass 5: updateResolvers()
cross-tree references are resolved in the pivot model.
- pivot specialization actual arguments
- TypedElementCS.type, TypedTypeRefCS.type, ...

Correlation between the CS and pivot is achieved by monikers which are unique for all NameableElements. The old pivot model's monikers initialize the moniker2PivotMap so the the subsequent refresh can discover a pre-existing pivot element for each required CS element. The moniker2PivotMap is updated as pivot elements are created. pivot monikers are not used during conversion since it may not be possible to create the correct moniker for a partially converted specialization.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.ocl.examples.xtext.base.cs2pivot.CS2Pivot
CS2Pivot.AbstractUnresolvedProxyMessageProvider, CS2Pivot.DefaultMessageBinder, CS2Pivot.MessageBinder, CS2Pivot.MessageBinderWithLineContext, CS2Pivot.UnresolvedProxyMessageProvider
 
Nested classes/interfaces inherited from class org.eclipse.ocl.examples.pivot.utilities.AbstractConversion
AbstractConversion.Predicate<T extends org.eclipse.emf.ecore.EObject>
 
Nested classes/interfaces inherited from class org.eclipse.emf.ecore.util.EcoreUtil
org.eclipse.emf.ecore.util.EcoreUtil.AbstractFilteredSettingsIterator<E>, org.eclipse.emf.ecore.util.EcoreUtil.ContentTreeIterator<E>, org.eclipse.emf.ecore.util.EcoreUtil.Copier, org.eclipse.emf.ecore.util.EcoreUtil.CrossReferencer, org.eclipse.emf.ecore.util.EcoreUtil.EGenericTypeConverter, org.eclipse.emf.ecore.util.EcoreUtil.EqualityHelper, org.eclipse.emf.ecore.util.EcoreUtil.ExternalCrossReferencer, org.eclipse.emf.ecore.util.EcoreUtil.FilteredSettingsIterator, org.eclipse.emf.ecore.util.EcoreUtil.ProperContentIterator<E>, org.eclipse.emf.ecore.util.EcoreUtil.ProxyCrossReferencer, org.eclipse.emf.ecore.util.EcoreUtil.UnresolvedProxyCrossReferencer, org.eclipse.emf.ecore.util.EcoreUtil.UsageCrossReferencer
 
Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter
org.eclipse.emf.common.notify.Adapter.Internal
 
Field Summary
 
Fields inherited from class org.eclipse.ocl.examples.xtext.base.cs2pivot.CS2Pivot
cs2PivotMapping, cs2pivotResourceMap, showContext
 
Fields inherited from class org.eclipse.ocl.examples.pivot.utilities.AbstractConversion
metaModelManager
 
Fields inherited from class org.eclipse.emf.ecore.util.EcoreUtil
GEN_MODEL_PACKAGE_NS_URI, GET, IS_SET, SET, UNSET
 
Constructor Summary
BaseCS2Pivot(BaseCS2Pivot cs2pivot)
           
BaseCS2Pivot(java.util.Map<? extends org.eclipse.emf.ecore.resource.Resource,? extends org.eclipse.emf.ecore.resource.Resource> cs2pivotResourceMap, MetaModelManager metaModelManager)
           
 
Method Summary
protected  BaseContainmentVisitor createContainmentVisitor(CS2PivotConversion converter)
           
protected  BaseLeft2RightVisitor createLeft2RightVisitor(CS2PivotConversion converter)
           
protected  BasePostOrderVisitor createPostOrderVisitor(CS2PivotConversion converter)
           
protected  BasePreOrderVisitor createPreOrderVisitor(CS2PivotConversion converter)
           
 
Methods inherited from class org.eclipse.ocl.examples.xtext.base.cs2pivot.CS2Pivot
addUnresolvedProxyMessageProvider, basicGetType, bind, computePivot2CSMap, computeRootContainmentFeatures, createConversion, dispose, findAdapter, getCSElement, getCSResources, getDocumentationNodes, getMessageBinder, getMetaModelManager, getPivotElement, getPivotElement, getPivotResource, getPivotResources, getTarget, getUnresolvedProxyMessage, getUnresolvedProxyText, installPivotDefinition, installPivotReference, installPivotUsage, isAdapterFor, isAdapterForType, metaModelManagerDisposed, notifyChanged, refreshModelElement, setElementType, setMessageBinder, setTarget, unsetTarget, update
 
Methods inherited from class org.eclipse.ocl.examples.pivot.utilities.AbstractConversion
basicGet, getEPackage, isId, refreshList, refreshSet
 
Methods inherited from class org.eclipse.emf.ecore.util.EcoreUtil
computeDiagnostic, convertToString, copy, copyAll, create, createFromString, delete, delete, equals, equals, filterDescendants, freeze, generateUUID, generateUUID, getAdapter, getAdapterFactory, getAllContents, getAllContents, getAllContents, getAllContents, getAllContents, getAllProperContents, getAllProperContents, getAllProperContents, getAllProperContents, getAnnotation, getConstraints, getConversionDelegateFactory, getConversionDelegates, getDocumentation, getExistingAdapter, getID, getIdentification, getInvocationDelegateFactory, getInvocationDelegates, getObjectByType, getObjectsByType, getRegisteredAdapter, getRegisteredAdapter, getRootContainer, getRootContainer, getSettingDelegateFactory, getSettingDelegates, getURI, getValidationDelegates, indexOf, isAncestor, isAncestor, isAncestor, isAncestor, isInvariant, isSuppressedVisibility, isSuppressedVisibility, remove, remove, remove, replace, replace, replace, resolve, resolve, resolve, resolveAll, resolveAll, resolveAll, setAnnotation, setConstraints, setConversionDelegates, setDocumentation, setEList, setEList, setID, setInvocationDelegates, setSettingDelegates, setSuppressedVisibility, setSuppressedVisibility, setValidationDelegates, toJavaInstanceTypeName, wrapperClassFor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseCS2Pivot

public BaseCS2Pivot(java.util.Map<? extends org.eclipse.emf.ecore.resource.Resource,? extends org.eclipse.emf.ecore.resource.Resource> cs2pivotResourceMap,
                    MetaModelManager metaModelManager)

BaseCS2Pivot

public BaseCS2Pivot(BaseCS2Pivot cs2pivot)
Method Detail

createContainmentVisitor

protected BaseContainmentVisitor createContainmentVisitor(CS2PivotConversion converter)
Specified by:
createContainmentVisitor in class CS2Pivot

createLeft2RightVisitor

protected BaseLeft2RightVisitor createLeft2RightVisitor(CS2PivotConversion converter)
Specified by:
createLeft2RightVisitor in class CS2Pivot

createPostOrderVisitor

protected BasePostOrderVisitor createPostOrderVisitor(CS2PivotConversion converter)
Specified by:
createPostOrderVisitor in class CS2Pivot

createPreOrderVisitor

protected BasePreOrderVisitor createPreOrderVisitor(CS2PivotConversion converter)
Specified by:
createPreOrderVisitor in class CS2Pivot