示例#1
0
  /**
   * returns a flat list of InterfaceItem scopes for a {@link MessageFromIf}
   *
   * @param mfi - the message from interface
   * @param ref - not used
   * @return a list of scopes
   */
  public IScope scope_MessageFromIf_from(MessageFromIf mfi, EReference ref) {
    final List<IEObjectDescription> scopes = new ArrayList<IEObjectDescription>();

    ActorClass ac = getActorClass(mfi);
    List<InterfaceItem> items = RoomHelpers.getAllInterfaceItems(ac);

    for (InterfaceItem item : items) {
      scopes.add(EObjectDescription.create(item.getName(), item));
    }

    return new SimpleScope(IScope.NULLSCOPE, scopes);
  }
示例#2
0
  public IScope scope_MessageHandler_msg(MessageHandler handler, EReference ref) {
    final List<IEObjectDescription> scopes = new ArrayList<IEObjectDescription>();

    ProtocolClass pc = RoomHelpers.getProtocolClass(handler);
    if (pc != null) {
      for (Message m : pc.getIncomingMessages()) {
        scopes.add(EObjectDescription.create(m.getName(), m));
      }
      for (Message m : pc.getOutgoingMessages()) {
        scopes.add(EObjectDescription.create(m.getName(), m));
      }
    }

    return new SimpleScope(IScope.NULLSCOPE, scopes);
  }
示例#3
0
  /**
   * returns a flat list of Message scopes for a {@link SemanticsInRule}
   *
   * @param sr - the semantics rule for incoming messages
   * @param ref - not used
   * @return a list of scopes
   */
  public IScope scope_SemanticsRule_msg(SemanticsRule sr, EReference ref) {
    final List<IEObjectDescription> scopes = new ArrayList<IEObjectDescription>();

    ProtocolClass pc = RoomHelpers.getProtocolClass(sr);
    LinkedList<ProtocolClass> classes = getBaseClasses(pc);
    for (ProtocolClass bpc : classes) {
      for (Message m : bpc.getIncomingMessages()) {
        scopes.add(EObjectDescription.create(m.getName(), m));
      }
      for (Message m : bpc.getOutgoingMessages()) {
        scopes.add(EObjectDescription.create(m.getName(), m));
      }
    }

    return new SimpleScope(IScope.NULLSCOPE, scopes);
  }
示例#4
0
  public IScope scope_PortOperation_sendsMsg(PortOperation op, EReference ref) {
    final List<IEObjectDescription> scopes = new ArrayList<IEObjectDescription>();

    PortClass pcls = (PortClass) op.eContainer();
    ProtocolClass pc = RoomHelpers.getProtocolClass(op);
    if (pc != null) {
      if (pcls == pc.getConjugate())
        for (Message m : pc.getIncomingMessages()) {
          scopes.add(EObjectDescription.create(m.getName(), m));
        }
      else
        for (Message m : pc.getOutgoingMessages()) {
          scopes.add(EObjectDescription.create(m.getName(), m));
        }
    }

    return new SimpleScope(IScope.NULLSCOPE, scopes);
  }