public AIdentifierVarExpIR consIdVar(String name, STypeIR type) { AIdentifierVarExpIR var = new AIdentifierVarExpIR(); var.setIsLambda(false); var.setIsLocal(true); var.setType(type); var.setName(name); return var; }
private SVarExpIR consIdVar(String name, boolean isLambda, STypeIR typeCg, boolean isLocalDef) { AIdentifierVarExpIR varExp = new AIdentifierVarExpIR(); varExp.setType(typeCg); varExp.setIsLocal(isLocalDef); varExp.setName(name); varExp.setIsLambda(isLambda); return varExp; }
public AIdentifierVarExpIR consSuccessVar(String successVarName) { AIdentifierVarExpIR successVar = new AIdentifierVarExpIR(); successVar.setIsLambda(false); successVar.setIsLocal(true); successVar.setName(successVarName); successVar.setType(new ABoolBasicTypeIR()); return successVar; }
protected void replaceCompWithTransformation(SStmIR enclosingStm, ABlockStmIR block, STypeIR type, String var, SExpIR comp) { AIdentifierVarExpIR compResult = new AIdentifierVarExpIR(); compResult.setType(type.clone()); compResult.setName(var); compResult.setIsLambda(false); compResult.setIsLocal(true); transform(enclosingStm, block, compResult, comp); }
public AIfStmIR consConditionalIncrement(String counterName, SExpIR predicate) { AIdentifierVarExpIR col = new AIdentifierVarExpIR(); col.setType(new AIntNumericBasicTypeIR()); col.setIsLambda(false); col.setIsLocal(true); col.setName(counterName); AIncrementStmIR inc = new AIncrementStmIR(); inc.setVar(col); AIfStmIR ifStm = new AIfStmIR(); ifStm.setIfExp(predicate); ifStm.setThenStm(inc); return ifStm; }
@Override protected List<SStmIR> getConditionalAdd(AIdentifierVarExpIR setVar, List<SPatternIR> patterns, SPatternIR pattern) { AIdentifierVarExpIR seqCompResult = new AIdentifierVarExpIR(); seqCompResult.setType(compType.clone()); seqCompResult.setName(idPattern.getName()); seqCompResult.setIsLambda(false); seqCompResult.setIsLocal(true); ASeqCompAddStmIR add = new ASeqCompAddStmIR(); add.setSeq(seqCompResult); add.setElement(first.clone()); return consConditionalAdd(seqCompResult, add); }
@Override protected List<SStmIR> getConditionalAdd(AIdentifierVarExpIR setVar, List<SPatternIR> patterns, SPatternIR pattern) { AIdentifierVarExpIR mapCompResult = new AIdentifierVarExpIR(); mapCompResult.setType(compType.clone()); mapCompResult.setName(idPattern.getName()); mapCompResult.setIsLambda(false); mapCompResult.setIsLocal(true); AMapCompAddStmIR add = new AMapCompAddStmIR(); add.setMap(mapCompResult); add.setElement(first.clone()); return consConditionalAdd(mapCompResult, add); } }
@Override protected List<SStmIR> getConditionalAdd(AIdentifierVarExpIR setVar, List<SPatternIR> patterns, SPatternIR pattern) { AIdentifierVarExpIR setCompResult = new AIdentifierVarExpIR(); setCompResult.setType(compType.clone()); setCompResult.setName(idPattern.getName()); setCompResult.setIsLambda(false); setCompResult.setIsLocal(true); ASetCompAddStmIR add = new ASetCompAddStmIR(); add.setSet(setCompResult); add.setElement(first.clone()); return consConditionalAdd(setCompResult, add); } }
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; }
varExp.setType(nextDeclCopy.getType()); varExp.setIsLocal(true); varExp.setIsLambda(false); varExp.setName(((AIdentifierPatternIR) nextDeclPattern).getName());
condVar.setType(predMethod.getMethodType().clone()); condVar.setName(predMethod.getName()); condVar.setIsLambda(false); condVar.setIsLocal(true); paramArg.setType(p.getType().clone()); paramArg.setIsLocal(true); paramArg.setIsLambda(false); paramArg.setName(paramId.getName());
private SExpIR consFieldStr(AFieldDeclIR field, boolean separate) { String left = ""; if (separate) { left += ", "; } left += field.getName(); left += field.getFinal() != null && field.getFinal() ? " = " : " := "; AApplyExpIR toStringCall = consUtilsToStringCall(); AIdentifierVarExpIR fieldVar = new AIdentifierVarExpIR(); fieldVar.setType(field.getType().clone()); fieldVar.setIsLambda(false); fieldVar.setIsLocal(false); fieldVar.setName(field.getName()); toStringCall.getArgs().add(fieldVar); ASeqConcatBinaryExpIR fieldStr = new ASeqConcatBinaryExpIR(); fieldStr.setType(new AStringTypeIR()); fieldStr.setLeft(info.getExpAssistant().consStringLiteral(left, false)); fieldStr.setRight(toStringCall); return fieldStr; } }
sentinelVar.setIsLambda(false); sentinelVar.setName(concPrefixes.sentinelInstanceName()); sentinelVar.setType(fieldType);
var.setType(param.getType().clone()); var.setName(idPattern.getName()); var.setIsLambda(false); var.setSourceNode(pattern.getSourceNode());
var.setType(valueToMatch.getType().clone()); var.setName(idPattern.getName()); var.setIsLambda(false); var.setIsLocal(true); patternData.setRootPatternVar(var);
resultVar.setIsLambda(false); resultVar.setName(casesExpResultName); resultVar.setType(node.getType().clone());
recordPatternVar.setType(recordType.clone()); recordPatternVar.setName(idPattern.getName()); recordPatternVar.setIsLambda(false); recordPatternVar.setIsLocal(true); patternData.setRootPatternVar(recordPatternVar);
tuplePatternVar.setType(tupleType.clone()); tuplePatternVar.setName(idPattern.getName()); tuplePatternVar.setIsLambda(false); tuplePatternVar.setIsLocal(true); patternData.setRootPatternVar(tuplePatternVar);
col.setIsLambda(false); col.setIsLocal(true); col.setName(counterName);
id.setName(name); id.setType(type.clone()); id.setIsLambda(false); id.setIsLocal(true);