try use ast for codegenerate