コード例 #1
0
  public ASTTemplateargument deepClone(ASTTemplateargument result) {

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

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

    super.deepClone(result);

    result.constantexpression =
        this.constantexpression.isPresent()
            ? Optional.ofNullable(
                (cpp14._ast.ASTConstantexpression) this.constantexpression.get().deepClone())
            : Optional.empty();
    result.typeidP =
        this.typeidP.isPresent()
            ? Optional.ofNullable((cpp14._ast.ASTTypeidP) this.typeidP.get().deepClone())
            : Optional.empty();
    result.idexpression =
        this.idexpression.isPresent()
            ? Optional.ofNullable((cpp14._ast.ASTIdexpression) this.idexpression.get().deepClone())
            : 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;
  }
コード例 #2
0
  public boolean equalsWithComments(Object o) {

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

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

    ASTTemplateargument comp;
    if ((o instanceof ASTTemplateargument)) {
      comp = (ASTTemplateargument) 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;
  }