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 |
7016
|
9 Free Software Foundation; either version 3 of the License, or (at your |
|
10 option) any later version. |
1
|
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 |
7016
|
18 along with Octave; see the file COPYING. If not, see |
|
19 <http://www.gnu.org/licenses/>. |
1
|
20 |
|
21 */ |
|
22 |
383
|
23 #if !defined (octave_parse_h) |
|
24 #define octave_parse_h 1 |
1
|
25 |
3021
|
26 #include <cstdio> |
|
27 |
1755
|
28 #include <string> |
|
29 |
4426
|
30 #include <stack> |
|
31 |
1
|
32 extern void reset_parser (void); |
4753
|
33 extern int octave_lex (void); |
|
34 extern int octave_parse (void); |
1
|
35 |
|
36 class tree; |
|
37 class tree_matrix; |
|
38 class tree_identifier; |
4342
|
39 class octaev_function; |
3021
|
40 class symbol_record; |
1
|
41 class symbol_table; |
3772
|
42 |
|
43 #include "oct-obj.h" |
1
|
44 |
|
45 // Temporary symbol table pointer used to cope with bogus function syntax. |
|
46 extern symbol_table *tmp_local_sym_tab; |
|
47 |
|
48 // Nonzero means print parser debugging info (-d). |
4753
|
49 extern int octave_debug; |
1
|
50 |
|
51 // The current input line number. |
|
52 extern int input_line_number; |
|
53 |
|
54 // The column of the current token. |
|
55 extern int current_input_column; |
|
56 |
338
|
57 // Buffer for help text snagged from function files. |
4426
|
58 extern std::stack<std::string> help_buf; |
1
|
59 |
3021
|
60 // TRUE means we are using readline. |
|
61 extern bool line_editing; |
|
62 |
|
63 // TRUE means we printed messages about reading startup files. |
|
64 extern bool reading_startup_message_printed; |
|
65 |
|
66 // TRUE means input is coming from startup file. |
|
67 extern bool input_from_startup_file; |
|
68 |
3489
|
69 // TRUE means that we are in the process of evaluating a function |
|
70 // body. The parser might be called in that case if we are looking at |
|
71 // an eval() statement. |
|
72 extern bool evaluating_function_body; |
|
73 |
4186
|
74 // Keep track of symbol table information when parsing functions. |
4238
|
75 extern std::stack<symbol_table*> symtab_context; |
|
76 |
|
77 // Name of parent function when parsing function files that might |
|
78 // contain nested functions. |
|
79 extern std::string parent_function_name; |
4186
|
80 |
4238
|
81 // Keep a count of how many END tokens we expect. |
|
82 extern int end_tokens_expected; |
|
83 |
6109
|
84 extern OCTINTERP_API void |
3021
|
85 parse_and_execute (FILE *f); |
|
86 |
6109
|
87 extern OCTINTERP_API void |
3523
|
88 parse_and_execute (const std::string& s, bool verbose = false, |
3021
|
89 const char *warn_for = 0); |
|
90 |
6109
|
91 extern OCTINTERP_API std::string |
5484
|
92 get_help_from_file (const std::string& nm, bool& symbol_found, |
5931
|
93 std::string& file); |
|
94 |
6109
|
95 extern OCTINTERP_API std::string |
5931
|
96 get_help_from_file (const std::string& nm, bool& symbol_found); |
5484
|
97 |
6109
|
98 extern OCTINTERP_API std::string lookup_autoload (const std::string& nm); |
3021
|
99 |
6109
|
100 extern OCTINTERP_API string_vector autoloaded_functions (void); |
5592
|
101 |
6109
|
102 extern OCTINTERP_API string_vector reverse_lookup_autoload (const std::string& nm); |
5592
|
103 |
6109
|
104 extern OCTINTERP_API bool |
5312
|
105 load_fcn_from_file (const std::string& nm, bool exec_script); |
|
106 |
6109
|
107 extern OCTINTERP_API bool |
3021
|
108 load_fcn_from_file (symbol_record *sym_rec, bool exec_script); |
|
109 |
6109
|
110 extern OCTINTERP_API void |
5975
|
111 source_file (const std::string& file_name, |
|
112 const std::string& context = std::string ()); |
4486
|
113 |
6109
|
114 extern OCTINTERP_API octave_value_list |
3772
|
115 feval (const std::string& name, |
|
116 const octave_value_list& args = octave_value_list (), |
|
117 int nargout = 0); |
3156
|
118 |
6109
|
119 extern OCTINTERP_API octave_value_list |
4342
|
120 feval (octave_function *fcn, |
|
121 const octave_value_list& args = octave_value_list (), |
|
122 int nargout = 0); |
|
123 |
6109
|
124 extern OCTINTERP_API octave_value_list |
3772
|
125 feval (const octave_value_list& args, int nargout = 0); |
3021
|
126 |
6109
|
127 extern OCTINTERP_API octave_value_list |
3523
|
128 eval_string (const std::string&, bool silent, int& parse_status, int hargout); |
3099
|
129 |
6109
|
130 extern OCTINTERP_API octave_value |
3523
|
131 eval_string (const std::string&, bool silent, int& parse_status); |
3021
|
132 |
1
|
133 #endif |
|
134 |
|
135 /* |
|
136 ;;; Local Variables: *** |
|
137 ;;; mode: C++ *** |
|
138 ;;; End: *** |
|
139 */ |