/** * Creates a new tree field only constructor {@code AMkBasicExpIR TAG=mkBasic} 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 arg_ the {@link SExpIR} node for the {@code arg} child of this {@link AMkBasicExpIR} node */ public AMkBasicExpIR(STypeIR type_, SExpIR arg_) { super(null,null,null,type_); this.setArg(arg_); }
/** * Creates a new complete constructor {@code AMkBasicExpIR} 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 arg_ the {@link SExpIR} node for the {@code arg} child of this {@link AMkBasicExpIR} node */ public AMkBasicExpIR(SourceNode sourceNode_, Object tag_, List<? extends ClonableString> metaData_, STypeIR type_, SExpIR arg_) { super(sourceNode_,tag_,metaData_,type_); this.setArg(arg_); }
@Override public SExpIR caseAMkBasicExp(AMkBasicExp node, IRInfo question) throws AnalysisException { PType type = node.getType(); if (!(type instanceof ATokenBasicType)) { question.addUnsupportedNode(node, "Expected token type for mk basic expression. Got: " + type); return null; } PExp arg = node.getArg(); STypeIR typeCg = type.apply(question.getTypeVisitor(), question); SExpIR argCg = arg.apply(question.getExpVisitor(), question); AMkBasicExpIR mkBasicExp = new AMkBasicExpIR(); mkBasicExp.setType(typeCg); mkBasicExp.setArg(argCg); return mkBasicExp; }