annotate libinterp/parse-tree/pt.cc @ 19697:4197fc428c7d

maint: Update copyright notices for 2015.
author John W. Eaton <jwe@octave.org>
date Wed, 11 Feb 2015 14:19:08 -0500
parents d63878346099
children 94fc5f13d51b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2991
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
1 /*
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
2
19697
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
3 Copyright (C) 1996-2015 John W. Eaton
2991
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
4
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
6
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5765
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5765
diff changeset
10 option) any later version.
2991
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
11
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
15 for more details.
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
16
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5765
diff changeset
18 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5765
diff changeset
19 <http://www.gnu.org/licenses/>.
2991
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
20
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
21 */
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
22
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
23 #ifdef HAVE_CONFIG_H
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
24 #include <config.h>
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
25 #endif
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
26
3503
d14c483b3c12 [project @ 2000-02-01 04:06:07 by jwe]
jwe
parents: 2991
diff changeset
27 #include <iostream>
5765
7ba9ad1fec11 [project @ 2006-04-17 05:05:15 by jwe]
jwe
parents: 5388
diff changeset
28 #include <sstream>
2991
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
29 #include <string>
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
30
4748
7b145222fea3 [project @ 2004-02-07 06:27:27 by jwe]
jwe
parents: 4192
diff changeset
31 #include "ov-fcn.h"
2991
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
32 #include "pt.h"
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
33 #include "pt-pr-code.h"
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
34
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
35 // Hide the details of the string buffer so that we are less likely to
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
36 // create a memory leak.
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
37
3536
e8fbc8c3d6d9 [project @ 2000-02-02 12:01:00 by jwe]
jwe
parents: 3534
diff changeset
38 std::string
2991
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
39 tree::str_print_code (void)
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
40 {
5765
7ba9ad1fec11 [project @ 2006-04-17 05:05:15 by jwe]
jwe
parents: 5388
diff changeset
41 std::ostringstream buf;
2991
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
42
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
43 tree_print_code tpc (buf);
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
44
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
45 accept (tpc);
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
46
5765
7ba9ad1fec11 [project @ 2006-04-17 05:05:15 by jwe]
jwe
parents: 5388
diff changeset
47 std::string retval = buf.str ();
2991
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
48
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
49 return retval;
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
50 }