GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
pt-misc.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 1994-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 (HAVE_CONFIG_H)
27 # include "config.h"
28 #endif
29 
30 #include "pt-idx.h"
31 #include "pt-misc.h"
32 
33 namespace octave
34 {
35  // Parameter lists.
36 
38  {
39  while (! empty ())
40  {
41  auto p = begin ();
42  delete *p;
43  erase (p);
44  }
45  }
46 
47  void
49  {
50  for (tree_decl_elt *elt : *this)
52  }
53 
54  std::list<std::string>
56  {
57  std::list<std::string> retval;
58 
59  for (tree_decl_elt *elt : *this)
60  retval.push_back (elt->name ());
61 
63  retval.push_back (varargs_symbol_name ());
64 
65  return retval;
66  }
67 
70  {
72 
74 
75  for (const tree_decl_elt *elt : *this)
76  new_list->append (elt->dup (scope));
77 
78  return new_list;
79  }
80 }
void append(const elt_type &s)
Definition: base-list.h:92
iterator erase(iterator pos)
Definition: base-list.h:55
std::string name(void) const
Definition: pt-decl.h:90
void mark_as_formal_parameter(void)
Definition: pt-decl.h:70
tree_decl_elt * dup(symbol_scope &scope) const
Definition: pt-decl.cc:61
tree_parameter_list(in_or_out io)
Definition: pt-misc.h:55
std::string varargs_symbol_name(void) const
Definition: pt-misc.h:95
std::list< std::string > variable_names(void) const
Definition: pt-misc.cc:55
tree_parameter_list * dup(symbol_scope &scope) const
Definition: pt-misc.cc:69
void mark_as_formal_parameters(void)
Definition: pt-misc.cc:48
octave_value::octave_value(const Array< char > &chm, char type) return retval
Definition: ov.cc:811