/** * Creates a deep clone of this {@link AApplyExp} 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 AApplyExp} node */ public AApplyExp clone(Map<INode,INode> oldToNewMap) { AApplyExp node = new AApplyExp( _type, _location, cloneNode(_root, oldToNewMap), cloneList(_args, oldToNewMap), _argtypes, _recursive ); oldToNewMap.put(this, node); return node; }
/** * Returns a deep clone of this {@link AApplyExp} node. * @return a deep clone of this {@link AApplyExp} node */ public AApplyExp clone() { return new AApplyExp( _type, _location, cloneNode(_root), cloneList(_args), _argtypes, _recursive ); }
/** * Generate an AApplyExp */ protected AApplyExp getApplyExp(PExp root, List<PExp> arglist) { AApplyExp apply = new AApplyExp(); apply.setRoot(root.clone()); List<PExp> args = new Vector<PExp>(); for (PExp arg : arglist) { args.add(arg.clone()); } apply.setArgs(args); return apply; }
public static AApplyExp newAApplyExp(PExp root) { AApplyExp result = new AApplyExp(); result.setLocation(root.getLocation()); result.setRoot(root); result.setArgs(new Vector<PExp>()); return result; }
@Override public PExp caseAMapSeqStateDesignator(AMapSeqStateDesignator node) throws AnalysisException { AApplyExp applyExp = new AApplyExp(); applyExp.setRoot(node.getMapseq().apply(this).clone()); List<PExp> args = new LinkedList<PExp>(); args.add(node.getExp().clone()); applyExp.setArgs(args); return applyExp; }
public static PExp newAApplyExp(PExp root, List<PExp> args) { AApplyExp result = new AApplyExp(); result.setLocation(root.getLocation()); result.setRoot(root); result.setArgs(args); return result; }
private PExp getPredicate(AStarStarBinaryExp exp, ILexNameToken preName, ILexNameToken arg) { if (preName != null) { return getImplies(getVarExp(preName), exp.getLeft(), preName, arg); } else { // if no existing pre_f, build it AApplyExp applyExp = new AApplyExp(); ILexNameToken prename = new LexNameToken("", "pre_", null); applyExp.setRoot(getVarExp(prename)); List<PExp> argList = new LinkedList<PExp>(); argList.add(exp.getLeft()); applyExp.setArgs(argList); return getImplies(applyExp, exp.getLeft(), prename, arg); } }
private PExp generateBody(AExplicitFunctionDefinition postdef, List<PExp> params, PExp body) { // post(params, body) AApplyExp applyExp = new AApplyExp(); applyExp.setType(new ABooleanBasicType()); AVariableExp varExp = getVarExp(postdef.getName()); varExp.setType(postdef.getType().clone()); applyExp.setRoot(varExp); List<PExp> args = params; args.add(body.clone()); applyExp.setArgs(args); return applyExp; }
throws AnalysisException AApplyExp apply_exp = new AApplyExp();
private PExp generatePredicate(AExplicitFunctionDefinition predef, AExplicitFunctionDefinition postdef, List<PExp> params, PExp body) { if (predef != null) { // pre(params) => AApplyExp applyExp = new AApplyExp(); applyExp.setType(new ABooleanBasicType()); applyExp.setArgs(cloneListPExp(params)); AVariableExp varExp = getVarExp(predef.getName().clone()); varExp.setType(predef.getType().clone()); applyExp.setRoot(varExp); return AstExpressionFactory.newAImpliesBooleanBinaryExp(applyExp, generateBody(postdef, params, body)); } return generateBody(postdef, params, body); }
|| func.getBody() instanceof ASubclassResponsibilityExp) AApplyExp applyExp = new AApplyExp(); applyExp.setArgs(params); AVariableExp varExp = getVarExp(func.getName().clone(), func.clone(), func.getType().clone());
|| func.getBody() instanceof ASubclassResponsibilityExp) AApplyExp applyExp = new AApplyExp(); applyExp.setArgs(params); AVariableExp varExp = getVarExp(func.getName().clone(), func.clone(), func.getType().clone());