1
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
1
|
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 the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 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, write to the Free |
5307
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
1
|
21 |
|
22 */ |
|
23 |
383
|
24 #if !defined (octave_variables_h) |
|
25 #define octave_variables_h 1 |
1
|
26 |
2975
|
27 class octave_function; |
4700
|
28 class octave_user_function; |
1
|
29 class symbol_record; |
|
30 class symbol_table; |
1738
|
31 |
2390
|
32 class tree_identifier; |
2086
|
33 class octave_value; |
|
34 class octave_value_list; |
2892
|
35 class octave_builtin; |
|
36 class octave_mapper; |
1755
|
37 class string_vector; |
|
38 |
|
39 #include <string> |
1
|
40 |
2390
|
41 #include "ov.h" |
2975
|
42 #include "ov-builtin.h" |
2953
|
43 #include "symtab.h" |
195
|
44 |
4700
|
45 extern bool at_top_level (void); |
|
46 |
195
|
47 extern void initialize_symbol_tables (void); |
|
48 |
3523
|
49 extern bool is_builtin_variable (const std::string&); |
4208
|
50 extern bool is_command_name (const std::string&); |
5102
|
51 extern bool is_rawcommand_name (const std::string&); |
3523
|
52 extern bool is_mapper_function_name (const std::string&); |
|
53 extern bool is_builtin_function_name (const std::string&); |
|
54 extern bool is_globally_visible (const std::string&); |
593
|
55 |
2975
|
56 extern octave_function * |
3523
|
57 is_valid_function (const octave_value&, const std::string& = std::string (), |
3308
|
58 bool warn = false); |
593
|
59 |
2975
|
60 extern octave_function * |
3523
|
61 is_valid_function (const std::string&, const std::string& = std::string (), |
3308
|
62 bool warn = false); |
3178
|
63 |
|
64 extern octave_function * |
3523
|
65 extract_function (const octave_value& arg, const std::string& warn_for, |
|
66 const std::string& fname, const std::string& header, |
|
67 const std::string& trailer); |
2796
|
68 |
2921
|
69 extern string_vector |
3523
|
70 get_struct_elts (const std::string& text); |
2921
|
71 |
3020
|
72 extern string_vector |
3523
|
73 generate_struct_completions (const std::string& text, std::string& prefix, |
|
74 std::string& hint); |
3020
|
75 |
2921
|
76 extern bool |
3523
|
77 looks_like_struct (const std::string& text); |
2921
|
78 |
4319
|
79 extern int |
4930
|
80 symbol_exist (const std::string& name, const std::string& type = "any"); |
4319
|
81 |
4954
|
82 extern std::string |
|
83 unique_symbol_name (const std::string& basename); |
|
84 |
5663
|
85 extern bool |
|
86 fcn_out_of_date (octave_function *fcn, const std::string& ff, time_t tp); |
|
87 |
3020
|
88 extern bool lookup (symbol_record *s, bool exec_script = true); |
|
89 |
|
90 extern symbol_record * |
3523
|
91 lookup_by_name (const std::string& nm, bool exec_script = true); |
3020
|
92 |
4930
|
93 extern octave_value lookup_function (const std::string& nm); |
4342
|
94 |
4930
|
95 extern octave_value lookup_user_function (const std::string& nm); |
4700
|
96 |
4988
|
97 extern octave_value lookup_function_handle (const std::string& nm); |
|
98 |
5027
|
99 extern octave_value |
|
100 get_global_value (const std::string& nm, bool silent = false); |
3020
|
101 |
3523
|
102 extern void set_global_value (const std::string& nm, const octave_value& val); |
3020
|
103 |
3523
|
104 extern std::string builtin_string_variable (const std::string&); |
|
105 extern int builtin_real_scalar_variable (const std::string&, double&); |
|
106 extern octave_value builtin_any_variable (const std::string&); |
3020
|
107 |
|
108 extern void link_to_global_variable (symbol_record *sr); |
|
109 extern void link_to_builtin_or_function (symbol_record *sr); |
|
110 |
3523
|
111 extern void force_link_to_function (const std::string&); |
2921
|
112 |
2856
|
113 extern void bind_ans (const octave_value& val, bool print); |
1162
|
114 |
2892
|
115 extern void |
3523
|
116 bind_builtin_constant (const std::string&, const octave_value&, |
3259
|
117 bool protect = false, bool eternal = false, |
3523
|
118 const std::string& help = std::string ()); |
3259
|
119 |
|
120 extern void |
3523
|
121 bind_builtin_variable (const std::string&, const octave_value&, |
2892
|
122 bool protect = false, bool eternal = false, |
3005
|
123 symbol_record::change_function f = 0, |
3523
|
124 const std::string& help = std::string ()); |
1406
|
125 |
4319
|
126 extern void mlock (const std::string&); |
|
127 extern void munlock (const std::string&); |
|
128 extern bool mislocked (const std::string&); |
4016
|
129 |
4954
|
130 extern bool clear_function (const std::string& nm); |
4988
|
131 extern bool clear_variable (const std::string& nm); |
|
132 extern bool clear_symbol (const std::string& nm); |
4954
|
133 |
1
|
134 // Symbol table for symbols at the top level. |
|
135 extern symbol_table *top_level_sym_tab; |
|
136 |
|
137 // Symbol table for the current scope. |
|
138 extern symbol_table *curr_sym_tab; |
|
139 |
4245
|
140 // Symbol table for the current caller scope. |
|
141 extern symbol_table *curr_caller_sym_tab; |
|
142 |
1
|
143 // Symbol table for global symbols. |
|
144 extern symbol_table *global_sym_tab; |
|
145 |
4009
|
146 // Symbol table for functions and built-in symbols. |
|
147 extern symbol_table *fbi_sym_tab; |
|
148 |
1
|
149 #endif |
|
150 |
|
151 /* |
|
152 ;;; Local Variables: *** |
|
153 ;;; mode: C++ *** |
|
154 ;;; End: *** |
|
155 */ |