GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
pt-arg-list.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1996-2018 John W. Eaton
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
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License 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, see
19 <https://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if ! defined (octave_pt_arg_list_h)
24 #define octave_pt_arg_list_h 1
25 
26 #include "octave-config.h"
27 
28 #include <list>
29 
30 class octave_value;
31 class octave_value_list;
32 
33 #include "str-vec.h"
34 
35 #include "base-list.h"
36 #include "pt-walk.h"
37 
38 namespace octave
39 {
40  class symbol_scope;
41  class tree_evaluator;
42  class tree_expression;
43 
44  // Argument lists. Used to hold the list of expressions that are the
45  // arguments in a function call or index expression.
46 
47  class tree_argument_list : public base_list<tree_expression *>
48  {
49  public:
50 
52 
56 
60  { append (t); }
61 
62  // No copying!
63 
64  tree_argument_list (const tree_argument_list&) = delete;
65 
67 
68  ~tree_argument_list (void);
69 
70  bool has_magic_end (void) const;
71 
72  bool has_magic_tilde (void) const
73  { return m_list_includes_magic_tilde; }
74 
76  {
77  iterator p = begin ();
79  erase (p);
80  return retval;
81  }
82 
83  void append (const element_type& s);
84 
86 
87  bool is_simple_assign_lhs (void) { return m_simple_assign_lhs; }
88 
89  bool all_elements_are_constant (void) const;
90 
91  bool is_valid_lvalue_list (void) const;
92 
95  const octave_value *object = nullptr);
96 
97  string_vector get_arg_names (void) const;
98 
99  std::list<std::string> variable_names (void) const;
100 
101  tree_argument_list * dup (symbol_scope& scope) const;
102 
103  void accept (tree_walker& tw)
104  {
105  tw.visit_argument_list (*this);
106  }
107 
108  private:
109 
111 
113 
115  };
116 }
117 
118 #if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS)
119 
120 // tree_argument_list is derived from a template.
121 
122 #endif
123 
124 #endif
tree_expression * element_type
Definition: pt-arg-list.h:51
std::list< tree_expression * >::iterator iterator
Definition: base-list.h:40
tree_argument_list * dup(symbol_scope &scope) const
iterator erase(iterator pos)
Definition: base-list.h:52
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function t
Definition: ov-usr-fcn.cc:997
tree_argument_list(tree_expression *t)
Definition: pt-arg-list.h:57
bool all_elements_are_constant(void) const
Definition: pt-arg-list.cc:90
s
Definition: file-io.cc:2729
virtual void visit_argument_list(tree_argument_list &)=0
bool has_magic_tilde(void) const
Definition: pt-arg-list.h:72
tree_argument_list & operator=(const tree_argument_list &)=delete
tree_expression * remove_front(void)
Definition: pt-arg-list.h:75
string_vector get_arg_names(void) const
is false
Definition: cellfun.cc:400
octave_value retval
Definition: data.cc:6246
std::list< std::string > variable_names(void) const
void append(const element_type &s)
Definition: pt-arg-list.cc:75
p
Definition: lu.cc:138
bool is_simple_assign_lhs(void)
Definition: pt-arg-list.h:87
octave_value_list convert_to_const_vector(tree_evaluator *tw, const octave_value *object=nullptr)
bool has_magic_end(void) const
Definition: pt-arg-list.cc:63
void accept(tree_walker &tw)
Definition: pt-arg-list.h:103
void mark_as_simple_assign_lhs(void)
Definition: pt-arg-list.h:85
bool is_valid_lvalue_list(void) const
Definition: pt-arg-list.cc:102