diff libinterp/parse-tree/pt-mat.cc @ 16237:70f465930546

rearrange class heirarchy for tree_cell and tree_matrix * pt-array-list.h, pt-array-list.cc: New files. (tree_array_list): New class. * pt-cell.h, pt-cell.cc (tree_cell): Derive from tree_array_list. * pt-mat.h, pt-mat.cc (tree_matrix): Derive from tree_array_list. * oct-parse.in.yy (octave_parser::finish_array_list): New function adapted from octave_parser::finish_matrix. (octave_parser::finish_matrix, octave_parser::finish_cell): Call finish_array_list to do the work. * pt-arg-list.h: Include symtab.h. * base-list.h: Include cstdlib.
author John W. Eaton <jwe@octave.org>
date Sat, 09 Mar 2013 18:04:51 -0500
parents 797ac81586d1
children aebb54d99dba
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-mat.cc
+++ b/libinterp/parse-tree/pt-mat.cc
@@ -655,48 +655,6 @@
   ok = ! error_state;
 }
 
-tree_matrix::~tree_matrix (void)
-{
-  while (! empty ())
-    {
-      iterator p = begin ();
-      delete *p;
-      erase (p);
-    }
-}
-
-bool
-tree_matrix::has_magic_end (void) const
-{
-  for (const_iterator p = begin (); p != end (); p++)
-    {
-      octave_quit ();
-
-      tree_argument_list *elt = *p;
-
-      if (elt && elt->has_magic_end ())
-        return true;
-    }
-
-  return false;
-}
-
-bool
-tree_matrix::all_elements_are_constant (void) const
-{
-  for (const_iterator p = begin (); p != end (); p++)
-    {
-      octave_quit ();
-
-      tree_argument_list *elt = *p;
-
-      if (! elt->all_elements_are_constant ())
-        return false;
-    }
-
-  return true;
-}
-
 octave_value_list
 tree_matrix::rvalue (int nargout)
 {
@@ -1174,14 +1132,7 @@
 {
   tree_matrix *new_matrix = new tree_matrix (0, line (), column ());
 
-  for (const_iterator p = begin (); p != end (); p++)
-    {
-      const tree_argument_list *elt = *p;
-
-      new_matrix->append (elt ? elt->dup (scope, context) : 0);
-    }
-
-  new_matrix->copy_base (*this);
+  new_matrix->copy_base (*this, scope, context);
 
   return new_matrix;
 }