GNU Octave  3.8.0
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-2013 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 <list>
27 
28 class octave_value_list;
29 class octave_lvalue;
30 class tree_expression;
31 class tree_walker;
32 
33 #include "str-vec.h"
34 
35 #include "base-list.h"
36 #include "symtab.h"
37 
38 // Argument lists. Used to hold the list of expressions that are the
39 // arguments in a function call or index expression.
40 
41 class
43 {
44 public:
45 
47 
49  : list_includes_magic_end (false), list_includes_magic_tilde (false),
50  simple_assign_lhs (false) { }
51 
53  : list_includes_magic_end (false), list_includes_magic_tilde (false),
54  simple_assign_lhs (false)
55  { append (t); }
56 
57  ~tree_argument_list (void);
58 
59  bool has_magic_end (void) const;
60 
61  bool has_magic_tilde (void) const
62  { return list_includes_magic_tilde; }
63 
64  tree_expression *remove_front (void)
65  {
66  iterator p = begin ();
67  tree_expression *retval = *p;
68  erase (p);
69  return retval;
70  }
71 
72  void append (const element_type& s);
73 
74  void mark_as_simple_assign_lhs (void) { simple_assign_lhs = true; }
75 
76  bool is_simple_assign_lhs (void) { return simple_assign_lhs; }
77 
78  bool all_elements_are_constant (void) const;
79 
80  bool is_valid_lvalue_list (void) const;
81 
82  octave_value_list convert_to_const_vector (const octave_value *object = 0);
83 
84  std::list<octave_lvalue> lvalue_list (void);
85 
86  string_vector get_arg_names (void) const;
87 
88  std::list<std::string> variable_names (void) const;
89 
92 
93  void accept (tree_walker& tw);
94 
95 private:
96 
98 
100 
102 
103  // No copying!
104 
106 
108 };
109 
110 #endif