changeset 2979:a3556d2adec9

[project @ 1997-05-15 22:35:37 by jwe]
author jwe
date Thu, 15 May 1997 22:36:40 +0000
parents 49de01238638
children cd5ad3fd8049
files src/ChangeLog src/Makefile.in src/oct-lvalue.cc src/oct-lvalue.h src/oct-var-ref.cc src/oct-var-ref.h src/ov-base.cc src/ov-base.h src/ov-re-mat.cc src/ov-re-mat.h src/ov-struct.cc src/ov-struct.h src/ov.cc src/ov.h src/pt-cmd.cc src/pt-cmd.h src/pt-exp-base.cc src/pt-exp-base.h src/pt-exp.cc src/pt-exp.h src/pt-id.cc src/pt-id.h src/pt-indir.cc src/pt-indir.h src/pt-misc.cc src/symtab.cc src/symtab.h
diffstat 27 files changed, 248 insertions(+), 253 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,9 @@
 Thu May 15 11:48:10 1997  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
+	* oct-lvalue.h: Rename from oct-var-ref.h.  Rename class from
+	octave_variable_reference to octave_lvalue.  Change all uses.
+	* oct-lvalue.cc: Rename from oct-var-ref.cc.
+
 	* variables.cc (bind_ans): Only bind ans and print result if value
 	is defined.
 
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -80,7 +80,7 @@
 	oct-fstrm.h oct-hist.h oct-iostrm.h \
 	oct-map.h oct-obj.h oct-prcstrm.h oct-procbuf.h \
 	oct-stdstrm.h oct-stream.h oct-strstrm.h \
-	oct-var-ref.h oct.h ops.h pager.h parse.h \
+	oct-lvalue.h oct.h ops.h pager.h parse.h \
 	pr-output.h procstream.h sighandlers.h symtab.h sysdep.h \
 	systime.h syswait.h token.h toplev.h unwind-prot.h utils.h \
 	variables.h version.h xdiv.h xpow.h $(OV_INCLUDES) $(PT_INCLUDES)
@@ -119,7 +119,7 @@
 	lex.l load-save.cc mappers.cc oct-fstrm.cc oct-hist.cc \
 	oct-iostrm.cc oct-map.cc oct-obj.cc oct-prcstrm.cc \
 	oct-procbuf.cc oct-stdstrm.cc oct-stream.cc oct-strstrm.cc \
-	oct-var-ref.cc pager.cc parse.y pr-output.cc procstream.cc \
+	oct-lvalue.cc pager.cc parse.y pr-output.cc procstream.cc \
 	sighandlers.cc strcasecmp.c strncase.c strfns.cc \
 	strftime.c symtab.cc syscalls.cc sysdep.cc token.cc \
 	toplev.cc unwind-prot.cc utils.cc variables.cc xdiv.cc \
