/** * Creates a new tree field only constructor {@code ATypeDeclIR TAG=type} 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 access_ the {@link String} node for the {@code access} child of this {@link ATypeDeclIR} node * @param inv_ the {@link SDeclIR} node for the {@code inv} child of this {@link ATypeDeclIR} node * @param decl_ the {@link SDeclIR} node for the {@code decl} child of this {@link ATypeDeclIR} node */ public ATypeDeclIR(String access_, SDeclIR inv_, SDeclIR decl_) { super(null,null,null); this.setAccess(access_); this.setInv(inv_); this.setDecl(decl_); }
/** * Creates a new complete constructor {@code ATypeDeclIR} 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 access_ the {@link String} node for the {@code access} child of this {@link ATypeDeclIR} node * @param inv_ the {@link SDeclIR} node for the {@code inv} child of this {@link ATypeDeclIR} node * @param decl_ the {@link SDeclIR} node for the {@code decl} child of this {@link ATypeDeclIR} node */ public ATypeDeclIR(SourceNode sourceNode_, Object tag_, List<? extends ClonableString> metaData_, String access_, SDeclIR inv_, SDeclIR decl_) { super(sourceNode_,tag_,metaData_); this.setAccess(access_); this.setInv(inv_); this.setDecl(decl_); }
@Override public SDeclIR caseATypeDefinition(ATypeDefinition node, IRInfo question) throws AnalysisException { String access = node.getAccess().getAccess().toString(); PType type = node.getType(); SDeclIR declCg = type.apply(question.getDeclVisitor(), question); SDeclIR invCg = question.getSettings().generateInvariants() && node.getInvdef() != null ? node.getInvdef().apply(question.getDeclVisitor(), question) : null; ATypeDeclIR typeDecl = new ATypeDeclIR(); typeDecl.setAccess(access); typeDecl.setDecl(declCg); typeDecl.setInv(invCg); return typeDecl; }
typeDecl.setInv(method); invMethodIsGen = true;