Search in sources :

Example 1 with CIAPort

use of verdict.vdm.vdm_model.CIAPort in project VERDICT by ge-high-assurance.

the class Vdm2Csv method updateCompDepTable.

private void updateCompDepTable(Table compDepTable, String qualNameComp, String packageName, String compTypeName, CyberExpr inputCyberExpr, CIAPort outputCIAPort) {
    if (inputCyberExpr.getKind() == null) {
        // expression is not an AND, OR, NOT expression
        compDepTable.addValue(qualNameComp);
        compDepTable.addValue(replaceColonsWithUnderscore(qualNameComp));
        compDepTable.addValue(packageName);
        compDepTable.addValue(compTypeName);
        CIAPort inpCIAPort = inputCyberExpr.getPort();
        compDepTable.addValue(inpCIAPort.getName());
        compDepTable.addValue(formatToSmall(inpCIAPort.getCia().name()));
        compDepTable.addValue(outputCIAPort.getName());
        compDepTable.addValue(formatToSmall(outputCIAPort.getCia().name()));
        compDepTable.capRow();
    } else if (inputCyberExpr.getKind().toString().equalsIgnoreCase("Or")) {
        List<CyberExpr> subInpCyberList = inputCyberExpr.getOr().getExpr();
        for (CyberExpr subInpCyberExpr : subInpCyberList) {
            updateCompDepTable(compDepTable, qualNameComp, packageName, compTypeName, subInpCyberExpr, outputCIAPort);
        }
    } else if (inputCyberExpr.getKind().toString().equalsIgnoreCase("And")) {
        updateCompDepTableWithAndCyberExpr(compDepTable, qualNameComp, packageName, compTypeName, inputCyberExpr, outputCIAPort);
    } else {
        throw new RuntimeException("Expression used as Cyber Relation input is not supported.");
    }
}
Also used : CIAPort(verdict.vdm.vdm_model.CIAPort) CyberExpr(verdict.vdm.vdm_model.CyberExpr) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 CIAPort (verdict.vdm.vdm_model.CIAPort)1 CyberExpr (verdict.vdm.vdm_model.CyberExpr)1