annotate src/pt.cc @ 5249:5c2f58301790 ss-2-9-1

[project @ 2005-03-27 12:06:59 by jwe]
author jwe
date Sun, 27 Mar 2005 12:06:59 +0000
parents e35b034d3523
children 4c8a2e4e0717
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
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
3 Copyright (C) 1996, 1997 John W. Eaton
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
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
10 later version.
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
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
18 along with Octave; see the file COPYING. If not, write to the Free
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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>
2991
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
28 #include <string>
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
29
4051
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3806
diff changeset
30 #include "lo-sstream.h"
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3806
diff changeset
31
4748
7b145222fea3 [project @ 2004-02-07 06:27:27 by jwe]
jwe
parents: 4192
diff changeset
32 #include "ov-fcn.h"
2991
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
33 #include "pt.h"
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
34 #include "pt-pr-code.h"
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
35
3772
e44ffad3d06c [project @ 2001-02-03 06:23:38 by jwe]
jwe
parents: 3538
diff changeset
36 // If true, stop executing at the next possible point.
e44ffad3d06c [project @ 2001-02-03 06:23:38 by jwe]
jwe
parents: 3538
diff changeset
37 bool tree::break_next = false;
e44ffad3d06c [project @ 2001-02-03 06:23:38 by jwe]
jwe
parents: 3538
diff changeset
38
3805
44386b0e53da [project @ 2001-03-01 16:54:31 by jwe]
jwe
parents: 3772
diff changeset
39 // The line where dbg_next was executed.
44386b0e53da [project @ 2001-03-01 16:54:31 by jwe]
jwe
parents: 3772
diff changeset
40 int tree::last_line = 0;
44386b0e53da [project @ 2001-03-01 16:54:31 by jwe]
jwe
parents: 3772
diff changeset
41
44386b0e53da [project @ 2001-03-01 16:54:31 by jwe]
jwe
parents: 3772
diff changeset
42 // The function where the last breakpoint occurred.
4748
7b145222fea3 [project @ 2004-02-07 06:27:27 by jwe]
jwe
parents: 4192
diff changeset
43 const octave_function *tree::break_function = 0;
3805
44386b0e53da [project @ 2001-03-01 16:54:31 by jwe]
jwe
parents: 3772
diff changeset
44
44386b0e53da [project @ 2001-03-01 16:54:31 by jwe]
jwe
parents: 3772
diff changeset
45 // The statement where the last breakpoint occurred.
3806
ae32674080b0 [project @ 2001-03-02 21:30:09 by jwe]
jwe
parents: 3805
diff changeset
46 const tree *tree::break_statement = 0;
3805
44386b0e53da [project @ 2001-03-01 16:54:31 by jwe]
jwe
parents: 3772
diff changeset
47
2991
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
48 // 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
49 // create a memory leak.
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
50
3536
e8fbc8c3d6d9 [project @ 2000-02-02 12:01:00 by jwe]
jwe
parents: 3534
diff changeset
51 std::string
2991
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
52 tree::str_print_code (void)
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
53 {
4051
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3806
diff changeset
54 OSSTREAM buf;
2991
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
55
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
56 tree_print_code tpc (buf);
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
57
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
58 accept (tpc);
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
59
4051
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3806
diff changeset
60 buf << OSSTREAM_ENDS;
2991
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
61
4051
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3806
diff changeset
62 std::string retval = OSSTREAM_STR (buf);
2991
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
63
4051
b79da8779a0e [project @ 2002-08-17 19:38:32 by jwe]
jwe
parents: 3806
diff changeset
64 OSSTREAM_FREEZE (buf);
2991
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
65
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
66 return retval;
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
67 }
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
68
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
69 /*
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
70 ;;; Local Variables: ***
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
71 ;;; mode: C++ ***
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
72 ;;; End: ***
fc751d2a99fd [project @ 1997-05-16 21:00:48 by jwe]
jwe
parents:
diff changeset
73 */