/** * Creates a new tree field only constructor {@code AApplyExp TAG=apply} 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 root_ the {@link PExp} node for the {@code root} child of this {@link AApplyExp} node * @param args_ the {@link NodeList} node for the {@code args} child of this {@link AApplyExp} node */ public AApplyExp(ILexLocation location_, PExp root_, List<? extends PExp> args_) { super(null,location_); this.setRoot(root_); this.setArgs(args_); }
@Override public PExp caseAApplyExp(AApplyExp node, Substitution question) throws AnalysisException { node.setArgs(distribute(node.getArgs(), question)); return node; }
/** * 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; }
/** * Creates a new complete constructor {@code AApplyExp} 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 root_ the {@link PExp} node for the {@code root} child of this {@link AApplyExp} node * @param args_ the {@link NodeList} node for the {@code args} child of this {@link AApplyExp} node * @param argtypes_ the {@link GraphNodeList} <b>graph</a> node for the {@code argtypes} child of this {@link AApplyExp} node. * <i>The parent of this {@code argtypes } will not be changed by adding it to this node.</i> * @param recursive_ the {@link PDefinition} <b>graph</a> node for the {@code recursive} child of this {@link AApplyExp} node. * <i>The parent of this {@code recursive } will not be changed by adding it to this node.</i> */ public AApplyExp(PType type_, ILexLocation location_, PExp root_, List<? extends PExp> args_, List<? extends PType> argtypes_, PDefinition recursive_) { super(type_,location_); this.setRoot(root_); this.setArgs(args_); this.setArgtypes(argtypes_); this.setRecursive(recursive_); }
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; }
apply_exp.setArgs(args); return apply_exp;
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); }
applyExp.setArgs(params); AVariableExp varExp = getVarExp(func.getName().clone(), func.clone(), func.getType().clone()); applyExp.setRoot(varExp);
applyExp.setArgs(params); AVariableExp varExp = getVarExp(func.getName().clone(), func.clone(), func.getType().clone()); applyExp.setRoot(varExp);