Mercurial > hg > octave-terminal
changeset 1270:0a5e9e8892a0
[project @ 1995-04-20 19:23:24 by jwe]
author | jwe |
---|---|
date | Thu, 20 Apr 1995 19:24:57 +0000 |
parents | abaf21f34109 |
children | ffecaa9b9892 |
files | src/pt-cmd.h src/pt-exp-base.cc src/pt-exp-base.h |
diffstat | 3 files changed, 33 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/pt-cmd.h +++ b/src/pt-cmd.h @@ -58,6 +58,8 @@ public: tree_command (int l = -1, int c = -1) : tree (l, c) { } + virtual ~tree_command (void) { } + virtual void eval (void) = 0; };
--- a/src/pt-exp-base.cc +++ b/src/pt-exp-base.cc @@ -1885,9 +1885,12 @@ { if (! preserve) { - delete lhs; - delete index; + if (lhs_idx_expr) + delete lhs_idx_expr; + else + delete lhs; } + delete rhs; } @@ -2497,6 +2500,17 @@ nargout_sr->define (tmp); } +tree_function::~tree_function (void) +{ + delete param_list; + delete ret_list; + delete sym_tab; + delete cmd_list; + delete [] file_name; + delete [] fcn_name; + delete vr_list; +} + #if 0 tree_function * tree_function::define (tree statement_list *t)
--- a/src/pt-exp-base.h +++ b/src/pt-exp-base.h @@ -196,6 +196,8 @@ public: tree_multi_val_ret (int l = -1, int c = -1) : tree_expression (l, c) { } + ~tree_multi_val_ret (void) { } + int is_multi_val_ret_expression (void) const { return 1; } @@ -219,6 +221,8 @@ values = v; } + ~tree_oct_obj (void) { } + tree_constant eval (int print); Octave_object eval (int print, int nargout, const Octave_object& args); @@ -237,6 +241,8 @@ public: tree_fvc (int l = -1, int c = -1) : tree_multi_val_ret (l, c) { } + ~tree_fvc (void) { } + virtual int is_constant (void) const { return 0; } @@ -288,6 +294,8 @@ maybe_do_ans_assign = 0; } + ~tree_identifier (void) { } + int is_identifier (void) const { return 1; } @@ -619,6 +627,7 @@ void init (int plhs, int ans_assign) { etype = tree_expression::assignment; + lhs_idx_expr = 0; lhs = 0; index = 0; rhs = 0; @@ -661,6 +670,7 @@ : tree_expression (l, c) { init (plhs, ans_assign); + lhs_idx_expr = idx_expr; // cache this -- we may need to delete it. lhs = idx_expr->ident (); index = idx_expr->arg_list (); rhs = r; @@ -687,6 +697,7 @@ void print_code (ostream& os); private: + tree_index_expression *lhs_idx_expr; tree_indirect_ref *lhs; tree_argument_list *index; tree_expression *rhs; @@ -799,6 +810,8 @@ tree_builtin (int i_max, int o_max, Octave_builtin_fcn f, const char *nm = 0); + ~tree_builtin (void) { } // XXX ?? XXX + // int is_builtin (void) const; int is_mapper_function (void) const @@ -868,6 +881,8 @@ install_nargin_and_nargout (); } + ~tree_function (void); + // tree_function *define (tree_statement_list *t); tree_function *define_param_list (tree_parameter_list *t); tree_function *define_ret_list (tree_parameter_list *t);