8
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
8
|
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 |
5307
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
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) |
|
92 : symbol_type (sym_type), eternal (0), 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 |
|
160 bool is_eternal (void) const |
|
161 { return eternal; } |
8
|
162 |
4913
|
163 bool is_matrix_type (void) const |
|
164 { return definition.is_matrix_type (); } |
|
165 |
5659
|
166 bool is_sparse_type (void) const |
|
167 { return definition.is_sparse_type (); } |
|
168 |
|
169 bool is_complex_type (void) const |
|
170 { return definition.is_complex_type (); } |
|
171 |
|
172 std::string class_name (void) const |
|
173 { return definition.class_name (); } |
|
174 |
|
175 Matrix size (void) const |
|
176 { return definition.size (); } |
|
177 |
4913
|
178 size_t byte_size (void) const |
|
179 { return definition.byte_size (); }; |
|
180 |
5275
|
181 octave_idx_type numel (void) const |
4913
|
182 { return definition.numel (); }; |
|
183 |
5275
|
184 octave_idx_type capacity (void) const |
5164
|
185 { return definition.capacity (); }; |
|
186 |
4913
|
187 dim_vector dims (void) const |
|
188 { return definition.dims (); } |
|
189 |
5275
|
190 octave_idx_type rows (void) const { return definition.rows (); } |
|
191 octave_idx_type columns (void) const { return definition.columns (); } |
3013
|
192 |
3523
|
193 std::string type_name (void) const { return definition.type_name (); } |
3013
|
194 |
3523
|
195 std::string type_as_string (void) const; |
3355
|
196 |
3523
|
197 void type (std::ostream& os, const std::string& name, bool pr_type_info, |
3356
|
198 bool quiet, bool pr_orig_txt); |
|
199 |
3523
|
200 std::string which (const std::string& name); |
3355
|
201 |
3523
|
202 void which (std::ostream& os, const std::string& name); |
3355
|
203 |
3011
|
204 void define (const octave_value& val, unsigned int sym_type) |
|
205 { |
|
206 definition = val; |
|
207 symbol_type = sym_type; |
|
208 } |
|
209 |
|
210 void protect (void) { read_only = 1; } |
|
211 |
|
212 void unprotect (void) { read_only = 0; } |
|
213 |
|
214 void make_eternal (void) { eternal = 1; } |
|
215 |
|
216 octave_value& def (void) { return definition; } |
|
217 |
3523
|
218 std::string help (void) const { return help_string; } |
3011
|
219 |
5823
|
220 void document (const std::string& h); |
3011
|
221 |
|
222 unsigned int type (void) { return symbol_type; } |
|
223 |
|
224 void *operator new (size_t size) |
|
225 { return allocator.alloc (size); } |
|
226 |
|
227 void operator delete (void *p, size_t size) |
|
228 { allocator.free (p, size); } |
|
229 |
|
230 static octave_allocator allocator; |
8
|
231 |
3011
|
232 // The type of this symbol (see the enum above). |
5102
|
233 unsigned int symbol_type : 9; |
3011
|
234 |
|
235 // Nonzero means this variable cannot be cleared. |
|
236 unsigned int eternal : 1; |
|
237 |
|
238 // Nonzero means this variable cannot be given a new value. |
|
239 unsigned int read_only : 1; |
|
240 |
|
241 // The doc string associated with this variable. |
3523
|
242 std::string help_string; |
3011
|
243 |
|
244 // The value of this definition. See ov.h and related files. |
|
245 octave_value definition; |
767
|
246 |
3011
|
247 // Reference count. |
|
248 int count; |
|
249 |
3933
|
250 void print_info (std::ostream& os, |
|
251 const std::string& prefix = std::string ()) const; |
3239
|
252 |
3011
|
253 // No copying! |
|
254 |
|
255 symbol_def (const symbol_def& sd); |
|
256 |
|
257 symbol_def& operator = (const symbol_def& sd); |
|
258 }; |
8
|
259 |
|
260 public: |
2953
|
261 |
3011
|
262 typedef int (*change_function) (void); |
2953
|
263 |
3011
|
264 symbol_record (void) |
5861
|
265 : formal_param (false), automatic_variable (false), |
|
266 linked_to_global (false), tagged_static (false), |
|
267 can_hide_function (true), visible (true), nm (), chg_fcn (0), |
4234
|
268 definition (new symbol_def ()), next_elem (0) { } |
|
269 |
5775
|
270 // FIXME -- kluge alert! We obviously need a better way of |
4234
|
271 // handling allow_shadow! |
3011
|
272 |
3523
|
273 symbol_record (const std::string& n, symbol_record *nxt) |
5861
|
274 : formal_param (false), automatic_variable (false), |
|
275 linked_to_global (false), tagged_static (false), |
|
276 can_hide_function (n != "__end__"), visible (true), nm (n), |
|
277 chg_fcn (0), definition (new symbol_def ()), next_elem (nxt) { } |
8
|
278 |
5013
|
279 ~symbol_record (void) |
|
280 { |
|
281 if (--definition->count <= 0) |
|
282 delete definition; |
|
283 } |
8
|
284 |
3523
|
285 std::string name (void) const { return nm; } |
2975
|
286 |
3523
|
287 std::string help (void) const { return definition->help (); } |
3011
|
288 |
|
289 octave_value& def (void) { return definition->def (); } |
8
|
290 |
3523
|
291 void rename (const std::string& new_name); |
195
|
292 |
3011
|
293 bool is_function (void) const |
|
294 { return definition->is_function (); } |
|
295 |
4208
|
296 void mark_as_command (void) |
|
297 { definition->mark_as_command (); } |
4207
|
298 |
4208
|
299 void unmark_command (void) |
|
300 { definition->unmark_command (); } |
4207
|
301 |
4208
|
302 bool is_command (void) const |
|
303 { return definition->is_command (); } |
3011
|
304 |
5102
|
305 void mark_as_rawcommand (void) |
|
306 { definition->mark_as_rawcommand (); } |
|
307 |
|
308 void unmark_rawcommand (void) |
|
309 { definition->unmark_rawcommand (); } |
|
310 |
|
311 bool is_rawcommand (void) const |
|
312 { return definition->is_rawcommand (); } |
|
313 |
3011
|
314 bool is_mapper_function (void) const |
|
315 { return definition->is_mapper_function (); } |
|
316 |
|
317 bool is_user_function (void) const |
|
318 { return definition->is_user_function (); } |
195
|
319 |
3011
|
320 bool is_builtin_function (void) const |
|
321 { return definition->is_builtin_function (); } |
|
322 |
3325
|
323 bool is_dld_function (void) const |
|
324 { return definition->is_dld_function (); } |
|
325 |
5864
|
326 bool is_mex_function (void) const |
|
327 { return definition->is_mex_function (); } |
|
328 |
3011
|
329 bool is_variable (void) const |
|
330 { return definition->is_variable (); } |
8
|
331 |
3011
|
332 bool is_user_variable (void) const |
|
333 { return definition->is_user_variable (); } |
|
334 |
3523
|
335 bool is_map_element (const std::string& elts) const |
3011
|
336 { return definition->is_map_element (elts); } |
8
|
337 |
3011
|
338 unsigned int type (void) const { return definition->type (); } |
|
339 |
|
340 bool is_defined (void) const { return definition->is_defined (); } |
|
341 |
|
342 bool is_read_only (void) const { return definition->is_read_only (); } |
8
|
343 |
3011
|
344 bool is_eternal (void) const { return definition->is_eternal (); } |
|
345 |
|
346 void protect (void) { definition->protect (); } |
195
|
347 |
3011
|
348 void unprotect (void) { definition->unprotect (); } |
|
349 |
|
350 void make_eternal (void) { definition->make_eternal (); } |
2893
|
351 |
5399
|
352 void hide (void) { visible = false; } |
|
353 void show (void) { visible = true; } |
|
354 bool is_visible (void) const { return visible; } |
5397
|
355 |
3011
|
356 void set_change_function (change_function f) { chg_fcn = f; } |
2893
|
357 |
3011
|
358 void define (const octave_value& v, unsigned int sym_type = USER_VARIABLE); |
|
359 |
|
360 bool define (octave_function *f, unsigned int sym_type); |
2893
|
361 |
3523
|
362 void document (const std::string& h) { definition->document (h); } |
195
|
363 |
3011
|
364 void clear (void); |
195
|
365 |
5397
|
366 void alias (symbol_record *s, bool mark_to_clear = false); |
8
|
367 |
|
368 void mark_as_formal_parameter (void); |
3011
|
369 bool is_formal_parameter (void) const { return formal_param; } |
8
|
370 |
5861
|
371 void mark_as_automatic_variable (void); |
|
372 bool is_automatic_variable (void) const { return automatic_variable; } |
|
373 |
195
|
374 void mark_as_linked_to_global (void); |
3011
|
375 bool is_linked_to_global (void) const { return linked_to_global; } |
8
|
376 |
2846
|
377 void mark_as_static (void); |
3011
|
378 bool is_static (void) const { return tagged_static; } |
4319
|
379 void unmark_static (void) { tagged_static = false; } |
2846
|
380 |
4913
|
381 bool is_matrix_type (void) const |
|
382 { return definition->is_matrix_type (); } |
|
383 |
5659
|
384 bool is_sparse_type (void) const |
|
385 { return definition->is_sparse_type (); } |
|
386 |
|
387 bool is_complex_type (void) const |
|
388 { return definition->is_complex_type (); } |
|
389 |
|
390 std::string class_name (void) const |
|
391 { return definition->class_name (); } |
|
392 |
|
393 Matrix size (void) const |
|
394 { return definition->size (); } |
|
395 |
4913
|
396 size_t byte_size (void) const |
|
397 { return definition->byte_size (); }; |
|
398 |
5275
|
399 octave_idx_type numel (void) const |
4913
|
400 { return definition->numel (); }; |
|
401 |
5275
|
402 octave_idx_type capacity (void) const |
5164
|
403 { return definition->capacity (); }; |
|
404 |
4913
|
405 dim_vector dims (void) const { return definition->dims (); } |
|
406 |
|
407 int dimensions_string_req_first_space (int print_dims) const; |
|
408 |
|
409 int dimensions_string_req_total_space (int print_dims) const; |
|
410 |
|
411 std::string make_dimensions_string (int print_dims) const; |
|
412 |
5275
|
413 octave_idx_type rows (void) const { return definition->rows (); } |
|
414 octave_idx_type columns (void) const { return definition->columns (); } |
3013
|
415 |
3523
|
416 std::string type_name (void) const { return definition->type_name (); } |
3013
|
417 |
3523
|
418 std::string type_as_string (void) const |
3355
|
419 { return definition->type_as_string (); } |
|
420 |
3523
|
421 void type (std::ostream& os, bool pr_type_info, bool quiet, bool pr_orig_txt) |
3356
|
422 { definition->type (os, name (), pr_type_info, quiet, pr_orig_txt); } |
|
423 |
3523
|
424 std::string which (void) { return definition->which (name ()); } |
3355
|
425 |
3523
|
426 void which (std::ostream& os) { definition->which (os, name ()); } |
3355
|
427 |
2975
|
428 octave_value& variable_value (void); |
2979
|
429 octave_lvalue variable_reference (void); |
2390
|
430 |
3011
|
431 symbol_record *next (void) const { return next_elem; } |
8
|
432 |
3011
|
433 void chain (symbol_record *s) { next_elem = s; } |
195
|
434 |
220
|
435 void push_context (void); |
3011
|
436 |
220
|
437 void pop_context (void); |
|
438 |
4913
|
439 void print_symbol_info_line (std::ostream& os, |
|
440 std::list<whos_parameter>& params) const; |
3013
|
441 |
3933
|
442 void print_info (std::ostream& os, |
|
443 const std::string& prefix = std::string ()) const; |
3239
|
444 |
8
|
445 private: |
|
446 |
2893
|
447 unsigned int formal_param : 1; |
5861
|
448 unsigned int automatic_variable : 1; |
2893
|
449 unsigned int linked_to_global : 1; |
|
450 unsigned int tagged_static : 1; |
4234
|
451 unsigned int can_hide_function : 1; |
5399
|
452 unsigned int visible : 1; |
195
|
453 |
3523
|
454 std::string nm; |
3011
|
455 change_function chg_fcn; |
195
|
456 symbol_def *definition; |
8
|
457 symbol_record *next_elem; |
395
|
458 |
3011
|
459 // This should maybe be one stack with a structure containing all the |
|
460 // items we need to save for recursive calls... |
4214
|
461 std::stack <symbol_def *> context; |
|
462 std::stack <unsigned int> global_link_context; |
8
|
463 |
5397
|
464 std::stack <symbol_record *> aliases_to_clear; |
|
465 |
|
466 void push_alias_to_clear (symbol_record *s) |
|
467 { aliases_to_clear.push (s); } |
|
468 |
3011
|
469 bool read_only_error (const char *action); |
195
|
470 |
5397
|
471 void maybe_delete_def (void) |
|
472 { |
|
473 if (--definition->count <= 0) |
|
474 delete definition; |
|
475 } |
|
476 |
3011
|
477 // No copying! |
|
478 |
|
479 symbol_record (const symbol_record& s); |
195
|
480 |
8
|
481 symbol_record& operator = (const symbol_record& s); |
|
482 }; |
|
483 |
767
|
484 // A symbol table. |
200
|
485 |
|
486 #define SYMTAB_LOCAL_SCOPE 1 |
|
487 #define SYMTAB_GLOBAL_SCOPE 2 |
|
488 |
|
489 #define SYMTAB_ALL_SCOPES (SYMTAB_LOCAL_SCOPE | SYMTAB_GLOBAL_SCOPE) |
|
490 |
3011
|
491 #define SYMTAB_ALL_TYPES (symbol_record::USER_FUNCTION \ |
|
492 | symbol_record::USER_VARIABLE \ |
3325
|
493 | symbol_record::DLD_FUNCTION \ |
3011
|
494 | symbol_record::BUILTIN_FUNCTION \ |
4208
|
495 | symbol_record::COMMAND \ |
5102
|
496 | symbol_record::RAWCOMMAND \ |
5864
|
497 | symbol_record::MAPPER_FUNCTION \ |
|
498 | symbol_record::MEX_FUNCTION) |
200
|
499 |
5794
|
500 #define SYMTAB_VARIABLES (symbol_record::USER_VARIABLE) |
1412
|
501 |
8
|
502 class |
6109
|
503 OCTINTERP_API |
8
|
504 symbol_table |
|
505 { |
|
506 public: |
|
507 |
4238
|
508 symbol_table (unsigned int tab_size = 128, |
|
509 const std::string& nm = std::string ()) |
|
510 : table_size (tab_size), table (new symbol_record [table_size]), |
|
511 table_name (nm) |
4009
|
512 { |
|
513 assert ((tab_size % 2) == 0); |
4238
|
514 |
|
515 if (table_name.empty ()) |
|
516 { |
5765
|
517 std::ostringstream buf; |
|
518 buf << symtab_count++; |
|
519 table_name = buf.str (); |
4238
|
520 } |
4009
|
521 } |
3011
|
522 |
5013
|
523 ~symbol_table (void); |
8
|
524 |
3523
|
525 symbol_record *lookup (const std::string& nm, bool insert = false, |
2856
|
526 bool warn = false); |
8
|
527 |
3523
|
528 void rename (const std::string& old_name, const std::string& new_name); |
572
|
529 |
4009
|
530 void clear (void); |
|
531 |
|
532 void clear_variables (void); |
|
533 void clear_functions (void); |
6072
|
534 void clear_mex_functions (void); |
4009
|
535 void clear_globals (void); |
|
536 |
|
537 bool clear (const std::string& nm); |
|
538 |
|
539 bool clear_variable (const std::string& nm); |
|
540 bool clear_function (const std::string& nm); |
|
541 bool clear_global (const std::string& nm); |
|
542 |
|
543 bool clear_variable_pattern (const std::string& pat); |
|
544 bool clear_function_pattern (const std::string& pat); |
|
545 bool clear_global_pattern (const std::string& pat); |
8
|
546 |
164
|
547 int size (void) const; |
8
|
548 |
3013
|
549 Array<symbol_record *> |
4913
|
550 subsymbol_list (const string_vector& pats = string_vector (), |
|
551 unsigned int type = SYMTAB_ALL_TYPES, |
|
552 unsigned int scope = SYMTAB_ALL_SCOPES) const; |
|
553 |
|
554 Array<symbol_record *> |
3355
|
555 symbol_list (const string_vector& pats = string_vector (), |
3013
|
556 unsigned int type = SYMTAB_ALL_TYPES, |
|
557 unsigned int scope = SYMTAB_ALL_SCOPES) const; |
|
558 |
195
|
559 |
1755
|
560 string_vector |
3355
|
561 name_list (const string_vector& pats = string_vector (), |
3013
|
562 bool sort = false, unsigned int type = SYMTAB_ALL_TYPES, |
|
563 unsigned int scope = SYMTAB_ALL_SCOPES) const; |
605
|
564 |
4009
|
565 string_vector |
|
566 user_function_name_list (void) const |
|
567 { |
|
568 return name_list |
|
569 (string_vector (), false, |
5864
|
570 symbol_record::USER_FUNCTION|symbol_record::DLD_FUNCTION|symbol_record::MEX_FUNCTION, |
4009
|
571 SYMTAB_ALL_SCOPES); |
|
572 } |
|
573 |
|
574 string_vector |
|
575 global_variable_name_list (void) const |
|
576 { |
|
577 return name_list |
|
578 (string_vector (), false, SYMTAB_VARIABLES, SYMTAB_GLOBAL_SCOPE); |
|
579 } |
|
580 |
|
581 string_vector |
|
582 variable_name_list (void) const |
|
583 { |
|
584 return name_list |
|
585 (string_vector (), false, SYMTAB_VARIABLES, SYMTAB_LOCAL_SCOPE); |
|
586 } |
3011
|
587 |
|
588 int maybe_list (const char *header, const string_vector& argv, |
3523
|
589 std::ostream& os, bool show_verbose, |
3011
|
590 unsigned type, unsigned scope); |
|
591 |
3523
|
592 Array<symbol_record *> glob (const std::string& pat = std::string ("*"), |
3355
|
593 unsigned int type = SYMTAB_ALL_TYPES, |
|
594 unsigned int scope = SYMTAB_ALL_SCOPES) const; |
8
|
595 |
220
|
596 void push_context (void); |
3011
|
597 |
220
|
598 void pop_context (void); |
|
599 |
5861
|
600 // Create a new symbol table with the same entries. Only the symbol |
|
601 // names and some attributes are copied, not values. |
|
602 symbol_table *dup (void); |
|
603 |
|
604 // Inherit some values from the parent_sym_tab. |
|
605 void inherit (symbol_table *parent_sym_tab); |
|
606 |
3941
|
607 void print_info (std::ostream& os) const; |
3011
|
608 |
8
|
609 private: |
|
610 |
3011
|
611 unsigned int table_size; |
|
612 |
|
613 symbol_record *table; |
|
614 |
4238
|
615 std::string table_name; |
|
616 |
|
617 static unsigned long int symtab_count; |
|
618 |
4913
|
619 void |
|
620 print_descriptor (std::ostream& os, |
|
621 std::list<whos_parameter> params) const; |
|
622 |
|
623 std::list<whos_parameter> |
|
624 parse_whos_line_format (Array<symbol_record *>& symbols) const; |
|
625 |
3523
|
626 unsigned int hash (const std::string& s); |
8
|
627 |
3011
|
628 // No copying! |
8
|
629 |
3011
|
630 symbol_table (const symbol_table&); |
1962
|
631 |
3011
|
632 symbol_table& operator = (const symbol_table&); |
|
633 }; |
2790
|
634 |
4913
|
635 // Defines layout for the whos/who -long command. |
|
636 extern std::string Vwhos_line_format; |
|
637 |
8
|
638 #endif |
|
639 |
|
640 /* |
|
641 ;;; Local Variables: *** |
|
642 ;;; mode: C++ *** |
|
643 ;;; End: *** |
|
644 */ |