| 323 | } |
| 324 | |
| 325 | PHP_SYN_NODE *make_switch_syn_node(PHP_EXP_NODE *cond, PHP_EXP_NODE *case_list) |
| 326 | { |
| 327 | PHP_SYN_NODE *syn_node = new PHP_SYN_NODE; |
| 328 | memset(syn_node, 0, sizeof(PHP_SYN_NODE)); |
| 329 | |
| 330 | syn_node->type = PHP_ST_SWITCH; |
| 331 | |
| 332 | // |
| 333 | // Bind all statement lists into single one for |
| 334 | // simpler execution |
| 335 | // |
| 336 | PHP_SYN_NODE *stat_list_tail = 0; |
| 337 | for(PHP_EXP_NODE *cur_case = case_list; cur_case; cur_case = cur_case->next) { |
| 338 | PHP_SYN_NODE *cur_stat_list = cur_case->exp_node->tree_node.syn_right; |
| 339 | if ( stat_list_tail ) { |
| 340 | while ( stat_list_tail->next_node ) stat_list_tail = stat_list_tail->next_node; |
| 341 | stat_list_tail->next_node = cur_stat_list; |
| 342 | } else { |
| 343 | stat_list_tail = cur_stat_list; |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | syn_node->node_switch.cond = cond; |
| 348 | syn_node->node_switch.case_list = case_list; |
| 349 | |
| 350 | return syn_node; |
| 351 | } |
| 352 | |
| 353 | PHP_VAR_NODE *make_var_node() |
| 354 | { |