GNU Octave  6.2.0
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-2021 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if ! defined (octave_pt_arg_list_h)
27 #define octave_pt_arg_list_h 1
28 
29 #include "octave-config.h"
30 
31 #include <list>
32 
33 class octave_value;
34 class octave_value_list;
35 
36 #include "str-vec.h"
37 
38 #include "base-list.h"
39 #include "pt-walk.h"
40 
41 namespace octave
42 {
43  class symbol_scope;
44  class tree_evaluator;
45  class tree_expression;
46 
47  // Argument lists. Used to hold the list of expressions that are the
48  // arguments in a function call or index expression.
49 
50  class tree_argument_list : public base_list<tree_expression *>
51  {
52  public:
53 
55 
58  { }
59 
62  { append (t); }
63 
64  // No copying!
65 
67 
69 
70  ~tree_argument_list (void);
71 
72  bool has_magic_tilde (void) const
73  {
75  }
76 
77  bool includes_magic_tilde (void) const
78  {
80  }
81 
83  {
84  auto p = begin ();
85  tree_expression *retval = *p;
86  erase (p);
87  return retval;
88  }
89 
90  void append (const element_type& s);
91 
93 
94  bool is_simple_assign_lhs (void) { return m_simple_assign_lhs; }
95 
96  bool all_elements_are_constant (void) const;
97 
98  bool is_valid_lvalue_list (void) const;
99 
100  string_vector get_arg_names (void) const;
101 
102  std::list<std::string> variable_names (void) const;
103 
104  tree_argument_list * dup (symbol_scope& scope) const;
105 
106  void accept (tree_walker& tw)
107  {
108  tw.visit_argument_list (*this);
109  }
110 
111  private:
112 
114 
116  };
117 }
118 
119 #if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS)
120 
121 // tree_argument_list is derived from a template.
122 
123 #endif
124 
125 #endif
iterator erase(iterator pos)
Definition: base-list.h:55
tree_expression * remove_front(void)
Definition: pt-arg-list.h:82
tree_argument_list & operator=(const tree_argument_list &)=delete
tree_argument_list(tree_expression *t)
Definition: pt-arg-list.h:60
void mark_as_simple_assign_lhs(void)
Definition: pt-arg-list.h:92
string_vector get_arg_names(void) const
Definition: pt-arg-list.cc:101
void append(const element_type &s)
Definition: pt-arg-list.cc:57
void accept(tree_walker &tw)
Definition: pt-arg-list.h:106
tree_argument_list * dup(symbol_scope &scope) const
Definition: pt-arg-list.cc:141
std::list< std::string > variable_names(void) const
Definition: pt-arg-list.cc:116
tree_argument_list(const tree_argument_list &)=delete
bool is_valid_lvalue_list(void) const
Definition: pt-arg-list.cc:81
bool is_simple_assign_lhs(void)
Definition: pt-arg-list.h:94
bool all_elements_are_constant(void) const
Definition: pt-arg-list.cc:69
bool has_magic_tilde(void) const
Definition: pt-arg-list.h:72
bool includes_magic_tilde(void) const
Definition: pt-arg-list.h:77
tree_expression * element_type
Definition: pt-arg-list.h:54
virtual void visit_argument_list(tree_argument_list &)
Definition: pt-walk.cc:39
octave_value::octave_value(const Array< char > &chm, char type) return retval
Definition: ov.cc:811