comparison src/pt-fcn-handle.h @ 5861:2a6cb4ed8f1e

[project @ 2006-06-16 05:09:41 by jwe]
author jwe
date Fri, 16 Jun 2006 05:09:42 +0000
parents 4c8a2e4e0717
children c7901606ba70
comparison
equal deleted inserted replaced
5860:b645066d40ad 5861:2a6cb4ed8f1e
27 #include <iostream> 27 #include <iostream>
28 #include <string> 28 #include <string>
29 29
30 #include "pt-bp.h" 30 #include "pt-bp.h"
31 #include "pt-exp.h" 31 #include "pt-exp.h"
32 #include "pt-misc.h"
33 #include "pt-stmt.h"
32 34
33 class octave_value_list; 35 class octave_value_list;
34 36
35 class tree_walker; 37 class tree_walker;
36 38
63 65
64 octave_value rvalue (void); 66 octave_value rvalue (void);
65 67
66 octave_value_list rvalue (int nargout); 68 octave_value_list rvalue (int nargout);
67 69
70 tree_expression *dup (symbol_table *sym_tab);
71
68 void accept (tree_walker& tw); 72 void accept (tree_walker& tw);
69 73
70 private: 74 private:
71 75
72 // The name of this function handle. 76 // The name of this function handle.
77 tree_fcn_handle (const tree_fcn_handle&); 81 tree_fcn_handle (const tree_fcn_handle&);
78 82
79 tree_fcn_handle& operator = (const tree_fcn_handle&); 83 tree_fcn_handle& operator = (const tree_fcn_handle&);
80 }; 84 };
81 85
86 class
87 tree_anon_fcn_handle : public tree_expression
88 {
89 public:
90
91 tree_anon_fcn_handle (int l = -1, int c = -1)
92 : tree_expression (l, c), param_list (0), cmd_list (0),
93 ret_list (0), sym_tab (0) { }
94
95 tree_anon_fcn_handle (tree_parameter_list *p, tree_parameter_list *r,
96 tree_statement_list *cl, symbol_table *st,
97 int l = -1, int c = -1)
98 : tree_expression (l, c), param_list (p), cmd_list (cl),
99 ret_list (r), sym_tab (st) { }
100
101 ~tree_anon_fcn_handle (void);
102
103 bool has_magic_end (void) const { return false; }
104
105 bool rvalue_ok (void) const { return true; }
106
107 octave_value rvalue (void);
108
109 octave_value_list rvalue (int nargout);
110
111 tree_parameter_list *parameter_list (void) { return param_list; }
112
113 tree_statement_list *body (void) { return cmd_list; }
114
115 tree_expression *dup (symbol_table *sym_tab);
116
117 void accept (tree_walker& tw);
118
119 private:
120
121 // The parameter list.
122 tree_parameter_list *param_list;
123
124 // The statement that makes up the body of the function.
125 tree_statement_list *cmd_list;
126
127 // The list of return values.
128 tree_parameter_list *ret_list;
129
130 // The symbol table.
131 symbol_table *sym_tab;
132
133 // No copying!
134
135 tree_anon_fcn_handle (const tree_anon_fcn_handle&);
136
137 tree_anon_fcn_handle& operator = (const tree_anon_fcn_handle&);
138 };
139
82 #endif 140 #endif
83 141
84 /* 142 /*
85 ;;; Local Variables: *** 143 ;;; Local Variables: ***
86 ;;; mode: C++ *** 144 ;;; mode: C++ ***