public static ALenUnaryExp newALenUnaryExp(ILexLocation location, PExp exp) { ALenUnaryExp result = new ALenUnaryExp(); initExpressionUnary(result, location, exp); return result; }
/** * Returns a deep clone of this {@link ALenUnaryExp} node. * @return a deep clone of this {@link ALenUnaryExp} node */ public ALenUnaryExp clone() { return new ALenUnaryExp( _type, _location, cloneNode(_exp) ); }
/** * Creates a deep clone of this {@link ALenUnaryExp} 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 ALenUnaryExp} node */ public ALenUnaryExp clone(Map<INode,INode> oldToNewMap) { ALenUnaryExp node = new ALenUnaryExp( _type, _location, cloneNode(_exp, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
public SeqApplyObligation(PStateDesignator root, PExp arg, IPOContextStack ctxt, IPogAssistantFactory af) throws AnalysisException { super(root, POType.SEQ_APPLY, ctxt, root.getLocation(), af); // arg >0 AIntLiteralExp zeroExp = new AIntLiteralExp(); zeroExp.setValue(new LexIntegerToken(0, null)); AGreaterNumericBinaryExp grExp = AstExpressionFactory.newAGreaterNumericBinaryExp(arg.clone(), zeroExp); // len(root) ALenUnaryExp lenExp = new ALenUnaryExp(); PExp stateExp = root.apply(new StateDesignatorToExpVisitor()); lenExp.setExp(stateExp.clone()); // len(root)+1 AIntLiteralExp oneExp = new AIntLiteralExp(); oneExp.setValue(new LexIntegerToken(1, null)); APlusNumericBinaryExp plusExp = AstExpressionFactory.newAPlusNumericBinaryExp(lenExp, oneExp); // arg <= len(root) +1 ALessEqualNumericBinaryExp lteExp = AstExpressionFactory.newALessEqualNumericBinaryExp(arg.clone(), plusExp); // arg > 0 and arg <= len(root)+1 AAndBooleanBinaryExp andExp = AstExpressionFactory.newAAndBooleanBinaryExp(grExp, lteExp); stitch = andExp; valuetree.setPredicate(ctxt.getPredWithContext(stitch)); } }
ALenUnaryExp len = new ALenUnaryExp(); len.setExp(subseq.getSeq()); le.setRight(len);