8
|
1 /* |
|
2 |
7017
|
3 Copyright (C) 1993, 1994, 1995, 1996, 1997, 1999, 2000, 2002, 2003, |
|
4 2004, 2005, 2006, 2007 John W. Eaton |
8
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
7016
|
10 Free Software Foundation; either version 3 of the License, or (at your |
|
11 option) any later version. |
8
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
7016
|
19 along with Octave; see the file COPYING. If not, see |
|
20 <http://www.gnu.org/licenses/>. |
8
|
21 |
|
22 */ |
|
23 |
383
|
24 #if !defined (octave_symtab_h) |
|
25 #define octave_symtab_h 1 |
8
|
26 |
3011
|
27 #include <cassert> |
|
28 |
1755
|
29 #include <string> |
4214
|
30 #include <stack> |
5765
|
31 #include <sstream> |
220
|
32 |
3011
|
33 #include "oct-alloc.h" |
1755
|
34 #include "str-vec.h" |
|
35 |
2975
|
36 #include "ov.h" |
|
37 |
2979
|
38 class octave_lvalue; |
8
|
39 |
1755
|
40 class string_vector; |
|
41 |
8
|
42 class symbol_record; |
|
43 class symbol_table; |
|
44 |
4913
|
45 struct |
|
46 whos_parameter |
|
47 { |
4914
|
48 char command; |
|
49 char modifier; |
|
50 int parameter_length; |
|
51 int first_parameter_length; |
|
52 int dimensions; |
|
53 int balance; |
4913
|
54 std::string text; |
|
55 std::string line; |
|
56 }; |
|
57 |
3011
|
58 // Individual records in a symbol table. |
8
|
59 |
3011
|
60 class |
6109
|
61 OCTINTERP_API |
3011
|
62 symbol_record |
|
63 { |
|
64 public: |
8
|
65 |
3258
|
66 // If you add or delete an entry here, you'll also need to change |
3325
|
67 // the width parameter in the declaration for symbol_type below... |
3258
|
68 |
195
|
69 enum TYPE |
|
70 { |
|
71 UNKNOWN = 0, |
|
72 USER_FUNCTION = 1, |
|
73 USER_VARIABLE = 2, |
3325
|
74 DLD_FUNCTION = 4, |
|
75 BUILTIN_FUNCTION = 8, |
4208
|
76 COMMAND = 16, |
5102
|
77 RAWCOMMAND = 32, |
5864
|
78 MAPPER_FUNCTION = 64, |
|
79 MEX_FUNCTION = 128, |
195
|
80 }; |
|
81 |
8
|
82 private: |
|
83 |
3011
|
84 // Variables or functions. |
|
85 |
|
86 class symbol_def |
|
87 { |
|
88 public: |
|
89 |
|
90 symbol_def (const octave_value& val = octave_value (), |
|
91 unsigned int sym_type = 0) |
6257
|
92 : symbol_type (sym_type), read_only (0), help_string (), |
5399
|
93 definition (val), count (1) { } |
3011
|
94 |
|
95 ~symbol_def (void) { } |
|
96 |
|
97 bool is_variable (void) const |
5794
|
98 { return (symbol_type & symbol_record::USER_VARIABLE); } |
3011
|
99 |
4208
|
100 // It's not necessary to check for COMMAND and MAPPER_FUNCTION |
3968
|
101 // here. Those tags are just used as additional qualifiers for |
|
102 // the other types of functions. |
|
103 |
3011
|
104 bool is_function (void) const |
|
105 { |
|
106 return (symbol_type & symbol_record::USER_FUNCTION |
3325
|
107 || symbol_type & symbol_record::DLD_FUNCTION |
5864
|
108 || symbol_type & symbol_record::MEX_FUNCTION |
3011
|
109 || symbol_type & symbol_record::BUILTIN_FUNCTION); |
|
110 } |
|
111 |
|
112 bool is_user_variable (void) const |
|
113 { return (symbol_type & symbol_record::USER_VARIABLE); } |
195
|
114 |
5136
|
115 // Don't use |= here to avoid error with AIX compiler. |
4208
|
116 void mark_as_command (void) |
5136
|
117 { symbol_type = symbol_type | symbol_record::COMMAND; } |
4207
|
118 |
4208
|
119 void unmark_command (void) |
|
120 { symbol_type &= ~symbol_record::COMMAND; } |
4207
|
121 |
4208
|
122 bool is_command (void) const |
|
123 { return (symbol_type & symbol_record::COMMAND); } |
3011
|
124 |
5102
|
125 void mark_as_rawcommand (void) |
|
126 { symbol_type |= (symbol_record::COMMAND |
|
127 | symbol_record::RAWCOMMAND); } |
|
128 |
|
129 void unmark_rawcommand (void) |
|
130 { symbol_type &= ~symbol_record::RAWCOMMAND; } |
|
131 |
|
132 bool is_rawcommand (void) const |
|
133 { return (symbol_type & symbol_record::RAWCOMMAND); } |
|
134 |
3011
|
135 bool is_mapper_function (void) const |
|
136 { return (symbol_type & symbol_record::MAPPER_FUNCTION); } |
|
137 |
|
138 bool is_user_function (void) const |
|
139 { return (symbol_type & symbol_record::USER_FUNCTION); } |
|
140 |
|
141 bool is_builtin_function (void) const |
|
142 { return (symbol_type & symbol_record::BUILTIN_FUNCTION); } |
|
143 |
3325
|
144 bool is_dld_function (void) const |
|
145 { return (symbol_type & symbol_record::DLD_FUNCTION); } |
|
146 |
5864
|
147 bool is_mex_function (void) const |
|
148 { return (symbol_type & symbol_record::MEX_FUNCTION); } |
|
149 |
5775
|
150 // FIXME |
3523
|
151 bool is_map_element (const std::string& /* elts */) const |
3011
|
152 { return false; } |
|
153 |
|
154 bool is_defined (void) const |
|
155 { return definition.is_defined (); } |
|
156 |
|
157 bool is_read_only (void) const |
|
158 { return read_only; } |
|
159 |
4913
|
160 bool is_matrix_type (void) const |
|
161 { return definition.is_matrix_type (); } |
|
162 |
5659
|
163 bool is_sparse_type (void) const |
|
164 { return definition.is_sparse_type (); } |
|
165 |
|
166 bool is_complex_type (void) const |
|
167 { return definition.is_complex_type (); } |
|
168 |
|
169 std::string class_name (void) const |
|
170 { return definition.class_name (); } |
|
171 |
|
172 Matrix size (void) const |
|
173 { return definition.size (); } |
|
174 |
4913
|
175 size_t byte_size (void) const |
|
176 { return definition.byte_size (); }; |
|
177 |
5275
|
178 octave_idx_type numel (void) const |
4913
|
179 { return definition.numel (); }; |
|
180 |
5275
|
181 octave_idx_type capacity (void) const |
5164
|
182 { return definition.capacity (); }; |
|
183 |
4913
|
184 dim_vector dims (void) const |
|
185 { return definition.dims (); } |
|
186 |
5275
|
187 octave_idx_type rows (void) const { return definition.rows (); } |
|
188 octave_idx_type columns (void) const { return definition.columns (); } |
3013
|
189 |
3523
|
190 std::string type_name (void) const { return definition.type_name (); } |
3013
|
191 |
3523
|
192 std::string type_as_string (void) const; |
3355
|
193 |
3523
|
194 void type (std::ostream& os, const std::string& name, bool pr_type_info, |
3356
|
195 bool quiet, bool pr_orig_txt); |
|
196 |
3523
|
197 std::string which (const std::string& name); |
3355
|
198 |
3523
|
199 void which (std::ostream& os, const std::string& name); |
3355
|
200 |
3011
|
201 void define (const octave_value& val, unsigned int sym_type) |
|
202 { |
|
203 definition = val; |
|
204 symbol_type = sym_type; |
|
205 } |
|
206 |
|
207 void protect (void) { read_only = 1; } |
|
208 |
|
209 void unprotect (void) { read_only = 0; } |
|
210 |
|
211 octave_value& def (void) { return definition; } |
|
212 |
3523
|
213 std::string help (void) const { return help_string; } |
3011
|
214 |
5823
|
215 void document (const std::string& h); |
3011
|
216 |
|
217 unsigned int type (void) { return symbol_type; } |
|
218 |
|
219 void *operator new (size_t size) |
|
220 { return allocator.alloc (size); } |
|
221 |
|
222 void operator delete (void *p, size_t size) |
|
223 { allocator.free (p, size); } |
|
224 |
|
225 static octave_allocator allocator; |
8
|
226 |
3011
|
227 // The type of this symbol (see the enum above). |
5102
|
228 unsigned int symbol_type : 9; |
3011
|
229 |
|
230 // Nonzero means this variable cannot be given a new value. |
|
231 unsigned int read_only : 1; |
|
232 |
|
233 // The doc string associated with this variable. |
3523
|
234 std::string help_string; |
3011
|
235 |
|
236 // The value of this definition. See ov.h and related files. |
|
237 octave_value definition; |
767
|
238 |
3011
|
239 // Reference count. |
|
240 int count; |
|
241 |
3933
|
242 void print_info (std::ostream& os, |
|
243 const std::string& prefix = std::string ()) const; |
3239
|
244 |
3011
|
245 // No copying! |
|
246 |
|
247 symbol_def (const symbol_def& sd); |
|
248 |
|
249 symbol_def& operator = (const symbol_def& sd); |
|
250 }; |
8
|
251 |
|
252 public: |
2953
|
253 |
3011
|
254 typedef int (*change_function) (void); |
2953
|
255 |
3011
|
256 symbol_record (void) |
5861
|
257 : formal_param (false), automatic_variable (false), |
|
258 linked_to_global (false), tagged_static (false), |
6257
|
259 can_hide_function (true), visible (true), eternal (false), |
|
260 nm (), chg_fcn (0), definition (new symbol_def ()), next_elem (0) { } |
4234
|
261 |
5775
|
262 // FIXME -- kluge alert! We obviously need a better way of |
4234
|
263 // handling allow_shadow! |
3011
|
264 |
3523
|
265 symbol_record (const std::string& n, symbol_record *nxt) |
5861
|
266 : formal_param (false), automatic_variable (false), |
|
267 linked_to_global (false), tagged_static (false), |
6257
|
268 can_hide_function (n != "__end__"), visible (true), |
|
269 eternal (false), nm (n), chg_fcn (0), |
|
270 definition (new symbol_def ()), next_elem (nxt) { } |
8
|
271 |
5013
|
272 ~symbol_record (void) |
|
273 { |
|
274 if (--definition->count <= 0) |
|
275 delete definition; |
|
276 } |
8
|
277 |
3523
|
278 std::string name (void) const { return nm; } |
2975
|
279 |
3523
|
280 std::string help (void) const { return definition->help (); } |
3011
|
281 |
|
282 octave_value& def (void) { return definition->def (); } |
8
|
283 |
3523
|
284 void rename (const std::string& new_name); |
195
|
285 |
3011
|
286 bool is_function (void) const |
|
287 { return definition->is_function (); } |
|
288 |
4208
|
289 void mark_as_command (void) |
|
290 { definition->mark_as_command (); } |
4207
|
291 |
4208
|
292 void unmark_command (void) |
|
293 { definition->unmark_command (); } |
4207
|
294 |
4208
|
295 bool is_command (void) const |
|
296 { return definition->is_command (); } |
3011
|
297 |
5102
|
298 void mark_as_rawcommand (void) |
|
299 { definition->mark_as_rawcommand (); } |
|
300 |
|
301 void unmark_rawcommand (void) |
|
302 { definition->unmark_rawcommand (); } |
|
303 |
|
304 bool is_rawcommand (void) const |
|
305 { return definition->is_rawcommand (); } |
|
306 |
3011
|
307 bool is_mapper_function (void) const |
|
308 { return definition->is_mapper_function (); } |
|
309 |
|
310 bool is_user_function (void) const |
|
311 { return definition->is_user_function (); } |
195
|
312 |
3011
|
313 bool is_builtin_function (void) const |
|
314 { return definition->is_builtin_function (); } |
|
315 |
3325
|
316 bool is_dld_function (void) const |
|
317 { return definition->is_dld_function (); } |
|
318 |
5864
|
319 bool is_mex_function (void) const |
|
320 { return definition->is_mex_function (); } |
|
321 |
3011
|
322 bool is_variable (void) const |
|
323 { return definition->is_variable (); } |
8
|
324 |
3011
|
325 bool is_user_variable (void) const |
|
326 { return definition->is_user_variable (); } |
|
327 |
3523
|
328 bool is_map_element (const std::string& elts) const |
3011
|
329 { return definition->is_map_element (elts); } |
8
|
330 |
3011
|
331 unsigned int type (void) const { return definition->type (); } |
|
332 |
|
333 bool is_defined (void) const { return definition->is_defined (); } |
|
334 |
|
335 bool is_read_only (void) const { return definition->is_read_only (); } |
8
|
336 |
6257
|
337 bool is_eternal (void) const { return eternal; } |
3011
|
338 |
|
339 void protect (void) { definition->protect (); } |
195
|
340 |
3011
|
341 void unprotect (void) { definition->unprotect (); } |
|
342 |
6257
|
343 void make_eternal (void) { eternal = 1; } |
2893
|
344 |
5399
|
345 void hide (void) { visible = false; } |
|
346 void show (void) { visible = true; } |
|
347 bool is_visible (void) const { return visible; } |
5397
|
348 |
3011
|
349 void set_change_function (change_function f) { chg_fcn = f; } |
2893
|
350 |
3011
|
351 void define (const octave_value& v, unsigned int sym_type = USER_VARIABLE); |
|
352 |
|
353 bool define (octave_function *f, unsigned int sym_type); |
2893
|
354 |
3523
|
355 void document (const std::string& h) { definition->document (h); } |
195
|
356 |
3011
|
357 void clear (void); |
195
|
358 |
5397
|
359 void alias (symbol_record *s, bool mark_to_clear = false); |
8
|
360 |
|
361 void mark_as_formal_parameter (void); |
3011
|
362 bool is_formal_parameter (void) const { return formal_param; } |
8
|
363 |
5861
|
364 void mark_as_automatic_variable (void); |
|
365 bool is_automatic_variable (void) const { return automatic_variable; } |
|
366 |
195
|
367 void mark_as_linked_to_global (void); |
3011
|
368 bool is_linked_to_global (void) const { return linked_to_global; } |
8
|
369 |
2846
|
370 void mark_as_static (void); |
3011
|
371 bool is_static (void) const { return tagged_static; } |
4319
|
372 void unmark_static (void) { tagged_static = false; } |
2846
|
373 |
4913
|
374 bool is_matrix_type (void) const |
|
375 { return definition->is_matrix_type (); } |
|
376 |
5659
|
377 bool is_sparse_type (void) const |
|
378 { return definition->is_sparse_type (); } |
|
379 |
|
380 bool is_complex_type (void) const |
|
381 { return definition->is_complex_type (); } |
|
382 |
|
383 std::string class_name (void) const |
|
384 { return definition->class_name (); } |
|
385 |
|
386 Matrix size (void) const |
|
387 { return definition->size (); } |
|
388 |
4913
|
389 size_t byte_size (void) const |
|
390 { return definition->byte_size (); }; |
|
391 |
5275
|
392 octave_idx_type numel (void) const |
4913
|
393 { return definition->numel (); }; |
|
394 |
5275
|
395 octave_idx_type capacity (void) const |
5164
|
396 { return definition->capacity (); }; |
|
397 |
4913
|
398 dim_vector dims (void) const { return definition->dims (); } |
|
399 |
|
400 int dimensions_string_req_first_space (int print_dims) const; |
|
401 |
|
402 int dimensions_string_req_total_space (int print_dims) const; |
|
403 |
|
404 std::string make_dimensions_string (int print_dims) const; |
|
405 |
5275
|
406 octave_idx_type rows (void) const { return definition->rows (); } |
|
407 octave_idx_type columns (void) const { return definition->columns (); } |
3013
|
408 |
3523
|
409 std::string type_name (void) const { return definition->type_name (); } |
3013
|
410 |
3523
|
411 std::string type_as_string (void) const |
3355
|
412 { return definition->type_as_string (); } |
|
413 |
3523
|
414 void type (std::ostream& os, bool pr_type_info, bool quiet, bool pr_orig_txt) |
3356
|
415 { definition->type (os, name (), pr_type_info, quiet, pr_orig_txt); } |
|
416 |
3523
|
417 std::string which (void) { return definition->which (name ()); } |
3355
|
418 |
3523
|
419 void which (std::ostream& os) { definition->which (os, name ()); } |
3355
|
420 |
2975
|
421 octave_value& variable_value (void); |
2979
|
422 octave_lvalue variable_reference (void); |
2390
|
423 |
3011
|
424 symbol_record *next (void) const { return next_elem; } |
8
|
425 |
3011
|
426 void chain (symbol_record *s) { next_elem = s; } |
195
|
427 |
220
|
428 void push_context (void); |
3011
|
429 |
220
|
430 void pop_context (void); |
|
431 |
4913
|
432 void print_symbol_info_line (std::ostream& os, |
|
433 std::list<whos_parameter>& params) const; |
3013
|
434 |
3933
|
435 void print_info (std::ostream& os, |
|
436 const std::string& prefix = std::string ()) const; |
3239
|
437 |
8
|
438 private: |
|
439 |
2893
|
440 unsigned int formal_param : 1; |
5861
|
441 unsigned int automatic_variable : 1; |
2893
|
442 unsigned int linked_to_global : 1; |
|
443 unsigned int tagged_static : 1; |
4234
|
444 unsigned int can_hide_function : 1; |
5399
|
445 unsigned int visible : 1; |
6257
|
446 unsigned int eternal : 1; |
195
|
447 |
3523
|
448 std::string nm; |
3011
|
449 change_function chg_fcn; |
195
|
450 symbol_def *definition; |
8
|
451 symbol_record *next_elem; |
395
|
452 |
3011
|
453 // This should maybe be one stack with a structure containing all the |
|
454 // items we need to save for recursive calls... |
4214
|
455 std::stack <symbol_def *> context; |
|
456 std::stack <unsigned int> global_link_context; |
8
|
457 |
5397
|
458 std::stack <symbol_record *> aliases_to_clear; |
|
459 |
|
460 void push_alias_to_clear (symbol_record *s) |
|
461 { aliases_to_clear.push (s); } |
|
462 |
3011
|
463 bool read_only_error (const char *action); |
195
|
464 |
5397
|
465 void maybe_delete_def (void) |
|
466 { |
|
467 if (--definition->count <= 0) |
|
468 delete definition; |
|
469 } |
|
470 |
3011
|
471 // No copying! |
|
472 |
|
473 symbol_record (const symbol_record& s); |
195
|
474 |
8
|
475 symbol_record& operator = (const symbol_record& s); |
|
476 }; |
|
477 |
767
|
478 // A symbol table. |
200
|
479 |
|
480 #define SYMTAB_LOCAL_SCOPE 1 |
|
481 #define SYMTAB_GLOBAL_SCOPE 2 |
|
482 |
|
483 #define SYMTAB_ALL_SCOPES (SYMTAB_LOCAL_SCOPE | SYMTAB_GLOBAL_SCOPE) |
|
484 |
3011
|
485 #define SYMTAB_ALL_TYPES (symbol_record::USER_FUNCTION \ |
|
486 | symbol_record::USER_VARIABLE \ |
3325
|
487 | symbol_record::DLD_FUNCTION \ |
3011
|
488 | symbol_record::BUILTIN_FUNCTION \ |
4208
|
489 | symbol_record::COMMAND \ |
5102
|
490 | symbol_record::RAWCOMMAND \ |
5864
|
491 | symbol_record::MAPPER_FUNCTION \ |
|
492 | symbol_record::MEX_FUNCTION) |
200
|
493 |
5794
|
494 #define SYMTAB_VARIABLES (symbol_record::USER_VARIABLE) |
1412
|
495 |
8
|
496 class |
6109
|
497 OCTINTERP_API |
8
|
498 symbol_table |
|
499 { |
|
500 public: |
|
501 |
4238
|
502 symbol_table (unsigned int tab_size = 128, |
|
503 const std::string& nm = std::string ()) |
|
504 : table_size (tab_size), table (new symbol_record [table_size]), |
|
505 table_name (nm) |
4009
|
506 { |
|
507 assert ((tab_size % 2) == 0); |
4238
|
508 |
|
509 if (table_name.empty ()) |
|
510 { |
5765
|
511 std::ostringstream buf; |
|
512 buf << symtab_count++; |
|
513 table_name = buf.str (); |
4238
|
514 } |
4009
|
515 } |
3011
|
516 |
5013
|
517 ~symbol_table (void); |
8
|
518 |
3523
|
519 symbol_record *lookup (const std::string& nm, bool insert = false, |
2856
|
520 bool warn = false); |
8
|
521 |
3523
|
522 void rename (const std::string& old_name, const std::string& new_name); |
572
|
523 |
4009
|
524 void clear (void); |
|
525 |
|
526 void clear_variables (void); |
|
527 void clear_functions (void); |
6072
|
528 void clear_mex_functions (void); |
4009
|
529 void clear_globals (void); |
|
530 |
|
531 bool clear (const std::string& nm); |
|
532 |
|
533 bool clear_variable (const std::string& nm); |
|
534 bool clear_function (const std::string& nm); |
|
535 bool clear_global (const std::string& nm); |
|
536 |
|
537 bool clear_variable_pattern (const std::string& pat); |
|
538 bool clear_function_pattern (const std::string& pat); |
|
539 bool clear_global_pattern (const std::string& pat); |
8
|
540 |
164
|
541 int size (void) const; |
8
|
542 |
3013
|
543 Array<symbol_record *> |
4913
|
544 subsymbol_list (const string_vector& pats = string_vector (), |
|
545 unsigned int type = SYMTAB_ALL_TYPES, |
|
546 unsigned int scope = SYMTAB_ALL_SCOPES) const; |
|
547 |
|
548 Array<symbol_record *> |
3355
|
549 symbol_list (const string_vector& pats = string_vector (), |
3013
|
550 unsigned int type = SYMTAB_ALL_TYPES, |
|
551 unsigned int scope = SYMTAB_ALL_SCOPES) const; |
|
552 |
195
|
553 |
1755
|
554 string_vector |
3355
|
555 name_list (const string_vector& pats = string_vector (), |
3013
|
556 bool sort = false, unsigned int type = SYMTAB_ALL_TYPES, |
|
557 unsigned int scope = SYMTAB_ALL_SCOPES) const; |
605
|
558 |
4009
|
559 string_vector |
|
560 user_function_name_list (void) const |
|
561 { |
|
562 return name_list |
|
563 (string_vector (), false, |
5864
|
564 symbol_record::USER_FUNCTION|symbol_record::DLD_FUNCTION|symbol_record::MEX_FUNCTION, |
4009
|
565 SYMTAB_ALL_SCOPES); |
|
566 } |
|
567 |
|
568 string_vector |
|
569 global_variable_name_list (void) const |
|
570 { |
|
571 return name_list |
|
572 (string_vector (), false, SYMTAB_VARIABLES, SYMTAB_GLOBAL_SCOPE); |
|
573 } |
|
574 |
|
575 string_vector |
|
576 variable_name_list (void) const |
|
577 { |
|
578 return name_list |
|
579 (string_vector (), false, SYMTAB_VARIABLES, SYMTAB_LOCAL_SCOPE); |
|
580 } |
3011
|
581 |
|
582 int maybe_list (const char *header, const string_vector& argv, |
3523
|
583 std::ostream& os, bool show_verbose, |
3011
|
584 unsigned type, unsigned scope); |
|
585 |
3523
|
586 Array<symbol_record *> glob (const std::string& pat = std::string ("*"), |
3355
|
587 unsigned int type = SYMTAB_ALL_TYPES, |
|
588 unsigned int scope = SYMTAB_ALL_SCOPES) const; |
8
|
589 |
220
|
590 void push_context (void); |
3011
|
591 |
220
|
592 void pop_context (void); |
|
593 |
5861
|
594 // Create a new symbol table with the same entries. Only the symbol |
|
595 // names and some attributes are copied, not values. |
|
596 symbol_table *dup (void); |
|
597 |
|
598 // Inherit some values from the parent_sym_tab. |
|
599 void inherit (symbol_table *parent_sym_tab); |
|
600 |
3941
|
601 void print_info (std::ostream& os) const; |
3011
|
602 |
8
|
603 private: |
|
604 |
3011
|
605 unsigned int table_size; |
|
606 |
|
607 symbol_record *table; |
|
608 |
4238
|
609 std::string table_name; |
|
610 |
|
611 static unsigned long int symtab_count; |
|
612 |
4913
|
613 void |
|
614 print_descriptor (std::ostream& os, |
|
615 std::list<whos_parameter> params) const; |
|
616 |
|
617 std::list<whos_parameter> |
|
618 parse_whos_line_format (Array<symbol_record *>& symbols) const; |
|
619 |
3523
|
620 unsigned int hash (const std::string& s); |
8
|
621 |
3011
|
622 // No copying! |
8
|
623 |
3011
|
624 symbol_table (const symbol_table&); |
1962
|
625 |
3011
|
626 symbol_table& operator = (const symbol_table&); |
|
627 }; |
2790
|
628 |
4913
|
629 // Defines layout for the whos/who -long command. |
|
630 extern std::string Vwhos_line_format; |
|
631 |
8
|
632 #endif |
|
633 |
|
634 /* |
|
635 ;;; Local Variables: *** |
|
636 ;;; mode: C++ *** |
|
637 ;;; End: *** |
|
638 */ |