GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
pt-array-list.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2013-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 (HAVE_CONFIG_H)
24 # include "config.h"
25 #endif
26 
27 #include <iostream>
28 
29 #include "quit.h"
30 
31 #include "error.h"
32 #include "pt-array-list.h"
33 
34 namespace octave
35 {
37  {
38  while (! empty ())
39  {
40  iterator p = begin ();
41  delete *p;
42  erase (p);
43  }
44  }
45 
46  bool
48  {
49  for (const tree_argument_list *elt : *this)
50  {
51  octave_quit ();
52 
53  if (! elt->all_elements_are_constant ())
54  return false;
55  }
56 
57  return true;
58  }
59 
60  bool
62  {
63  for (const tree_argument_list *elt : *this)
64  {
65  octave_quit ();
66 
67  if (elt && elt->has_magic_end ())
68  return true;
69  }
70 
71  return false;
72  }
73 
74  void
76  {
77  tree_expression::copy_base (array_list);
78  }
79 
80  void
82  symbol_scope& scope)
83  {
84  for (const tree_argument_list *elt : array_list)
85  append (elt ? elt->dup (scope) : nullptr);
86 
87  copy_base (*this);
88  }
89 
92  {
94  return nullptr;
95  }
96 
97  void
99  {
100  panic_impossible ();
101  }
102 }
void copy_base(const tree_array_list &array_list)
bool all_elements_are_constant(void) const
Definition: pt-arg-list.cc:90
virtual void copy_base(const tree_expression &e)
Definition: pt-exp.h:130
bool has_magic_end(void) const
#define panic_impossible()
Definition: error.h:40
base_list< tree_argument_list * >::iterator iterator
Definition: pt-array-list.h:44
bool all_elements_are_constant(void) const
p
Definition: lu.cc:138
bool has_magic_end(void) const
Definition: pt-arg-list.cc:63
tree_expression * dup(symbol_scope &scope) const
void append(const tree_argument_list * &s)
Definition: base-list.h:110
void accept(tree_walker &tw)