/** * Creates a deep clone of this {@link AMkTypeExp} 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 AMkTypeExp} node */ public AMkTypeExp clone(Map<INode,INode> oldToNewMap) { AMkTypeExp node = new AMkTypeExp( _type, _location, cloneNode(_typeName, oldToNewMap), cloneList(_args, oldToNewMap), _recordType, _argTypes ); oldToNewMap.put(this, node); return node; }
/** * Returns a deep clone of this {@link AMkTypeExp} node. * @return a deep clone of this {@link AMkTypeExp} node */ public AMkTypeExp clone() { return new AMkTypeExp( _type, _location, cloneNode(_typeName), cloneList(_args), _recordType, _argTypes ); }
public static AMkTypeExp newAMkTypeExp(ILexNameToken typename, List<PExp> args) { AMkTypeExp result = new AMkTypeExp(); initExpression(result, typename.getLocation()); result.setTypeName(typename); result.setArgs(args); return result; }
public static AMkTypeExp newAMkTypeExp(ILexNameToken typeName, PType type, List<PExp> arglist) { AMkTypeExp mktype = new AMkTypeExp(); mktype.setType(type); if (type instanceof ARecordInvariantType) { mktype.setRecordType((ARecordInvariantType) type.clone()); } mktype.setTypeName(typeName); mktype.setArgs(arglist); return mktype; }
/** * Now, compound patterns involve recursive calls to expand their pattern components to expressions. * * @param node * @return * @throws AnalysisException */ public PExp caseARecordPattern(ARecordPattern node) throws AnalysisException { AMkTypeExp mkExp = new AMkTypeExp(); mkExp.setTypeName(node.getTypename().clone()); List<PExp> args = new Vector<PExp>(); for (PPattern p : node.getPlist()) { args.add(p.apply(this).clone()); } addPossibleType(mkExp, node); mkExp.setArgs(args); return mkExp; }