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 |
1315
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
1
|
20 |
|
21 */ |
|
22 |
383
|
23 #if !defined (octave_variables_h) |
|
24 #define octave_variables_h 1 |
1
|
25 |
2975
|
26 class octave_function; |
4700
|
27 class octave_user_function; |
1
|
28 class symbol_record; |
|
29 class symbol_table; |
1738
|
30 |
2390
|
31 class tree_identifier; |
2086
|
32 class octave_value; |
|
33 class octave_value_list; |
2892
|
34 class octave_builtin; |
|
35 class octave_mapper; |
1755
|
36 class string_vector; |
|
37 |
|
38 #include <string> |
1
|
39 |
2390
|
40 #include "ov.h" |
2975
|
41 #include "ov-builtin.h" |
2953
|
42 #include "symtab.h" |
195
|
43 |
4700
|
44 extern bool at_top_level (void); |
|
45 |
195
|
46 extern void initialize_symbol_tables (void); |
|
47 |
3523
|
48 extern bool is_builtin_variable (const std::string&); |
4208
|
49 extern bool is_command_name (const std::string&); |
3523
|
50 extern bool is_mapper_function_name (const std::string&); |
|
51 extern bool is_builtin_function_name (const std::string&); |
|
52 extern bool is_globally_visible (const std::string&); |
593
|
53 |
2975
|
54 extern octave_function * |
3523
|
55 is_valid_function (const octave_value&, const std::string& = std::string (), |
3308
|
56 bool warn = false); |
593
|
57 |
2975
|
58 extern octave_function * |
3523
|
59 is_valid_function (const std::string&, const std::string& = std::string (), |
3308
|
60 bool warn = false); |
3178
|
61 |
|
62 extern octave_function * |
3523
|
63 extract_function (const octave_value& arg, const std::string& warn_for, |
|
64 const std::string& fname, const std::string& header, |
|
65 const std::string& trailer); |
2796
|
66 |
2921
|
67 extern string_vector |
3523
|
68 get_struct_elts (const std::string& text); |
2921
|
69 |
3020
|
70 extern string_vector |
3523
|
71 generate_struct_completions (const std::string& text, std::string& prefix, |
|
72 std::string& hint); |
3020
|
73 |
2921
|
74 extern bool |
3523
|
75 looks_like_struct (const std::string& text); |
2921
|
76 |
4319
|
77 extern int |
4930
|
78 symbol_exist (const std::string& name, const std::string& type = "any"); |
4319
|
79 |
4954
|
80 extern std::string |
|
81 unique_symbol_name (const std::string& basename); |
|
82 |
3020
|
83 extern bool lookup (symbol_record *s, bool exec_script = true); |
|
84 |
|
85 extern symbol_record * |
3523
|
86 lookup_by_name (const std::string& nm, bool exec_script = true); |
3020
|
87 |
4930
|
88 extern octave_value lookup_function (const std::string& nm); |
4342
|
89 |
4930
|
90 extern octave_value lookup_user_function (const std::string& nm); |
4700
|
91 |
4988
|
92 extern octave_value lookup_function_handle (const std::string& nm); |
|
93 |
5027
|
94 extern octave_value |
|
95 get_global_value (const std::string& nm, bool silent = false); |
3020
|
96 |
3523
|
97 extern void set_global_value (const std::string& nm, const octave_value& val); |
3020
|
98 |
3523
|
99 extern std::string builtin_string_variable (const std::string&); |
|
100 extern int builtin_real_scalar_variable (const std::string&, double&); |
|
101 extern octave_value builtin_any_variable (const std::string&); |
3020
|
102 |
|
103 extern void link_to_global_variable (symbol_record *sr); |
|
104 extern void link_to_builtin_or_function (symbol_record *sr); |
|
105 |
3523
|
106 extern void force_link_to_function (const std::string&); |
2921
|
107 |
2856
|
108 extern void bind_ans (const octave_value& val, bool print); |
1162
|
109 |
2892
|
110 extern void |
3523
|
111 bind_builtin_constant (const std::string&, const octave_value&, |
3259
|
112 bool protect = false, bool eternal = false, |
3523
|
113 const std::string& help = std::string ()); |
3259
|
114 |
|
115 extern void |
3523
|
116 bind_builtin_variable (const std::string&, const octave_value&, |
2892
|
117 bool protect = false, bool eternal = false, |
3005
|
118 symbol_record::change_function f = 0, |
3523
|
119 const std::string& help = std::string ()); |
1406
|
120 |
4319
|
121 extern void mlock (const std::string&); |
|
122 extern void munlock (const std::string&); |
|
123 extern bool mislocked (const std::string&); |
4016
|
124 |
4954
|
125 extern bool clear_function (const std::string& nm); |
4988
|
126 extern bool clear_variable (const std::string& nm); |
|
127 extern bool clear_symbol (const std::string& nm); |
4954
|
128 |
1
|
129 // Symbol table for symbols at the top level. |
|
130 extern symbol_table *top_level_sym_tab; |
|
131 |
|
132 // Symbol table for the current scope. |
|
133 extern symbol_table *curr_sym_tab; |
|
134 |
4245
|
135 // Symbol table for the current caller scope. |
|
136 extern symbol_table *curr_caller_sym_tab; |
|
137 |
1
|
138 // Symbol table for global symbols. |
|
139 extern symbol_table *global_sym_tab; |
|
140 |
4009
|
141 // Symbol table for functions and built-in symbols. |
|
142 extern symbol_table *fbi_sym_tab; |
|
143 |
1
|
144 #endif |
|
145 |
|
146 /* |
|
147 ;;; Local Variables: *** |
|
148 ;;; mode: C++ *** |
|
149 ;;; End: *** |
|
150 */ |