コード例 #1
0
  public static String formatNodeString(
      VdmNodeInfo nodeInfo, LocationAssistantCG locationAssistant) {
    INode node = nodeInfo.getNode();
    StringBuilder messageSb = new StringBuilder();
    messageSb.append(limitStr(node.toString()));
    messageSb.append(" (" + node.getClass().getSimpleName() + ")");

    ILexLocation location = locationAssistant.findLocation(node);
    if (location != null) {
      messageSb.append(" " + location.toShortString());
    }

    String reason = nodeInfo.getReason();
    if (reason != null) {
      messageSb.append(". Reason: " + reason);
    }

    return messageSb.toString();
  }
コード例 #2
0
  public static void addMarkers(VdmNodeInfo nodeInfo, LocationAssistantCG locationAssistant) {
    if (nodeInfo == null) {
      return;
    }

    INode node = nodeInfo.getNode();

    ILexLocation location = locationAssistant.findLocation(node);

    if (location == null) {
      return;
    }

    IFile ifile = convert(location.getFile());

    String reason = nodeInfo.getReason();

    String message = "Code generation support not implemented: " + node.toString();
    message += reason != null ? ". Reason: " + reason : "";

    FileUtility.addMarker(
        ifile, message, location, IMarker.PRIORITY_NORMAL, ICodeGenConstants.PLUGIN_ID, -1);
  }