577
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
577
|
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 2, or (at your option) any |
|
10 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, write to the Free |
1315
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
577
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_tree_misc_h) |
|
24 #define octave_tree_misc_h 1 |
|
25 |
1297
|
26 #if defined (__GNUG__) |
|
27 #pragma interface |
|
28 #endif |
|
29 |
577
|
30 #include <SLList.h> |
|
31 |
2982
|
32 class octave_value; |
|
33 class octave_value_list; |
577
|
34 |
2982
|
35 class tree_identifier; |
|
36 class tree_index_expression; |
|
37 class tree_va_return_list; |
1588
|
38 |
2982
|
39 class tree_walker; |
577
|
40 |
|
41 // Parameter lists. Used to hold the list of input and output |
|
42 // parameters in a function definition. Elements are identifiers |
|
43 // only. |
|
44 |
|
45 class |
2124
|
46 tree_parameter_list : public SLList<tree_identifier *> |
577
|
47 { |
|
48 public: |
2124
|
49 |
1227
|
50 tree_parameter_list (void) |
2124
|
51 : SLList<tree_identifier *> (), marked_for_varargs (0) { } |
632
|
52 |
1227
|
53 tree_parameter_list (tree_identifier *t) |
2124
|
54 : SLList<tree_identifier *> (), marked_for_varargs (0) { append (t); } |
577
|
55 |
1740
|
56 ~tree_parameter_list (void); |
577
|
57 |
|
58 void mark_as_formal_parameters (void); |
|
59 |
|
60 void mark_varargs (void) |
|
61 { marked_for_varargs = 1; } |
|
62 |
1827
|
63 bool takes_varargs (void) const |
|
64 { return marked_for_varargs != 0; } |
577
|
65 |
|
66 void mark_varargs_only (void) |
|
67 { marked_for_varargs = -1; } |
|
68 |
1827
|
69 bool varargs_only (void) |
577
|
70 { return (marked_for_varargs < 0); } |
|
71 |
2086
|
72 void initialize_undefined_elements (octave_value& val); |
1093
|
73 |
2086
|
74 void define_from_arg_vector (const octave_value_list& args); |
577
|
75 |
1827
|
76 bool is_defined (void); |
577
|
77 |
2086
|
78 octave_value_list convert_to_const_vector (tree_va_return_list *vr_list); |
577
|
79 |
2124
|
80 void accept (tree_walker& tw); |
581
|
81 |
577
|
82 private: |
2124
|
83 |
577
|
84 int marked_for_varargs; |
|
85 }; |
|
86 |
|
87 // Return lists. Used to hold the right hand sides of multiple |
|
88 // assignment expressions. |
|
89 |
|
90 class |
2124
|
91 tree_return_list : public SLList<tree_index_expression *> |
577
|
92 { |
|
93 public: |
2124
|
94 |
1227
|
95 tree_return_list (void) |
2124
|
96 : SLList<tree_index_expression *> () { } |
1227
|
97 |
577
|
98 tree_return_list (tree_index_expression *t) |
2124
|
99 : SLList<tree_index_expression *> () { append (t); } |
577
|
100 |
1740
|
101 ~tree_return_list (void); |
581
|
102 |
2124
|
103 void accept (tree_walker& tw); |
577
|
104 }; |
|
105 |
723
|
106 class |
2086
|
107 tree_va_return_list : public SLList<octave_value> |
723
|
108 { |
|
109 public: |
2124
|
110 |
2086
|
111 tree_va_return_list (void) : SLList<octave_value> () { } |
1269
|
112 |
|
113 ~tree_va_return_list (void) { } |
723
|
114 }; |
|
115 |
577
|
116 #endif |
|
117 |
|
118 /* |
|
119 ;;; Local Variables: *** |
|
120 ;;; mode: C++ *** |
|
121 ;;; End: *** |
|
122 */ |