Mercurial > hg > octave-avbm
annotate src/parse.h @ 7728:13820b9f5fd9
more consistent handling of CR/CRLF/LF line endings in lexer and parser
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 23 Apr 2008 16:03:34 -0400 |
parents | 5b4d278ec828 |
children | 33783e94fb16 |
rev | line source |
---|---|
1 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001, 2002, |
4 2003, 2004, 2005, 2006, 2007 John W. Eaton | |
1 | 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 | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
1 | 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 | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
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; | |
7102 | 40 class octave_function; |
3772 | 41 |
42 #include "oct-obj.h" | |
1 | 43 |
44 // Nonzero means print parser debugging info (-d). | |
4753 | 45 extern int octave_debug; |
1 | 46 |
47 // The current input line number. | |
48 extern int input_line_number; | |
49 | |
50 // The column of the current token. | |
51 extern int current_input_column; | |
52 | |
338 | 53 // Buffer for help text snagged from function files. |
4426 | 54 extern std::stack<std::string> help_buf; |
1 | 55 |
3021 | 56 // TRUE means we are using readline. |
57 extern bool line_editing; | |
58 | |
59 // TRUE means we printed messages about reading startup files. | |
60 extern bool reading_startup_message_printed; | |
61 | |
62 // TRUE means input is coming from startup file. | |
63 extern bool input_from_startup_file; | |
64 | |
3489 | 65 // TRUE means that we are in the process of evaluating a function |
66 // body. The parser might be called in that case if we are looking at | |
67 // an eval() statement. | |
68 extern bool evaluating_function_body; | |
69 | |
4186 | 70 // Keep track of symbol table information when parsing functions. |
7336 | 71 extern std::stack<symbol_table::scope_id> symtab_context; |
4238 | 72 |
73 // Name of parent function when parsing function files that might | |
74 // contain nested functions. | |
75 extern std::string parent_function_name; | |
4186 | 76 |
7336 | 77 // Name of the current class when we are parsing class methods or |
78 // constructors. | |
79 extern std::string current_class_name; | |
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 std::string |
5484 | 85 get_help_from_file (const std::string& nm, bool& symbol_found, |
5931 | 86 std::string& file); |
87 | |
6109 | 88 extern OCTINTERP_API std::string |
5931 | 89 get_help_from_file (const std::string& nm, bool& symbol_found); |
5484 | 90 |
6109 | 91 extern OCTINTERP_API std::string lookup_autoload (const std::string& nm); |
3021 | 92 |
6109 | 93 extern OCTINTERP_API string_vector autoloaded_functions (void); |
5592 | 94 |
6109 | 95 extern OCTINTERP_API string_vector reverse_lookup_autoload (const std::string& nm); |
5592 | 96 |
7336 | 97 extern OCTINTERP_API octave_function * |
98 load_fcn_from_file (const std::string& file_name, | |
99 const std::string& dir_name = std::string (), | |
100 const std::string& dispatch_type = std::string (), | |
101 const std::string& fcn_name = std::string (), | |
102 bool autoload = false); | |
3021 | 103 |
6109 | 104 extern OCTINTERP_API void |
5975 | 105 source_file (const std::string& file_name, |
7715
5b4d278ec828
parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
106 const std::string& context = std::string (), |
5b4d278ec828
parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
107 bool verbose = false, bool require_file = true, |
5b4d278ec828
parse scripts completely before executing
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
108 const std::string& warn_for = std::string ()); |
4486 | 109 |
6109 | 110 extern OCTINTERP_API 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 |
6109 | 115 extern OCTINTERP_API octave_value_list |
4342 | 116 feval (octave_function *fcn, |
117 const octave_value_list& args = octave_value_list (), | |
118 int nargout = 0); | |
119 | |
6109 | 120 extern OCTINTERP_API octave_value_list |
3772 | 121 feval (const octave_value_list& args, int nargout = 0); |
3021 | 122 |
6109 | 123 extern OCTINTERP_API octave_value_list |
3523 | 124 eval_string (const std::string&, bool silent, int& parse_status, int hargout); |
3099 | 125 |
6109 | 126 extern OCTINTERP_API 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 */ |