26 #if ! defined (octave_interpreter_h)
27 #define octave_interpreter_h 1
29 #include "octave-config.h"
101 void insert (
const std::string& file);
136 void initialize_history (
bool read_history_file =
false);
144 void initialize_load_path (
bool set_initial_path =
true);
156 void shutdown (
void);
160 return m_interactive;
170 m_read_site_files = flag;
175 m_read_init_files = flag;
185 m_inhibit_startup_message = flag;
190 return m_in_top_level_repl;
195 return m_initialized;
200 return m_display_info;
205 return m_environment;
215 return m_error_system;
220 return m_help_system;
225 return m_input_system;
230 return m_output_system;
235 return m_history_system;
240 return m_dynamic_loader;
250 return m_load_save_system;
260 return m_symbol_table;
267 symbol_scope require_current_scope (
const std::string& who)
const;
282 return m_cdef_manager;
287 return m_gtk_manager;
292 return m_event_manager;
297 return *m_gh_manager;
305 int chdir (
const std::string& dir);
307 void mlock (
bool skip_first =
false)
const;
308 void munlock (
bool skip_first =
false)
const;
309 bool mislocked (
bool skip_first =
false)
const;
313 void munlock (
const char *nm);
314 void munlock (
const std::string& nm);
316 bool mislocked (
const char *nm);
317 bool mislocked (
const std::string& nm);
319 std::string mfilename (
const std::string& opt =
"")
const;
322 int& parse_status,
int nargout);
328 int& parse_status,
int nargout);
333 const std::string& catch_code,
int nargout);
336 const std::string& try_code,
int nargout);
339 const std::string& try_code,
340 const std::string& catch_code,
int nargout);
373 void global_assign (
const std::string&
name,
378 void top_level_assign (
const std::string&
name,
381 bool is_variable (
const std::string&
name)
const;
383 bool is_local_variable (
const std::string&
name)
const;
387 void assign (
const std::string&
name,
390 void assignin (
const std::string&
context,
const std::string& varname,
394 const std::string&
context =
"",
395 bool verbose =
false,
bool require_file =
true);
397 bool at_top_level (
void)
const;
399 bool isglobal (
const std::string&
name)
const;
403 void clear_all (
bool force =
false);
405 void clear_objects (
void);
407 void clear_variable (
const std::string&
name);
409 void clear_variable_pattern (
const std::string& pattern);
411 void clear_variable_regexp (
const std::string& pattern);
413 void clear_variables (
void);
415 void clear_global_variable (
const std::string&
name);
417 void clear_global_variable_pattern (
const std::string& pattern);
419 void clear_global_variable_regexp (
const std::string& pattern);
421 void clear_global_variables (
void);
423 void clear_functions (
bool force =
false);
425 void clear_function (
const std::string&
name);
427 void clear_symbol (
const std::string&
name);
429 void clear_function_pattern (
const std::string& pat);
431 void clear_function_regexp (
const std::string& pat);
433 void clear_symbol_pattern (
const std::string& pat);
435 void clear_symbol_regexp (
const std::string& pat);
437 std::list<std::string> variable_names (
void);
439 std::list<std::string> top_level_variable_names (
void);
441 std::list<std::string> global_variable_names (
void);
443 std::list<std::string> user_function_names (
void);
445 std::list<std::string> autoloaded_functions (
void)
const;
449 void recover_from_exception (
void);
455 void quit (
int exit_status,
bool force =
false,
bool confirm =
true);
461 return m_executing_finish_script;
464 void add_atexit_fcn (
const std::string& fname);
466 bool remove_atexit_fcn (
const std::string& fname);
468 OCTAVE_DEPRECATED (6,
"use interpreter::add_atexit_fcn member function instead")
469 static
void add_atexit_function (const std::
string& fname);
471 OCTAVE_DEPRECATED (6, "use
interpreter::remove_atexit_fcn member function instead")
472 static
bool remove_atexit_function (const std::
string& fname);
488 void display_startup_message (
void)
const;
490 int execute_startup_files (
void);
492 int execute_eval_option_code (
void);
494 int execute_command_line_file (
void);
496 int main_loop (
void);
498 void execute_atexit_fcns (
void);
574 void maximum_braindamage (
void);
576 void execute_pkg_add (
const std::string& dir);
Provides threadsafe access to octave.
gtk_manager & get_gtk_manager(void)
history_system m_history_system
settings & get_settings(void)
child_list & get_child_list(void)
output_system & get_output_system(void)
bool m_inhibit_startup_message
environment m_environment
help_system m_help_system
input_system & get_input_system(void)
event_manager m_event_manager
bool in_top_level_repl(void) const
bool initialized(void) const
void inhibit_startup_message(bool flag)
void interactive(bool arg)
std::list< std::string > m_atexit_fcns
help_system & get_help_system(void)
void read_site_files(bool flag)
gh_manager & get_gh_manager(void)
void set_global_value(const std::string &name, const octave_value &value)
gtk_manager m_gtk_manager
environment & get_environment(void)
dynamic_loader m_dynamic_loader
void cancel_quit(bool flag)
load_path & get_load_path(void)
display_info m_display_info
load_save_system m_load_save_system
load_save_system & get_load_save_system(void)
application * m_app_context
bool m_history_initialized
gh_manager * m_gh_manager
bool m_executing_finish_script
stream_list m_stream_list
void read_init_files(bool flag)
cdef_manager & get_cdef_manager(void)
input_system m_input_system
tree_evaluator m_evaluator
type_info & get_type_info(void)
symbol_table m_symbol_table
display_info & get_display_info(void)
bool executing_finish_script(void) const
history_system & get_history_system(void)
cdef_manager m_cdef_manager
bool interactive(void) const
symbol_table & get_symbol_table(void)
static OCTAVE_THREAD_LOCAL interpreter * instance
output_system m_output_system
temporary_file_list m_tmp_files
bool m_load_path_initialized
error_system & get_error_system(void)
interpreter(const interpreter &)=delete
error_system m_error_system
url_handle_manager m_url_handle_manager
event_manager & get_event_manager(void)
dynamic_loader & get_dynamic_loader(void)
~temporary_file_list(void)
std::set< std::string > m_files
temporary_file_list & operator=(const temporary_file_list &)=delete
void insert(const std::string &file)
temporary_file_list(void)
temporary_file_list(const temporary_file_list &)=delete
static octave_idx_type find(octave_idx_type i, octave_idx_type *pp)
void mark_for_deletion(const std::string &file)
void cleanup_tmp_files(void)
OCTINTERP_API bool octave_interpreter_ready
OCTINTERP_API bool quit_allowed
OCTINTERP_API bool octave_initialized
static void initialize(void)
int chdir(const std::string &path_arg)
octave_value_list eval_string(const std::string &eval_str, bool silent, int &parse_status, int nargout)
static llvm::LLVMContext & context
octave_value_list feval(const char *name, const octave_value_list &args, int nargout)
Evaluate an Octave function (built-in or interpreted) and return the list of result values.
sys::time Vlast_chdir_time
void source_file(const std::string &file_name, const std::string &context, bool verbose, bool require_file)