/** * Creates a new complete constructor {@code AExplicitVarExpIR} 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 classType_ the {@link STypeIR} node for the {@code classType} child of this {@link AExplicitVarExpIR} node */ public AExplicitVarExpIR(SourceNode sourceNode_, Object tag_, List<? extends ClonableString> metaData_, STypeIR type_, Boolean isLambda_, Boolean isLocal_, String name_, STypeIR classType_) { super(sourceNode_,tag_,metaData_,type_,isLambda_,isLocal_,name_); this.setClassType(classType_); }
/** * Creates a new tree field only constructor {@code AExplicitVarExpIR TAG=explicit} 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 classType_ the {@link STypeIR} node for the {@code classType} child of this {@link AExplicitVarExpIR} node */ public AExplicitVarExpIR(STypeIR type_, Boolean isLambda_, Boolean isLocal_, String name_, STypeIR classType_) { super(null,null,null,type_,isLambda_,isLocal_,name_); this.setClassType(classType_); }
private SVarExpIR consExplicitVar(String className, String name, boolean isLambda, STypeIR typeCg, boolean isLocalDef) { AExplicitVarExpIR varExp = new AExplicitVarExpIR(); AClassTypeIR classType = new AClassTypeIR(); classType.setName(className); varExp.setType(typeCg); varExp.setIsLocal(isLocalDef); varExp.setClassType(classType); varExp.setName(name); varExp.setIsLambda(isLambda); return varExp; }
public AExplicitVarExpIR consTypeArg(String className) { AExternalTypeIR runtimeUtilClass = new AExternalTypeIR(); runtimeUtilClass.setName(className); AExternalTypeIR anyType = new AExternalTypeIR(); anyType.setName(getTypeArgumentFieldName()); AExplicitVarExpIR typeArg = new AExplicitVarExpIR(); typeArg.setClassType(runtimeUtilClass); typeArg.setIsLocal(false); typeArg.setIsLambda(false); typeArg.setType(anyType); return typeArg; }
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; } }
protected SStmIR handleVoidValueReturn(SStmIR stm) { AExternalTypeIR traceNodeClassType = new AExternalTypeIR(); traceNodeClassType.setName(traceTrans.getTracePrefixes().voidValueEnclosingClassName()); AExplicitVarExpIR voidValue = new AExplicitVarExpIR(); voidValue.setType(new AObjectTypeIR()); voidValue.setClassType(traceNodeClassType); voidValue.setIsLambda(false); voidValue.setIsLocal(true); voidValue.setName(traceTrans.getTracePrefixes().voidValueFieldName()); AReturnStmIR returnVoidVal = new AReturnStmIR(); returnVoidVal.setExp(voidValue); ABlockStmIR block = new ABlockStmIR(); block.getStatements().add(stm); block.getStatements().add(returnVoidVal); return block; }
public AApplyExpIR consUtilCall(STypeIR returnType, String memberName) { AExplicitVarExpIR member = new AExplicitVarExpIR(); AMethodTypeIR methodType = new AMethodTypeIR(); methodType.setResult(returnType.clone()); member.setType(methodType); member.setIsLambda(false); member.setIsLocal(false); AExternalTypeIR classType = new AExternalTypeIR(); classType.setName(JavaFormat.UTILS_FILE); member.setClassType(classType); member.setName(memberName); AApplyExpIR call = new AApplyExpIR(); call.setType(returnType.clone()); call.setRoot(member); return call; }
readStateMethod.setClassType(traceNodeClassType); readStateMethod.setIsLambda(false); readStateMethod.setIsLocal(false);
classType.setName(defClass); func.setClassType(classType); func.setIsLambda(false); func.setIsLocal(false);
public SVarExpIR idStateDesignatorToExp(AIdentifierStateDesignatorIR node) { if (node.getExplicit()) { AClassTypeIR classType = new AClassTypeIR(); classType.setName(node.getClassName()); AExplicitVarExpIR explicitVar = new AExplicitVarExpIR(); explicitVar.setClassType(classType); explicitVar.setIsLambda(false); explicitVar.setIsLocal(node.getIsLocal()); explicitVar.setName(node.getName()); explicitVar.setSourceNode(node.getSourceNode()); explicitVar.setTag(node.getTag()); explicitVar.setType(node.getType().clone()); return explicitVar; } else { AIdentifierVarExpIR idVar = consIdVar(node.getName(), node.getType().clone()); idVar.setTag(node.getTag()); idVar.setSourceNode(node.getSourceNode()); idVar.setIsLocal(node.getIsLocal()); return idVar; } }
@Override public void caseAIdentifierVarExpIR(AIdentifierVarExpIR node) throws AnalysisException { INode var = AssistantBase.getVdmNode(node); if(var instanceof AVariableExp) { PDefinition def = ((AVariableExp) var).getVardef(); if(def instanceof ARenamedDefinition) { ARenamedDefinition renamedDef = (ARenamedDefinition) def; AClassTypeIR definingClass = new AClassTypeIR(); definingClass.setName(renamedDef.getDef().getName().getModule()); definingClass.setSourceNode(node.getSourceNode()); AExplicitVarExpIR expVar = new AExplicitVarExpIR(); expVar.setName(renamedDef.getDef().getName().getName()); expVar.setType(node.getType().clone()); expVar.setIsLambda(node.getIsLambda()); expVar.setIsLocal(node.getIsLocal()); expVar.setMetaData(node.getMetaData()); expVar.setTag(node.getTag()); expVar.setSourceNode(node.getSourceNode()); expVar.setClassType(definingClass); assist.replaceNodeWith(node, expVar); } } }