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