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 |
|
36 // Hide the details of the string buffer so that we are less likely to |
|
37 // create a memory leak. |
|
38 |
3536
|
39 std::string |
2991
|
40 tree::str_print_code (void) |
|
41 { |
5765
|
42 std::ostringstream buf; |
2991
|
43 |
|
44 tree_print_code tpc (buf); |
|
45 |
|
46 accept (tpc); |
|
47 |
5765
|
48 std::string retval = buf.str (); |
2991
|
49 |
|
50 return retval; |
|
51 } |
|
52 |
|
53 /* |
|
54 ;;; Local Variables: *** |
|
55 ;;; mode: C++ *** |
|
56 ;;; End: *** |
|
57 */ |