/** * Creates a new tree field only constructor {@code AAssignToExpStmIR TAG=assignToExp} 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 target_ the {@link SExpIR} node for the {@code target} child of this {@link AAssignToExpStmIR} node * @param exp_ the {@link SExpIR} node for the {@code exp} child of this {@link AAssignToExpStmIR} node */ public AAssignToExpStmIR(SExpIR target_, SExpIR exp_) { super(null,null,null); this.setTarget(target_); this.setExp(exp_); }
/** * Creates a new complete constructor {@code AAssignToExpStmIR} 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 target_ the {@link SExpIR} node for the {@code target} child of this {@link AAssignToExpStmIR} node * @param exp_ the {@link SExpIR} node for the {@code exp} child of this {@link AAssignToExpStmIR} node */ public AAssignToExpStmIR(SourceNode sourceNode_, Object tag_, List<? extends ClonableString> metaData_, SExpIR target_, SExpIR exp_) { super(sourceNode_,tag_,metaData_); this.setTarget(target_); this.setExp(exp_); }
protected AAssignToExpStmIR assignToVar(AIdentifierVarExpIR var, SExpIR exp) { AAssignToExpStmIR assignment = new AAssignToExpStmIR(); assignment.setTarget(var.clone()); assignment.setExp(exp.clone()); return assignment; }
public AAssignToExpStmIR consBoolVarAssignment(SExpIR predicate, String boolVarName) { AAssignToExpStmIR boolVarAssignment = new AAssignToExpStmIR(); boolVarAssignment.setTarget(consBoolCheck(boolVarName, false)); boolVarAssignment.setExp(predicate != null ? predicate.clone() : info.getExpAssistant().consBoolLiteral(true)); return boolVarAssignment; }
private void initSuccessVar(PatternBlockData patternData, SExpIR initExp, ABlockStmIR patternBlock) { if (patternData.getSuccessVarDecl().getExp() instanceof AUndefinedExpIR) { patternData.getSuccessVarDecl().setExp(initExp); } else { AAssignToExpStmIR successVarAssignment = new AAssignToExpStmIR(); successVarAssignment.setTarget(patternData.getSuccessVar().clone()); successVarAssignment.setExp(initExp); patternBlock.getStatements().add(successVarAssignment); } }
@Override public List<SStmIR> getPreForLoopStms(AIdentifierVarExpIR setVar, List<SPatternIR> patterns, SPatternIR pattern) { if (count > 0) { AAssignToExpStmIR successAssignment = new AAssignToExpStmIR(); successAssignment.setExp(transAssist.getInfo().getExpAssistant().consBoolLiteral(false)); successAssignment.setTarget(transAssist.consSuccessVar(successVarName)); return packStm(successAssignment); } else { return null; } }
protected SStmIR consOrExpCheck(AOrBoolBinaryExpIR node, String orResultVarName) { SExpIR left = node.getLeft().clone(); SExpIR right = node.getRight().clone(); AIfStmIR leftCheck = new AIfStmIR(); leftCheck.setIfExp(left); AAssignToExpStmIR setOrResultVarTrue = new AAssignToExpStmIR(); setOrResultVarTrue.setTarget(transAssistant.consBoolCheck(orResultVarName, false)); setOrResultVarTrue.setExp(transAssistant.getInfo().getAssistantManager().getExpAssistant().consBoolLiteral(true)); leftCheck.setThenStm(setOrResultVarTrue); AAssignToExpStmIR setOrResultVarToRightExp = new AAssignToExpStmIR(); setOrResultVarToRightExp.setTarget(transAssistant.consBoolCheck(orResultVarName, false)); setOrResultVarToRightExp.setExp(right); leftCheck.setElseStm(setOrResultVarToRightExp); return leftCheck; }
private AAssignToExpStmIR declareAndAssignIdVarAssignment( ABlockStmIR declBlock, SPatternIR currentPattern, STypeIR currentType, SExpIR valueToMatch) { AIdentifierPatternIR currentId = (AIdentifierPatternIR) currentPattern; AVarDeclIR idVarDecl = transAssistant.getInfo().getDeclAssistant().consLocalVarDecl(currentType.clone(), currentPattern.clone(), new AUndefinedExpIR()); declBlock.getLocalDefs().add(idVarDecl); AIdentifierVarExpIR var = new AIdentifierVarExpIR(); var.setType(currentType.clone()); var.setName(currentId.getName()); var.setIsLocal(true); var.setIsLambda(false); AAssignToExpStmIR localAssignment = new AAssignToExpStmIR(); localAssignment.setTarget(var); localAssignment.setExp(valueToMatch); return localAssignment; }
assignment.setExp(assignedExp.clone()); replacementBlock.getStatements().addFirst(assignment); } else
protected AIfStmIR consAndExpCheck(AAndBoolBinaryExpIR node, String andResultVarName) { SExpIR left = node.getLeft().clone(); SExpIR right = node.getRight().clone(); AIfStmIR leftCheck = new AIfStmIR(); leftCheck.setIfExp(left); AIfStmIR rightCheck = new AIfStmIR(); rightCheck.setIfExp(right); AAssignToExpStmIR assignAndVar = new AAssignToExpStmIR(); assignAndVar.setTarget(transAssistant.consBoolCheck(andResultVarName, false)); assignAndVar.setExp(transAssistant.getInfo().getAssistantManager().getExpAssistant().consBoolLiteral(true)); rightCheck.setThenStm(assignAndVar); leftCheck.setThenStm(rightCheck); return leftCheck; }
setFalse.setExp(transAssistant.getInfo().getExpAssistant().consBoolLiteral(false)); ifStm.setElseStm(setFalse);
setLetBeStResult.setExp(value); outerBlock.getStatements().add(setLetBeStResult);
STypeIR elementType = transAssist.getElementType(setVar.getType()); resultAssign.setTarget(transAssist.getInfo().getExpAssistant().consIdVar(resultVarName, elementType)); resultAssign.setExp(transAssist.getInfo().getExpAssistant().consIdVar(name, elementType.clone()));
assign.setExp(node.getExp().clone()); assign.setSourceNode(node.getSourceNode()); assign.setTag(node.getTag());
assignment.setExp(value);
private AMethodDeclIR consSetter(AFieldDeclIR f) { AMethodDeclIR setter = new AMethodDeclIR(); setter.setAbstract(false); setter.setAccess(IRConstants.PUBLIC); setter.setAsync(false); setter.setImplicit(false); setter.setIsConstructor(false); setter.setName(consSetCallName(f.getName())); setter.setStatic(false); setter.setSourceNode(f.getSourceNode()); String paramName = consParamName(f); AFormalParamLocalParamIR param = new AFormalParamLocalParamIR(); param.setType(f.getType().clone()); param.setPattern(jmlGen.getJavaGen().getInfo().getPatternAssistant().consIdPattern(paramName)); setter.getFormalParams().add(param); AMethodTypeIR methodType = new AMethodTypeIR(); methodType.setResult(new AVoidTypeIR()); methodType.getParams().add(f.getType().clone()); setter.setMethodType(methodType); AAssignToExpStmIR fieldUpdate = new AAssignToExpStmIR(); fieldUpdate.setTarget(jmlGen.getJavaGen().getInfo().getExpAssistant().consIdVar(f.getName(), f.getType().clone())); fieldUpdate.setExp(jmlGen.getJavaGen().getInfo().getExpAssistant().consIdVar(paramName, f.getType().clone())); setter.setBody(fieldUpdate); return setter; }
assignInstance.setExp(newQuote);
assignHashcode.setExp(superCall);