494
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
494
|
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 |
1315
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
494
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_tree_cmd_h) |
|
24 #define octave_tree_cmd_h 1 |
|
25 |
1297
|
26 #if defined (__GNUG__) |
|
27 #pragma interface |
|
28 #endif |
|
29 |
2982
|
30 #include <string> |
494
|
31 |
2124
|
32 class tree_walker; |
|
33 |
1740
|
34 #include "pt-base.h" |
578
|
35 |
|
36 // A base class for commands. |
|
37 |
494
|
38 class |
|
39 tree_command : public tree |
|
40 { |
578
|
41 public: |
2124
|
42 |
2982
|
43 tree_command (int l = -1, int c = -1) |
|
44 : tree (l, c) { } |
578
|
45 |
1270
|
46 virtual ~tree_command (void) { } |
|
47 |
578
|
48 virtual void eval (void) = 0; |
494
|
49 }; |
|
50 |
2620
|
51 // No-op. |
|
52 |
|
53 class |
|
54 tree_no_op_command : public tree_command |
|
55 { |
|
56 public: |
|
57 |
|
58 tree_no_op_command (const string& cmd = "no_op", int l = -1, int c = -1) |
|
59 : tree_command (l, c), orig_cmd (cmd) { } |
|
60 |
|
61 ~tree_no_op_command (void) { } |
|
62 |
|
63 void eval (void) { } |
|
64 |
|
65 void accept (tree_walker& tw); |
|
66 |
|
67 string original_command (void) { return orig_cmd; } |
|
68 |
|
69 private: |
|
70 |
|
71 string orig_cmd; |
|
72 }; |
|
73 |
494
|
74 #endif |
|
75 |
|
76 /* |
|
77 ;;; Local Variables: *** |
|
78 ;;; mode: C++ *** |
|
79 ;;; End: *** |
|
80 */ |