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