GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
interpreter-private.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2017-2018 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software: you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <https://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if defined (HAVE_CONFIG_H)
24 # include "config.h"
25 #endif
26 
27 #include <string>
28 
29 #include "bp-table.h"
30 #include "call-stack.h"
31 #include "child-list.h"
32 #include "error.h"
33 #include "gtk-manager.h"
34 #include "help.h"
35 #include "interpreter-private.h"
36 #include "interpreter.h"
37 #include "load-path.h"
38 #include "ov-classdef.h"
39 #include "symtab.h"
40 
41 namespace octave
42 {
44  {
46 
47  if (! interp)
48  {
49  abort ();
50  error ("%s: interpreter context missing", who.c_str ());
51  }
52 
53  return *interp;
54  }
55 
57  {
58  interpreter& interp = __get_interpreter__ (who);
59 
60  return interp.get_dynamic_loader ();
61  }
62 
64  {
65  interpreter& interp = __get_interpreter__ (who);
66 
67  return interp.get_help_system ();
68  }
69 
71  {
72  interpreter& interp = __get_interpreter__ (who);
73 
74  return interp.get_load_path ();
75  }
76 
78  {
79  interpreter& interp = __get_interpreter__ (who);
80 
81  return interp.get_type_info ();
82  }
83 
85  {
86  interpreter& interp = __get_interpreter__ (who);
87 
88  return interp.get_symbol_table ();
89  }
90 
92  {
93  interpreter& interp = __get_interpreter__ (who);
94 
95  return interp.get_current_scope ();
96  }
97 
99  {
100  symbol_scope scope = __get_current_scope__ (who);
101 
102  if (! scope)
103  error ("%s: symbol table scope missing", who.c_str ());
104 
105  return scope;
106  }
107 
109  {
110  interpreter& interp = __get_interpreter__ (who);
111 
112  return interp.get_evaluator ();
113  }
114 
116  {
117  interpreter& interp = __get_interpreter__ (who);
118 
119  return interp.get_bp_table ();
120  }
121 
123  {
124  interpreter& interp = __get_interpreter__ (who);
125 
126  return interp.get_call_stack ();
127  }
128 
130  {
131  interpreter& interp = __get_interpreter__ (who);
132 
133  return interp.get_child_list ();
134  }
135 
137  {
138  interpreter& interp = __get_interpreter__ (who);
139 
140  return interp.get_cdef_manager ();
141  }
142 
144  {
145  interpreter& interp = __get_interpreter__ (who);
146 
147  return interp.get_gtk_manager ();
148  }
149 }
help_system & get_help_system(void)
Definition: interpreter.h:154
interpreter & __get_interpreter__(const std::string &who)
child_list & __get_child_list__(const std::string &who)
bp_table & get_bp_table(void)
Definition: interpreter.h:182
child_list & get_child_list(void)
Definition: interpreter.h:195
void error(const char *fmt,...)
Definition: error.cc:578
symbol_scope __get_current_scope__(const std::string &who)
cdef_manager & __get_cdef_manager__(const std::string &who)
tree_evaluator & get_evaluator(void)
type_info & get_type_info(void)
Definition: interpreter.h:174
static interpreter * the_interpreter(void)
Definition: interpreter.h:224
help_system & __get_help_system__(const std::string &who)
symbol_table & __get_symbol_table__(const std::string &who)
gtk_manager & get_gtk_manager(void)
Definition: interpreter.h:207
type_info & __get_type_info__(const std::string &who)
load_path & get_load_path(void)
Definition: interpreter.h:164
dynamic_loader & __get_dynamic_loader__(const std::string &who)
load_path & __get_load_path__(const std::string &who)
symbol_table & get_symbol_table(void)
Definition: interpreter.h:169
cdef_manager & get_cdef_manager(void)
Definition: interpreter.h:202
symbol_scope __require_current_scope__(const std::string &who)
bp_table & __get_bp_table__(const std::string &who)
call_stack & __get_call_stack__(const std::string &who)
call_stack & get_call_stack(void)
symbol_scope get_current_scope(void)
gtk_manager & __get_gtk_manager__(const std::string &who)
dynamic_loader & get_dynamic_loader(void)
Definition: interpreter.h:159
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:888
tree_evaluator & __get_evaluator__(const std::string &who)