simplified implementation of parse_table()