new file mode 100644
--- /dev/null
+++ b/src/oct-lvalue.cc
@@ -0,0 +1,67 @@
+/*
+
+Copyright (C) 1996, 1997 John W. Eaton
+
+This file is part of Octave.
+
+Octave is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+Octave is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+*/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "oct-obj.h"
+#include "oct-lvalue.h"
+#include "ov.h"
+
+void
+octave_lvalue::assign (octave_value::assign_op op, const octave_value& rhs)
+{
+  octave_value saved_val;
+
+  if (chg_fcn)
+    octave_value saved_val = *val;
+
+  if (idx.empty ())
+    {
+      if (struct_elt_name.empty ())
+	val->assign (op, rhs);
+      else
+	val->assign_struct_elt (op, struct_elt_name, rhs);
+    }
+  else
+    {
+      if (struct_elt_name.empty ())
+	val->assign (op, idx, rhs);
+      else
+	val->assign_struct_elt (op, struct_elt_name, idx, rhs);
+    }
+
+  if (chg_fcn && chg_fcn () < 0)
+    *val = saved_val;
+
+  // Clear index so subsequent value() operations will not perform an
+  // indexing operation.
+
+  idx = octave_value_list ();
+}
+
+/*
+;;; Local Variables: ***
+;;; mode: C++ ***
+;;; End: ***
+*/
new file mode 100644
--- /dev/null
+++ b/src/oct-lvalue.h
@@ -0,0 +1,112 @@
+/*
+
+Copyright (C) 1996, 1997 John W. Eaton
+
+This file is part of Octave.
+
+Octave is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+Octave is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+*/
+
+#if !defined (octave_lvalue_h)
+#define octave_lvalue_h 1
+
+class octave_value;
+class octave_value_list;
+
+#include <string>
+
+#include "oct-obj.h"
+#include "symtab.h"
+
+class
+octave_lvalue
+{
+public:
+
+  octave_lvalue (octave_value *v = 0, symbol_record::sv_function f = 0)
+    : val (v), idx (), chg_fcn (f), struct_elt_name () { }
+
+  octave_lvalue (octave_value *v, const string& nm,
+		 symbol_record::sv_function f = 0)
+    : val (v), idx (), chg_fcn (f), struct_elt_name (nm) { }
+
+  octave_lvalue (const octave_lvalue& vr)
+    : val (vr.val), idx (vr.idx), chg_fcn (vr.chg_fcn),
+      struct_elt_name (vr.struct_elt_name) { }
+
+  octave_lvalue& operator = (const octave_lvalue& vr)
+    {
+      if (this != &vr)
+	{
+	  val = vr.val;
+	  idx = vr.idx;
+	  chg_fcn = vr.chg_fcn;
+	  struct_elt_name = vr.struct_elt_name;
+	}
+
+      return *this;
+    }
+
+  ~octave_lvalue (void) { }
+
+  bool is_defined (void) { return val->is_defined (); }
+
+  bool is_undefined (void) { return val->is_undefined (); }
+
+  bool is_map (void) { return val->is_map (); }
+
+  void define (const octave_value& v) { *val = v; }
+
+  void assign (octave_value::assign_op, const octave_value&);
+
+  octave_lvalue struct_elt_ref (const string& nm)
+    { return val->struct_elt_ref (nm); }
+
+  void index (const octave_value_list& i) { idx = i; }
+
+  void increment (void) { val->increment (); }
+
+  void decrement (void) { val->decrement (); }
+
+  octave_value value (void)
+    {
+      return struct_elt_name.empty ()
+	? (idx.empty ()
+	   ? *val
+	   : val->do_index_op (idx))
+	: (idx.empty ()
+	   ? val->do_struct_elt_index_op (struct_elt_name)
+	   : val->do_struct_elt_index_op (struct_elt_name, idx));
+    }
+
+private:
+
+  octave_value *val;
+
+  octave_value_list idx;
+
+  symbol_record::sv_function chg_fcn;
+
+  string struct_elt_name;
+};
+
+#endif
+
+/*
+;;; Local Variables: ***
+;;; mode: C++ ***
+;;; End: ***
+*/
deleted file mode 100644
--- a/src/oct-var-ref.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
-
-Copyright (C) 1996, 1997 John W. Eaton
-
-This file is part of Octave.
-
-Octave is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-Octave is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with Octave; see the file COPYING.  If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-*/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "oct-obj.h"
-#include "oct-var-ref.h"
-#include "ov.h"
-
-void
-octave_variable_reference::assign (octave_value::assign_op op,
-				   const octave_value& rhs)
-{
-  octave_value saved_val;
-
-  if (chg_fcn)
-    octave_value saved_val = *val;
-
-  if (idx.empty ())
-    {
-      if (struct_elt_name.empty ())
-	val->assign (op, rhs);
-      else
-	val->assign_struct_elt (op, struct_elt_name, rhs);
-    }
-  else
-    {
-      if (struct_elt_name.empty ())
-	val->assign (op, idx, rhs);
-      else
-	val->assign_struct_elt (op, struct_elt_name, idx, rhs);
-    }
-
-  if (chg_fcn && chg_fcn () < 0)
-    *val = saved_val;
-
-  // Clear index so subsequent value() operations will not perform an
-  // indexing operation.
-
-  idx = octave_value_list ();
-}
-
-/*
-;;; Local Variables: ***
-;;; mode: C++ ***
-;;; End: ***
-*/
deleted file mode 100644
--- a/src/oct-var-ref.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
-
-Copyright (C) 1996, 1997 John W. Eaton
-
-This file is part of Octave.
-
-Octave is free software; you can redistribute it and/or modify it
-under the terms of the GNU General Public License as published by the
-Free Software Foundation; either version 2, or (at your option) any
-later version.
-
-Octave is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with Octave; see the file COPYING.  If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-
-*/
-
-#if !defined (octave_variable_reference_h)
-#define octave_variable_reference_h 1
-
-class octave_value;
-class octave_value_list;
-
-#include <string>
-
-#include "oct-obj.h"
-#include "symtab.h"
-
-class
-octave_variable_reference
-{
-public:
-
-  octave_variable_reference (octave_value *v = 0,
-			     symbol_record::sv_function f = 0)
-    : val (v), idx (), chg_fcn (f), struct_elt_name () { }
-
-  octave_variable_reference (octave_value *v, const string& nm,
-			     symbol_record::sv_function f = 0)
-    : val (v), idx (), chg_fcn (f), struct_elt_name (nm) { }
-
-  octave_variable_reference (const octave_variable_reference& vr)
-    : val (vr.val), idx (vr.idx), chg_fcn (vr.chg_fcn),
-      struct_elt_name (vr.struct_elt_name) { }
-
-  octave_variable_reference& operator = (const octave_variable_reference& vr)
-    {
-      if (this != &vr)
-	{
-	  val = vr.val;
-	  idx = vr.idx;
-	  chg_fcn = vr.chg_fcn;
-	  struct_elt_name = vr.struct_elt_name;
-	}
-
-      return *this;
-    }
-
-  ~octave_variable_reference (void) { }
-
-  bool is_defined (void) { return val->is_defined (); }
-
-  bool is_undefined (void) { return val->is_undefined (); }
-
-  bool is_map (void) { return val->is_map (); }
-
-  void define (const octave_value& v) { *val = v; }
-
-  void assign (octave_value::assign_op, const octave_value&);
-
-  octave_variable_reference struct_elt_ref (const string& nm)
-    { return val->struct_elt_ref (nm); }
-
-  void index (const octave_value_list& i) { idx = i; }
-
-  void increment (void) { val->increment (); }
-
-  void decrement (void) { val->decrement (); }
-
-  octave_value value (void)
-    {
-      return struct_elt_name.empty ()
-	? (idx.empty ()
-	   ? *val
-	   : val->do_index_op (idx))
-	: (idx.empty ()
-	   ? val->do_struct_elt_index_op (struct_elt_name)
-	   : val->do_struct_elt_index_op (struct_elt_name, idx));
-    }
-
-private:
-
-  octave_value *val;
-
-  octave_value_list idx;
-
-  symbol_record::sv_function chg_fcn;
-
-  string struct_elt_name;
-};
-
-#endif
-
-/*
-;;; Local Variables: ***
-;;; mode: C++ ***
-;;; End: ***
-*/
--- a/src/ov-base.cc
+++ b/src/ov-base.cc
@@ -35,7 +35,7 @@
 #include "gripes.h"
 #include "oct-map.h"
 #include "oct-obj.h"
