comparison src/pt-id.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 a3556d2adec9
comparison
equal deleted inserted replaced
2970:b9e64477f703 2971:f2be17e6f1ea
31 31
32 #include <string> 32 #include <string>
33 33
34 class octave_value; 34 class octave_value;
35 class octave_value_list; 35 class octave_value_list;
36 class octave_symbol;
37 class octave_function; 36 class octave_function;
38 class symbol_record; 37 class symbol_record;
39 38
40 class tree_walker; 39 class tree_walker;
41 40
42 #include "pt-mvr-base.h" 41 #include "pt-exp-base.h"
43 42
44 // Symbols from the symbol table. 43 // Symbols from the symbol table.
45 44
46 class 45 class
47 tree_identifier : public tree_multi_val_ret 46 tree_identifier : public tree_expression
48 { 47 {
49 friend class tree_index_expression; 48 friend class tree_index_expression;
50 49
51 public: 50 public:
52 51
53 tree_identifier (int l = -1, int c = -1) 52 tree_identifier (int l = -1, int c = -1)
54 : tree_multi_val_ret (l, c), sym (0), maybe_do_ans_assign (false) { } 53 : tree_expression (l, c), sym (0) { }
55 54
56 tree_identifier (symbol_record *s, int l = -1, int c = -1) 55 tree_identifier (symbol_record *s, int l = -1, int c = -1)
57 : tree_multi_val_ret (l, c), sym (s), maybe_do_ans_assign (false) { } 56 : tree_expression (l, c), sym (s) { }
58 57
59 ~tree_identifier (void) { } 58 ~tree_identifier (void) { }
60 59
61 bool is_identifier (void) const 60 bool is_identifier (void) const
62 { return true; } 61 { return true; }
67 66
68 void document (const string& s); 67 void document (const string& s);
69 68
70 bool is_defined (void); 69 bool is_defined (void);
71 70
72 octave_symbol *do_lookup (bool& script_file_executed, bool 71 bool is_function (void);
73 exec_script = true); 72
73 octave_value
74 do_lookup (bool& script_file_executed, bool exec_script = true);
74 75
75 void link_to_global (void); 76 void link_to_global (void);
76 77
77 void mark_as_static (void); 78 void mark_as_static (void);
78 79
79 void mark_as_formal_parameter (void); 80 void mark_as_formal_parameter (void);
80 81
81 void mark_for_possible_ans_assign (void) 82 octave_value rvalue (void);
82 { maybe_do_ans_assign = true; }
83 83
84 octave_value eval (bool print = false); 84 octave_value_list rvalue (int nargout);
85 85
86 octave_value_list 86 octave_variable_reference lvalue (void);
87 eval (bool print, int nargout, const octave_value_list& args);
88 87
89 void eval_undefined_error (void); 88 void eval_undefined_error (void);
90 89
91 void accept (tree_walker& tw); 90 void accept (tree_walker& tw);
92 91
93 octave_value value (void) const;
94
95 octave_variable_reference reference (void);
96
97 private: 92 private:
98 93
99 // The symbol record that this identifier references. 94 // The symbol record that this identifier references.
100 symbol_record *sym; 95 symbol_record *sym;
101
102 // True if we should consider assigning the result of evaluating
103 // this identifier to the built-in variable ans.
104 bool maybe_do_ans_assign;
105 }; 96 };
106 97
107 #endif 98 #endif
108 99
109 /* 100 /*