ast codegen (finished select-case statement)