parse.h

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) 1993-2012 John W. Eaton
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 3 of the License, or (at your
00010 option) any later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, see
00019 <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 #if !defined (octave_parse_h)
00024 #define octave_parse_h 1
00025 
00026 #include <cstdio>
00027 
00028 #include <string>
00029 
00030 #include <stack>
00031 
00032 extern void reset_parser (void);
00033 extern int octave_lex (void);
00034 extern int octave_parse (void);
00035 
00036 class tree;
00037 class tree_matrix;
00038 class tree_identifier;
00039 class tree_statement_list;
00040 class octave_function;
00041 
00042 #include "oct-obj.h"
00043 
00044 // Nonzero means print parser debugging info (-d).
00045 extern int octave_debug;
00046 
00047 // The current input line number.
00048 extern int input_line_number;
00049 
00050 // The column of the current token.
00051 extern int current_input_column;
00052 
00053 // Buffer for help text snagged from function files.
00054 extern std::stack<std::string> help_buf;
00055 
00056 // TRUE means we are using readline.
00057 extern bool line_editing;
00058 
00059 // TRUE means we printed messages about reading startup files.
00060 extern bool reading_startup_message_printed;
00061 
00062 // TRUE means input is coming from startup file.
00063 extern bool input_from_startup_file;
00064 
00065 // Keep track of symbol table information when parsing functions.
00066 extern std::stack<symbol_table::scope_id> symtab_context;
00067 
00068 // Name of the current class when we are parsing class methods or
00069 // constructors.
00070 extern std::string current_class_name;
00071 
00072 extern OCTINTERP_API std::string
00073 get_help_from_file (const std::string& nm, bool& symbol_found,
00074                     std::string& file);
00075 
00076 extern OCTINTERP_API std::string
00077 get_help_from_file (const std::string& nm, bool& symbol_found);
00078 
00079 extern OCTINTERP_API std::string lookup_autoload (const std::string& nm);
00080 
00081 extern OCTINTERP_API string_vector autoloaded_functions (void);
00082 
00083 extern OCTINTERP_API string_vector reverse_lookup_autoload (const std::string& nm);
00084 
00085 extern OCTINTERP_API octave_function *
00086 load_fcn_from_file (const std::string& file_name,
00087                     const std::string& dir_name = std::string (),
00088                     const std::string& dispatch_type = std::string (),
00089                     const std::string& fcn_name = std::string (),
00090                     bool autoload = false);
00091 
00092 extern OCTINTERP_API void
00093 source_file (const std::string& file_name,
00094              const std::string& context = std::string (),
00095              bool verbose = false, bool require_file = true,
00096              const std::string& warn_for = std::string ());
00097 
00098 extern OCTINTERP_API octave_value_list
00099 feval (const std::string& name,
00100        const octave_value_list& args = octave_value_list (),
00101        int nargout = 0);
00102 
00103 extern OCTINTERP_API octave_value_list
00104 feval (octave_function *fcn,
00105        const octave_value_list& args = octave_value_list (),
00106        int nargout = 0);
00107 
00108 extern OCTINTERP_API octave_value_list
00109 feval (const octave_value_list& args, int nargout = 0);
00110 
00111 extern OCTINTERP_API octave_value_list
00112 eval_string (const std::string&, bool silent, int& parse_status, int hargout);
00113 
00114 extern OCTINTERP_API octave_value
00115 eval_string (const std::string&, bool silent, int& parse_status);
00116 
00117 extern OCTINTERP_API void cleanup_statement_list (tree_statement_list **lst);
00118 
00119 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines