Octave-Forge - Extra packages for GNU Octave | |
Home · Packages · Developers · Documentation · FAQ · Bugs · Mailing Lists · Links · Code |
00001 /* 00002 00003 Copyright (C) 1996, 1997, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 00004 John W. Eaton 00005 00006 This file is part of Octave. 00007 00008 Octave is free software; you can redistribute it and/or modify it 00009 under the terms of the GNU General Public License as published by the 00010 Free Software Foundation; either version 3 of the License, or (at your 00011 option) any later version. 00012 00013 Octave is distributed in the hope that it will be useful, but WITHOUT 00014 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00015 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00016 for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with Octave; see the file COPYING. If not, see 00020 <http://www.gnu.org/licenses/>. 00021 00022 */ 00023 00024 #if !defined (octave_tree_arg_list_h) 00025 #define octave_tree_arg_list_h 1 00026 00027 #include <list> 00028 00029 class octave_value_list; 00030 class octave_lvalue; 00031 class tree_expression; 00032 class tree_walker; 00033 00034 #include "str-vec.h" 00035 00036 #include "base-list.h" 00037 00038 // Argument lists. Used to hold the list of expressions that are the 00039 // arguments in a function call or index expression. 00040 00041 class 00042 tree_argument_list : public octave_base_list<tree_expression *> 00043 { 00044 public: 00045 00046 typedef tree_expression* element_type; 00047 00048 tree_argument_list (void) 00049 : list_includes_magic_end (false), simple_assign_lhs (false) { } 00050 00051 tree_argument_list (tree_expression *t) 00052 : list_includes_magic_end (false), simple_assign_lhs (false) 00053 { append (t); } 00054 00055 ~tree_argument_list (void); 00056 00057 bool has_magic_end (void) const; 00058 00059 tree_expression *remove_front (void) 00060 { 00061 iterator p = begin (); 00062 tree_expression *retval = *p; 00063 erase (p); 00064 return retval; 00065 } 00066 00067 void append (const element_type& s); 00068 00069 void mark_as_simple_assign_lhs (void) { simple_assign_lhs = true; } 00070 00071 bool is_simple_assign_lhs (void) { return simple_assign_lhs; } 00072 00073 bool all_elements_are_constant (void) const; 00074 00075 octave_value_list convert_to_const_vector (const octave_value *object = 0); 00076 00077 std::list<octave_lvalue> lvalue_list (void); 00078 00079 string_vector get_arg_names (void) const; 00080 00081 tree_argument_list *dup (symbol_table::scope_id scope, 00082 symbol_table::context_id context) const; 00083 00084 void accept (tree_walker& tw); 00085 00086 private: 00087 00088 bool list_includes_magic_end; 00089 00090 bool simple_assign_lhs; 00091 00092 // No copying! 00093 00094 tree_argument_list (const tree_argument_list&); 00095 00096 tree_argument_list& operator = (const tree_argument_list&); 00097 }; 00098 00099 #endif 00100 00101 /* 00102 ;;; Local Variables: *** 00103 ;;; mode: C++ *** 00104 ;;; End: *** 00105 */