コード例 #1
0
 protected void check(final Identifier identifier, final String description, Problems problems) {
   String displayName = identifier.getDisplayName();
   if (VISIBILITY_PATTERN.matcher(displayName).matches()) {
     String msg = MessageFormat.format(REPORT, description, displayName);
     problems.report(identifier.getLocation(), msg);
   }
 }
コード例 #2
0
 @Override
 protected boolean memberAccept(ASTVisitor v) {
   if (name != null && !name.accept(v)) {
     return false;
   }
   if (instance != null && !instance.accept(v)) {
     return false;
   }
   return true;
 }
コード例 #3
0
  @Override
  public String getText(final Object element) {
    Identifier identifier = null;
    if (element instanceof IOutlineElement) {
      IOutlineElement e = (IOutlineElement) element;
      String outlineText = e.getOutlineText();
      if (outlineText.length() != 0) {
        return outlineText;
      }
      identifier = e.getIdentifier();
    } else if (element instanceof List<?>) {
      return "imports";
    }

    if (identifier == null) {
      return "unknown";
    }

    return identifier.getDisplayName();
  }
コード例 #4
0
 public String createStringRepresentation() {
   if (name == null || instance == null) {
     return "<unknown named parameter>";
   } else {
     StringBuilder sb = new StringBuilder();
     sb.append(name.getName());
     sb.append(" := ");
     sb.append(instance.createStringRepresentation());
     return sb.toString();
   }
 }
コード例 #5
0
  /**
   * Handles the incremental parsing of this named parameter.
   *
   * @param reparser the parser doing the incremental parsing.
   * @param isDamaged true if the location contains the damaged area, false if only its' location
   *     needs to be updated.
   */
  @Override
  public void updateSyntax(final TTCN3ReparseUpdater reparser, final boolean isDamaged)
      throws ReParseException {
    if (isDamaged) {
      throw new ReParseException();
    }

    reparser.updateLocation(name.getLocation());

    if (instance != null) {
      instance.updateSyntax(reparser, false);
      reparser.updateLocation(instance.getLocation());
    }
  }