-#include "oct-var-ref.h"
+#include "oct-lvalue.h"
 #include "ops.h"
 #include "ov-base.h"
 #include "ov-scalar.h"
@@ -96,13 +96,13 @@
   return octave_value ();
 }
 
-octave_variable_reference
+octave_lvalue
 octave_base_value::struct_elt_ref (octave_value *, const string&)
 {
   string nm = type_name ();
   error ("can't perform structure reference operations for %s type",
 	 nm.c_str ());
-  return octave_variable_reference ();
+  return octave_lvalue ();
 }
 
 octave_value
--- a/src/ov-base.h
+++ b/src/ov-base.h
@@ -82,8 +82,7 @@
 
   octave_value do_struct_elt_index_op (const string& nm, bool silent);
 
-  octave_variable_reference
-  struct_elt_ref (octave_value *parent, const string& nm);
+  octave_lvalue struct_elt_ref (octave_value *parent, const string& nm);
 
   int rows (void) const { return -1; }
 
--- a/src/ov-re-mat.cc
+++ b/src/ov-re-mat.cc
@@ -36,7 +36,7 @@
 
 #include "gripes.h"
 #include "oct-obj.h"
-#include "oct-var-ref.h"
+#include "oct-lvalue.h"
 #include "ops.h"
 #include "ov-scalar.h"
 #include "ov-re-mat.h"
