Mercurial > hg > octave-nkf
annotate libinterp/parse-tree/parse.h @ 16109:229eb14653fd
new entry point for parser
* oct-parse.yy (octave_parse_input): New function.
(parse_fcn_file, eval_string): Use it instead of yyparse.
* toplev.cc (main_loop): Use it instead of octave_parse.
* input.cc (get_debug_input): Use it instead of octave_parse.
* oct-parse.h (octave_parse_input): Provide decl.
(octave_parse): Delete decl.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 26 Feb 2013 00:45:43 -0500 |
parents | 6434f70f0ee0 |
children | 6884401b2fbb |
rev | line source |
---|---|
1 | 1 /* |
2 | |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
13970
diff
changeset
|
3 Copyright (C) 1993-2012 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); |
1 | 34 |
35 class tree; | |
36 class tree_matrix; | |
37 class tree_identifier; | |
13970 | 38 class tree_statement_list; |
7102 | 39 class octave_function; |
3772 | 40 |
41 #include "oct-obj.h" | |
1 | 42 |
43 // Nonzero means print parser debugging info (-d). | |
4753 | 44 extern int octave_debug; |
1 | 45 |
338 | 46 // Buffer for help text snagged from function files. |
4426 | 47 extern std::stack<std::string> help_buf; |
1 | 48 |
3021 | 49 // TRUE means we are using readline. |
50 extern bool line_editing; | |
51 | |
52 // TRUE means we printed messages about reading startup files. | |
53 extern bool reading_startup_message_printed; | |
54 | |
55 // TRUE means input is coming from startup file. | |
56 extern bool input_from_startup_file; | |
57 | |
7336 | 58 // Name of the current class when we are parsing class methods or |
59 // constructors. | |
60 extern std::string current_class_name; | |
61 | |
6109 | 62 extern OCTINTERP_API std::string |
5484 | 63 get_help_from_file (const std::string& nm, bool& symbol_found, |
10313 | 64 std::string& file); |
5931 | 65 |
6109 | 66 extern OCTINTERP_API std::string |
5931 | 67 get_help_from_file (const std::string& nm, bool& symbol_found); |
5484 | 68 |
6109 | 69 extern OCTINTERP_API std::string lookup_autoload (const std::string& nm); |
3021 | 70 |
6109 | 71 extern OCTINTERP_API string_vector autoloaded_functions (void); |
5592 | 72 |
6109 | 73 extern OCTINTERP_API string_vector reverse_lookup_autoload (const std::string& nm); |
5592 | 74 |
7336 | 75 extern OCTINTERP_API octave_function * |
76 load_fcn_from_file (const std::string& file_name, | |
10313 | 77 const std::string& dir_name = std::string (), |
78 const std::string& dispatch_type = std::string (), | |
79 const std::string& fcn_name = std::string (), | |
80 bool autoload = false); | |
3021 | 81 |
6109 | 82 extern OCTINTERP_API void |
5975 | 83 source_file (const std::string& file_name, |
10313 | 84 const std::string& context = std::string (), |
85 bool verbose = false, bool require_file = true, | |
86 const std::string& warn_for = std::string ()); | |
4486 | 87 |
6109 | 88 extern OCTINTERP_API octave_value_list |
3772 | 89 feval (const std::string& name, |
90 const octave_value_list& args = octave_value_list (), | |
91 int nargout = 0); | |
3156 | 92 |
6109 | 93 extern OCTINTERP_API octave_value_list |
4342 | 94 feval (octave_function *fcn, |
95 const octave_value_list& args = octave_value_list (), | |
96 int nargout = 0); | |
97 | |
6109 | 98 extern OCTINTERP_API octave_value_list |
3772 | 99 feval (const octave_value_list& args, int nargout = 0); |
3021 | 100 |
6109 | 101 extern OCTINTERP_API octave_value_list |
3523 | 102 eval_string (const std::string&, bool silent, int& parse_status, int hargout); |
3099 | 103 |
6109 | 104 extern OCTINTERP_API octave_value |
3523 | 105 eval_string (const std::string&, bool silent, int& parse_status); |
3021 | 106 |
13970 | 107 extern OCTINTERP_API void cleanup_statement_list (tree_statement_list **lst); |
108 | |
16109
229eb14653fd
new entry point for parser
John W. Eaton <jwe@octave.org>
parents:
16103
diff
changeset
|
109 extern OCTINTERP_API int octave_parse_input (void); |
229eb14653fd
new entry point for parser
John W. Eaton <jwe@octave.org>
parents:
16103
diff
changeset
|
110 |
1 | 111 #endif |