4343
|
1 /* |
|
2 |
|
3 Copyright (C) 2003 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 (octave_tree_fcn_handle_h) |
|
24 #define octave_fcn_handle_h 1 |
|
25 |
|
26 #include <iostream> |
|
27 #include <string> |
|
28 |
|
29 #include "pt-bp.h" |
|
30 #include "pt-exp.h" |
|
31 |
|
32 class octave_value_list; |
|
33 |
|
34 class tree_walker; |
|
35 |
|
36 #include "ov.h" |
|
37 |
|
38 class |
|
39 tree_fcn_handle : public tree_expression |
|
40 { |
|
41 public: |
|
42 |
|
43 tree_fcn_handle (int l = -1, int c = -1) |
|
44 : tree_expression (l, c), nm () { } |
|
45 |
|
46 tree_fcn_handle (const std::string& n, int l = -1, int c = -1) |
|
47 : tree_expression (l, c), nm (n) { } |
|
48 |
|
49 ~tree_fcn_handle (void) { } |
|
50 |
|
51 bool has_magic_end (void) const { return false; } |
|
52 |
|
53 void print (std::ostream& os, bool pr_as_read_syntax = false, |
|
54 bool pr_orig_txt = true); |
|
55 |
|
56 void print_raw (std::ostream& os, bool pr_as_read_syntax = false, |
|
57 bool pr_orig_txt = true); |
|
58 |
5043
|
59 std::string name (void) const { return nm; } |
|
60 |
4343
|
61 bool rvalue_ok (void) const { return true; } |
|
62 |
|
63 octave_value rvalue (void); |
|
64 |
|
65 octave_value_list rvalue (int nargout); |
|
66 |
|
67 void accept (tree_walker& tw); |
|
68 |
|
69 private: |
|
70 |
|
71 // The name of this function handle. |
|
72 std::string nm; |
|
73 |
|
74 // No copying! |
|
75 |
|
76 tree_fcn_handle (const tree_fcn_handle&); |
|
77 |
|
78 tree_fcn_handle& operator = (const tree_fcn_handle&); |
|
79 }; |
|
80 |
|
81 #endif |
|
82 |
|
83 /* |
|
84 ;;; Local Variables: *** |
|
85 ;;; mode: C++ *** |
|
86 ;;; End: *** |
|
87 */ |