public static AOrdRelation newAOrdRelation(PPattern leftPattern, PPattern rightPattern, PExp exp) { AOrdRelation result = new AOrdRelation(); result.setLhsPattern(leftPattern); result.setRhsPattern(rightPattern); result.setRelExp(exp); return result; }
/** * Forwarding hashCode call to {@link Object#hashCode()}. **/ @Override public int hashCode() { return super.hashCode(); }
public static AEqRelation newAEqRelation(PPattern leftPattern, PPattern rightPattern, PExp exp) { AEqRelation result = new AEqRelation(); result.setLhsPattern(leftPattern); result.setRhsPattern(rightPattern); result.setRelExp(exp); return result; }
@Override public PType caseAOrdRelation(AOrdRelation node, TypeCheckInfo question) throws AnalysisException { // Do not report TC errors for Min or Max. Just confusing. TypeChecker.suppressErrors(true); node.getMinDef().apply(THIS,question); node.getMaxDef().apply(THIS,question); TypeChecker.suppressErrors(false); return node.getRelDef().apply(THIS, question); }
/** * Creates a new complete constructor {@code PRelationBase} node with the given nodes as children. * @deprecated This method should not be used, use AstFactory instead. * The basic child nodes are removed from their previous parents. * @param location_ the {@link ILexLocation} node for the {@code location} child of this {@link PRelationBase} node * @param lhsPattern_ the {@link PPattern} node for the {@code lhsPattern} child of this {@link PRelationBase} node * @param rhsPattern_ the {@link PPattern} node for the {@code rhsPattern} child of this {@link PRelationBase} node * @param relExp_ the {@link PExp} node for the {@code relExp} child of this {@link PRelationBase} node * @param relDef_ the {@link AExplicitFunctionDefinition} node for the {@code relDef} child of this {@link PRelationBase} node */ public PRelationBase(ILexLocation location_, PPattern lhsPattern_, PPattern rhsPattern_, PExp relExp_, AExplicitFunctionDefinition relDef_) { super(); this.setLocation(location_); this.setLhsPattern(lhsPattern_); this.setRhsPattern(rhsPattern_); this.setRelExp(relExp_); this.setRelDef(relDef_); }
/** * Creates a new complete constructor {@code AOrdRelation} node with the given nodes as children. * @deprecated This method should not be used, use AstFactory instead. * The basic child nodes are removed from their previous parents. * @param minDef_ the {@link AExplicitFunctionDefinition} node for the {@code minDef} child of this {@link AOrdRelation} node * @param maxDef_ the {@link AExplicitFunctionDefinition} node for the {@code maxDef} child of this {@link AOrdRelation} node */ public AOrdRelation(ILexLocation location_, PPattern lhsPattern_, PPattern rhsPattern_, PExp relExp_, AExplicitFunctionDefinition relDef_, AExplicitFunctionDefinition minDef_, AExplicitFunctionDefinition maxDef_) { super(location_,lhsPattern_,rhsPattern_,relExp_,relDef_); this.setMinDef(minDef_); this.setMaxDef(maxDef_); }
@Override public PType caseAEqRelation(AEqRelation node, TypeCheckInfo question) throws AnalysisException { return node.getRelDef().apply(THIS,question); }
/** * Returns a deep clone of this {@link AEqRelation} node. * @return a deep clone of this {@link AEqRelation} node */ public AEqRelation clone() { return new AEqRelation( _location, cloneNode(_lhsPattern), cloneNode(_rhsPattern), cloneNode(_relExp), cloneNode(_relDef) ); }
/** * Returns a deep clone of this {@link AOrdRelation} node. * @return a deep clone of this {@link AOrdRelation} node */ public AOrdRelation clone() { return new AOrdRelation( _location, cloneNode(_lhsPattern), cloneNode(_rhsPattern), cloneNode(_relExp), cloneNode(_relDef), cloneNode(_minDef), cloneNode(_maxDef) ); }
public String toString() { return super.toString(); }
@Override public PType defaultPRelation(PRelation node, TypeCheckInfo question) throws AnalysisException { return node.apply(tcDefinition, question); }
/** * Sets the {@code _ordRelation} child of this {@link ATypeDefinition} node. * @param value the new {@code _ordRelation} child of this {@link ATypeDefinition} node */ public void setOrdRelation(AOrdRelation value) { if (this._ordRelation != null) { this._ordRelation.parent(null); } if (value != null) { if (value.parent() != null) { value.parent().removeChild(value); } value.parent(this); } this._ordRelation = value; }
/** * Sets the {@code _eqRelation} child of this {@link ATypeDefinition} node. * @param value the new {@code _eqRelation} child of this {@link ATypeDefinition} node */ public void setEqRelation(AEqRelation value) { if (this._eqRelation != null) { this._eqRelation.parent(null); } if (value != null) { if (value.parent() != null) { value.parent().removeChild(value); } value.parent(this); } this._eqRelation = value; }
/** * Essentially this.toString().equals(o.toString()). **/ @Override public boolean equals(Object o) { if (o != null && o instanceof AOrdRelation) { return toString().equals(o.toString()); } return false; }
/** * Essentially this.toString().equals(o.toString()). **/ @Override public boolean equals(Object o) { if (o != null && o instanceof AEqRelation) { return toString().equals(o.toString()); } return false; }
/** * Creates a map of all field names and their value * @param includeInheritedFields if true all inherited fields are included * @return a a map of names to values of all fields */ @Override public Map<String,Object> getChildren(Boolean includeInheritedFields) { Map<String,Object> fields = new HashMap<String,Object>(); if(includeInheritedFields) { fields.putAll(super.getChildren(includeInheritedFields)); } return fields; }
/** * Creates a deep clone of this {@link AEqRelation} node while putting all * old node-new node relations in the map {@code oldToNewMap}. * @param oldToNewMap the map filled with the old node-new node relation * @return a deep clone of this {@link AEqRelation} node */ public AEqRelation clone(Map<INode,INode> oldToNewMap) { AEqRelation node = new AEqRelation( _location, cloneNode(_lhsPattern, oldToNewMap), cloneNode(_rhsPattern, oldToNewMap), cloneNode(_relExp, oldToNewMap), cloneNode(_relDef, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Creates a deep clone of this {@link AOrdRelation} node while putting all * old node-new node relations in the map {@code oldToNewMap}. * @param oldToNewMap the map filled with the old node-new node relation * @return a deep clone of this {@link AOrdRelation} node */ public AOrdRelation clone(Map<INode,INode> oldToNewMap) { AOrdRelation node = new AOrdRelation( _location, cloneNode(_lhsPattern, oldToNewMap), cloneNode(_rhsPattern, oldToNewMap), cloneNode(_relExp, oldToNewMap), cloneNode(_relDef, oldToNewMap), cloneNode(_minDef, oldToNewMap), cloneNode(_maxDef, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Forwarding hashCode call to {@link Object#hashCode()}. **/ @Override public int hashCode() { return super.hashCode(); }
/** * Essentially this.toString().equals(o.toString()). **/ @Override public boolean equals(Object o) { if (o != null && o instanceof PRelationBase) { return toString().equals(o.toString()); } return false; }