comparison src/pt-jump.cc @ 2982:20f5cec4f11c

[project @ 1997-05-16 03:29:26 by jwe]
author jwe
date Fri, 16 May 1997 03:30:14 +0000
parents
children aa9d0c0e0458
comparison
equal deleted inserted replaced
2981:38365813950d 2982:20f5cec4f11c
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
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
21 */
22
23 #if defined (__GNUG__)
24 #pragma implementation
25 #endif
26
27 #ifdef HAVE_CONFIG_H
28 #include <config.h>
29 #endif
30
31 // Nonzero means we're breaking out of a loop or function body.
32 int breaking = 0;
33
34 // Nonzero means we're jumping to the end of a loop.
35 int continuing = 0;
36
37 // Nonzero means we're returning from a function. Global because it
38 // is also needed in tree-expr.cc.
39 int returning = 0;
40
41 #include "error.h"
42 #include "pt-jump.h"
43 #include "pt-walk.h"
44
45 // Break.
46
47 void
48 tree_break_command::eval (void)
49 {
50 if (! error_state)
51 breaking = 1;
52 }
53
54 void
55 tree_break_command::accept (tree_walker& tw)
56 {
57 tw.visit_break_command (*this);
58 }
59
60 // Continue.
61
62 void
63 tree_continue_command::eval (void)
64 {
65 if (! error_state)
66 continuing = 1;
67 }
68
69 void
70 tree_continue_command::accept (tree_walker& tw)
71 {
72 tw.visit_continue_command (*this);
73 }
74
75 // Return.
76
77 void
78 tree_return_command::eval (void)
79 {
80 if (! error_state)
81 returning = 1;
82 }
83
84 void
85 tree_return_command::accept (tree_walker& tw)
86 {
87 tw.visit_return_command (*this);
88 }
89
90 /*
91 ;;; Local Variables: ***
92 ;;; mode: C++ ***
93 ;;; End: ***
94 */