generate code for table_scan and print