@@ -249,10 +249,10 @@
   return retval;
 }
 
-octave_variable_reference
+octave_lvalue
 octave_matrix::struct_elt_ref (octave_value *parent, const string& nm)
 {
-  return octave_variable_reference (parent, nm);
+  return octave_lvalue (parent, nm);
 }
 
 bool
--- a/src/ov-re-mat.h
+++ b/src/ov-re-mat.h
@@ -100,8 +100,7 @@
 
   octave_value do_struct_elt_index_op (const string& nm, bool silent);
 
-  octave_variable_reference
-  struct_elt_ref (octave_value *parent, const string& nm);
+  octave_lvalue struct_elt_ref (octave_value *parent, const string& nm);
 
   int rows (void) const { return matrix.rows (); }
   int columns (void) const { return matrix.columns (); }
--- a/src/ov-struct.cc
+++ b/src/ov-struct.cc
@@ -31,7 +31,7 @@
 #include <iostream.h>
 
 #include "error.h"
-#include "oct-var-ref.h"
+#include "oct-lvalue.h"
 #include "ov-struct.h"
 #include "unwind-prot.h"
 #include "variables.h"
@@ -68,10 +68,10 @@
   return retval;
 }
 
-octave_variable_reference
+octave_lvalue
 octave_struct::struct_elt_ref (octave_value *, const string& nm)
 {
-  return octave_variable_reference (&map [nm]);
+  return octave_lvalue (&map [nm]);
 }
 
 void
--- a/src/ov-struct.h
+++ b/src/ov-struct.h
@@ -79,8 +79,7 @@
 
   octave_value do_struct_elt_index_op (const string& nm, bool silent);
 
-  octave_variable_reference
-  struct_elt_ref (octave_value *parent, const string& nm);
+  octave_lvalue struct_elt_ref (octave_value *parent, const string& nm);
 
   bool is_defined (void) const { return true; }
 
--- a/src/ov.cc
+++ b/src/ov.cc
@@ -32,7 +32,7 @@
 #include "str-vec.h"
 
 #include "oct-obj.h"
-#include "oct-var-ref.h"
+#include "oct-lvalue.h"
 #include "ov.h"
 #include "ov-base.h"
 #include "ov-bool.h"
@@ -559,18 +559,18 @@
   rep->assign_struct_elt (op, elt_nm, idx, rhs);
 }
 
-octave_variable_reference
+octave_lvalue
 octave_value::struct_elt_ref (const string& nm)
 {
   return rep->struct_elt_ref (this, nm);
 }
 
-octave_variable_reference
+octave_lvalue
 octave_value::struct_elt_ref (octave_value *, const string&)
 {
   panic_impossible ();
 
-  return octave_variable_reference ();
+  return octave_lvalue ();
 }
 
 Octave_map
--- a/src/ov.h
+++ b/src/ov.h
@@ -43,7 +43,7 @@
 class octave_stream;
 class octave_function;
 class octave_value_list;
