diff src/pt-exp-base.h @ 2971:f2be17e6f1ea

[project @ 1997-05-15 18:55:44 by jwe]
author jwe
date Thu, 15 May 1997 18:55:47 +0000
parents 8a77d52c9d02
children a3556d2adec9
line wrap: on
line diff
--- a/src/pt-exp-base.h	Thu May 15 18:08:21 1997 +0000
+++ b/src/pt-exp-base.h	Thu May 15 18:55:47 1997 +0000
@@ -42,7 +42,8 @@
 public:
 
   tree_expression (int l = -1, int c = -1)
-    : tree (l, c), num_parens (0) { }
+    : tree (l, c), num_parens (0), postfix_indexed (false),
+      print_flag (false) { }
 
   virtual ~tree_expression (void) { }
 
@@ -52,16 +53,13 @@
   virtual bool is_matrix_constant (void) const
     { return false; }
 
-  virtual bool is_multi_val_ret_expression (void) const
-    { return false; }
-
   virtual bool is_identifier (void) const
     { return false; }
 
-  virtual bool is_indirect_ref (void) const
+  virtual bool is_index_expression (void) const
     { return false; }
 
-  virtual bool is_index_expression (void) const
+  virtual bool is_indirect_ref (void) const
     { return false; }
 
   virtual bool is_assignment_expression (void) const
@@ -72,18 +70,33 @@
 
   virtual bool is_logically_true (const char *);
 
-  virtual int paren_count (void) const
+  virtual bool lvalue_ok (void) const
+    { return false; }
+
+  virtual bool rvalue_ok (void) const
+    { return false; }
+
+  virtual octave_value rvalue (void);
+
+  virtual octave_value_list rvalue (int nargout);
+
+  virtual octave_variable_reference lvalue (void);
+
+  int paren_count (void) const
     { return num_parens; }
 
-  virtual void mark_for_possible_ans_assign (void);
+  bool is_postfix_indexed (void) const
+    { return postfix_indexed; }
 
-  virtual octave_value eval (bool print = false) = 0;
-
-  virtual octave_variable_reference reference (void);
+  bool print_result (void) const
+    { return print_flag; }
 
   virtual string oper (void) const
     { return "<unknown>"; }
 
+  virtual string name (void) const
+    { return "<unknown>"; }
+
   virtual string original_text (void) const;
 
   tree_expression *mark_in_parens (void)
@@ -92,6 +105,18 @@
       return this;
     }
 
+  tree_expression *mark_postfix_indexed (void)
+    {
+      postfix_indexed = true;
+      return this;
+    }
+
+  tree_expression *set_print_flag (bool print)
+    {
+      print_flag = print;
+      return this;
+    }
+
 protected:
 
   // A count of the number of times this expression appears directly
@@ -101,6 +126,13 @@
   //                  ==> 1 for expression ((e1)) + e2
   //                  ==> 0 for expression e2
   int num_parens;
+
+  // A flag that says whether this expression has an index associated
+  // with it.  See the code in tree_identifier::rvalue for the rationale.
+  bool postfix_indexed;
+
+  // Print result of rvalue for this expression?
+  bool print_flag;
 };
 
 #endif