1
|
1 // variables.h -*- C++ -*- |
|
2 /* |
|
3 |
|
4 Copyright (C) 1992, 1993 John W. Eaton |
|
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 |
|
24 #if !defined (_variables_h) |
|
25 #define _variables_h 1 |
|
26 |
|
27 class istream; |
|
28 class symbol_record; |
|
29 class symbol_table; |
|
30 class tree; |
|
31 class tree_constant; |
|
32 |
195
|
33 struct builtin_mapper_functions; |
|
34 struct builtin_text_functions; |
|
35 struct builtin_general_functions; |
|
36 struct builtin_string_variables; |
|
37 |
|
38 #ifndef SV_FUNCTION_TYPEDEFS |
|
39 #define SV_FUNCTION_TYPEDEFS 1 |
|
40 |
|
41 typedef int (*sv_Function)(void); |
|
42 |
|
43 #endif |
|
44 |
|
45 extern void initialize_symbol_tables (void); |
|
46 |
1
|
47 extern int symbol_out_of_date (symbol_record *sr); |
195
|
48 |
|
49 extern void document_symbol (const char *name, const char *help); |
|
50 |
|
51 extern void install_builtin_mapper_function (builtin_mapper_functions *mf); |
|
52 |
|
53 extern void install_builtin_text_function (builtin_text_functions *tf); |
|
54 |
|
55 extern void install_builtin_general_function (builtin_general_functions *gf); |
|
56 |
|
57 extern void install_builtin_variable (builtin_string_variables *sv); |
|
58 |
|
59 extern void install_builtin_variable_as_function (const char *name, |
|
60 tree_constant *val, |
|
61 int protect = 0, |
|
62 int eternal = 0); |
|
63 |
|
64 extern void bind_nargin_and_nargout (symbol_table *sym_tab, |
|
65 int nargin, int nargout); |
|
66 |
|
67 extern void bind_builtin_variable (const char *, tree_constant *, |
|
68 int protect = 0, int eternal = 0, |
|
69 sv_Function f = (sv_Function) 0, |
|
70 const char *help = (char *) 0); |
|
71 |
|
72 extern char *builtin_string_variable (const char *); |
|
73 extern int builtin_real_scalar_variable (const char *, double&); |
|
74 |
|
75 extern void link_to_global_variable (symbol_record *sr); |
|
76 extern void link_to_builtin_variable (symbol_record *sr); |
|
77 extern void link_to_builtin_or_function (symbol_record *sr); |
|
78 |
|
79 extern void force_link_to_function (const char *s); |
|
80 |
|
81 extern int is_globally_visible (const char *nm); |
|
82 |
1
|
83 extern int extract_keyword (istream&, char *, char *); |
|
84 extern int extract_keyword (istream&, char *, int&); |
195
|
85 |
1
|
86 extern void skip_comments (istream&); |
|
87 extern int valid_identifier (char *); |
|
88 extern int identifier_exists (char *); |
195
|
89 extern int is_builtin_variable (const char *name); |
1
|
90 extern tree *is_valid_function (tree_constant&, char *, int warn = 0); |
|
91 extern int takes_correct_nargs (tree *, int, char *, int warn = 0); |
|
92 extern char **make_name_list (void); |
|
93 |
|
94 // Symbol table for symbols at the top level. |
|
95 extern symbol_table *top_level_sym_tab; |
|
96 |
|
97 // Symbol table for the current scope. |
|
98 extern symbol_table *curr_sym_tab; |
|
99 |
|
100 // Symbol table for global symbols. |
|
101 extern symbol_table *global_sym_tab; |
|
102 |
|
103 #endif |
|
104 |
|
105 /* |
|
106 ;;; Local Variables: *** |
|
107 ;;; mode: C++ *** |
|
108 ;;; page-delimiter: "^/\\*" *** |
|
109 ;;; End: *** |
|
110 */ |