2887
|
1 /* |
|
2 |
|
3 Copyright (C) 1996, 1997 John W. Eaton |
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_tree_identifier_h) |
|
24 #define octave_tree_identifier_h 1 |
|
25 |
|
26 #if defined (__GNUG__) |
|
27 #pragma interface |
|
28 #endif |
|
29 |
|
30 class ostream; |
|
31 |
|
32 #include <string> |
|
33 |
2943
|
34 class octave_value; |
|
35 class octave_value_list; |
2887
|
36 class octave_function; |
|
37 class symbol_record; |
|
38 |
|
39 class tree_walker; |
|
40 |
2971
|
41 #include "pt-exp-base.h" |
2887
|
42 |
|
43 // Symbols from the symbol table. |
|
44 |
|
45 class |
2971
|
46 tree_identifier : public tree_expression |
2887
|
47 { |
|
48 friend class tree_index_expression; |
|
49 |
|
50 public: |
|
51 |
|
52 tree_identifier (int l = -1, int c = -1) |
2971
|
53 : tree_expression (l, c), sym (0) { } |
2887
|
54 |
|
55 tree_identifier (symbol_record *s, int l = -1, int c = -1) |
2971
|
56 : tree_expression (l, c), sym (s) { } |
2887
|
57 |
|
58 ~tree_identifier (void) { } |
|
59 |
|
60 bool is_identifier (void) const |
|
61 { return true; } |
|
62 |
|
63 string name (void) const; |
|
64 |
|
65 tree_identifier *define (octave_function *f, unsigned int sym_type); |
|
66 |
|
67 void document (const string& s); |
|
68 |
|
69 bool is_defined (void); |
|
70 |
2971
|
71 bool is_function (void); |
|
72 |
|
73 octave_value |
|
74 do_lookup (bool& script_file_executed, bool exec_script = true); |
2887
|
75 |
|
76 void link_to_global (void); |
|
77 |
|
78 void mark_as_static (void); |
|
79 |
|
80 void mark_as_formal_parameter (void); |
|
81 |
2971
|
82 octave_value rvalue (void); |
2887
|
83 |
2971
|
84 octave_value_list rvalue (int nargout); |
2887
|
85 |
2979
|
86 octave_lvalue lvalue (void); |
2887
|
87 |
|
88 void eval_undefined_error (void); |
|
89 |
|
90 void accept (tree_walker& tw); |
|
91 |
|
92 private: |
|
93 |
|
94 // The symbol record that this identifier references. |
|
95 symbol_record *sym; |
|
96 }; |
|
97 |
|
98 #endif |
|
99 |
|
100 /* |
|
101 ;;; Local Variables: *** |
|
102 ;;; mode: C++ *** |
|
103 ;;; End: *** |
|
104 */ |