Mercurial > hg > octave-nkf
diff src/pt-const.h @ 2971:f2be17e6f1ea
[project @ 1997-05-15 18:55:44 by jwe]
author | jwe |
---|---|
date | Thu, 15 May 1997 18:55:47 +0000 |
parents | 194b50e4725b |
children | cd5ad3fd8049 |
line wrap: on
line diff
--- a/src/pt-const.h +++ b/src/pt-const.h @@ -33,7 +33,7 @@ #include "oct-alloc.h" -#include "pt-mvr-base.h" +#include "pt-exp-base.h" class octave_value_list; @@ -42,18 +42,18 @@ #include "ov.h" class -tree_constant : public tree_multi_val_ret +tree_constant : public tree_expression { public: tree_constant (int l = -1, int c = -1) - : tree_multi_val_ret (l, c), val (), orig_text () { } + : tree_expression (l, c), val (), orig_text () { } tree_constant (const octave_value& v, int l = -1, int c = -1) - : tree_multi_val_ret (l, c), val (v), orig_text () { } + : tree_expression (l, c), val (v), orig_text () { } tree_constant (const tree_constant& a) - : tree_multi_val_ret (-1, -1), val (a.val), orig_text () { } + : tree_expression (-1, -1), val (a.val), orig_text () { } ~tree_constant (void) { } @@ -61,7 +61,7 @@ { if (this != &a) { - tree_multi_val_ret::operator = (a); + tree_expression::operator = (a); val = a.val; } return *this; @@ -75,7 +75,8 @@ // Type. It would be nice to eliminate the need for this. - bool is_constant (void) const { return true; } + bool is_constant (void) const + { return true; } void maybe_mutate (void) { val.maybe_mutate (); } @@ -86,10 +87,15 @@ void print_raw (ostream& os, bool pr_as_read_syntax = false, bool pr_orig_txt = true); - octave_value eval (bool print = false); + bool rvalue_ok (void) const + { return true; } - octave_value_list - eval (bool print, int nargout, const octave_value_list& args); + octave_value rvalue (void) + { return val; } + + octave_value_list rvalue (int nargout); + + void accept (tree_walker& tw); // Store the original text corresponding to this constant for later // pretty printing. @@ -100,8 +106,6 @@ string original_text (void) const { return orig_text; } - void accept (tree_walker& tw); - private: // For custom memory management.