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 |
1315
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
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 |
3162
|
81 // TRUE means warn about function files that have time stamps in the future. |
|
82 extern bool Vwarn_future_time_stamp; |
|
83 |
4238
|
84 // Keep a count of how many END tokens we expect. |
|
85 extern int end_tokens_expected; |
|
86 |
3021
|
87 extern void |
|
88 parse_and_execute (FILE *f); |
|
89 |
|
90 extern void |
3523
|
91 parse_and_execute (const std::string& s, bool verbose = false, |
3021
|
92 const char *warn_for = 0); |
|
93 |
3523
|
94 extern std::string get_help_from_file (const std::string& f); |
3021
|
95 |
|
96 extern bool |
|
97 load_fcn_from_file (symbol_record *sym_rec, bool exec_script); |
|
98 |
4486
|
99 extern void |
|
100 source_file (const std::string file_name); |
|
101 |
3021
|
102 extern octave_value_list |
3772
|
103 feval (const std::string& name, |
|
104 const octave_value_list& args = octave_value_list (), |
|
105 int nargout = 0); |
3156
|
106 |
|
107 extern octave_value_list |
4342
|
108 feval (octave_function *fcn, |
|
109 const octave_value_list& args = octave_value_list (), |
|
110 int nargout = 0); |
|
111 |
|
112 extern octave_value_list |
3772
|
113 feval (const octave_value_list& args, int nargout = 0); |
3021
|
114 |
3100
|
115 extern octave_value_list |
3523
|
116 eval_string (const std::string&, bool silent, int& parse_status, int hargout); |
3099
|
117 |
|
118 extern octave_value |
3523
|
119 eval_string (const std::string&, bool silent, int& parse_status); |
3021
|
120 |
1
|
121 #endif |
|
122 |
|
123 /* |
|
124 ;;; Local Variables: *** |
|
125 ;;; mode: C++ *** |
|
126 ;;; End: *** |
|
127 */ |