2991
|
1 /* |
|
2 |
7017
|
3 Copyright (C) 1996, 1997, 2000, 2001, 2002, 2004, 2005, 2006, 2007 |
|
4 John W. Eaton |
2991
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
7016
|
10 Free Software Foundation; either version 3 of the License, or (at your |
|
11 option) any later version. |
2991
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
7016
|
19 along with Octave; see the file COPYING. If not, see |
|
20 <http://www.gnu.org/licenses/>. |
2991
|
21 |
|
22 */ |
|
23 |
|
24 #ifdef HAVE_CONFIG_H |
|
25 #include <config.h> |
|
26 #endif |
|
27 |
3503
|
28 #include <iostream> |
5765
|
29 #include <sstream> |
2991
|
30 #include <string> |
|
31 |
4748
|
32 #include "ov-fcn.h" |
2991
|
33 #include "pt.h" |
|
34 #include "pt-pr-code.h" |
|
35 |
3772
|
36 // If true, stop executing at the next possible point. |
|
37 bool tree::break_next = false; |
|
38 |
5388
|
39 // The line where dbnext was executed. |
3805
|
40 int tree::last_line = 0; |
|
41 |
|
42 // The function where the last breakpoint occurred. |
4748
|
43 const octave_function *tree::break_function = 0; |
3805
|
44 |
|
45 // The statement where the last breakpoint occurred. |
3806
|
46 const tree *tree::break_statement = 0; |
3805
|
47 |
2991
|
48 // Hide the details of the string buffer so that we are less likely to |
|
49 // create a memory leak. |
|
50 |
3536
|
51 std::string |
2991
|
52 tree::str_print_code (void) |
|
53 { |
5765
|
54 std::ostringstream buf; |
2991
|
55 |
|
56 tree_print_code tpc (buf); |
|
57 |
|
58 accept (tpc); |
|
59 |
5765
|
60 std::string retval = buf.str (); |
2991
|
61 |
|
62 return retval; |
|
63 } |
|
64 |
|
65 /* |
|
66 ;;; Local Variables: *** |
|
67 ;;; mode: C++ *** |
|
68 ;;; End: *** |
|
69 */ |