diff src/symtab.h @ 5861:2a6cb4ed8f1e

[project @ 2006-06-16 05:09:41 by jwe]
author jwe
date Fri, 16 Jun 2006 05:09:42 +0000
parents 080c08b192d8
children e884ab4f29ee
line wrap: on
line diff
--- a/src/symtab.h	Fri Jun 16 05:01:39 2006 +0000
+++ b/src/symtab.h	Fri Jun 16 05:09:42 2006 +0000
@@ -256,19 +256,19 @@
   typedef int (*change_function) (void);
 
   symbol_record (void)
-    : formal_param (false), linked_to_global (false),
-      tagged_static (false), can_hide_function (true),
-      visible (true), nm (), chg_fcn (0),
+    : formal_param (false), automatic_variable (false),
+      linked_to_global (false), tagged_static (false),
+      can_hide_function (true), visible (true), nm (), chg_fcn (0),
       definition (new symbol_def ()), next_elem (0) { }
 
   // FIXME -- kluge alert!  We obviously need a better way of
   // handling allow_shadow!
 
   symbol_record (const std::string& n, symbol_record *nxt)
-    : formal_param (false), linked_to_global (false),
-      tagged_static (false), can_hide_function (n != "__end__"),
-      visible (true), nm (n), chg_fcn (0),
-      definition (new symbol_def ()), next_elem (nxt) { }
+    : formal_param (false), automatic_variable (false),
+      linked_to_global (false), tagged_static (false),
+      can_hide_function (n != "__end__"), visible (true), nm (n),
+      chg_fcn (0), definition (new symbol_def ()), next_elem (nxt) { }
 
   ~symbol_record (void)
     {
@@ -359,6 +359,9 @@
   void mark_as_formal_parameter (void);
   bool is_formal_parameter (void) const { return formal_param; }
 
+  void mark_as_automatic_variable (void);
+  bool is_automatic_variable (void) const { return automatic_variable; }
+
   void mark_as_linked_to_global (void);
   bool is_linked_to_global (void) const { return linked_to_global; }
 
@@ -433,6 +436,7 @@
 private:
 
   unsigned int formal_param : 1;
+  unsigned int automatic_variable : 1;
   unsigned int linked_to_global : 1;
   unsigned int tagged_static : 1;
   unsigned int can_hide_function : 1;
@@ -581,6 +585,13 @@
 
   void pop_context (void);
 
+  // Create a new symbol table with the same entries.  Only the symbol
+  // names and some attributes are copied, not values.
+  symbol_table *dup (void);
+
+  // Inherit some values from the parent_sym_tab.
+  void inherit (symbol_table *parent_sym_tab);
+
   void print_info (std::ostream& os) const;
 
 private: