multiple dispatch ast codegen