annotate src/variables.h @ 3020:f491f232cb09

[project @ 1997-06-03 22:15:08 by jwe]
author jwe
date Tue, 03 Jun 1997 22:15:26 +0000
parents f512c16826d1
children 09a3064a3a17
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
1 /*
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
2
2847
8b262e771614 [project @ 1997-03-27 16:18:26 by jwe]
jwe
parents: 2796
diff changeset
3 Copyright (C) 1996, 1997 John W. Eaton
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
4
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
6
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
10 later version.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
11
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
15 for more details.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
16
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
18 along with Octave; see the file COPYING. If not, write to the Free
1315
611d403c7f3d [project @ 1995-06-25 19:56:32 by jwe]
jwe
parents: 1162
diff changeset
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
20
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
21 */
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
22
383
0b52c68ec81f [project @ 1994-03-09 21:19:44 by jwe]
jwe
parents: 296
diff changeset
23 #if !defined (octave_variables_h)
0b52c68ec81f [project @ 1994-03-09 21:19:44 by jwe]
jwe
parents: 296
diff changeset
24 #define octave_variables_h 1
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
25
2975
b9c107cbe388 [project @ 1997-05-15 20:01:00 by jwe]
jwe
parents: 2954
diff changeset
26 class octave_function;
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
27 class symbol_record;
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
28 class symbol_table;
1738
bb9d00aa55fb [project @ 1996-01-12 10:56:22 by jwe]
jwe
parents: 1727
diff changeset
29
2390
c2c1482c34c8 [project @ 1996-10-12 19:13:23 by jwe]
jwe
parents: 2293
diff changeset
30 class tree_identifier;
c2c1482c34c8 [project @ 1996-10-12 19:13:23 by jwe]
jwe
parents: 2293
diff changeset
31 class tree_indirect_ref;
2086
bfb775fb6fe8 [project @ 1996-04-25 05:55:19 by jwe]
jwe
parents: 1996
diff changeset
32 class octave_value;
bfb775fb6fe8 [project @ 1996-04-25 05:55:19 by jwe]
jwe
parents: 1996
diff changeset
33 class octave_value_list;
2892
aef2d43edbc2 [project @ 1997-04-28 02:04:28 by jwe]
jwe
parents: 2878
diff changeset
34 class octave_builtin;
aef2d43edbc2 [project @ 1997-04-28 02:04:28 by jwe]
jwe
parents: 2878
diff changeset
35 class octave_mapper;
1755
3a9462b655f1 [project @ 1996-01-22 04:47:22 by jwe]
jwe
parents: 1738
diff changeset
36 class string_vector;
3a9462b655f1 [project @ 1996-01-22 04:47:22 by jwe]
jwe
parents: 1738
diff changeset
37
3a9462b655f1 [project @ 1996-01-22 04:47:22 by jwe]
jwe
parents: 1738
diff changeset
38 #include <string>
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
39
2390
c2c1482c34c8 [project @ 1996-10-12 19:13:23 by jwe]
jwe
parents: 2293
diff changeset
40 #include "ov.h"
2975
b9c107cbe388 [project @ 1997-05-15 20:01:00 by jwe]
jwe
parents: 2954
diff changeset
41 #include "ov-builtin.h"
2953
ca7d3625ee01 [project @ 1997-05-09 14:56:52 by jwe]
jwe
parents: 2949
diff changeset
42 #include "symtab.h"
195
13c6086c325c [project @ 1993-11-06 10:12:29 by jwe]
jwe
parents: 1
diff changeset
43
13c6086c325c [project @ 1993-11-06 10:12:29 by jwe]
jwe
parents: 1
diff changeset
44 extern void initialize_symbol_tables (void);
13c6086c325c [project @ 1993-11-06 10:12:29 by jwe]
jwe
parents: 1
diff changeset
45
1827
effa9400766f [project @ 1996-02-02 14:07:51 by jwe]
jwe
parents: 1755
diff changeset
46 extern bool is_builtin_variable (const string&);
effa9400766f [project @ 1996-02-02 14:07:51 by jwe]
jwe
parents: 1755
diff changeset
47 extern bool is_text_function_name (const string&);
2293
a015ab4392c2 [project @ 1996-06-13 08:52:18 by jwe]
jwe
parents: 2204
diff changeset
48 extern bool is_mapper_function_name (const string&);
a015ab4392c2 [project @ 1996-06-13 08:52:18 by jwe]
jwe
parents: 2204
diff changeset
49 extern bool is_builtin_function_name (const string&);
1827
effa9400766f [project @ 1996-02-02 14:07:51 by jwe]
jwe
parents: 1755
diff changeset
50 extern bool is_globally_visible (const string&);
593
6f948c6251a9 [project @ 1994-08-09 04:29:10 by jwe]
jwe
parents: 581
diff changeset
51
2975
b9c107cbe388 [project @ 1997-05-15 20:01:00 by jwe]
jwe
parents: 2954
diff changeset
52 extern octave_function *
2892
aef2d43edbc2 [project @ 1997-04-28 02:04:28 by jwe]
jwe
parents: 2878
diff changeset
53 is_valid_function (const octave_value&, const string&, bool warn = false);
593
6f948c6251a9 [project @ 1994-08-09 04:29:10 by jwe]
jwe
parents: 581
diff changeset
54
2975
b9c107cbe388 [project @ 1997-05-15 20:01:00 by jwe]
jwe
parents: 2954
diff changeset
55 extern octave_function *
2892
aef2d43edbc2 [project @ 1997-04-28 02:04:28 by jwe]
jwe
parents: 2878
diff changeset
56 extract_function (const octave_value& arg, const string& warn_for,
aef2d43edbc2 [project @ 1997-04-28 02:04:28 by jwe]
jwe
parents: 2878
diff changeset
57 const string& fname, const string& header,
aef2d43edbc2 [project @ 1997-04-28 02:04:28 by jwe]
jwe
parents: 2878
diff changeset
58 const string& trailer);
2796
74bc1ede3c3d [project @ 1997-03-07 06:55:47 by jwe]
jwe
parents: 2447
diff changeset
59
2921
64dd86522a1d [project @ 1997-05-02 02:52:54 by jwe]
jwe
parents: 2907
diff changeset
60 extern string_vector
64dd86522a1d [project @ 1997-05-02 02:52:54 by jwe]
jwe
parents: 2907
diff changeset
61 get_struct_elts (const string& text);
64dd86522a1d [project @ 1997-05-02 02:52:54 by jwe]
jwe
parents: 2907
diff changeset
62
3020
f491f232cb09 [project @ 1997-06-03 22:15:08 by jwe]
jwe
parents: 3016
diff changeset
63 extern string_vector
f491f232cb09 [project @ 1997-06-03 22:15:08 by jwe]
jwe
parents: 3016
diff changeset
64 generate_struct_completions (const string& text, string& prefix,
f491f232cb09 [project @ 1997-06-03 22:15:08 by jwe]
jwe
parents: 3016
diff changeset
65 string& hint);
f491f232cb09 [project @ 1997-06-03 22:15:08 by jwe]
jwe
parents: 3016
diff changeset
66
2921
64dd86522a1d [project @ 1997-05-02 02:52:54 by jwe]
jwe
parents: 2907
diff changeset
67 extern bool
64dd86522a1d [project @ 1997-05-02 02:52:54 by jwe]
jwe
parents: 2907
diff changeset
68 looks_like_struct (const string& text);
64dd86522a1d [project @ 1997-05-02 02:52:54 by jwe]
jwe
parents: 2907
diff changeset
69
3020
f491f232cb09 [project @ 1997-06-03 22:15:08 by jwe]
jwe
parents: 3016
diff changeset
70 extern bool lookup (symbol_record *s, bool exec_script = true);
f491f232cb09 [project @ 1997-06-03 22:15:08 by jwe]
jwe
parents: 3016
diff changeset
71
f491f232cb09 [project @ 1997-06-03 22:15:08 by jwe]
jwe
parents: 3016
diff changeset
72 extern symbol_record *
f491f232cb09 [project @ 1997-06-03 22:15:08 by jwe]
jwe
parents: 3016
diff changeset
73 lookup_by_name (const string& nm, bool exec_script = true);
f491f232cb09 [project @ 1997-06-03 22:15:08 by jwe]
jwe
parents: 3016
diff changeset
74
f491f232cb09 [project @ 1997-06-03 22:15:08 by jwe]
jwe
parents: 3016
diff changeset
75 extern octave_value get_global_value (const string& nm);
f491f232cb09 [project @ 1997-06-03 22:15:08 by jwe]
jwe
parents: 3016
diff changeset
76
f491f232cb09 [project @ 1997-06-03 22:15:08 by jwe]
jwe
parents: 3016
diff changeset
77 extern void set_global_value (const string& nm, const octave_value& val);
f491f232cb09 [project @ 1997-06-03 22:15:08 by jwe]
jwe
parents: 3016
diff changeset
78
f491f232cb09 [project @ 1997-06-03 22:15:08 by jwe]
jwe
parents: 3016
diff changeset
79 extern string builtin_string_variable (const string&);
f491f232cb09 [project @ 1997-06-03 22:15:08 by jwe]
jwe
parents: 3016
diff changeset
80 extern int builtin_real_scalar_variable (const string&, double&);
f491f232cb09 [project @ 1997-06-03 22:15:08 by jwe]
jwe
parents: 3016
diff changeset
81 extern octave_value builtin_any_variable (const string&);
f491f232cb09 [project @ 1997-06-03 22:15:08 by jwe]
jwe
parents: 3016
diff changeset
82
f491f232cb09 [project @ 1997-06-03 22:15:08 by jwe]
jwe
parents: 3016
diff changeset
83 extern void link_to_global_variable (symbol_record *sr);
f491f232cb09 [project @ 1997-06-03 22:15:08 by jwe]
jwe
parents: 3016
diff changeset
84 extern void link_to_builtin_variable (symbol_record *sr);
f491f232cb09 [project @ 1997-06-03 22:15:08 by jwe]
jwe
parents: 3016
diff changeset
85 extern void link_to_builtin_or_function (symbol_record *sr);
f491f232cb09 [project @ 1997-06-03 22:15:08 by jwe]
jwe
parents: 3016
diff changeset
86
f491f232cb09 [project @ 1997-06-03 22:15:08 by jwe]
jwe
parents: 3016
diff changeset
87 extern void force_link_to_function (const string&);
2921
64dd86522a1d [project @ 1997-05-02 02:52:54 by jwe]
jwe
parents: 2907
diff changeset
88
2856
8c516da3c1f7 [project @ 1997-03-31 06:37:21 by jwe]
jwe
parents: 2849
diff changeset
89 extern void bind_ans (const octave_value& val, bool print);
1162
c210c5a25a48 [project @ 1995-02-27 17:36:16 by jwe]
jwe
parents: 1160
diff changeset
90
1489
3e705c864019 [project @ 1995-09-28 05:38:26 by jwe]
jwe
parents: 1488
diff changeset
91 extern void bind_global_error_variable (void);
3e705c864019 [project @ 1995-09-28 05:38:26 by jwe]
jwe
parents: 1488
diff changeset
92
3e705c864019 [project @ 1995-09-28 05:38:26 by jwe]
jwe
parents: 1488
diff changeset
93 extern void clear_global_error_variable (void *);
3e705c864019 [project @ 1995-09-28 05:38:26 by jwe]
jwe
parents: 1488
diff changeset
94
2892
aef2d43edbc2 [project @ 1997-04-28 02:04:28 by jwe]
jwe
parents: 2878
diff changeset
95 extern void
aef2d43edbc2 [project @ 1997-04-28 02:04:28 by jwe]
jwe
parents: 2878
diff changeset
96 bind_builtin_variable (const string&, const octave_value&,
aef2d43edbc2 [project @ 1997-04-28 02:04:28 by jwe]
jwe
parents: 2878
diff changeset
97 bool protect = false, bool eternal = false,
3005
fd2080b2800e [project @ 1997-05-24 17:37:39 by jwe]
jwe
parents: 2975
diff changeset
98 symbol_record::change_function f = 0,
2892
aef2d43edbc2 [project @ 1997-04-28 02:04:28 by jwe]
jwe
parents: 2878
diff changeset
99 const string& help = string ());
1406
034a57daf076 [project @ 1995-09-15 06:03:10 by jwe]
jwe
parents: 1405
diff changeset
100
1
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
101 // Symbol table for symbols at the top level.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
102 extern symbol_table *top_level_sym_tab;
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
103
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
104 // Symbol table for the current scope.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
105 extern symbol_table *curr_sym_tab;
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
106
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
107 // Symbol table for global symbols.
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
108 extern symbol_table *global_sym_tab;
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
109
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
110 #endif
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
111
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
112 /*
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
113 ;;; Local Variables: ***
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
114 ;;; mode: C++ ***
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
115 ;;; End: ***
78fd87e624cb [project @ 1993-08-08 01:13:40 by jwe]
jwe
parents:
diff changeset
116 */