-class octave_variable_reference;
+class octave_lvalue;
 
 // Constants.
 
@@ -244,9 +244,9 @@
 			  bool silent = false)
     { return rep->do_struct_elt_index_op (nm, idx, silent); }
 
-  octave_variable_reference struct_elt_ref (const string& nm);
+  octave_lvalue struct_elt_ref (const string& nm);
 
-  virtual octave_variable_reference
+  virtual octave_lvalue
   struct_elt_ref (octave_value *parent, const string& nm);
 
   // Size.
--- a/src/pt-cmd.cc
+++ b/src/pt-cmd.cc
@@ -43,7 +43,7 @@
 #include "error.h"
 #include "gripes.h"
 #include "oct-map.h"
-#include "oct-var-ref.h"
+#include "oct-lvalue.h"
 #include "pt-cmd.h"
 #include "symtab.h"
 #include "ov.h"
@@ -102,7 +102,7 @@
 	{
 	  octave_value init_val = expr->rvalue ();
 
-	  octave_variable_reference ult = id->lvalue ();
+	  octave_lvalue ult = id->lvalue ();
 
 	  ult.assign (octave_value::asn_eq, init_val);
 	}
@@ -141,7 +141,7 @@
 	{
 	  octave_value init_val = expr->rvalue ();
 
-	  octave_variable_reference ult = id->lvalue ();
+	  octave_lvalue ult = id->lvalue ();
 
 	  ult.assign (octave_value::asn_eq, init_val);
 	}
@@ -228,7 +228,7 @@
 }
 
 inline void
-tree_simple_for_command::do_for_loop_once (octave_variable_reference& ult,
+tree_simple_for_command::do_for_loop_once (octave_lvalue& ult,
 					   const octave_value& rhs,
 					   bool& quit)
 {
@@ -283,7 +283,7 @@
       return;
     }
 
-  octave_variable_reference ult = lhs->lvalue ();
+  octave_lvalue ult = lhs->lvalue ();
 
   if (error_state)
     {
@@ -403,8 +403,8 @@
 }
 
 void
-tree_complex_for_command::do_for_loop_once (octave_variable_reference &val_ref,
-					    octave_variable_reference &key_ref,
+tree_complex_for_command::do_for_loop_once (octave_lvalue &val_ref,
+					    octave_lvalue &key_ref,
 					    const octave_value& val,
 					    const octave_value& key,
 					    bool& quit)
@@ -452,11 +452,11 @@
 
       Pix p = lhs->first ();
       tree_expression *elt = lhs->operator () (p);
-      octave_variable_reference val_ref = elt->lvalue ();
+      octave_lvalue val_ref = elt->lvalue ();
 
       lhs->next (p);
       elt = lhs->operator () (p);
-      octave_variable_reference key_ref = elt->lvalue ();
+      octave_lvalue key_ref = elt->lvalue ();
 
       Octave_map tmp_val (rhs.map_value ());
 
--- a/src/pt-cmd.h
+++ b/src/pt-cmd.h
@@ -225,8 +225,8 @@
   // List of commands to execute.
   tree_statement_list *list;
 
-  void do_for_loop_once (octave_variable_reference &ult,
-			 const octave_value& rhs, bool& quit);
+  void do_for_loop_once (octave_lvalue &ult, const octave_value& rhs,
+			 bool& quit);
 };
 
 class
@@ -266,10 +266,8 @@
   // List of commands to execute.
   tree_statement_list *list;
 
-  void do_for_loop_once (octave_variable_reference &val_ref,
-			 octave_variable_reference &key_ref,
-			 const octave_value& val,
-			 const octave_value& key,
+  void do_for_loop_once (octave_lvalue &val_ref, octave_lvalue &key_ref,
+			 const octave_value& val, const octave_value& key,
 			 bool& quit);
 };
 
--- a/src/pt-exp-base.cc
+++ b/src/pt-exp-base.cc
@@ -35,7 +35,7 @@
 
 #include "error.h"
 #include "pager.h"
-#include "oct-var-ref.h"
+#include "oct-lvalue.h"
 #include "ov.h"
 #include "pt-exp-base.h"
 
@@ -76,11 +76,11 @@
   return octave_value_list ();
 }
 
