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&); |
5685
|
51 |
|
52 // The next three are here temporarily... |
|
53 extern bool is_marked_as_rawcommand (const std::string& s); |
|
54 extern void mark_as_rawcommand (const std::string& s); |
|
55 extern void unmark_rawcommand (const std::string& s); |
|
56 |
5102
|
57 extern bool is_rawcommand_name (const std::string&); |
3523
|
58 extern bool is_mapper_function_name (const std::string&); |
|
59 extern bool is_builtin_function_name (const std::string&); |
|
60 extern bool is_globally_visible (const std::string&); |
593
|
61 |
2975
|
62 extern octave_function * |
3523
|
63 is_valid_function (const octave_value&, const std::string& = std::string (), |
3308
|
64 bool warn = false); |
593
|
65 |
2975
|
66 extern octave_function * |
3523
|
67 is_valid_function (const std::string&, const std::string& = std::string (), |
3308
|
68 bool warn = false); |
3178
|
69 |
|
70 extern octave_function * |
3523
|
71 extract_function (const octave_value& arg, const std::string& warn_for, |
|
72 const std::string& fname, const std::string& header, |
|
73 const std::string& trailer); |
2796
|
74 |
2921
|
75 extern string_vector |
3523
|
76 get_struct_elts (const std::string& text); |
2921
|
77 |
3020
|
78 extern string_vector |
3523
|
79 generate_struct_completions (const std::string& text, std::string& prefix, |
|
80 std::string& hint); |
3020
|
81 |
2921
|
82 extern bool |
3523
|
83 looks_like_struct (const std::string& text); |
2921
|
84 |
4319
|
85 extern int |
4930
|
86 symbol_exist (const std::string& name, const std::string& type = "any"); |
4319
|
87 |
4954
|
88 extern std::string |
|
89 unique_symbol_name (const std::string& basename); |
|
90 |
5663
|
91 extern bool |
|
92 fcn_out_of_date (octave_function *fcn, const std::string& ff, time_t tp); |
|
93 |
3020
|
94 extern bool lookup (symbol_record *s, bool exec_script = true); |
|
95 |
|
96 extern symbol_record * |
3523
|
97 lookup_by_name (const std::string& nm, bool exec_script = true); |
3020
|
98 |
4930
|
99 extern octave_value lookup_function (const std::string& nm); |
4342
|
100 |
4930
|
101 extern octave_value lookup_user_function (const std::string& nm); |
4700
|
102 |
4988
|
103 extern octave_value lookup_function_handle (const std::string& nm); |
|
104 |
5027
|
105 extern octave_value |
|
106 get_global_value (const std::string& nm, bool silent = false); |
3020
|
107 |
3523
|
108 extern void set_global_value (const std::string& nm, const octave_value& val); |
3020
|
109 |
3523
|
110 extern std::string builtin_string_variable (const std::string&); |
|
111 extern int builtin_real_scalar_variable (const std::string&, double&); |
|
112 extern octave_value builtin_any_variable (const std::string&); |
3020
|
113 |
|
114 extern void link_to_global_variable (symbol_record *sr); |
|
115 extern void link_to_builtin_or_function (symbol_record *sr); |
|
116 |
3523
|
117 extern void force_link_to_function (const std::string&); |
2921
|
118 |
2856
|
119 extern void bind_ans (const octave_value& val, bool print); |
1162
|
120 |
2892
|
121 extern void |
3523
|
122 bind_builtin_variable (const std::string&, const octave_value&, |
2892
|
123 bool protect = false, bool eternal = false, |
3005
|
124 symbol_record::change_function f = 0, |
3523
|
125 const std::string& help = std::string ()); |
1406
|
126 |
4319
|
127 extern void mlock (const std::string&); |
|
128 extern void munlock (const std::string&); |
|
129 extern bool mislocked (const std::string&); |
4016
|
130 |
4954
|
131 extern bool clear_function (const std::string& nm); |
4988
|
132 extern bool clear_variable (const std::string& nm); |
|
133 extern bool clear_symbol (const std::string& nm); |
4954
|
134 |
1
|
135 // Symbol table for symbols at the top level. |
|
136 extern symbol_table *top_level_sym_tab; |
|
137 |
|
138 // Symbol table for the current scope. |
|
139 extern symbol_table *curr_sym_tab; |
|
140 |
4245
|
141 // Symbol table for the current caller scope. |
|
142 extern symbol_table *curr_caller_sym_tab; |
|
143 |
1
|
144 // Symbol table for global symbols. |
|
145 extern symbol_table *global_sym_tab; |
|
146 |
4009
|
147 // Symbol table for functions and built-in symbols. |
|
148 extern symbol_table *fbi_sym_tab; |
|
149 |
1
|
150 #endif |
|
151 |
|
152 /* |
|
153 ;;; Local Variables: *** |
|
154 ;;; mode: C++ *** |
|
155 ;;; End: *** |
|
156 */ |