Mercurial > hg > octave-lyh
changeset 2878:55cca18e943a
[project @ 1997-04-24 09:19:43 by jwe]
author | jwe |
---|---|
date | Thu, 24 Apr 1997 09:25:02 +0000 |
parents | 5c1b9e545dd1 |
children | 4309724baab6 |
files | src/pt-misc.cc src/pt-misc.h src/pt-mvr.h src/pt-plot.h src/pt-pr-code.cc src/symtab.cc src/variables.cc src/variables.h |
diffstat | 8 files changed, 42 insertions(+), 32 deletions(-) [+] |
line wrap: on
line diff
--- a/src/pt-misc.cc +++ b/src/pt-misc.cc @@ -40,17 +40,18 @@ #include "error.h" #include "input.h" #include "oct-obj.h" +#include "ov.h" #include "pager.h" -#include "toplev.h" #include "pt-cmd.h" +#include "pt-const.h" #include "pt-exp.h" #include "pt-fcn.h" #include "pt-fvc.h" #include "pt-misc.h" #include "pt-mvr.h" +#include "pt-pr-code.h" #include "pt-walk.h" -#include "pt-pr-code.h" -#include "ov.h" +#include "toplev.h" #include "variables.h" // Nonzero means we're breaking out of a loop or function body. @@ -214,6 +215,15 @@ tw.visit_statement_list (*this); } +tree_argument_list::~tree_argument_list (void) +{ + while (! empty ()) + { + tree_expression *t = remove_front (); + delete t; + } +} + octave_value_list tree_argument_list::convert_to_const_vector (void) { @@ -312,7 +322,7 @@ if (! elt->is_defined ()) { octave_variable_reference tmp (elt); - tmp.assign (val); + tmp.assign (octave_value::asn_eq, val); } } }
--- a/src/pt-misc.h +++ b/src/pt-misc.h @@ -56,8 +56,6 @@ #include <SLList.h> -#include "pt-base.h" - // A statement is either a command to execute or an expression to // evaluate. @@ -165,14 +163,7 @@ tree_argument_list (tree_expression *t) : SLList<tree_expression *> () { append (t); } - ~tree_argument_list (void) - { - while (! empty ()) - { - tree_expression *t = remove_front (); - delete t; - } - } + ~tree_argument_list (void); octave_value_list convert_to_const_vector (void);
--- a/src/pt-mvr.h +++ b/src/pt-mvr.h @@ -29,8 +29,6 @@ class ostream; -class octave_value_list; - class tree_argument_list; class tree_identifier; class tree_index_expression; @@ -41,7 +39,6 @@ #include <string> -#include "ov.h" #include "pt-mvr-base.h" #include "oct-obj.h"
--- a/src/pt-plot.h +++ b/src/pt-plot.h @@ -30,7 +30,7 @@ class ostream; class ostrstream; -class tree_command; +class tree_expression; class tree_plot_command; class plot_limits; class plot_range; @@ -49,9 +49,7 @@ #include "dColVector.h" -#include "idx-vector.h" #include "pt-cmd.h" -#include "pt-exp.h" class tree_plot_command : public tree_command
--- a/src/pt-pr-code.cc +++ b/src/pt-pr-code.cc @@ -32,6 +32,15 @@ #include "error.h" #include "pr-output.h" +#include "pt-cmd.h" +#include "pt-const.h" +#include "pt-exp.h" +#include "pt-fcn.h" +#include "pt-fvc.h" +#include "pt-mat.h" +#include "pt-misc.h" +#include "pt-mvr.h" +#include "pt-plot.h" #include "pt-pr-code.h" void @@ -777,7 +786,7 @@ os << ")"; } - os << " = "; + os << " " << expr.oper () << " "; } tree_expression *rhs = expr.right_hand_side ();
--- a/src/symtab.cc +++ b/src/symtab.cc @@ -764,10 +764,12 @@ tree_constant *tmp = static_cast<tree_constant *> (sr.def ()); - const_type = tmp->type_name (); + octave_value vtmp = tmp->value (); - nr = tmp->rows (); - nc = tmp->columns (); + const_type = vtmp.type_name (); + + nr = vtmp.rows (); + nc = vtmp.columns (); symbol_def *sr_def = sr.definition; symbol_def *hidden_def = sr_def->next_elem;
--- a/src/variables.cc +++ b/src/variables.cc @@ -126,29 +126,31 @@ } void -octave_variable_reference::assign (const octave_value& rhs) +octave_variable_reference::assign (octave_value::assign_op op, + const octave_value& rhs) { if (id) - id->assign (rhs); + id->assign (op, rhs); else if (indir) { octave_value& ult = indir->reference (); - ult = rhs; + ult.assign (op, rhs); } else panic_impossible (); } void -octave_variable_reference::assign (const octave_value_list& idx, +octave_variable_reference::assign (octave_value::assign_op op, + const octave_value_list& idx, const octave_value& rhs) { if (id) - id->assign (idx, rhs); + id->assign (op, idx, rhs); else if (indir) { octave_value& ult = indir->reference (); - ult.assign (idx, rhs); + ult.assign (op, idx, rhs); } else panic_impossible ();
--- a/src/variables.h +++ b/src/variables.h @@ -68,9 +68,10 @@ ~octave_variable_reference (void) { } - void assign (const octave_value&); + void assign (octave_value::assign_op, const octave_value&); - void assign (const octave_value_list&, const octave_value&); + void assign (octave_value::assign_op, const octave_value_list&, + const octave_value&); octave_value value (void);