26 #if ! defined (octave_interpreter_h)
27 #define octave_interpreter_h 1
29 #include "octave-config.h"
103 void insert (
const std::string& file);
138 void initialize_history (
bool read_history_file =
false);
146 void initialize_load_path (
bool set_initial_path =
true);
155 void get_line_and_eval (
void);
161 void parse_and_execute (
const std::string&
input,
bool& incomplete_parse);
169 bool server_mode (
void)
const {
return m_evaluator.server_mode (); }
173 return m_interactive;
183 m_read_site_files = flag;
188 m_read_init_files = flag;
198 m_traditional = flag;
203 return m_traditional;
208 m_inhibit_startup_message = flag;
213 return m_evaluator.in_top_level_repl ();
218 return m_initialized;
223 m_interrupt_all_in_process_group = b;
228 return m_interrupt_all_in_process_group;
233 return m_app_context;
238 return m_display_info;
243 return m_environment;
253 return m_error_system;
260 return m_help_system;
265 return m_input_system;
270 return m_output_system;
275 return m_history_system;
280 return m_dynamic_loader;
290 return m_load_save_system;
300 return m_symbol_table;
305 symbol_scope require_current_scope (
const std::string& who)
const;
320 return m_cdef_manager;
325 return m_gtk_manager;
330 return m_event_manager;
335 return *m_gh_manager;
343 int chdir (
const std::string& dir);
345 void mlock (
bool skip_first =
false)
const;
346 void munlock (
bool skip_first =
false)
const;
347 bool mislocked (
bool skip_first =
false)
const;
351 void munlock (
const char *nm);
352 void munlock (
const std::string& nm);
354 bool mislocked (
const char *nm);
355 bool mislocked (
const std::string& nm);
357 std::string mfilename (
const std::string& opt =
"")
const;
360 int& parse_status,
int nargout);
362 octave_value eval_string (
const std::string& eval_str,
bool silent,
366 int& parse_status,
int nargout);
371 const std::string& catch_code,
int nargout);
374 const std::string& try_code,
int nargout);
377 const std::string& try_code,
378 const std::string& catch_code,
int nargout);
381 feval (
const char *name,
386 feval (
const std::string& name,
402 octave_value make_function_handle (
const std::string& name);
404 void install_variable (
const std::string& name,
const octave_value& value,
409 octave_value global_varval (
const std::string& name)
const;
411 void global_assign (
const std::string& name,
414 octave_value top_level_varval (
const std::string& name)
const;
416 void top_level_assign (
const std::string& name,
419 bool is_variable (
const std::string& name)
const;
421 bool is_local_variable (
const std::string& name)
const;
425 void assign (
const std::string& name,
428 void assignin (
const std::string& context,
const std::string& varname,
432 const std::string& context =
"",
433 bool verbose =
false,
bool require_file =
true);
435 bool at_top_level (
void)
const;
437 bool isglobal (
const std::string& name)
const;
441 void clear_all (
bool force =
false);
443 void clear_objects (
void);
445 void clear_variable (
const std::string& name);
447 void clear_variable_pattern (
const std::string& pattern);
449 void clear_variable_regexp (
const std::string& pattern);
451 void clear_variables (
void);
453 void clear_global_variable (
const std::string& name);
455 void clear_global_variable_pattern (
const std::string& pattern);
457 void clear_global_variable_regexp (
const std::string& pattern);
459 void clear_global_variables (
void);
461 void clear_functions (
bool force =
false);
463 void clear_function (
const std::string& name);
465 void clear_symbol (
const std::string& name);
467 void clear_function_pattern (
const std::string& pat);
469 void clear_function_regexp (
const std::string& pat);
471 void clear_symbol_pattern (
const std::string& pat);
473 void clear_symbol_regexp (
const std::string& pat);
475 std::list<std::string> variable_names (
void);
477 std::list<std::string> top_level_variable_names (
void);
479 std::list<std::string> global_variable_names (
void);
481 std::list<std::string> user_function_names (
void);
483 std::list<std::string> autoloaded_functions (
void)
const;
485 void interrupt (
void);
497 void add_debug_watch_expression (
const std::string& expr);
501 void remove_debug_watch_expression (
const std::string& expr);
505 void clear_debug_watch_expressions (
void);
509 std::set<std::string> debug_watch_expressions (
void)
const;
516 bool experimental_terminal_widget (
void)
const;
520 void recover_from_exception (
void);
522 void mark_for_deletion (
const std::string& file);
524 void cleanup_tmp_files (
void);
526 void quit (
int exit_status,
bool force =
false,
bool confirm =
true);
532 return m_executing_finish_script;
535 void add_atexit_fcn (
const std::string& fname);
537 bool remove_atexit_fcn (
const std::string& fname);
543 void display_startup_message (
void)
const;
545 int execute_startup_files (
void);
547 int execute_eval_option_code (
void);
549 int execute_command_line_file (
void);
551 int main_loop (
void);
553 int server_loop (
void);
555 void shutdown (
void);
557 void execute_atexit_fcns (
void);
559 void maximum_braindamage (
void);
561 void execute_pkg_add (
const std::string& dir);
Provides threadsafe access to octave.
output_system & get_output_system(void)
bool m_interrupt_all_in_process_group
url_handle_manager m_url_handle_manager
void interrupt_all_in_process_group(bool b)
stream_list m_stream_list
environment m_environment
event_manager & get_event_manager(void)
error_system m_error_system
type_info & get_type_info(void)
bool in_top_level_repl(void) const
history_system & get_history_system(void)
help_system m_help_system
application * get_app_context(void)
void read_site_files(bool flag)
event_manager m_event_manager
gh_manager & get_gh_manager(void)
dynamic_loader m_dynamic_loader
bool server_mode(void) const
display_info m_display_info
help_system & get_help_system(void)
error_system & get_error_system(void)
bool executing_finish_script(void) const
interpreter(const interpreter &)=delete
load_save_system m_load_save_system
void cancel_quit(bool flag)
child_list & get_child_list(void)
history_system m_history_system
gtk_manager m_gtk_manager
output_system m_output_system
bool traditional(void) const
symbol_table m_symbol_table
dynamic_loader & get_dynamic_loader(void)
static OCTAVE_THREAD_LOCAL interpreter * m_instance
bool m_executing_finish_script
void traditional(bool flag)
bool m_inhibit_startup_message
temporary_file_list m_tmp_files
environment & get_environment(void)
static interpreter * the_interpreter(void)
symbol_table & get_symbol_table(void)
bool initialized(void) const
settings & get_settings(void)
void interactive(bool arg)
bool interrupt_all_in_process_group(void) const
bool m_load_path_initialized
display_info & get_display_info(void)
void inhibit_startup_message(bool flag)
cdef_manager m_cdef_manager
bool m_history_initialized
void read_init_files(bool flag)
load_save_system & get_load_save_system(void)
void set_global_value(const std::string &name, const octave_value &value)
input_system m_input_system
cdef_manager & get_cdef_manager(void)
application * m_app_context
bool interactive(void) const
gh_manager * m_gh_manager
tree_evaluator m_evaluator
std::list< std::string > m_atexit_fcns
gtk_manager & get_gtk_manager(void)
input_system & get_input_system(void)
load_path & get_load_path(void)
void insert(const std::string &file)
temporary_file_list & operator=(const temporary_file_list &)=delete
std::set< std::string > m_files
~temporary_file_list(void)
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)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
OCTINTERP_API bool octave_interpreter_ready
sys::time Vlast_chdir_time
OCTINTERP_API bool quit_allowed
OCTINTERP_API bool octave_initialized
int chdir(const std::string &path_arg)
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.
void source_file(const std::string &file_name, const std::string &context, bool verbose, bool require_file)
static int input(yyscan_t yyscanner)
static void initialize(void)