GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
pt-arg-list.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1996-2017 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 the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 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 <http://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_list;
31 class octave_lvalue;
32 class tree_expression;
33 class tree_walker;
34 
35 #include "str-vec.h"
36 
37 #include "base-list.h"
38 #include "symtab.h"
39 
40 // Argument lists. Used to hold the list of expressions that are the
41 // arguments in a function call or index expression.
42 
43 class
45 {
46 public:
47 
49 
51  : list_includes_magic_end (false), list_includes_magic_tilde (false),
52  simple_assign_lhs (false) { }
53 
55  : list_includes_magic_end (false), list_includes_magic_tilde (false),
56  simple_assign_lhs (false)
57  { append (t); }
58 
59  ~tree_argument_list (void);
60 
61  bool has_magic_end (void) const;
62 
63  bool has_magic_tilde (void) const
64  { return list_includes_magic_tilde; }
65 
67  {
68  iterator p = begin ();
70  erase (p);
71  return retval;
72  }
73 
74  void append (const element_type& s);
75 
76  void mark_as_simple_assign_lhs (void) { simple_assign_lhs = true; }
77 
78  bool is_simple_assign_lhs (void) { return simple_assign_lhs; }
79 
80  bool all_elements_are_constant (void) const;
81 
82  bool is_valid_lvalue_list (void) const;
83 
84  octave_value_list convert_to_const_vector (const octave_value *object = 0);
85 
86  std::list<octave_lvalue> lvalue_list (void);
87 
88  string_vector get_arg_names (void) const;
89 
90  std::list<std::string> variable_names (void) const;
91 
94 
95  void accept (tree_walker& tw);
96 
97 private:
98 
100 
102 
104 
105  // No copying!
106 
108 
110 };
111 
112 #endif
tree_expression * element_type
Definition: pt-arg-list.h:48
tree_expression * remove_front(void)
Definition: pt-arg-list.h:66
bool has_magic_tilde(void) const
Definition: pt-arg-list.h:63
void mark_as_simple_assign_lhs(void)
Definition: pt-arg-list.h:76
bool list_includes_magic_tilde
Definition: pt-arg-list.h:101
std::list< tree_expression * >::iterator iterator
Definition: base-list.h:40
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:935
s
Definition: file-io.cc:2682
tree_argument_list(tree_expression *t)
Definition: pt-arg-list.h:54
bool list_includes_magic_end
Definition: pt-arg-list.h:99
static llvm::LLVMContext & context
Definition: jit-typeinfo.cc:76
tree_argument_list(void)
Definition: pt-arg-list.h:50
is false
Definition: cellfun.cc:398
octave_value retval
Definition: data.cc:6294
bool append
Definition: load-save.cc:1582
p
Definition: lu.cc:138
tree_walker & operator=(const tree_walker &)
bool is_simple_assign_lhs(void)
Definition: pt-arg-list.h:78