Package org.destecs.core.contract

Examples of org.destecs.core.contract.Contract


    StringBuilder sb = new StringBuilder();
    try
    {
      if (p != null)
      {
        Contract contract = ParserUtil.getContract(p, null);
        Links vdmLinks = ParserUtil.getVdmLinks(p, null);

        sb.append("--- \n");
        sb.append("--- Shared Design Parameters ---\n");
        sb.append("--- \n");
        for (IVariable sdp : contract.getSharedDesignParameters())
        {
          LinkInfo info = vdmLinks.getBoundVariableInfo(sdp.getName());
          String id = "?";
          if (info != null)
          {
            id = info.getQualifiedNameString();
          }
          sb.append(id + " <-> " + sdp.getName() + " <-> "
              + sdp.getName() + " not checked\n");
        }

        sb.append("\n\n");
        sb.append("--- \n");
        sb.append("--- Monitored Variables ---\n");
        sb.append("--- \n");
        for (IVariable sdp : contract.getMonitoredVariables())
        {
          LinkInfo info = vdmLinks.getBoundVariableInfo(sdp.getName());
          String id = "?";
          if (info != null)
          {
            id = info.getQualifiedNameString();
          }
          sb.append(id + " <-> " + sdp.getName() + " <-> "
              + sdp.getName() + " not checked\n");
        }
        sb.append("\n\n");
        sb.append("--- \n");
        sb.append("--- Controlled Variables ---\n");
        sb.append("--- \n");
        for (IVariable sdp : contract.getControlledVariables())
        {
          LinkInfo info = vdmLinks.getBoundVariableInfo(sdp.getName());
          String id = "?";
          if (info != null)
          {
            id = info.getQualifiedNameString();
          }
          sb.append(id + " <-> " + sdp.getName() + " <-> "
              + sdp.getName() + " not checked\n");
        }
        sb.append("\n\n");
        sb.append("--- \n");
        sb.append("--- Events ---\n");
        sb.append("--- \n");
        for (String event : contract.getEvents())
        {
          LinkInfo info = vdmLinks.getBoundVariableInfo(event);
          String id = "?";
          if (info != null)
          {
View Full Code Here


        if (project != null)
        {
          ContractParserWrapper parser = new ContractParserWrapper();
          IDestecsProject dproject = (IDestecsProject) project.getAdapter(IDestecsProject.class);

          Contract contract;
          try
          {
            if (dproject == null)
            {
              return;
            }
            File file = dproject.getContractFile().getLocation().toFile();
            if (!file.exists())
            {
              return;
            }
            contract = parser.parse(file);

            if (contract == null)
            {
              return;
            }

            fillSdpTable(contract.getSharedDesignParameters());
            return;
          } catch (IOException e)
          {
            DestecsDebugPlugin.logError("Faild to synchronize SDPs with contract", e);
          }
View Full Code Here

   */
  public static Contract getContract(IDestecsProject project,
      IAddErrorHandler errorHandler) throws Exception
  {
    ContractParserWrapper contractParser = new ContractParserWrapper();
    Contract contract = (Contract) parse(contractParser,
        project.getContractFile(), errorHandler);
    return contract;
  }
View Full Code Here

TOP

Related Classes of org.destecs.core.contract.Contract

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.