public AApplyExpIR consUtilsToStringCall() { return consUtilCall(new AStringTypeIR(), IJavaConstants.TO_STRING); } }
/** * Returns a deep clone of this {@link AStringTypeIR} node. * @return a deep clone of this {@link AStringTypeIR} node */ public AStringTypeIR clone() { return new AStringTypeIR( _sourceNode, _tag, _metaData, _optional, cloneNode(_namedInvType) ); }
/** * Creates a deep clone of this {@link AStringTypeIR} 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 AStringTypeIR} node */ public AStringTypeIR clone(Map<INode,INode> oldToNewMap) { AStringTypeIR node = new AStringTypeIR( _sourceNode, _tag, _metaData, _optional, cloneNode(_namedInvType, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
public AStringLiteralExpIR consStringLiteral(String value, boolean isNull) { AStringLiteralExpIR stringLiteral = new AStringLiteralExpIR(); stringLiteral.setType(new AStringTypeIR()); stringLiteral.setIsNull(isNull); stringLiteral.setValue(value); return stringLiteral; }
private void correctExpToString(SExpIR toCorrect) { ASeqToStringUnaryExpIR conversion = new ASeqToStringUnaryExpIR(); transformationAssistant.replaceNodeWith(toCorrect, conversion); conversion.setType(new AStringTypeIR()); conversion.setExp(toCorrect); } }
public AMethodDeclIR consToStringSignature() { AMethodDeclIR toStringMethod = new AMethodDeclIR(); toStringMethod.setTag(new IRGeneratedTag(getClass().getName())); toStringMethod.setIsConstructor(false); toStringMethod.setAccess(IJavaConstants.PUBLIC); toStringMethod.setStatic(false); toStringMethod.setName(IJavaConstants.TO_STRING); toStringMethod.setAbstract(false); AStringTypeIR returnType = new AStringTypeIR(); AMethodTypeIR methodType = new AMethodTypeIR(); methodType.setResult(returnType); toStringMethod.setMethodType(methodType); return toStringMethod; }
str.setType(new AStringTypeIR()); str.setLeft(info.getExpAssistant().consStringLiteral(prefix + "(", false)); tmp.setType(new AStringTypeIR());
public AApplyExpIR consPostCheckCall(AMethodDeclIR method, AApplyExpIR postCondCall, AIdentifierVarExpIR resultVar, AStringLiteralExpIR methodName) { AExternalTypeIR externalType = new AExternalTypeIR(); externalType.setName(JavaFormat.UTILS_FILE); AMethodTypeIR methodType = new AMethodTypeIR(); methodType.setResult(new ABoolBasicTypeIR()); methodType.getParams().add(method.getMethodType().getResult().clone()); methodType.getParams().add(new ABoolBasicTypeIR()); methodType.getParams().add(new AStringTypeIR()); AExplicitVarExpIR explicitVar = new AExplicitVarExpIR(); explicitVar.setType(methodType); explicitVar.setIsLambda(false); explicitVar.setIsLocal(false); explicitVar.setName(postCheckMethodName); explicitVar.setClassType(externalType); AApplyExpIR utilsCall = new AApplyExpIR(); utilsCall.setRoot(explicitVar); utilsCall.setType(methodType.getResult().clone()); utilsCall.getArgs().add(resultVar); utilsCall.getArgs().add(postCondCall); utilsCall.getArgs().add(methodName); return utilsCall; } }
&& right.getType() instanceof AStringTypeIR) node.setType(new AStringTypeIR()); return; node.setType(new AStringTypeIR());
AStringTypeIR returnType = new AStringTypeIR();
public STypeIR constructSeqType(SSeqTypeBase node, IRInfo question) throws AnalysisException { STypeIR seqOfCg = node.getSeqof().apply(question.getTypeVisitor(), question); boolean emptyCg = node.getEmpty(); boolean isSeq1 = node instanceof ASeq1SeqType; // This is a special case since sequence of characters are strings if (seqOfCg instanceof ACharBasicTypeIR && question.getSettings().getCharSeqAsString()) { AStringTypeIR stringTypeCg = new AStringTypeIR(); stringTypeCg.setSourceNode(new SourceNode(node)); return stringTypeCg; } ASeqSeqTypeIR seqType = new ASeqSeqTypeIR(); seqType.setSeqOf(seqOfCg); seqType.setEmpty(emptyCg); seqType.setSeq1(isSeq1); return seqType; }
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; } }
return new AStringTypeIR(); } else
} else typeCg = new AStringTypeIR();