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-misc.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1994-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_misc_h)
24 #define octave_pt_misc_h 1
25 
26 #include "octave-config.h"
27 
28 class Cell;
29 
30 class octave_value;
31 class octave_value_list;
32 
33 class tree_identifier;
36 
37 class tree_walker;
38 
39 #include "base-list.h"
40 #include "pt-decl.h"
41 #include "symtab.h"
42 
43 // Parameter lists. Used to hold the list of input and output
44 // parameters in a function definition. Elements are identifiers
45 // only.
46 
47 class
49 {
50 public:
51 
52  enum in_or_out
53  {
54  in = 1,
55  out = 2
56  };
57 
59  : marked_for_varargs (0) { }
60 
62  : marked_for_varargs (0) { append (t); }
63 
65  : marked_for_varargs (0) { append (new tree_decl_elt (id)); }
66 
67  ~tree_parameter_list (void);
68 
69  void mark_as_formal_parameters (void);
70 
71  bool validate (in_or_out type);
72 
73  bool takes_varargs (void) const { return marked_for_varargs != 0; }
74 
75  bool varargs_only (void) { return (marked_for_varargs < 0); }
76 
77  void initialize_undefined_elements (const std::string& warnfor,
78  int nargout, const octave_value& val);
79 
80  void define_from_arg_vector (const octave_value_list& args);
81 
82  void undefine (void);
83 
84  bool is_defined (void);
85 
86  std::list<std::string> variable_names (void) const;
87 
88  octave_value_list convert_to_const_vector (int nargout,
89  const Cell& varargout);
90 
93 
94  void accept (tree_walker& tw);
95 
96 private:
97 
99 
100  void mark_varargs (void) { marked_for_varargs = 1; }
101 
102  void mark_varargs_only (void) { marked_for_varargs = -1; }
103 
104  // No copying!
105 
107 
109 };
110 
111 // Return lists. Used to hold the right hand sides of multiple
112 // assignment expressions.
113 
114 class
116 {
117 public:
118 
119  tree_return_list (void) { }
120 
122 
123  ~tree_return_list (void);
124 
127 
128  void accept (tree_walker& tw);
129 
130 private:
131 
132  // No copying!
133 
135 
137 };
138 
139 class
141 {
142 public:
143 
145 
147 
148 private:
149 
150  // No copying!
151 
153 
155 };
156 
157 #endif
tree_parameter_list(tree_decl_elt *t)
Definition: pt-misc.h:61
Definition: Cell.h:37
identity matrix If supplied two scalar respectively For allows like xample val
Definition: data.cc:5068
bool varargs_only(void)
Definition: pt-misc.h:75
void mark_varargs(void)
Definition: pt-misc.h:100
tree_return_list(tree_index_expression *t)
Definition: pt-misc.h:121
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
~tree_va_return_list(void)
Definition: pt-misc.h:146
tree_parameter_list(tree_identifier *id)
Definition: pt-misc.h:64
JNIEnv void * args
Definition: ov-java.cc:67
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function xample nargout(@histc)
Definition: ov-usr-fcn.cc:935
static llvm::LLVMContext & context
Definition: jit-typeinfo.cc:76
bool append
Definition: load-save.cc:1582
tree_return_list(void)
Definition: pt-misc.h:119
idx type
Definition: ov.cc:3129
tree_parameter_list(void)
Definition: pt-misc.h:58
bool takes_varargs(void) const
Definition: pt-misc.h:73
tree_va_return_list(void)
Definition: pt-misc.h:144
int marked_for_varargs
Definition: pt-misc.h:98
void mark_varargs_only(void)
Definition: pt-misc.h:102
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:854
tree_walker & operator=(const tree_walker &)