GNU Octave  8.1.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-2023 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 
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 
119 
120 #endif
OCTAVE_END_NAMESPACE(octave)
iterator erase(iterator pos)
Definition: base-list.h:55
bool m_list_includes_magic_tilde
Definition: pt-arg-list.h:113
bool has_magic_tilde(void) const
Definition: pt-arg-list.h:72
string_vector get_arg_names(void) const
Definition: pt-arg-list.cc:101
bool is_valid_lvalue_list(void) const
Definition: pt-arg-list.cc:81
bool includes_magic_tilde(void) const
Definition: pt-arg-list.h:77
std::list< std::string > variable_names(void) const
Definition: pt-arg-list.cc:116
tree_argument_list & operator=(const tree_argument_list &)=delete
tree_argument_list(const tree_argument_list &)=delete
void accept(tree_walker &tw)
Definition: pt-arg-list.h:106
tree_expression * remove_front(void)
Definition: pt-arg-list.h:82
tree_argument_list(tree_expression *t)
Definition: pt-arg-list.h:60
tree_argument_list * dup(symbol_scope &scope) const
Definition: pt-arg-list.cc:141
void append(const element_type &s)
Definition: pt-arg-list.cc:57
void mark_as_simple_assign_lhs(void)
Definition: pt-arg-list.h:92
bool all_elements_are_constant(void) const
Definition: pt-arg-list.cc:69
bool is_simple_assign_lhs(void)
Definition: pt-arg-list.h:94
tree_expression * element_type
Definition: pt-arg-list.h:54
tree_argument_list(void)
Definition: pt-arg-list.h:56
virtual void visit_argument_list(tree_argument_list &)
Definition: pt-walk.cc:47
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn