Mercurial > octave-nkf
comparison src/pt-jump.cc @ 8658:73c4516fae10
New evaluator and debugger derived from tree-walker class
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 04 Feb 2009 00:47:53 -0500 |
parents | 4976f66d469b |
children | 35cd375d4bb3 |
comparison
equal
deleted
inserted
replaced
8657:102e05821f93 | 8658:73c4516fae10 |
---|---|
36 // Break. | 36 // Break. |
37 | 37 |
38 // Nonzero means we're breaking out of a loop or function body. | 38 // Nonzero means we're breaking out of a loop or function body. |
39 int tree_break_command::breaking = 0; | 39 int tree_break_command::breaking = 0; |
40 | 40 |
41 void | |
42 tree_break_command::eval (void) | |
43 { | |
44 // Even if we have an error we should still enter debug mode. | |
45 MAYBE_DO_BREAKPOINT; | |
46 | |
47 if (! error_state) | |
48 breaking = 1; | |
49 } | |
50 | |
51 tree_command * | 41 tree_command * |
52 tree_break_command::dup (symbol_table::scope_id, | 42 tree_break_command::dup (symbol_table::scope_id, |
53 symbol_table::context_id /*context*/) | 43 symbol_table::context_id /*context*/) |
54 { | 44 { |
55 return new tree_break_command (line (), column ()); | 45 return new tree_break_command (line (), column ()); |
63 | 53 |
64 // Continue. | 54 // Continue. |
65 | 55 |
66 // Nonzero means we're jumping to the end of a loop. | 56 // Nonzero means we're jumping to the end of a loop. |
67 int tree_continue_command::continuing = 0; | 57 int tree_continue_command::continuing = 0; |
68 | |
69 void | |
70 tree_continue_command::eval (void) | |
71 { | |
72 MAYBE_DO_BREAKPOINT; | |
73 | |
74 if (! error_state) | |
75 continuing = 1; | |
76 } | |
77 | 58 |
78 tree_command * | 59 tree_command * |
79 tree_continue_command::dup (symbol_table::scope_id, | 60 tree_continue_command::dup (symbol_table::scope_id, |
80 symbol_table::context_id /*context*/) | 61 symbol_table::context_id /*context*/) |
81 { | 62 { |
91 // Return. | 72 // Return. |
92 | 73 |
93 // Nonzero means we're returning from a function. | 74 // Nonzero means we're returning from a function. |
94 int tree_return_command::returning = 0; | 75 int tree_return_command::returning = 0; |
95 | 76 |
96 void | |
97 tree_return_command::eval (void) | |
98 { | |
99 MAYBE_DO_BREAKPOINT; | |
100 | |
101 if (! error_state) | |
102 returning = 1; | |
103 } | |
104 | |
105 tree_command * | 77 tree_command * |
106 tree_return_command::dup (symbol_table::scope_id, | 78 tree_return_command::dup (symbol_table::scope_id, |
107 symbol_table::context_id /*context*/) | 79 symbol_table::context_id /*context*/) |
108 { | 80 { |
109 return new tree_return_command (line (), column ()); | 81 return new tree_return_command (line (), column ()); |