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 |
2892
|
26 class octave_symbol; |
1
|
27 class symbol_record; |
|
28 class symbol_table; |
1738
|
29 |
2390
|
30 class tree_identifier; |
|
31 class tree_indirect_ref; |
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" |
2953
|
41 #include "symtab.h" |
195
|
42 |
2086
|
43 typedef octave_value_list (*Octave_builtin_fcn)(const octave_value_list&, int); |
529
|
44 |
195
|
45 extern void initialize_symbol_tables (void); |
|
46 |
2856
|
47 extern bool lookup (symbol_record *s, bool exec_script = true); |
581
|
48 |
2856
|
49 extern symbol_record *lookup_by_name (const string& nm, |
|
50 bool exec_script = true); |
581
|
51 |
2849
|
52 extern octave_value get_global_value (const string& nm); |
|
53 |
|
54 extern void set_global_value (const string& nm, const octave_value& val); |
|
55 |
1755
|
56 extern string get_help_from_file (const string& f); |
991
|
57 |
1755
|
58 extern string builtin_string_variable (const string&); |
|
59 extern int builtin_real_scalar_variable (const string&, double&); |
2086
|
60 extern octave_value builtin_any_variable (const string&); |
593
|
61 |
|
62 extern void link_to_global_variable (symbol_record *sr); |
|
63 extern void link_to_builtin_variable (symbol_record *sr); |
|
64 extern void link_to_builtin_or_function (symbol_record *sr); |
|
65 |
1755
|
66 extern void force_link_to_function (const string&); |
593
|
67 |
1827
|
68 extern bool is_builtin_variable (const string&); |
|
69 extern bool is_text_function_name (const string&); |
2293
|
70 extern bool is_mapper_function_name (const string&); |
|
71 extern bool is_builtin_function_name (const string&); |
1827
|
72 extern bool is_globally_visible (const string&); |
593
|
73 |
2892
|
74 extern octave_symbol * |
|
75 is_valid_function (const octave_value&, const string&, bool warn = false); |
593
|
76 |
2921
|
77 extern octave_symbol * |
2892
|
78 extract_function (const octave_value& arg, const string& warn_for, |
|
79 const string& fname, const string& header, |
|
80 const string& trailer); |
2796
|
81 |
2921
|
82 extern string_vector |
|
83 get_struct_elts (const string& text); |
|
84 |
|
85 extern bool |
|
86 looks_like_struct (const string& text); |
|
87 |
|
88 extern string_vector |
|
89 generate_struct_completions (const string& text, string& prefix, |
|
90 string& hint); |
|
91 |
1755
|
92 extern string_vector make_name_list (void); |
195
|
93 |
2892
|
94 extern void |
|
95 install_builtin_mapper (octave_mapper *mf); |
195
|
96 |
2892
|
97 extern void |
|
98 install_builtin_function (octave_builtin *f, bool is_text_fcn = false); |
195
|
99 |
2892
|
100 extern void |
2954
|
101 install_builtin_variable (const string& n, const octave_value& v, |
|
102 bool iaf, bool p, bool e, |
|
103 symbol_record::sv_function svf, const string& h); |
195
|
104 |
1755
|
105 extern void |
2390
|
106 install_builtin_variable_as_function (const string& name, |
|
107 const octave_value& val, |
2856
|
108 bool protect = false, |
|
109 bool eternal = false, |
2390
|
110 const string& help = string ()); |
1755
|
111 |
|
112 extern void alias_builtin (const string& alias, const string& name); |
548
|
113 |
2856
|
114 extern void bind_ans (const octave_value& val, bool print); |
1162
|
115 |
1489
|
116 extern void bind_global_error_variable (void); |
|
117 |
|
118 extern void clear_global_error_variable (void *); |
|
119 |
2892
|
120 extern void |
|
121 bind_builtin_variable (const string&, const octave_value&, |
|
122 bool protect = false, bool eternal = false, |
2953
|
123 symbol_record::sv_function f = 0, |
2892
|
124 const string& help = string ()); |
1406
|
125 |
1
|
126 // Symbol table for symbols at the top level. |
|
127 extern symbol_table *top_level_sym_tab; |
|
128 |
|
129 // Symbol table for the current scope. |
|
130 extern symbol_table *curr_sym_tab; |
|
131 |
|
132 // Symbol table for global symbols. |
|
133 extern symbol_table *global_sym_tab; |
|
134 |
2204
|
135 enum echo_state |
|
136 { |
|
137 ECHO_OFF = 0, |
|
138 ECHO_SCRIPTS = 1, |
|
139 ECHO_FUNCTIONS = 2, |
|
140 ECHO_CMD_LINE = 4 |
|
141 }; |
|
142 |
|
143 extern int Vecho_executing_commands; |
|
144 |
1
|
145 #endif |
|
146 |
|
147 /* |
|
148 ;;; Local Variables: *** |
|
149 ;;; mode: C++ *** |
|
150 ;;; End: *** |
|
151 */ |