comparison src/pt-eval.cc @ 8845:5a6db6bd1a02

eigs.cc (Feigs): fix handling of sigma arg
author John W. Eaton <jwe@octave.org>
date Mon, 23 Feb 2009 16:29:20 -0500
parents 280fae940bb0
children 4d812facab0e
comparison
equal deleted inserted replaced
8844:c84a5b6377c4 8845:5a6db6bd1a02
83 { 83 {
84 panic_impossible (); 84 panic_impossible ();
85 } 85 }
86 86
87 void 87 void
88 tree_evaluator::visit_break_command (tree_break_command&) 88 tree_evaluator::visit_break_command (tree_break_command& cmd)
89 { 89 {
90 if (! error_state) 90 if (! error_state)
91 tree_break_command::breaking = 1; 91 {
92 if (debug_mode)
93 do_breakpoint (cmd.is_breakpoint (), cmd.line (), cmd.column ());
94
95 tree_break_command::breaking = 1;
96 }
92 } 97 }
93 98
94 void 99 void
95 tree_evaluator::visit_colon_expression (tree_colon_expression&) 100 tree_evaluator::visit_colon_expression (tree_colon_expression&)
96 { 101 {
181 } 186 }
182 187
183 void 188 void
184 tree_evaluator::visit_global_command (tree_global_command& cmd) 189 tree_evaluator::visit_global_command (tree_global_command& cmd)
185 { 190 {
191 if (debug_mode)
192 do_breakpoint (cmd.is_breakpoint (), cmd.line (), cmd.column ());
193
186 do_decl_init_list (do_global_init, cmd.initializer_list ()); 194 do_decl_init_list (do_global_init, cmd.initializer_list ());
187 } 195 }
188 196
189 void 197 void
190 tree_evaluator::visit_static_command (tree_static_command& cmd) 198 tree_evaluator::visit_static_command (tree_static_command& cmd)
191 { 199 {
200 if (debug_mode)
201 do_breakpoint (cmd.is_breakpoint (), cmd.line (), cmd.column ());
202
192 do_decl_init_list (do_static_init, cmd.initializer_list ()); 203 do_decl_init_list (do_static_init, cmd.initializer_list ());
193 } 204 }
194 205
195 void 206 void
196 tree_evaluator::visit_decl_elt (tree_decl_elt&) 207 tree_evaluator::visit_decl_elt (tree_decl_elt&)
265 void 276 void
266 tree_evaluator::visit_simple_for_command (tree_simple_for_command& cmd) 277 tree_evaluator::visit_simple_for_command (tree_simple_for_command& cmd)
267 { 278 {
268 if (error_state) 279 if (error_state)
269 return; 280 return;
281
282 if (debug_mode)
283 do_breakpoint (cmd.is_breakpoint (), cmd.line (), cmd.column ());
270 284
271 unwind_protect::begin_frame ("tree_evaluator::visit_simple_for_command"); 285 unwind_protect::begin_frame ("tree_evaluator::visit_simple_for_command");
272 286
273 unwind_protect_bool (in_loop_command); 287 unwind_protect_bool (in_loop_command);
274 288
406 tree_evaluator::visit_complex_for_command (tree_complex_for_command& cmd) 420 tree_evaluator::visit_complex_for_command (tree_complex_for_command& cmd)
407 { 421 {
408 if (error_state) 422 if (error_state)
409 return; 423 return;
410 424
425 if (debug_mode)
426 do_breakpoint (cmd.is_breakpoint (), cmd.line (), cmd.column ());
427
411 unwind_protect::begin_frame ("tree_evaluator::visit_complex_for_command"); 428 unwind_protect::begin_frame ("tree_evaluator::visit_complex_for_command");
412 429
413 unwind_protect_bool (in_loop_command); 430 unwind_protect_bool (in_loop_command);
414 431
415 in_loop_command = true; 432 in_loop_command = true;
542 { 559 {
543 tree_if_clause *tic = *p; 560 tree_if_clause *tic = *p;
544 561
545 tree_expression *expr = tic->condition (); 562 tree_expression *expr = tic->condition ();
546 563
547 if (debug_mode) 564 if (debug_mode && ! tic->is_else_clause ())
548 do_breakpoint (! tic->is_else_clause () && tic->is_breakpoint (), 565 do_breakpoint (tic->is_breakpoint (), tic->line (), tic->column ());
549 tic->line (), tic->column ());
550 566
551 if (tic->is_else_clause () || expr->is_logically_true ("if")) 567 if (tic->is_else_clause () || expr->is_logically_true ("if"))
552 { 568 {
553 if (! error_state) 569 if (! error_state)
554 { 570 {
586 { 602 {
587 panic_impossible (); 603 panic_impossible ();
588 } 604 }
589 605
590 void 606 void
591 tree_evaluator::visit_no_op_command (tree_no_op_command&) 607 tree_evaluator::visit_no_op_command (tree_no_op_command& cmd)
592 { 608 {
593 // Do nothing. 609 if (debug_mode && cmd.is_end_of_fcn_or_script ())
610 do_breakpoint (cmd.is_breakpoint (), cmd.line (), cmd.column (), true);
594 } 611 }
595 612
596 void 613 void
597 tree_evaluator::visit_constant (tree_constant&) 614 tree_evaluator::visit_constant (tree_constant&)
598 { 615 {
622 { 639 {
623 panic_impossible (); 640 panic_impossible ();
624 } 641 }
625 642
626 void 643 void
627 tree_evaluator::visit_return_command (tree_return_command&) 644 tree_evaluator::visit_return_command (tree_return_command& cmd)
628 { 645 {
629 if (! error_state) 646 if (! error_state)
630 tree_return_command::returning = 1; 647 {
648 if (debug_mode)
649 do_breakpoint (cmd.is_breakpoint (), cmd.line (), cmd.column ());
650
651 tree_return_command::returning = 1;
652 }
631 } 653 }
632 654
633 void 655 void
634 tree_evaluator::visit_return_list (tree_return_list&) 656 tree_evaluator::visit_return_list (tree_return_list&)
635 { 657 {
643 } 665 }
644 666
645 void 667 void
646 tree_evaluator::visit_statement (tree_statement& stmt) 668 tree_evaluator::visit_statement (tree_statement& stmt)
647 { 669 {
648 if (debug_mode)
649 do_breakpoint (stmt);
650
651 tree_command *cmd = stmt.command (); 670 tree_command *cmd = stmt.command ();
652 tree_expression *expr = stmt.expression (); 671 tree_expression *expr = stmt.expression ();
653 672
654 if (cmd || expr) 673 if (cmd || expr)
655 { 674 {
665 { 684 {
666 if (cmd) 685 if (cmd)
667 cmd->accept (*this); 686 cmd->accept (*this);
668 else 687 else
669 { 688 {
689 if (debug_mode)
690 do_breakpoint (expr->is_breakpoint (), expr->line (),
691 expr->column ());
692
670 if (in_fcn_or_script_body && Vsilent_functions) 693 if (in_fcn_or_script_body && Vsilent_functions)
671 expr->set_print_flag (false); 694 expr->set_print_flag (false);
672 695
673 // FIXME -- maybe all of this should be packaged in 696 // FIXME -- maybe all of this should be packaged in
674 // one virtual function that returns a flag saying whether 697 // one virtual function that returns a flag saying whether
792 for (tree_switch_case_list::iterator p = lst->begin (); 815 for (tree_switch_case_list::iterator p = lst->begin ();
793 p != lst->end (); p++) 816 p != lst->end (); p++)
794 { 817 {
795 tree_switch_case *t = *p; 818 tree_switch_case *t = *p;
796 819
797 if (debug_mode) 820 if (debug_mode && ! t->is_default_case ())
798 do_breakpoint (! t->is_default_case () && t->is_breakpoint (), 821 do_breakpoint (t->is_breakpoint (), t->line (), t->column ());
799 t->line (), t->column ());
800 822
801 if (t->is_default_case () || t->label_matches (val)) 823 if (t->is_default_case () || t->label_matches (val))
802 { 824 {
803 if (error_state) 825 if (error_state)
804 break; 826 break;
1014 int c = expr->column (); 1036 int c = expr->column ();
1015 1037
1016 for (;;) 1038 for (;;)
1017 { 1039 {
1018 if (debug_mode) 1040 if (debug_mode)
1019 do_breakpoint (expr->is_breakpoint (), l, c); 1041 do_breakpoint (cmd.is_breakpoint (), l, c);
1020 1042
1021 if (expr->is_logically_true ("while")) 1043 if (expr->is_logically_true ("while"))
1022 { 1044 {
1023 tree_statement_list *loop_body = cmd.body (); 1045 tree_statement_list *loop_body = cmd.body ();
1024 1046
1071 1093
1072 if (error_state) 1094 if (error_state)
1073 goto cleanup; 1095 goto cleanup;
1074 } 1096 }
1075 1097
1098 if (quit_loop_now ())
1099 break;
1100
1076 if (debug_mode) 1101 if (debug_mode)
1077 do_breakpoint (expr->is_breakpoint (), l, c); 1102 do_breakpoint (cmd.is_breakpoint (), l, c);
1078 1103
1079 if (quit_loop_now () || expr->is_logically_true ("do-until")) 1104 if (expr->is_logically_true ("do-until"))
1080 break; 1105 break;
1081 } 1106 }
1082 1107
1083 cleanup: 1108 cleanup:
1084 unwind_protect::run_frame ("tree_evaluator::visit_do_until_command"); 1109 unwind_protect::run_frame ("tree_evaluator::visit_do_until_command");