diff libinterp/corefcn/symtab.h @ 27594:e091e09d26f0

restore some symbol table functions for backward compatibility These functions were removed from the public interface before being deprecated. * interpreter.h, interpreter.cc (interpreter::top_level_variable_names): New function. * pt-eval.h, pt-eval.cc (tree_evaluator::top_level_variable_names): New function. * call-stack.h, call-stack.cc (call_stack::top_level_variable_names): New function. * symtab.h, symtab.cc (symbol_table::at_top_level, symbol_table::varval, symbol_table::global_varval, symbol_table::top_level_varval, symbol_table::global_variable_names, symbol_table::top_level_variable_names, symbol_table::variable_names, symbol_table::assign, symbol_table::clear_all, symbol_table::clear_global, symbol_table::clear_global_pattern, symbol_table::clear_symbol, symbol_table::clear_symbol_pattern, symbol_table::global_assign, symbol_table::top_level_assign): New functions.
author John W. Eaton <jwe@octave.org>
date Thu, 31 Oct 2019 00:51:45 -0400
parents 85233937b6b7
children b2b23c7d5a24
line wrap: on
line diff
--- a/libinterp/corefcn/symtab.h	Wed Oct 30 15:19:07 2019 -0700
+++ b/libinterp/corefcn/symtab.h	Thu Oct 31 00:51:45 2019 -0400
@@ -46,6 +46,8 @@
 
 namespace octave
 {
+  class interpreter;
+
   class OCTINTERP_API symbol_table
   {
   public:
@@ -177,6 +179,64 @@
 
     fcn_info * get_fcn_info (const std::string& name);
 
+    // The remaining functions are all provided for backward
+    // compatibility.  New code should use the functions provided by the
+    // interpreter class.
+
+    // OCTAVE_DEPRECATED (V, "use 'interpreter::at_top_level' instead")
+    bool at_top_level (void);
+
+    // OCTAVE_DEPRECATED (V, "use 'interpreter::varval' instead")
+    octave_value varval (const std::string& name) const;
+
+    // OCTAVE_DEPRECATED (V, "use 'interpreter::global_varval' instead")
+    octave_value global_varval (const std::string& name) const;
+
+    // OCTAVE_DEPRECATED (V, "use 'interpreter::top_level_varval' instead")
+    octave_value top_level_varval (const std::string& name) const;
+
+    // OCTAVE_DEPRECATED (V, "use 'interpreter::global_variable_names' instead")
+    std::list<std::string> global_variable_names (void);
+
+    // OCTAVE_DEPRECATED (V, "use 'interpreter::top_level_variable_names' instead")
+    std::list<std::string> top_level_variable_names (void);
+
+    // OCTAVE_DEPRECATED (V, "use 'interpreter::variable_names' instead")
+    std::list<std::string> variable_names (void);
+
+    // OCTAVE_DEPRECATED (V, "use 'interpreter::assign' instead")
+    void assign (const std::string& name, const octave_value& value = octave_value ());
+
+    // Note, FORCE_ADD no longer has any meaning.
+    // OCTAVE_DEPRECATED (V, "use 'interpreter::assign' instead")
+    void assign (const std::string& name, const octave_value& value, bool /*force_add*/)
+    {
+      assign (name, value);
+    }
+
+    // OCTAVE_DEPRECATED (V, "use 'interpreter::clear_all' instead")
+    void clear_all (bool force = false);
+
+    // OCTAVE_DEPRECATED (V, "use 'interpreter::clear_global' instead")
+    void clear_global (const std::string& name);
+
+    // OCTAVE_DEPRECATED (V, "use 'interpreter::clear_global_pattern' instead")
+    void clear_global_pattern (const std::string& pattern);
+
+    // OCTAVE_DEPRECATED (V, "use 'interpreter::clear_symbol' instead")
+    void clear_symbol (const std::string& name);
+
+    // OCTAVE_DEPRECATED (V, "use 'interpreter::clear_symbol_pattern' instead")
+    void clear_symbol_pattern (const std::string& pattern);
+
+    // OCTAVE_DEPRECATED (V, "use 'interpreter::global_assign' instead")
+    void global_assign (const std::string& name,
+                        const octave_value& value = octave_value ());
+
+    // OCTAVE_DEPRECATED (V, "use 'interpreter::top_level_assign' instead")
+    void top_level_assign (const std::string& name,
+                           const octave_value& value = octave_value ());
+
   private:
 
     interpreter& m_interpreter;