1
|
1 // variables.h -*- C++ -*- |
|
2 /* |
|
3 |
296
|
4 Copyright (C) 1992, 1993, 1994 John W. Eaton |
1
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
21 |
|
22 */ |
|
23 |
383
|
24 #if !defined (octave_variables_h) |
|
25 #define octave_variables_h 1 |
1
|
26 |
|
27 class istream; |
|
28 class symbol_record; |
|
29 class symbol_table; |
|
30 class tree; |
490
|
31 class tree_fvc; |
1
|
32 class tree_constant; |
|
33 |
195
|
34 struct builtin_mapper_functions; |
|
35 struct builtin_text_functions; |
|
36 struct builtin_general_functions; |
|
37 struct builtin_string_variables; |
|
38 |
|
39 #ifndef SV_FUNCTION_TYPEDEFS |
|
40 #define SV_FUNCTION_TYPEDEFS 1 |
|
41 |
|
42 typedef int (*sv_Function)(void); |
|
43 |
|
44 #endif |
|
45 |
|
46 extern void initialize_symbol_tables (void); |
|
47 |
1
|
48 extern int symbol_out_of_date (symbol_record *sr); |
195
|
49 |
|
50 extern void document_symbol (const char *name, const char *help); |
|
51 |
|
52 extern void install_builtin_mapper_function (builtin_mapper_functions *mf); |
|
53 |
|
54 extern void install_builtin_text_function (builtin_text_functions *tf); |
|
55 |
|
56 extern void install_builtin_general_function (builtin_general_functions *gf); |
|
57 |
|
58 extern void install_builtin_variable (builtin_string_variables *sv); |
|
59 |
|
60 extern void install_builtin_variable_as_function (const char *name, |
|
61 tree_constant *val, |
|
62 int protect = 0, |
|
63 int eternal = 0); |
|
64 |
|
65 extern void bind_nargin_and_nargout (symbol_table *sym_tab, |
|
66 int nargin, int nargout); |
|
67 |
|
68 extern void bind_builtin_variable (const char *, tree_constant *, |
|
69 int protect = 0, int eternal = 0, |
|
70 sv_Function f = (sv_Function) 0, |
|
71 const char *help = (char *) 0); |
|
72 |
|
73 extern char *builtin_string_variable (const char *); |
|
74 extern int builtin_real_scalar_variable (const char *, double&); |
|
75 |
|
76 extern void link_to_global_variable (symbol_record *sr); |
|
77 extern void link_to_builtin_variable (symbol_record *sr); |
|
78 extern void link_to_builtin_or_function (symbol_record *sr); |
|
79 |
|
80 extern void force_link_to_function (const char *s); |
|
81 |
|
82 extern int is_globally_visible (const char *nm); |
|
83 |
279
|
84 extern char *extract_keyword (istream&, char *); |
1
|
85 extern int extract_keyword (istream&, char *, int&); |
195
|
86 |
1
|
87 extern void skip_comments (istream&); |
|
88 extern int valid_identifier (char *); |
|
89 extern int identifier_exists (char *); |
195
|
90 extern int is_builtin_variable (const char *name); |
490
|
91 extern tree_fvc *is_valid_function (tree_constant&, char *, int warn = 0); |
|
92 extern int takes_correct_nargs (tree_fvc *, int, char *, int warn = 0); |
1
|
93 extern char **make_name_list (void); |
|
94 |
|
95 // Symbol table for symbols at the top level. |
|
96 extern symbol_table *top_level_sym_tab; |
|
97 |
|
98 // Symbol table for the current scope. |
|
99 extern symbol_table *curr_sym_tab; |
|
100 |
|
101 // Symbol table for global symbols. |
|
102 extern symbol_table *global_sym_tab; |
|
103 |
|
104 #endif |
|
105 |
|
106 /* |
|
107 ;;; Local Variables: *** |
|
108 ;;; mode: C++ *** |
|
109 ;;; page-delimiter: "^/\\*" *** |
|
110 ;;; End: *** |
|
111 */ |