Package sg.edu.nus.comp.simTL.engine.tracing

Examples of sg.edu.nus.comp.simTL.engine.tracing.Reference2Element


     
      ReferenceFromParent referenceFromParent = null;
      if(newSFInSource instanceof EAttribute){
        referenceFromParent = new Reference2Attribute(source,(EAttribute)newSFInSource);
      } else {
        referenceFromParent = new Reference2Element(source,(EReference)newSFInSource, template);
      }
     
//      String notificS = null;
      switch(notification.getEventType()){
        case Notification.ADD : {
View Full Code Here


    EStructuralFeature structuralFeature = placeHolderReturnContainer.getStructuralFeature();
    EObject sfContainer = placeHolderReturnContainer.getSFContainer();
    if(structuralFeature instanceof EAttribute){
      referenceFromParent = new Reference2Attribute(sfContainer,(EAttribute)structuralFeature);
    } else {
      referenceFromParent = new Reference2Element(sfContainer,(EReference)structuralFeature, template);
    }
  }
View Full Code Here

      //Both elements are within a loop with a body containing one element
      //Obviously this is a new iteration
      //TODO also add positions after left and before right
      if(!canAllocateAddTo(tLeft, tiChild)){
        //New elements in adjacent, existing iterations
        Reference2Element tFor2TLeft = template.getParentFrom(tLeft, tLeftContext);
        Reference2Element tFor2TRight = template.getParentFrom(tRight, tRightContext);
       
        // #1
        elementsInRange.add(new PositionAddAllocation(
            AllocationType.FOR_EXIST,
            tFor2TLeft.getParent(),
            tFor2TLeft.getReferenceToChildren(),
            1, //behind tLeft
            tLeftContext));
        // #2
        elementsInRange.add(new PositionAddAllocation(
            AllocationType.FOR_EXIST,
            tFor2TRight.getParent(),
            tFor2TRight.getReferenceToChildren(),
            0, //before tRight
            tRightContext));
       
      } else {
        EObject uppermostForLoop = findUpperMostForLoop(tParent, tLeft, tLeftContext);
View Full Code Here

   */
  private EObject addAllocationsTillCap(boolean leftToRight,
      EObject tObject, IContext context,
      EObject cap, EObject tiChild, Vector<AddAllocation> allocations)
      throws SimTLException{
    Reference2Element tReference2Element =  template.getParentFrom(tObject, context);
    EObject tParent = tReference2Element.getParent();
    AllocationType allocationType = findAllocationType(tParent);
   
    EReference tP2cRef = tReference2Element.getReferenceToChildren();
    if(tParent==cap){
      return tObject; //directly under cap is handled elsewhere
    }
   
    //leftToRight => start to collect when hit tObject
View Full Code Here

    }
    return super.getParentFrom(tChild, context);
  }

  private PatternVersion findPatternVersion(EObject tParent, EReference tParent2tChildRef, IContext context) throws SimTLException{
    Reference2Element tRef2El = new Reference2Element(tParent, tParent2tChildRef, context, this);
    IContext relevantContext = findRelevantContext(tParent, context);
    Map<IContext,PatternVersion> patternVersionMap = parent2context2patternVersionMap.get(tRef2El);
    if(patternVersionMap==null){
      patternVersionMap = new HashMap<IContext, PatternVersion>();
      parent2context2patternVersionMap.put(tRef2El, patternVersionMap);
View Full Code Here

    }
    return pv;
  }
 
  private boolean hasPatternVersion(EObject tParent, EReference tParent2tChildRef, IContext context) throws SimTLException{
    Reference2Element tRef2El = new Reference2Element(tParent, tParent2tChildRef, context, this);
    IContext relevantContext = findRelevantContext(tParent, context);
    Map<IContext,PatternVersion> patternVersionMap = parent2context2patternVersionMap.get(tRef2El);
    if(patternVersionMap==null) return false;
    PatternVersion pv = patternVersionMap.get(relevantContext);
    if(pv==null) return false;
View Full Code Here

       
      } else if(TForLoop.isTForLoop(tObject)){
        TForLoop forLoop = new TForLoop(tObject, context, template);
        EObject neighborInputElement = context.getVariableValue(forLoop.getName());
       
        Reference2Element pPointerToList = (Reference2Element)forLoop.getSetToBeIterated().getReferenceFromParent();
        List<EObject> parameterList = (List<EObject>)pPointerToList.getReferencedValue();
        if(parameterList.size()>0
            && (neighborInputElement==null
              ||!parameterList.contains(neighborInputElement))){
          throw new SimTLException("InputModel collection doesn't contain neighbor input element. It does contain other elements though");
         
        }
       
        Reference2Element pPointerToListElement = (Reference2Element)pPointerToList;
        EClass pClass = pPointerToListElement.getReferenceToChildren().getEReferenceType();
        //create new inputElement
        EObject pElement = pClass.getEPackage().getEFactoryInstance().create(pClass);
       
       
        if(pElement==null) throw new SimTLException("Couldn't instantiate parameter element type " + pClass.getName());
View Full Code Here

  @Override
  public Reference2Element getParentFrom(EObject child, IContext context) throws SimTLException{
    if(child==null) return null;
    EObject parent = child.eContainer(); //Language is build that containment is always activated
    EReference reference = child.eContainmentFeature();
    return new Reference2Element(parent, reference,context,this);
  }
View Full Code Here

TOP

Related Classes of sg.edu.nus.comp.simTL.engine.tracing.Reference2Element

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.