Mercurial > octave
annotate libinterp/corefcn/interpreter.h @ 27408:9b19eec60931
move change directory function to interpreter class
* interpreter.h, interpreter.cc (interpreter::chdir,
Vlast_chdir_time): Move here from change_directory in dirfns.cc.
Change all uses.
* main-window.cc (main_window::set_current_working_directory):
Use interpreter function directly instead of going through DEFUN
function.
* dirfns.h: Delete. This file no longer declares any functions or
variables. Remove remaining include statements from other files.
* libinterp/corefcn/module.mk: Update.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 13 Sep 2019 16:22:34 -0400 |
parents | eddce82a57cc |
children | fd32c1a9b1bd |
rev | line source |
---|---|
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
1 /* |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
2 |
26376
00f796120a6d
maint: Update copyright dates in all source files.
John W. Eaton <jwe@octave.org>
parents:
26113
diff
changeset
|
3 Copyright (C) 2002-2019 John W. Eaton |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
4 |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
5 This file is part of Octave. |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
6 |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24361
diff
changeset
|
7 Octave is free software: you can redistribute it and/or modify it |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
8 under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24361
diff
changeset
|
9 the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
10 (at your option) any later version. |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
11 |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
13 WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
15 GNU General Public License for more details. |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
16 |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
18 along with Octave; see the file COPYING. If not, see |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24361
diff
changeset
|
19 <https://www.gnu.org/licenses/>. |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
20 |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
21 */ |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
22 |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
23 #if ! defined (octave_interpreter_h) |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
24 #define octave_interpreter_h 1 |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
26 #include "octave-config.h" |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
27 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
28 #include <map> |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
29 #include <string> |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 |
24734
5d8c4cbc56d7
don't use singleton pattern for child_list
John W. Eaton <jwe@octave.org>
parents:
24540
diff
changeset
|
31 #include "child-list.h" |
27408
9b19eec60931
move change directory function to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27321
diff
changeset
|
32 #include "oct-time.h" |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
33 #include "quit.h" |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
34 #include "str-vec.h" |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
35 |
26769
2f847e3e8d6b
split classdef into multiple smaller source files
John W. Eaton <jwe@octave.org>
parents:
26722
diff
changeset
|
36 #include "cdef-manager.h" |
27266
596312d4f25d
don't use singleton pattern for display_info class
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
37 #include "display.h" |
23627
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23615
diff
changeset
|
38 #include "dynamic-ld.h" |
23719
69a111259a2c
eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
23703
diff
changeset
|
39 #include "environment.h" |
27160
6b0c61a5a0f0
move global error configuration and status variables inside a class
John W. Eaton <jwe@octave.org>
parents:
27020
diff
changeset
|
40 #include "error.h" |
27263
99aa1bcb8848
rename octave_link and octave_link_events classes, move inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
27261
diff
changeset
|
41 #include "event-manager.h" |
27321
eddce82a57cc
don't use singleton pattern for gh_manager object
John W. Eaton <jwe@octave.org>
parents:
27266
diff
changeset
|
42 #include "graphics.h" |
23774
41795b504a8b
don't use singleton for gtk_manager
John W. Eaton <jwe@octave.org>
parents:
23753
diff
changeset
|
43 #include "gtk-manager.h" |
23721
b2d55b52ee51
new class to manage help system and associated variables
John W. Eaton <jwe@octave.org>
parents:
23719
diff
changeset
|
44 #include "help.h" |
25407
ab10403a0b50
new input_system class to manage user input for the interpreter
John W. Eaton <jwe@octave.org>
parents:
25392
diff
changeset
|
45 #include "input.h" |
23438
d24d01273bd0
eliminate load-path singleton
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
46 #include "load-path.h" |
25993
f75bb9d659e0
eliminate global and file-scope static variables from load-save.cc (bug #54571)
John W. Eaton <jwe@octave.org>
parents:
25460
diff
changeset
|
47 #include "load-save.h" |
25994
f881d3e271d2
eliminate global and file-scope static variables in oct-hist.cc
John W. Eaton <jwe@octave.org>
parents:
25993
diff
changeset
|
48 #include "oct-hist.h" |
23738
8acd390d16c9
don't use singleton for stream_list object
John W. Eaton <jwe@octave.org>
parents:
23723
diff
changeset
|
49 #include "oct-stream.h" |
24540
46440078d73b
don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents:
24538
diff
changeset
|
50 #include "ov-typeinfo.h" |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25407
diff
changeset
|
51 #include "pager.h" |
23630
8a47d4735655
avoid memory leak in interpreter
John W. Eaton <jwe@octave.org>
parents:
23627
diff
changeset
|
52 #include "pt-eval.h" |
25443
2fa7cd178c4a
new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
25440
diff
changeset
|
53 #include "settings.h" |
23599
5cb3a2bb5e1e
don't use singleton for symbol_table
John W. Eaton <jwe@octave.org>
parents:
23553
diff
changeset
|
54 #include "symtab.h" |
23742
1f0daaf81955
don't use singleton for ch_manager, rename to url_handle_manager
John W. Eaton <jwe@octave.org>
parents:
23738
diff
changeset
|
55 #include "url-handle-manager.h" |
23438
d24d01273bd0
eliminate load-path singleton
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
56 |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
57 extern OCTINTERP_API bool quit_allowed; |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
58 |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
59 // TRUE means we are ready to interpret commands, but not everything |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
60 // is ready for interactive use. |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
61 extern OCTINTERP_API bool octave_interpreter_ready; |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
62 |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
63 // TRUE means we've processed all the init code and we are good to go. |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
64 extern OCTINTERP_API bool octave_initialized; |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
65 |
27408
9b19eec60931
move change directory function to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27321
diff
changeset
|
66 #include "oct-time.h" |
9b19eec60931
move change directory function to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27321
diff
changeset
|
67 |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
68 namespace octave |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
69 { |
23753
c3828bd031cd
move profiler inside evaluator and inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23742
diff
changeset
|
70 class profiler; |
24734
5d8c4cbc56d7
don't use singleton pattern for child_list
John W. Eaton <jwe@octave.org>
parents:
24540
diff
changeset
|
71 class child_list; |
23127
5a91168a30be
avoid including parse tree headers in other header files unnecessarily
John W. Eaton <jwe@octave.org>
parents:
23117
diff
changeset
|
72 |
27408
9b19eec60931
move change directory function to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27321
diff
changeset
|
73 // The time we last time we changed directories. |
9b19eec60931
move change directory function to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27321
diff
changeset
|
74 extern sys::time Vlast_chdir_time; |
9b19eec60931
move change directory function to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27321
diff
changeset
|
75 |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
76 // The application object contains a pointer to the current |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
77 // interpreter and the interpreter contains a pointer back to the |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
78 // application context so we need a forward declaration for one (or |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
79 // both) of them... |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
80 |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
81 class application; |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
82 |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
83 class OCTINTERP_API interpreter |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
84 { |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
85 public: |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
86 |
23819
5d8ef9b859f8
defer execution of user code to interpreter::execute (bug #51631)
John W. Eaton <jwe@octave.org>
parents:
23774
diff
changeset
|
87 // Create an interpreter object and perform basic initialization. |
23117
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
88 |
23457
21baad6b35c4
maint: Use C++11 nullptr rather than 0 or NULL when possible.
Rik <rik@octave.org>
parents:
23438
diff
changeset
|
89 interpreter (application *app_context = nullptr); |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
90 |
22869
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
91 // No copying, at least not yet... |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
92 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
93 interpreter (const interpreter&) = delete; |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
94 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
95 interpreter& operator = (const interpreter&) = delete; |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
96 |
23117
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
97 // Clean up the interpreter object. |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
98 |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
22157
diff
changeset
|
99 ~interpreter (void); |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
100 |
23599
5cb3a2bb5e1e
don't use singleton for symbol_table
John W. Eaton <jwe@octave.org>
parents:
23553
diff
changeset
|
101 void intern_nargin (octave_idx_type nargs); |
5cb3a2bb5e1e
don't use singleton for symbol_table
John W. Eaton <jwe@octave.org>
parents:
23553
diff
changeset
|
102 |
23117
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
103 // If creating an embedded interpreter, you may inhibit reading |
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
104 // the command history file by calling initialize_history with |
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
105 // read_history_file = false prior to calling initialize. |
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
106 |
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
107 void initialize_history (bool read_history_file = false); |
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
108 |
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
109 // If creating an embedded interpreter, you may inhibit setting |
26699
775643b5eae4
maint: Fix typos in comments where "intial" instead of "initial" used.
Rik <rik@octave.org>
parents:
26661
diff
changeset
|
110 // the default compiled-in path by calling initialize_load_path |
23117
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
111 // with set_initial_path = false prior calling initialize. After |
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
112 // that, you can add directories to the load path to set up a |
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
113 // custom path. |
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
114 |
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
115 void initialize_load_path (bool set_initial_path = true); |
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
116 |
23819
5d8ef9b859f8
defer execution of user code to interpreter::execute (bug #51631)
John W. Eaton <jwe@octave.org>
parents:
23774
diff
changeset
|
117 // Load command line history, set the load path. |
23117
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
118 |
23819
5d8ef9b859f8
defer execution of user code to interpreter::execute (bug #51631)
John W. Eaton <jwe@octave.org>
parents:
23774
diff
changeset
|
119 void initialize (void); |
23117
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
120 |
23819
5d8ef9b859f8
defer execution of user code to interpreter::execute (bug #51631)
John W. Eaton <jwe@octave.org>
parents:
23774
diff
changeset
|
121 // Initialize the interpreter (if not already done by an explicit |
26699
775643b5eae4
maint: Fix typos in comments where "intial" instead of "initial" used.
Rik <rik@octave.org>
parents:
26661
diff
changeset
|
122 // call to initialize), execute startup files, --eval option code, |
23117
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
123 // script files, and/or interactive commands. |
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
124 |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
125 int execute (void); |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
126 |
23111
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
127 bool interactive (void) const |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
128 { |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
129 return m_interactive; |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
130 } |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
131 |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
132 void interactive (bool arg) |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
133 { |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
134 m_interactive = arg; |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
135 } |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
136 |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
137 void read_site_files (bool flag) |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
138 { |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
139 m_read_site_files = flag; |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
140 } |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
141 |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
142 void read_init_files (bool flag) |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
143 { |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
144 m_read_init_files = flag; |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
145 } |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
146 |
23111
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
147 void verbose (bool flag) |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
148 { |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
149 m_verbose = flag; |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
150 } |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
151 |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
152 void inhibit_startup_message (bool flag) |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
153 { |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
154 m_inhibit_startup_message = flag; |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
155 } |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
156 |
23117
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
157 bool initialized (void) const |
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
158 { |
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
159 return m_initialized; |
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
160 } |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
161 |
27266
596312d4f25d
don't use singleton pattern for display_info class
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
162 display_info& get_display_info (void) |
596312d4f25d
don't use singleton pattern for display_info class
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
163 { |
596312d4f25d
don't use singleton pattern for display_info class
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
164 return m_display_info; |
596312d4f25d
don't use singleton pattern for display_info class
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
165 } |
596312d4f25d
don't use singleton pattern for display_info class
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
166 |
23719
69a111259a2c
eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
23703
diff
changeset
|
167 environment& get_environment (void) |
69a111259a2c
eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
23703
diff
changeset
|
168 { |
69a111259a2c
eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
23703
diff
changeset
|
169 return m_environment; |
69a111259a2c
eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
23703
diff
changeset
|
170 } |
69a111259a2c
eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
23703
diff
changeset
|
171 |
25443
2fa7cd178c4a
new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
25440
diff
changeset
|
172 settings& get_settings (void) |
2fa7cd178c4a
new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
25440
diff
changeset
|
173 { |
2fa7cd178c4a
new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
25440
diff
changeset
|
174 return m_settings; |
2fa7cd178c4a
new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
25440
diff
changeset
|
175 } |
2fa7cd178c4a
new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
25440
diff
changeset
|
176 |
27160
6b0c61a5a0f0
move global error configuration and status variables inside a class
John W. Eaton <jwe@octave.org>
parents:
27020
diff
changeset
|
177 error_system& get_error_system (void) |
6b0c61a5a0f0
move global error configuration and status variables inside a class
John W. Eaton <jwe@octave.org>
parents:
27020
diff
changeset
|
178 { |
6b0c61a5a0f0
move global error configuration and status variables inside a class
John W. Eaton <jwe@octave.org>
parents:
27020
diff
changeset
|
179 return m_error_system; |
6b0c61a5a0f0
move global error configuration and status variables inside a class
John W. Eaton <jwe@octave.org>
parents:
27020
diff
changeset
|
180 } |
6b0c61a5a0f0
move global error configuration and status variables inside a class
John W. Eaton <jwe@octave.org>
parents:
27020
diff
changeset
|
181 |
23721
b2d55b52ee51
new class to manage help system and associated variables
John W. Eaton <jwe@octave.org>
parents:
23719
diff
changeset
|
182 help_system& get_help_system (void) |
b2d55b52ee51
new class to manage help system and associated variables
John W. Eaton <jwe@octave.org>
parents:
23719
diff
changeset
|
183 { |
b2d55b52ee51
new class to manage help system and associated variables
John W. Eaton <jwe@octave.org>
parents:
23719
diff
changeset
|
184 return m_help_system; |
b2d55b52ee51
new class to manage help system and associated variables
John W. Eaton <jwe@octave.org>
parents:
23719
diff
changeset
|
185 } |
b2d55b52ee51
new class to manage help system and associated variables
John W. Eaton <jwe@octave.org>
parents:
23719
diff
changeset
|
186 |
25407
ab10403a0b50
new input_system class to manage user input for the interpreter
John W. Eaton <jwe@octave.org>
parents:
25392
diff
changeset
|
187 input_system& get_input_system (void) |
ab10403a0b50
new input_system class to manage user input for the interpreter
John W. Eaton <jwe@octave.org>
parents:
25392
diff
changeset
|
188 { |
ab10403a0b50
new input_system class to manage user input for the interpreter
John W. Eaton <jwe@octave.org>
parents:
25392
diff
changeset
|
189 return m_input_system; |
ab10403a0b50
new input_system class to manage user input for the interpreter
John W. Eaton <jwe@octave.org>
parents:
25392
diff
changeset
|
190 } |
ab10403a0b50
new input_system class to manage user input for the interpreter
John W. Eaton <jwe@octave.org>
parents:
25392
diff
changeset
|
191 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25407
diff
changeset
|
192 output_system& get_output_system (void) |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25407
diff
changeset
|
193 { |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25407
diff
changeset
|
194 return m_output_system; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25407
diff
changeset
|
195 } |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25407
diff
changeset
|
196 |
25994
f881d3e271d2
eliminate global and file-scope static variables in oct-hist.cc
John W. Eaton <jwe@octave.org>
parents:
25993
diff
changeset
|
197 history_system& get_history_system (void) |
f881d3e271d2
eliminate global and file-scope static variables in oct-hist.cc
John W. Eaton <jwe@octave.org>
parents:
25993
diff
changeset
|
198 { |
f881d3e271d2
eliminate global and file-scope static variables in oct-hist.cc
John W. Eaton <jwe@octave.org>
parents:
25993
diff
changeset
|
199 return m_history_system; |
f881d3e271d2
eliminate global and file-scope static variables in oct-hist.cc
John W. Eaton <jwe@octave.org>
parents:
25993
diff
changeset
|
200 } |
f881d3e271d2
eliminate global and file-scope static variables in oct-hist.cc
John W. Eaton <jwe@octave.org>
parents:
25993
diff
changeset
|
201 |
23627
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23615
diff
changeset
|
202 dynamic_loader& get_dynamic_loader (void) |
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23615
diff
changeset
|
203 { |
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23615
diff
changeset
|
204 return m_dynamic_loader; |
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23615
diff
changeset
|
205 } |
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23615
diff
changeset
|
206 |
23438
d24d01273bd0
eliminate load-path singleton
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
207 load_path& get_load_path (void) |
d24d01273bd0
eliminate load-path singleton
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
208 { |
d24d01273bd0
eliminate load-path singleton
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
209 return m_load_path; |
d24d01273bd0
eliminate load-path singleton
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
210 } |
d24d01273bd0
eliminate load-path singleton
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
211 |
25993
f75bb9d659e0
eliminate global and file-scope static variables from load-save.cc (bug #54571)
John W. Eaton <jwe@octave.org>
parents:
25460
diff
changeset
|
212 load_save_system& get_load_save_system (void) |
f75bb9d659e0
eliminate global and file-scope static variables from load-save.cc (bug #54571)
John W. Eaton <jwe@octave.org>
parents:
25460
diff
changeset
|
213 { |
f75bb9d659e0
eliminate global and file-scope static variables from load-save.cc (bug #54571)
John W. Eaton <jwe@octave.org>
parents:
25460
diff
changeset
|
214 return m_load_save_system; |
f75bb9d659e0
eliminate global and file-scope static variables from load-save.cc (bug #54571)
John W. Eaton <jwe@octave.org>
parents:
25460
diff
changeset
|
215 } |
f75bb9d659e0
eliminate global and file-scope static variables from load-save.cc (bug #54571)
John W. Eaton <jwe@octave.org>
parents:
25460
diff
changeset
|
216 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
217 type_info& get_type_info (void) |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
218 { |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
219 return m_type_info; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
220 } |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
221 |
23599
5cb3a2bb5e1e
don't use singleton for symbol_table
John W. Eaton <jwe@octave.org>
parents:
23553
diff
changeset
|
222 symbol_table& get_symbol_table (void) |
5cb3a2bb5e1e
don't use singleton for symbol_table
John W. Eaton <jwe@octave.org>
parents:
23553
diff
changeset
|
223 { |
5cb3a2bb5e1e
don't use singleton for symbol_table
John W. Eaton <jwe@octave.org>
parents:
23553
diff
changeset
|
224 return m_symbol_table; |
5cb3a2bb5e1e
don't use singleton for symbol_table
John W. Eaton <jwe@octave.org>
parents:
23553
diff
changeset
|
225 } |
5cb3a2bb5e1e
don't use singleton for symbol_table
John W. Eaton <jwe@octave.org>
parents:
23553
diff
changeset
|
226 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
227 tree_evaluator& get_evaluator (void); |
23609
99989ab8f142
new convenience functions for accessing current scope
John W. Eaton <jwe@octave.org>
parents:
23599
diff
changeset
|
228 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
229 symbol_scope get_top_scope (void) const; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
230 symbol_scope get_current_scope (void) const; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
231 symbol_scope require_current_scope (const std::string& who) const; |
23753
c3828bd031cd
move profiler inside evaluator and inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23742
diff
changeset
|
232 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
233 profiler& get_profiler (void); |
23532
084245f9bd03
pass reference to evaluator to octave_function call methods
John W. Eaton <jwe@octave.org>
parents:
23511
diff
changeset
|
234 |
23738
8acd390d16c9
don't use singleton for stream_list object
John W. Eaton <jwe@octave.org>
parents:
23723
diff
changeset
|
235 stream_list& get_stream_list (void); |
8acd390d16c9
don't use singleton for stream_list object
John W. Eaton <jwe@octave.org>
parents:
23723
diff
changeset
|
236 |
24734
5d8c4cbc56d7
don't use singleton pattern for child_list
John W. Eaton <jwe@octave.org>
parents:
24540
diff
changeset
|
237 child_list& get_child_list (void) |
5d8c4cbc56d7
don't use singleton pattern for child_list
John W. Eaton <jwe@octave.org>
parents:
24540
diff
changeset
|
238 { |
5d8c4cbc56d7
don't use singleton pattern for child_list
John W. Eaton <jwe@octave.org>
parents:
24540
diff
changeset
|
239 return m_child_list; |
5d8c4cbc56d7
don't use singleton pattern for child_list
John W. Eaton <jwe@octave.org>
parents:
24540
diff
changeset
|
240 } |
5d8c4cbc56d7
don't use singleton pattern for child_list
John W. Eaton <jwe@octave.org>
parents:
24540
diff
changeset
|
241 |
23742
1f0daaf81955
don't use singleton for ch_manager, rename to url_handle_manager
John W. Eaton <jwe@octave.org>
parents:
23738
diff
changeset
|
242 url_handle_manager& get_url_handle_manager (void); |
1f0daaf81955
don't use singleton for ch_manager, rename to url_handle_manager
John W. Eaton <jwe@octave.org>
parents:
23738
diff
changeset
|
243 |
23651
5c6cceef132b
don't use singleton for cdef_manager object
John W. Eaton <jwe@octave.org>
parents:
23630
diff
changeset
|
244 cdef_manager& get_cdef_manager (void) |
5c6cceef132b
don't use singleton for cdef_manager object
John W. Eaton <jwe@octave.org>
parents:
23630
diff
changeset
|
245 { |
5c6cceef132b
don't use singleton for cdef_manager object
John W. Eaton <jwe@octave.org>
parents:
23630
diff
changeset
|
246 return m_cdef_manager; |
5c6cceef132b
don't use singleton for cdef_manager object
John W. Eaton <jwe@octave.org>
parents:
23630
diff
changeset
|
247 } |
5c6cceef132b
don't use singleton for cdef_manager object
John W. Eaton <jwe@octave.org>
parents:
23630
diff
changeset
|
248 |
23774
41795b504a8b
don't use singleton for gtk_manager
John W. Eaton <jwe@octave.org>
parents:
23753
diff
changeset
|
249 gtk_manager& get_gtk_manager (void) |
41795b504a8b
don't use singleton for gtk_manager
John W. Eaton <jwe@octave.org>
parents:
23753
diff
changeset
|
250 { |
41795b504a8b
don't use singleton for gtk_manager
John W. Eaton <jwe@octave.org>
parents:
23753
diff
changeset
|
251 return m_gtk_manager; |
41795b504a8b
don't use singleton for gtk_manager
John W. Eaton <jwe@octave.org>
parents:
23753
diff
changeset
|
252 } |
41795b504a8b
don't use singleton for gtk_manager
John W. Eaton <jwe@octave.org>
parents:
23753
diff
changeset
|
253 |
27263
99aa1bcb8848
rename octave_link and octave_link_events classes, move inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
27261
diff
changeset
|
254 event_manager& get_event_manager (void) |
27261
dccdc3b001a2
eliminate static functions from octave_link class
John W. Eaton <jwe@octave.org>
parents:
27214
diff
changeset
|
255 { |
27263
99aa1bcb8848
rename octave_link and octave_link_events classes, move inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
27261
diff
changeset
|
256 return m_event_manager; |
27261
dccdc3b001a2
eliminate static functions from octave_link class
John W. Eaton <jwe@octave.org>
parents:
27214
diff
changeset
|
257 } |
dccdc3b001a2
eliminate static functions from octave_link class
John W. Eaton <jwe@octave.org>
parents:
27214
diff
changeset
|
258 |
27321
eddce82a57cc
don't use singleton pattern for gh_manager object
John W. Eaton <jwe@octave.org>
parents:
27266
diff
changeset
|
259 gh_manager& get_gh_manager (void) |
eddce82a57cc
don't use singleton pattern for gh_manager object
John W. Eaton <jwe@octave.org>
parents:
27266
diff
changeset
|
260 { |
eddce82a57cc
don't use singleton pattern for gh_manager object
John W. Eaton <jwe@octave.org>
parents:
27266
diff
changeset
|
261 return *m_gh_manager; |
eddce82a57cc
don't use singleton pattern for gh_manager object
John W. Eaton <jwe@octave.org>
parents:
27266
diff
changeset
|
262 } |
eddce82a57cc
don't use singleton pattern for gh_manager object
John W. Eaton <jwe@octave.org>
parents:
27266
diff
changeset
|
263 |
27408
9b19eec60931
move change directory function to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27321
diff
changeset
|
264 // Any Octave code that needs to change the current directory should |
9b19eec60931
move change directory function to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27321
diff
changeset
|
265 // call this function instead of calling the system chdir function |
9b19eec60931
move change directory function to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27321
diff
changeset
|
266 // directly so that the load-path and GUI may be notified of the |
9b19eec60931
move change directory function to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27321
diff
changeset
|
267 // change. |
9b19eec60931
move change directory function to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27321
diff
changeset
|
268 |
9b19eec60931
move change directory function to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27321
diff
changeset
|
269 int chdir (const std::string& dir); |
9b19eec60931
move change directory function to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27321
diff
changeset
|
270 |
23703
6eb5f6199a5a
move mlock, munlock, and mislocked to interpreter class
John W. Eaton <jwe@octave.org>
parents:
23651
diff
changeset
|
271 void mlock (void); |
6eb5f6199a5a
move mlock, munlock, and mislocked to interpreter class
John W. Eaton <jwe@octave.org>
parents:
23651
diff
changeset
|
272 |
6eb5f6199a5a
move mlock, munlock, and mislocked to interpreter class
John W. Eaton <jwe@octave.org>
parents:
23651
diff
changeset
|
273 void munlock (const std::string& nm); |
6eb5f6199a5a
move mlock, munlock, and mislocked to interpreter class
John W. Eaton <jwe@octave.org>
parents:
23651
diff
changeset
|
274 |
6eb5f6199a5a
move mlock, munlock, and mislocked to interpreter class
John W. Eaton <jwe@octave.org>
parents:
23651
diff
changeset
|
275 bool mislocked (const std::string& nm); |
6eb5f6199a5a
move mlock, munlock, and mislocked to interpreter class
John W. Eaton <jwe@octave.org>
parents:
23651
diff
changeset
|
276 |
27015
4d9e1a832a55
move core of mfilename function to evaluator
John W. Eaton <jwe@octave.org>
parents:
27014
diff
changeset
|
277 std::string mfilename (const std::string& opt = "") const; |
4d9e1a832a55
move core of mfilename function to evaluator
John W. Eaton <jwe@octave.org>
parents:
27014
diff
changeset
|
278 |
26113
8a15f3bace49
move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents:
25994
diff
changeset
|
279 octave_value_list eval_string (const std::string& eval_str, bool silent, |
8a15f3bace49
move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents:
25994
diff
changeset
|
280 int& parse_status, int nargout); |
8a15f3bace49
move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents:
25994
diff
changeset
|
281 |
8a15f3bace49
move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents:
25994
diff
changeset
|
282 octave_value eval_string (const std::string& eval_str, bool silent, |
8a15f3bace49
move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents:
25994
diff
changeset
|
283 int& parse_status); |
8a15f3bace49
move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents:
25994
diff
changeset
|
284 |
8a15f3bace49
move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents:
25994
diff
changeset
|
285 octave_value_list eval_string (const octave_value& arg, bool silent, |
8a15f3bace49
move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents:
25994
diff
changeset
|
286 int& parse_status, int nargout); |
8a15f3bace49
move eval_string inside interpreter/evaluator class
John W. Eaton <jwe@octave.org>
parents:
25994
diff
changeset
|
287 |
27019
6cb675912f2b
move core of eval function to evaluator
John W. Eaton <jwe@octave.org>
parents:
27018
diff
changeset
|
288 octave_value_list eval (const std::string& try_code, int nargout); |
6cb675912f2b
move core of eval function to evaluator
John W. Eaton <jwe@octave.org>
parents:
27018
diff
changeset
|
289 |
6cb675912f2b
move core of eval function to evaluator
John W. Eaton <jwe@octave.org>
parents:
27018
diff
changeset
|
290 octave_value_list eval (const std::string& try_code, |
6cb675912f2b
move core of eval function to evaluator
John W. Eaton <jwe@octave.org>
parents:
27018
diff
changeset
|
291 const std::string& catch_code, int nargout); |
6cb675912f2b
move core of eval function to evaluator
John W. Eaton <jwe@octave.org>
parents:
27018
diff
changeset
|
292 |
27018
a20ead51515d
move core of evalin function to evaluator
John W. Eaton <jwe@octave.org>
parents:
27017
diff
changeset
|
293 octave_value_list evalin (const std::string& context, |
a20ead51515d
move core of evalin function to evaluator
John W. Eaton <jwe@octave.org>
parents:
27017
diff
changeset
|
294 const std::string& try_code, int nargout); |
a20ead51515d
move core of evalin function to evaluator
John W. Eaton <jwe@octave.org>
parents:
27017
diff
changeset
|
295 |
a20ead51515d
move core of evalin function to evaluator
John W. Eaton <jwe@octave.org>
parents:
27017
diff
changeset
|
296 octave_value_list evalin (const std::string& context, |
a20ead51515d
move core of evalin function to evaluator
John W. Eaton <jwe@octave.org>
parents:
27017
diff
changeset
|
297 const std::string& try_code, |
a20ead51515d
move core of evalin function to evaluator
John W. Eaton <jwe@octave.org>
parents:
27017
diff
changeset
|
298 const std::string& catch_code, int nargout); |
a20ead51515d
move core of evalin function to evaluator
John W. Eaton <jwe@octave.org>
parents:
27017
diff
changeset
|
299 |
27020
30e9204de313
move feval functions to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
300 octave_value_list |
30e9204de313
move feval functions to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
301 feval (const char *name, |
30e9204de313
move feval functions to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
302 const octave_value_list& args = octave_value_list (), |
30e9204de313
move feval functions to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
303 int nargout = 0); |
30e9204de313
move feval functions to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
304 |
30e9204de313
move feval functions to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
305 octave_value_list |
30e9204de313
move feval functions to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
306 feval (const std::string& name, |
30e9204de313
move feval functions to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
307 const octave_value_list& args = octave_value_list (), |
30e9204de313
move feval functions to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
308 int nargout = 0); |
30e9204de313
move feval functions to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
309 |
30e9204de313
move feval functions to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
310 octave_value_list |
30e9204de313
move feval functions to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
311 feval (octave_function *fcn, |
30e9204de313
move feval functions to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
312 const octave_value_list& args = octave_value_list (), |
30e9204de313
move feval functions to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
313 int nargout = 0); |
30e9204de313
move feval functions to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
314 |
30e9204de313
move feval functions to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
315 octave_value_list |
30e9204de313
move feval functions to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
316 feval (const octave_value& f_arg, |
30e9204de313
move feval functions to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
317 const octave_value_list& args = octave_value_list (), |
30e9204de313
move feval functions to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
318 int nargout = 0); |
30e9204de313
move feval functions to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
319 |
30e9204de313
move feval functions to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
320 octave_value_list feval (const octave_value_list& args, int nargout = 0); |
30e9204de313
move feval functions to interpreter class
John W. Eaton <jwe@octave.org>
parents:
27019
diff
changeset
|
321 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
322 void install_variable (const std::string& name, const octave_value& value, |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
323 bool global); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
324 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
325 void set_global_value (const std::string& name, const octave_value& value); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
326 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
327 octave_value global_varval (const std::string& name) const; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
328 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
329 void global_assign (const std::string& name, |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
330 const octave_value& val = octave_value ()); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
331 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
332 octave_value top_level_varval (const std::string& name) const; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
333 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
334 void top_level_assign (const std::string& name, |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
335 const octave_value& val = octave_value ()); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
336 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
337 bool is_variable (const std::string& name) const; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
338 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
339 bool is_local_variable (const std::string& name) const; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
340 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
341 octave_value varval (const std::string& name) const; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
342 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
343 void assign (const std::string& name, |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
344 const octave_value& val = octave_value ()); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
345 |
27017
24b7e6326e26
move parse_fcn_file to interpreter; source_file to evaluator
John W. Eaton <jwe@octave.org>
parents:
27016
diff
changeset
|
346 void assignin (const std::string& context, const std::string& varname, |
27014
daab1b311a98
move core of assignin function to evaluator
John W. Eaton <jwe@octave.org>
parents:
26769
diff
changeset
|
347 const octave_value& val = octave_value ()); |
daab1b311a98
move core of assignin function to evaluator
John W. Eaton <jwe@octave.org>
parents:
26769
diff
changeset
|
348 |
27017
24b7e6326e26
move parse_fcn_file to interpreter; source_file to evaluator
John W. Eaton <jwe@octave.org>
parents:
27016
diff
changeset
|
349 void source_file (const std::string& file_name, |
24b7e6326e26
move parse_fcn_file to interpreter; source_file to evaluator
John W. Eaton <jwe@octave.org>
parents:
27016
diff
changeset
|
350 const std::string& context = "", |
24b7e6326e26
move parse_fcn_file to interpreter; source_file to evaluator
John W. Eaton <jwe@octave.org>
parents:
27016
diff
changeset
|
351 bool verbose = false, bool require_file = true, |
24b7e6326e26
move parse_fcn_file to interpreter; source_file to evaluator
John W. Eaton <jwe@octave.org>
parents:
27016
diff
changeset
|
352 const std::string& warn_for = ""); |
24b7e6326e26
move parse_fcn_file to interpreter; source_file to evaluator
John W. Eaton <jwe@octave.org>
parents:
27016
diff
changeset
|
353 |
24b7e6326e26
move parse_fcn_file to interpreter; source_file to evaluator
John W. Eaton <jwe@octave.org>
parents:
27016
diff
changeset
|
354 octave_value parse_fcn_file (const std::string& full_file, |
24b7e6326e26
move parse_fcn_file to interpreter; source_file to evaluator
John W. Eaton <jwe@octave.org>
parents:
27016
diff
changeset
|
355 const std::string& file, |
24b7e6326e26
move parse_fcn_file to interpreter; source_file to evaluator
John W. Eaton <jwe@octave.org>
parents:
27016
diff
changeset
|
356 const std::string& dir_name, |
24b7e6326e26
move parse_fcn_file to interpreter; source_file to evaluator
John W. Eaton <jwe@octave.org>
parents:
27016
diff
changeset
|
357 const std::string& dispatch_type, |
24b7e6326e26
move parse_fcn_file to interpreter; source_file to evaluator
John W. Eaton <jwe@octave.org>
parents:
27016
diff
changeset
|
358 const std::string& package_name, |
24b7e6326e26
move parse_fcn_file to interpreter; source_file to evaluator
John W. Eaton <jwe@octave.org>
parents:
27016
diff
changeset
|
359 bool require_file, bool force_script, |
24b7e6326e26
move parse_fcn_file to interpreter; source_file to evaluator
John W. Eaton <jwe@octave.org>
parents:
27016
diff
changeset
|
360 bool autoload, bool relative_lookup, |
24b7e6326e26
move parse_fcn_file to interpreter; source_file to evaluator
John W. Eaton <jwe@octave.org>
parents:
27016
diff
changeset
|
361 const std::string& warn_for); |
24b7e6326e26
move parse_fcn_file to interpreter; source_file to evaluator
John W. Eaton <jwe@octave.org>
parents:
27016
diff
changeset
|
362 |
26661
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
363 bool at_top_level (void) const; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
364 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
365 bool isglobal (const std::string& name) const; |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
366 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
367 octave_value find (const std::string& name); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
368 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
369 void clear_all (bool force = false); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
370 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
371 void clear_objects (void); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
372 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
373 void clear_variable (const std::string& name); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
374 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
375 void clear_variable_pattern (const std::string& pattern); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
376 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
377 void clear_variable_regexp (const std::string& pattern); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
378 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
379 void clear_variables (void); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
380 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
381 void clear_global_variable (const std::string& name); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
382 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
383 void clear_global_variable_pattern (const std::string& pattern); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
384 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
385 void clear_global_variable_regexp (const std::string& pattern); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
386 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
387 void clear_global_variables (void); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
388 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
389 void clear_functions (bool force = false); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
390 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
391 void clear_function (const std::string& name); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
392 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
393 void clear_symbol (const std::string& name); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
394 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
395 void clear_function_pattern (const std::string& pat); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
396 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
397 void clear_function_regexp (const std::string& pat); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
398 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
399 void clear_symbol_pattern (const std::string& pat); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
400 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
401 void clear_symbol_regexp (const std::string& pat); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
402 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
403 std::list<std::string> global_variable_names (void); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
404 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
405 std::list<std::string> variable_names (void); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
406 |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
407 std::list<std::string> user_function_names (void); |
cf9e10ce3351
move variable values from symbol_record objects to stack_frame objects
John W. Eaton <jwe@octave.org>
parents:
26377
diff
changeset
|
408 |
27016
9b261300a001
move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents:
27015
diff
changeset
|
409 std::list<std::string> autoloaded_functions (void) const; |
9b261300a001
move file-scope static autoload map variable and functions to evaluator
John W. Eaton <jwe@octave.org>
parents:
27015
diff
changeset
|
410 |
23110
af48d8be62b3
move recover_from_exception and atexit functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23106
diff
changeset
|
411 static void recover_from_exception (void); |
af48d8be62b3
move recover_from_exception and atexit functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23106
diff
changeset
|
412 |
af48d8be62b3
move recover_from_exception and atexit functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23106
diff
changeset
|
413 static void add_atexit_function (const std::string& fname); |
af48d8be62b3
move recover_from_exception and atexit functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23106
diff
changeset
|
414 |
af48d8be62b3
move recover_from_exception and atexit functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23106
diff
changeset
|
415 static bool remove_atexit_function (const std::string& fname); |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
416 |
23511
232c8d69d934
manage interpreter instance in interpreter object
John W. Eaton <jwe@octave.org>
parents:
23457
diff
changeset
|
417 static interpreter * the_interpreter (void) { return instance; } |
232c8d69d934
manage interpreter instance in interpreter object
John W. Eaton <jwe@octave.org>
parents:
23457
diff
changeset
|
418 |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
419 private: |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
420 |
23511
232c8d69d934
manage interpreter instance in interpreter object
John W. Eaton <jwe@octave.org>
parents:
23457
diff
changeset
|
421 // The interpreter instance; Currently it is only possible to |
24538
2b273df71aa0
allow experimenting with thread_local storage
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
422 // have one, so OCTAVE_THREAD_LOCAL will normally be defined to be |
2b273df71aa0
allow experimenting with thread_local storage
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
423 // empty. Eventually we would like to allow multiple interpreters |
2b273df71aa0
allow experimenting with thread_local storage
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
424 // to be active at once, but they will still be limited to one per |
2b273df71aa0
allow experimenting with thread_local storage
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
425 // thread. When that is possible, OCTAVE_THREAD_LOCAL can be |
2b273df71aa0
allow experimenting with thread_local storage
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
426 // replaced by the C++ thread_local keyword. For now, use a macro |
2b273df71aa0
allow experimenting with thread_local storage
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
427 // to allow experimenting with thread_local storage. |
2b273df71aa0
allow experimenting with thread_local storage
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
428 |
2b273df71aa0
allow experimenting with thread_local storage
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
429 OCTAVE_THREAD_LOCAL static interpreter *instance; |
23511
232c8d69d934
manage interpreter instance in interpreter object
John W. Eaton <jwe@octave.org>
parents:
23457
diff
changeset
|
430 |
23110
af48d8be62b3
move recover_from_exception and atexit functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23106
diff
changeset
|
431 static std::list<std::string> atexit_functions; |
af48d8be62b3
move recover_from_exception and atexit functions inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23106
diff
changeset
|
432 |
23102
373771419d51
refactor interpreter::execute
John W. Eaton <jwe@octave.org>
parents:
23092
diff
changeset
|
433 void display_startup_message (void) const; |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
434 |
26722
f51e8a7c33f4
run Matlab user files from interpreter, not startup scripts (bug #55681)
Mike Miller <mtmiller@octave.org>
parents:
26699
diff
changeset
|
435 int execute_startup_files (void); |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
436 |
23102
373771419d51
refactor interpreter::execute
John W. Eaton <jwe@octave.org>
parents:
23092
diff
changeset
|
437 int execute_eval_option_code (void); |
373771419d51
refactor interpreter::execute
John W. Eaton <jwe@octave.org>
parents:
23092
diff
changeset
|
438 |
373771419d51
refactor interpreter::execute
John W. Eaton <jwe@octave.org>
parents:
23092
diff
changeset
|
439 int execute_command_line_file (void); |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
440 |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
441 int main_loop (void); |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
442 |
23087
9f406f0b36da
rework clean_up_and_exit (bug #50068)
John W. Eaton <jwe@octave.org>
parents:
23084
diff
changeset
|
443 void cleanup (void); |
22157
c5842206aaea
maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents:
22094
diff
changeset
|
444 |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
445 application *m_app_context; |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
446 |
27266
596312d4f25d
don't use singleton pattern for display_info class
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
447 display_info m_display_info; |
596312d4f25d
don't use singleton pattern for display_info class
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
448 |
23719
69a111259a2c
eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
23703
diff
changeset
|
449 environment m_environment; |
69a111259a2c
eliminate some global variables
John W. Eaton <jwe@octave.org>
parents:
23703
diff
changeset
|
450 |
25443
2fa7cd178c4a
new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
25440
diff
changeset
|
451 settings m_settings; |
2fa7cd178c4a
new class for miscellaneous interpreter settings
John W. Eaton <jwe@octave.org>
parents:
25440
diff
changeset
|
452 |
27160
6b0c61a5a0f0
move global error configuration and status variables inside a class
John W. Eaton <jwe@octave.org>
parents:
27020
diff
changeset
|
453 error_system m_error_system; |
6b0c61a5a0f0
move global error configuration and status variables inside a class
John W. Eaton <jwe@octave.org>
parents:
27020
diff
changeset
|
454 |
23721
b2d55b52ee51
new class to manage help system and associated variables
John W. Eaton <jwe@octave.org>
parents:
23719
diff
changeset
|
455 help_system m_help_system; |
b2d55b52ee51
new class to manage help system and associated variables
John W. Eaton <jwe@octave.org>
parents:
23719
diff
changeset
|
456 |
25407
ab10403a0b50
new input_system class to manage user input for the interpreter
John W. Eaton <jwe@octave.org>
parents:
25392
diff
changeset
|
457 input_system m_input_system; |
ab10403a0b50
new input_system class to manage user input for the interpreter
John W. Eaton <jwe@octave.org>
parents:
25392
diff
changeset
|
458 |
25435
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25407
diff
changeset
|
459 output_system m_output_system; |
a52e6fb674b1
eliminate some singletons and static & global variables
John W. Eaton <jwe@octave.org>
parents:
25407
diff
changeset
|
460 |
25994
f881d3e271d2
eliminate global and file-scope static variables in oct-hist.cc
John W. Eaton <jwe@octave.org>
parents:
25993
diff
changeset
|
461 history_system m_history_system; |
f881d3e271d2
eliminate global and file-scope static variables in oct-hist.cc
John W. Eaton <jwe@octave.org>
parents:
25993
diff
changeset
|
462 |
23627
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23615
diff
changeset
|
463 dynamic_loader m_dynamic_loader; |
0a6e87804cab
don't use singleton pattern for dynamic_loader class
John W. Eaton <jwe@octave.org>
parents:
23615
diff
changeset
|
464 |
23599
5cb3a2bb5e1e
don't use singleton for symbol_table
John W. Eaton <jwe@octave.org>
parents:
23553
diff
changeset
|
465 load_path m_load_path; |
22196
dd992fd74fce
put parser, lexer, and evaluator in namespace; interpreter now owns evaluator
John W. Eaton <jwe@octave.org>
parents:
22157
diff
changeset
|
466 |
25993
f75bb9d659e0
eliminate global and file-scope static variables from load-save.cc (bug #54571)
John W. Eaton <jwe@octave.org>
parents:
25460
diff
changeset
|
467 load_save_system m_load_save_system; |
f75bb9d659e0
eliminate global and file-scope static variables from load-save.cc (bug #54571)
John W. Eaton <jwe@octave.org>
parents:
25460
diff
changeset
|
468 |
24540
46440078d73b
don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents:
24538
diff
changeset
|
469 type_info m_type_info; |
46440078d73b
don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents:
24538
diff
changeset
|
470 |
23599
5cb3a2bb5e1e
don't use singleton for symbol_table
John W. Eaton <jwe@octave.org>
parents:
23553
diff
changeset
|
471 symbol_table m_symbol_table; |
5cb3a2bb5e1e
don't use singleton for symbol_table
John W. Eaton <jwe@octave.org>
parents:
23553
diff
changeset
|
472 |
23630
8a47d4735655
avoid memory leak in interpreter
John W. Eaton <jwe@octave.org>
parents:
23627
diff
changeset
|
473 tree_evaluator m_evaluator; |
23438
d24d01273bd0
eliminate load-path singleton
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
474 |
23738
8acd390d16c9
don't use singleton for stream_list object
John W. Eaton <jwe@octave.org>
parents:
23723
diff
changeset
|
475 stream_list m_stream_list; |
8acd390d16c9
don't use singleton for stream_list object
John W. Eaton <jwe@octave.org>
parents:
23723
diff
changeset
|
476 |
24734
5d8c4cbc56d7
don't use singleton pattern for child_list
John W. Eaton <jwe@octave.org>
parents:
24540
diff
changeset
|
477 child_list m_child_list; |
5d8c4cbc56d7
don't use singleton pattern for child_list
John W. Eaton <jwe@octave.org>
parents:
24540
diff
changeset
|
478 |
23742
1f0daaf81955
don't use singleton for ch_manager, rename to url_handle_manager
John W. Eaton <jwe@octave.org>
parents:
23738
diff
changeset
|
479 url_handle_manager m_url_handle_manager; |
1f0daaf81955
don't use singleton for ch_manager, rename to url_handle_manager
John W. Eaton <jwe@octave.org>
parents:
23738
diff
changeset
|
480 |
23651
5c6cceef132b
don't use singleton for cdef_manager object
John W. Eaton <jwe@octave.org>
parents:
23630
diff
changeset
|
481 cdef_manager m_cdef_manager; |
5c6cceef132b
don't use singleton for cdef_manager object
John W. Eaton <jwe@octave.org>
parents:
23630
diff
changeset
|
482 |
23774
41795b504a8b
don't use singleton for gtk_manager
John W. Eaton <jwe@octave.org>
parents:
23753
diff
changeset
|
483 gtk_manager m_gtk_manager; |
41795b504a8b
don't use singleton for gtk_manager
John W. Eaton <jwe@octave.org>
parents:
23753
diff
changeset
|
484 |
27263
99aa1bcb8848
rename octave_link and octave_link_events classes, move inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
27261
diff
changeset
|
485 event_manager m_event_manager; |
27261
dccdc3b001a2
eliminate static functions from octave_link class
John W. Eaton <jwe@octave.org>
parents:
27214
diff
changeset
|
486 |
27321
eddce82a57cc
don't use singleton pattern for gh_manager object
John W. Eaton <jwe@octave.org>
parents:
27266
diff
changeset
|
487 gh_manager *m_gh_manager; |
eddce82a57cc
don't use singleton pattern for gh_manager object
John W. Eaton <jwe@octave.org>
parents:
27266
diff
changeset
|
488 |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
489 // TRUE means this is an interactive interpreter (forced or not). |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
490 bool m_interactive; |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
491 |
23111
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
492 bool m_read_site_files; |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
493 |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
494 bool m_read_init_files; |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
495 |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
496 bool m_verbose; |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
497 |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
498 bool m_inhibit_startup_message; |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
499 |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
500 bool m_load_path_initialized; |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
501 |
252975fdc444
more refactoring of interpreter and application classes
John W. Eaton <jwe@octave.org>
parents:
23110
diff
changeset
|
502 bool m_history_initialized; |
23117
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
503 |
17a3567a7b01
separate final interpreter initialization from execution
John W. Eaton <jwe@octave.org>
parents:
23111
diff
changeset
|
504 bool m_initialized; |
23723
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
505 |
ab8831d346c1
revamp echo command and move related variables inside tree_evaluator class
John W. Eaton <jwe@octave.org>
parents:
23721
diff
changeset
|
506 void maximum_braindamage (void); |
25345
ce6f7a5cd68e
avoid global access of load path in interpreter class
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
507 |
ce6f7a5cd68e
avoid global access of load path in interpreter class
John W. Eaton <jwe@octave.org>
parents:
25054
diff
changeset
|
508 void execute_pkg_add (const std::string& dir); |
22094
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
509 }; |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
510 } |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
511 |
9203833cab7d
move new interpreter class to separate file
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
512 #endif |