@Override public void validateAllFields(IHDLObject expectedParent, boolean checkResolve) { super.validateAllFields(expectedParent, checkResolve); validateParams(getParams()); if (getParams() != null) { for (final HDLExpression o : getParams()) { o.validateAllFields(this, checkResolve); } } }
@Override public int hashCode() { if (hashCache != null) return hashCache; int result = super.hashCode(); final int prime = 31; result = (prime * result) + ((expr == null) ? 0 : expr.hashCode()); hashCache = result; return result; }
@Override public String toConstructionString(String spacing) { final boolean first = true; final StringBuilder sb = new StringBuilder(); sb.append('\n').append(spacing).append("new HDLUnresolvedFragmentFunction()"); if (frag != null) { sb.append(".setFrag(").append('"' + frag + '"').append(")"); } if (isStatement != null) { sb.append(".setIsStatement(").append(isStatement).append(")"); } if (array != null) { if (array.size() > 0) { sb.append('\n').append(spacing); for (final HDLExpression o : array) { sb.append(".addArray(").append(o.toConstructionString(spacing + "\t\t")); sb.append('\n').append(spacing).append(")"); } } } if (bits != null) { if (bits.size() > 0) { sb.append('\n').append(spacing); for (final HDLRange o : bits) { sb.append(".addBits(").append(o.toConstructionString(spacing + "\t\t")); sb.append('\n').append(spacing).append(")"); } } } if (sub != null) { sb.append(".setSub(").append(sub.toConstructionString(spacing + "\t")).append(")"); } if (params != null) { if (params.size() > 0) { sb.append('\n').append(spacing); for (final HDLExpression o : params) { sb.append(".addParams(").append(o.toConstructionString(spacing + "\t\t")); sb.append('\n').append(spacing).append(")"); } } } return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof AbstractHDLInlineFunction)) return false; if (!super.equals(obj)) return false; final AbstractHDLInlineFunction other = (AbstractHDLInlineFunction) obj; if (expr == null) { if (other.expr != null) return false; } else if (!expr.equals(other.expr)) return false; return true; }
@Override public String toConstructionString(String spacing) { final boolean first = true; final StringBuilder sb = new StringBuilder(); sb.append('\n').append(spacing).append("new HDLInlineFunction()"); if (annotations != null) { if (annotations.size() > 0) { sb.append('\n').append(spacing); for (final HDLAnnotation o : annotations) { sb.append(".addAnnotations(").append(o.toConstructionString(spacing + "\t\t")); sb.append('\n').append(spacing).append(")"); } } } if (name != null) { sb.append(".setName(").append('"' + name + '"').append(")"); } if (args != null) { if (args.size() > 0) { sb.append('\n').append(spacing); for (final HDLFunctionParameter o : args) { sb.append(".addArgs(").append(o.toConstructionString(spacing + "\t\t")); sb.append('\n').append(spacing).append(")"); } } } if (returnType != null) { sb.append(".setReturnType(") .append(returnType.toConstructionString(spacing + "\t")) .append(")"); } if (expr != null) { sb.append(".setExpr(").append(expr.toConstructionString(spacing + "\t")).append(")"); } return sb.toString(); }