コード例 #1
0
  public boolean equalsWithComments(Object o) {

    /* generated by template ast.ErrorIfNull*/
    Log.errorIfNull(o, "0xA7006_960 Parameter 'o' must not be null.");

    /* generated by template ast.additionalmethods.EqualsWithComments*/

    ASTUsingdeclaration comp;
    if ((o instanceof ASTUsingdeclaration)) {
      comp = (ASTUsingdeclaration) o;
    } else {
      return false;
    }
    if (!equalAttributes(comp)) {
      return false;
    }
    // comparing comments
    if (get_PreComments().size() == comp.get_PreComments().size()) {
      java.util.Iterator<de.monticore.ast.Comment> one = get_PreComments().iterator();
      java.util.Iterator<de.monticore.ast.Comment> two = comp.get_PreComments().iterator();
      while (one.hasNext()) {
        if (!one.next().equals(two.next())) {
          return false;
        }
      }
    } else {
      return false;
    }

    if (get_PostComments().size() == comp.get_PostComments().size()) {
      java.util.Iterator<de.monticore.ast.Comment> one = get_PostComments().iterator();
      java.util.Iterator<de.monticore.ast.Comment> two = comp.get_PostComments().iterator();
      while (one.hasNext()) {
        if (!one.next().equals(two.next())) {
          return false;
        }
      }
    } else {
      return false;
    }
    return true;
  }
コード例 #2
0
  public ASTUsingdeclaration deepClone(ASTUsingdeclaration result) {

    /* generated by template ast.ErrorIfNull*/
    Log.errorIfNull(result, "0xA7006_130 Parameter 'result' must not be null.");

    /* generated by template ast.additionalmethods.DeepCloneWithParameters*/

    super.deepClone(result);

    result.typenameL =
        this.typenameL.isPresent()
            ? Optional.ofNullable((String) this.typenameL.get())
            : Optional.empty();
    result.nestednamespecifier =
        this.nestednamespecifier.isPresent()
            ? Optional.ofNullable(
                (cpp14._ast.ASTNestednamespecifier) this.nestednamespecifier.get().deepClone())
            : Optional.empty();
    result.usingL =
        this.usingL.isPresent()
            ? Optional.ofNullable((String) this.usingL.get())
            : Optional.empty();
    result.doublecolonL =
        this.doublecolonL.isPresent()
            ? Optional.ofNullable((String) this.doublecolonL.get())
            : Optional.empty();
    result.unqualifiedid =
        this.unqualifiedid.isPresent()
            ? Optional.ofNullable(
                (cpp14._ast.ASTUnqualifiedid) this.unqualifiedid.get().deepClone())
            : Optional.empty();
    result.semiL =
        this.semiL.isPresent() ? Optional.ofNullable((String) this.semiL.get()) : Optional.empty();
    result.symbol =
        this.symbol.isPresent()
            ? Optional.ofNullable((Symbol) this.symbol.get())
            : Optional.empty();
    result.enclosingScope =
        this.enclosingScope.isPresent()
            ? Optional.ofNullable((Scope) this.enclosingScope.get())
            : Optional.empty();
    return result;
  }