-octave_variable_reference
+octave_lvalue
 tree_expression::lvalue (void)
 {
   ::error ("invalid lvalue function called in expression");
-  return octave_variable_reference ();
+  return octave_lvalue ();
 }
 
 string
--- a/src/pt-exp-base.h
+++ b/src/pt-exp-base.h
@@ -30,7 +30,7 @@
 #include <string>
 
 class octave_value;
-class octave_variable_reference;
+class octave_lvalue;
 
 #include "pt-base.h"
 
@@ -80,7 +80,7 @@
 
   virtual octave_value_list rvalue (int nargout);
 
-  virtual octave_variable_reference lvalue (void);
+  virtual octave_lvalue lvalue (void);
 
   int paren_count (void) const
     { return num_parens; }
--- a/src/pt-exp.cc
+++ b/src/pt-exp.cc
@@ -37,7 +37,7 @@
 #include "help.h"
 #include "input.h"
 #include "oct-obj.h"
-#include "oct-var-ref.h"
+#include "oct-lvalue.h"
 #include "pager.h"
 #include "ov.h"
 #include "pt-exp.h"
@@ -105,7 +105,7 @@
 	}
       else if (etype == increment || etype == decrement)
 	{
-	  octave_variable_reference ref = op->lvalue ();
+	  octave_lvalue ref = op->lvalue ();
 
 	  if (! error_state)
 	    {
@@ -220,7 +220,7 @@
 	}
       else if (etype == increment || etype == decrement)
 	{
-	  octave_variable_reference ref = op->lvalue ();
+	  octave_lvalue ref = op->lvalue ();
 
 	  if (! error_state)
 	    {
@@ -519,7 +519,7 @@
 	    }
 	  else
 	    {
-	      octave_variable_reference ult = lhs->lvalue ();
+	      octave_lvalue ult = lhs->lvalue ();
 
 	      if (error_state)
 		eval_error ();
@@ -789,10 +789,10 @@
   return retval;
 }
 
-octave_variable_reference
+octave_lvalue
 tree_index_expression::lvalue (void)
 {
-  octave_variable_reference retval;
+  octave_lvalue retval;
 
   if (! error_state)
     {
@@ -898,7 +898,7 @@
 
 		  if (lhs_elt)
 		    {
-		      octave_variable_reference ult = lhs_elt->lvalue ();
+		      octave_lvalue ult = lhs_elt->lvalue ();
 
 		      if (error_state)
 			eval_error ();
--- a/src/pt-exp.h
+++ b/src/pt-exp.h
@@ -39,7 +39,7 @@
 
 class octave_value;
 class octave_value_list;
-class octave_variable_reference;
+class octave_lvalue;
 
 #include "oct-obj.h"
 #include "pt-exp-base.h"
@@ -286,12 +286,10 @@
 
 private:
 
-  void do_assign (octave_variable_reference& ult,
-		  const octave_value_list& args,
+  void do_assign (octave_lvalue& ult, const octave_value_list& args,
 		  const octave_value& rhs_val);
 
-  void do_assign (octave_variable_reference& ult,
-		  const octave_value& rhs_val);
+  void do_assign (octave_lvalue& ult, const octave_value& rhs_val);
 
   // The left hand side of the assignment.
   tree_expression *lhs;
@@ -383,7 +381,7 @@
 
   octave_value_list rvalue (int nargout);
 
-  octave_variable_reference lvalue (void);
+  octave_lvalue lvalue (void);
 
   void eval_error (void);
 
--- a/src/pt-id.cc
+++ b/src/pt-id.cc
@@ -30,7 +30,7 @@
 
 #include "error.h"
 #include "oct-obj.h"
-#include "oct-var-ref.h"
+#include "oct-lvalue.h"
 #include "pager.h"
 #include "pt-const.h"
 #include "pt-id.h"
@@ -196,7 +196,7 @@
   return retval;
 }
 
-octave_variable_reference
+octave_lvalue
 tree_identifier::lvalue (void)
 {
   return sym->variable_reference ();
--- a/src/pt-id.h
+++ b/src/pt-id.h
@@ -83,7 +83,7 @@
 
   octave_value_list rvalue (int nargout);
 
-  octave_variable_reference lvalue (void);
+  octave_lvalue lvalue (void);
 
   void eval_undefined_error (void);
 
--- a/src/pt-indir.cc
+++ b/src/pt-indir.cc
@@ -32,7 +32,7 @@
 #include "gripes.h"
 #include "oct-map.h"
 #include "oct-obj.h"
-#include "oct-var-ref.h"
+#include "oct-lvalue.h"
 #include "pager.h"
 #include "pt-const.h"
 #include "pt-id.h"
@@ -95,10 +95,10 @@
   return retval;
 }
 
-octave_variable_reference
+octave_lvalue
 tree_indirect_ref::lvalue (void)
 {
-  octave_variable_reference tmp = expr->lvalue ();
+  octave_lvalue tmp = expr->lvalue ();
 
   if (tmp.is_undefined () || ! tmp.is_map ())
     tmp.define (Octave_map ());
--- a/src/pt-indir.h
+++ b/src/pt-indir.h
@@ -65,7 +65,7 @@
 
   octave_value_list rvalue (int nargout);
 
-  octave_variable_reference lvalue (void);
+  octave_lvalue lvalue (void);
 
   tree_expression *expression (void)
     { return expr; }
--- a/src/pt-misc.cc
+++ b/src/pt-misc.cc
@@ -44,7 +44,7 @@
 #include "error.h"
 #include "input.h"
 #include "oct-obj.h"
-#include "oct-var-ref.h"
+#include "oct-lvalue.h"
 #include "ov-usr-fcn.h"
 #include "ov.h"
 #include "pager.h"
@@ -354,7 +354,7 @@
 
       if (! elt->is_defined ())
 	{
-	  octave_variable_reference tmp = elt->lvalue ();
+	  octave_lvalue tmp = elt->lvalue ();
 
 	  tmp.assign (octave_value::asn_eq, val);
 	}
@@ -377,7 +377,7 @@
     {
       tree_identifier *elt = this->operator () (p);
 
-      octave_variable_reference ref = elt->lvalue ();
+      octave_lvalue ref = elt->lvalue ();
 
       if (i < nargin)
 	{
--- a/src/symtab.cc
+++ b/src/symtab.cc
@@ -34,7 +34,7 @@
 #include "str-vec.h"
 
 #include "error.h"
-#include "oct-var-ref.h"
+#include "oct-lvalue.h"
 #include "ov.h"
 #include "symtab.h"
 #include "utils.h"
@@ -542,7 +542,7 @@
   return is_variable () ? def () : foo;
 }
 
-octave_variable_reference
+octave_lvalue
 symbol_record::variable_reference (void)
 {
   if (is_function ())
@@ -560,7 +560,7 @@
 	}
     }
 
-  return octave_variable_reference (&(def ()), sv_fcn);
+  return octave_lvalue (&(def ()), sv_fcn);
 }
 
 symbol_record *
--- a/src/symtab.h
+++ b/src/symtab.h
@@ -39,7 +39,7 @@
 #define HASH_TABLE_SIZE 1024
 #define HASH_MASK (HASH_TABLE_SIZE - 1)
 
-class octave_variable_reference;
+class octave_lvalue;
 
 class string_vector;
 
@@ -185,7 +185,7 @@
   bool is_static (void) const;
 
   octave_value& variable_value (void);
-  octave_variable_reference variable_reference (void);
+  octave_lvalue variable_reference (void);
 
   symbol_record *next (void) const;