/** * Creates a deep clone of this {@link ACaseAlternative} 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 ACaseAlternative} node */ public ACaseAlternative clone(Map<INode,INode> oldToNewMap) { ACaseAlternative node = new ACaseAlternative( _location, cloneNode(_cexp, oldToNewMap), cloneNode(_pattern, oldToNewMap), cloneNode(_result, oldToNewMap), cloneList(_defs, oldToNewMap), _type, _expType ); oldToNewMap.put(this, node); return node; }
/** * Returns a deep clone of this {@link ACaseAlternative} node. * @return a deep clone of this {@link ACaseAlternative} node */ public ACaseAlternative clone() { return new ACaseAlternative( _location, cloneNode(_cexp), cloneNode(_pattern), cloneNode(_result), cloneList(_defs), _type, _expType ); }
public static ACaseAlternative newACaseAlternative(PExp cexp, PPattern pattern, PExp resultExp) { ACaseAlternative result = new ACaseAlternative(); result.setLocation(pattern.getLocation()); result.setCexp(cexp); result.setPattern(pattern); result.setResult(resultExp); return result; }