diff src/pt-misc.h @ 4219:23d06c9e1edd

[project @ 2002-12-06 21:29:17 by jwe]
author jwe
date Fri, 06 Dec 2002 21:29:19 +0000
parents 8ad52ec4f374
children bdaa0d3dfc0b
line wrap: on
line diff
--- a/src/pt-misc.h
+++ b/src/pt-misc.h
@@ -27,8 +27,6 @@
 #pragma interface
 #endif
 
-#include <SLList.h>
-
 class octave_value;
 class octave_value_list;
 
@@ -38,36 +36,25 @@
 
 class tree_walker;
 
+#include "base-list.h"
+
 // Parameter lists.  Used to hold the list of input and output
 // parameters in a function definition.  Elements are identifiers
 // only.
 
 class
-tree_parameter_list
+tree_parameter_list : public octave_base_list<tree_identifier *>
 {
 public:
 
   tree_parameter_list (void)
-    : lst (), marked_for_varargs (0) { }
+    : marked_for_varargs (0) { }
 
   tree_parameter_list (tree_identifier *t)
-    : lst (), marked_for_varargs (0) { lst.append (t); }
+    : marked_for_varargs (0) { append (t); }
 
   ~tree_parameter_list (void);
 
-  int length (void) const { return lst.length (); }
-
-  void append (tree_identifier *&s) { lst.append (s); }
-  void append (tree_identifier * const &s) { lst.append (s); }
-
-  tree_identifier *&operator () (Pix p) { return lst (p); }
-
-  tree_identifier * const &operator () (Pix p) const { return lst (p); }
-
-  Pix first (void) const { return lst.first (); }
-
-  void next (Pix& p) const { return lst.next (p); }
-
   void mark_as_formal_parameters (void);
 
   void mark_varargs (void) { marked_for_varargs = 1; }
@@ -82,7 +69,7 @@
 
   void define_from_arg_vector (const octave_value_list& args);
 
-  void clear (void);
+  void undefine (void);
 
   bool is_defined (void);
 
@@ -92,9 +79,6 @@
 
 private:
 
-  // The list of identifiers in the parameter list.
-  SLList<tree_identifier *> lst;
-
   int marked_for_varargs;
 
   // No copying!
@@ -108,36 +92,20 @@
 // assignment expressions.
 
 class
-tree_return_list
+tree_return_list : public octave_base_list<tree_index_expression *>
 {
 public:
 
-  tree_return_list (void)
-    : lst () { }
+  tree_return_list (void) { }
 
-  tree_return_list (tree_index_expression *t)
-    : lst () { lst.append (t); }
+  tree_return_list (tree_index_expression *t) { append (t); }
 
   ~tree_return_list (void);
 
-  void append (tree_index_expression *&s) { lst.append (s); }
-  void append (tree_index_expression * const &s) { lst.append (s); }
-
-  tree_index_expression *&operator () (Pix p) { return lst (p); }
-
-  tree_index_expression * const &operator () (Pix p) const { return lst (p); }
-
-  Pix first (void) const { return lst.first (); }
-
-  void next (Pix& p) const { return lst.next (p); }
-
   void accept (tree_walker& tw);
 
 private:
 
-  // The list of expressions in the return list.
-  SLList<tree_index_expression *> lst;
-
   // No copying!
 
   tree_return_list (const tree_return_list&);
@@ -146,36 +114,16 @@
 };
 
 class
-tree_va_return_list
+tree_va_return_list : public octave_base_list<octave_value>
 {
 public:
 
-  tree_va_return_list (void) : lst () { }
+  tree_va_return_list (void) { }
 
   ~tree_va_return_list (void) { }
 
-  int length (void) const { return lst.length (); }
-
-  void clear (void) { lst.clear (); }
-
-  int empty (void) const { return lst.empty (); }
-
-  void append (octave_value& s) { lst.append (s); }
-  void append (const octave_value& s) { lst.append (s); }
-
-  octave_value& operator () (Pix p) { return lst (p); }
-
-  const octave_value& operator () (Pix p) const { return lst (p); }
-
-  Pix first (void) const { return lst.first (); }
-
-  void next (Pix& p) const { return lst.next (p); }
-
 private:
 
-  // The list of values in the va return list.
-  SLList<octave_value> lst;
-
   // No copying!
 
   tree_va_return_list (const tree_va_return_list&);