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