comparison src/pt-exp.h @ 5861:2a6cb4ed8f1e

[project @ 2006-06-16 05:09:41 by jwe]
author jwe
date Fri, 16 Jun 2006 05:09:42 +0000
parents 4c8a2e4e0717
children 93c65f2a5668
comparison
equal deleted inserted replaced
5860:b645066d40ad 5861:2a6cb4ed8f1e
26 26
27 #include <string> 27 #include <string>
28 28
29 class octave_value; 29 class octave_value;
30 class octave_lvalue; 30 class octave_lvalue;
31 class symbol_table;
31 32
32 #include "pt.h" 33 #include "pt.h"
33 34
34 // A base class for expressions. 35 // A base class for expressions.
35 36
43 print_flag (false) { } 44 print_flag (false) { }
44 45
45 virtual ~tree_expression (void) { } 46 virtual ~tree_expression (void) { }
46 47
47 virtual bool has_magic_end (void) const = 0; 48 virtual bool has_magic_end (void) const = 0;
49
50 virtual tree_expression *dup (symbol_table *) = 0;
48 51
49 virtual bool is_constant (void) const { return false; } 52 virtual bool is_constant (void) const { return false; }
50 53
51 virtual bool is_matrix_constant (void) const { return false; } 54 virtual bool is_matrix_constant (void) const { return false; }
52 55
102 { 105 {
103 print_flag = print; 106 print_flag = print;
104 return this; 107 return this;
105 } 108 }
106 109
110 virtual void copy_base (tree_expression& e)
111 {
112 num_parens = e.num_parens;
113 postfix_indexed = e.postfix_indexed;
114 print_flag = e.print_flag;
115 }
116
107 protected: 117 protected:
108 118
109 // A count of the number of times this expression appears directly 119 // A count of the number of times this expression appears directly
110 // inside a set of parentheses. 120 // inside a set of parentheses.
111 // 121 //