Mercurial > hg > octave-nkf
annotate src/pt-misc.h @ 7923:c3d21b9b94b6
eliminate octave_call_stack member functions caller_user_script and caller_user_function, and unused difference_type args
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 11 Jul 2008 15:43:10 -0400 |
parents | 71f068b22fcc |
children | 35cd375d4bb3 |
rev | line source |
---|---|
577 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1994, 1995, 1996, 1997, 1999, 2002, 2003, 2004, 2005, |
4 2006, 2007 John W. Eaton | |
577 | 5 |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
577 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
577 | 21 |
22 */ | |
23 | |
24 #if !defined (octave_tree_misc_h) | |
25 #define octave_tree_misc_h 1 | |
26 | |
5848 | 27 class Cell; |
28 | |
2982 | 29 class octave_value; |
30 class octave_value_list; | |
577 | 31 |
2982 | 32 class tree_identifier; |
33 class tree_index_expression; | |
34 class tree_va_return_list; | |
1588 | 35 |
2982 | 36 class tree_walker; |
577 | 37 |
4219 | 38 #include "base-list.h" |
6215 | 39 #include "pt-decl.h" |
7336 | 40 #include "symtab.h" |
4219 | 41 |
577 | 42 // Parameter lists. Used to hold the list of input and output |
43 // parameters in a function definition. Elements are identifiers | |
44 // only. | |
45 | |
46 class | |
6215 | 47 tree_parameter_list : public octave_base_list<tree_decl_elt *> |
577 | 48 { |
49 public: | |
2124 | 50 |
7587
1f662945c2be
handle varargin and varargout without keywords
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
51 enum in_or_out |
1f662945c2be
handle varargin and varargout without keywords
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
52 { |
1f662945c2be
handle varargin and varargout without keywords
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
53 in = 1, |
1f662945c2be
handle varargin and varargout without keywords
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
54 out = 2 |
1f662945c2be
handle varargin and varargout without keywords
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
55 }; |
1f662945c2be
handle varargin and varargout without keywords
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
56 |
1227 | 57 tree_parameter_list (void) |
4219 | 58 : marked_for_varargs (0) { } |
632 | 59 |
6215 | 60 tree_parameter_list (tree_decl_elt *t) |
4219 | 61 : marked_for_varargs (0) { append (t); } |
577 | 62 |
1740 | 63 ~tree_parameter_list (void); |
577 | 64 |
65 void mark_as_formal_parameters (void); | |
66 | |
7587
1f662945c2be
handle varargin and varargout without keywords
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
67 bool validate (in_or_out type); |
577 | 68 |
3933 | 69 bool takes_varargs (void) const { return marked_for_varargs != 0; } |
577 | 70 |
3933 | 71 bool varargs_only (void) { return (marked_for_varargs < 0); } |
577 | 72 |
4466 | 73 void initialize_undefined_elements (const std::string& warnfor, |
74 int nargout, const octave_value& val); | |
1093 | 75 |
2086 | 76 void define_from_arg_vector (const octave_value_list& args); |
577 | 77 |
4219 | 78 void undefine (void); |
3239 | 79 |
1827 | 80 bool is_defined (void); |
577 | 81 |
5848 | 82 octave_value_list convert_to_const_vector (const Cell& varargout); |
577 | 83 |
7767
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7587
diff
changeset
|
84 tree_parameter_list *dup (symbol_table::scope_id scope, |
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7587
diff
changeset
|
85 symbol_table::context_id context); |
5861 | 86 |
2124 | 87 void accept (tree_walker& tw); |
581 | 88 |
577 | 89 private: |
2124 | 90 |
577 | 91 int marked_for_varargs; |
2988 | 92 |
7587
1f662945c2be
handle varargin and varargout without keywords
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
93 void mark_varargs (void) { marked_for_varargs = 1; } |
1f662945c2be
handle varargin and varargout without keywords
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
94 |
1f662945c2be
handle varargin and varargout without keywords
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
95 void mark_varargs_only (void) { marked_for_varargs = -1; } |
1f662945c2be
handle varargin and varargout without keywords
John W. Eaton <jwe@octave.org>
parents:
7336
diff
changeset
|
96 |
2988 | 97 // No copying! |
98 | |
99 tree_parameter_list (const tree_parameter_list&); | |
100 | |
101 tree_parameter_list& operator = (const tree_parameter_list&); | |
577 | 102 }; |
103 | |
104 // Return lists. Used to hold the right hand sides of multiple | |
105 // assignment expressions. | |
106 | |
107 class | |
4219 | 108 tree_return_list : public octave_base_list<tree_index_expression *> |
577 | 109 { |
110 public: | |
2124 | 111 |
4219 | 112 tree_return_list (void) { } |
1227 | 113 |
4219 | 114 tree_return_list (tree_index_expression *t) { append (t); } |
577 | 115 |
1740 | 116 ~tree_return_list (void); |
581 | 117 |
7767
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7587
diff
changeset
|
118 tree_return_list *dup (symbol_table::scope_id scope, |
71f068b22fcc
scope and context fixes for function handles
John W. Eaton <jwe@octave.org>
parents:
7587
diff
changeset
|
119 symbol_table::context_id context); |
5861 | 120 |
2124 | 121 void accept (tree_walker& tw); |
2988 | 122 |
123 private: | |
124 | |
125 // No copying! | |
126 | |
127 tree_return_list (const tree_return_list&); | |
128 | |
129 tree_return_list& operator = (const tree_return_list&); | |
577 | 130 }; |
131 | |
723 | 132 class |
4219 | 133 tree_va_return_list : public octave_base_list<octave_value> |
723 | 134 { |
135 public: | |
2124 | 136 |
4219 | 137 tree_va_return_list (void) { } |
1269 | 138 |
139 ~tree_va_return_list (void) { } | |
2988 | 140 |
141 private: | |
142 | |
143 // No copying! | |
144 | |
145 tree_va_return_list (const tree_va_return_list&); | |
146 | |
147 tree_va_return_list& operator = (const tree_va_return_list&); | |
723 | 148 }; |
149 | |
577 | 150 #endif |
151 | |
152 /* | |
153 ;;; Local Variables: *** | |
154 ;;; mode: C++ *** | |
155 ;;; End: *** | |
156 */ |