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