コード例 #1
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());
    }
  }
コード例 #2
0
 @Override
 public void setMyScope(final Scope scope) {
   super.setMyScope(scope);
   if (instance != null) {
     instance.setMyScope(scope);
   }
 }
コード例 #3
0
 @Override
 public void findReferences(
     final ReferenceFinder referenceFinder, final List<Hit> foundIdentifiers) {
   if (instance != null) {
     instance.findReferences(referenceFinder, foundIdentifiers);
   }
 }
コード例 #4
0
  public NamedParameter(final Identifier name, final TemplateInstance instance) {
    super();
    this.name = name;
    this.instance = instance;
    location = NULL_Location.INSTANCE;

    if (instance != null) {
      instance.setFullNameParent(this);
    }
  }
コード例 #5
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;
 }
コード例 #6
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();
   }
 }