Mercurial > octave
comparison src/pt-const.cc @ 1199:4f1bfa351b99
[project @ 1995-03-31 22:16:54 by jwe]
author | jwe |
---|---|
date | Fri, 31 Mar 1995 22:21:38 +0000 |
parents | b6360f2d4fa6 |
children | db4f4009d6e8 |
comparison
equal
deleted
inserted
replaced
1198:1352ecca2d91 | 1199:4f1bfa351b99 |
---|---|
24 #ifdef HAVE_CONFIG_H | 24 #ifdef HAVE_CONFIG_H |
25 #include <config.h> | 25 #include <config.h> |
26 #endif | 26 #endif |
27 | 27 |
28 #include <iostream.h> | 28 #include <iostream.h> |
29 #include <strstream.h> | |
29 | 30 |
30 #include "tree-const.h" | 31 #include "tree-const.h" |
32 #include "user-prefs.h" | |
33 #include "pager.h" | |
31 #include "error.h" | 34 #include "error.h" |
32 #include "gripes.h" | 35 #include "gripes.h" |
33 #include "user-prefs.h" | |
34 #include "oct-map.h" | 36 #include "oct-map.h" |
35 | 37 |
36 // The following three variables could be made static members of the | 38 // The following three variables could be made static members of the |
37 // tree_constant class. | 39 // tree_constant class. |
38 | 40 |
130 if (! p) | 132 if (! p) |
131 retval = tmp; | 133 retval = tmp; |
132 } | 134 } |
133 | 135 |
134 return retval; | 136 return retval; |
137 } | |
138 | |
139 void | |
140 tree_constant::print (void) | |
141 { | |
142 ostrstream output_buf; | |
143 print (output_buf); | |
144 output_buf << ends; | |
145 maybe_page_output (output_buf); | |
135 } | 146 } |
136 | 147 |
137 // Simple structure assignment. | 148 // Simple structure assignment. |
138 | 149 |
139 void | 150 void |
247 if (rep) | 258 if (rep) |
248 rep->print_code (os); | 259 rep->print_code (os); |
249 | 260 |
250 if (in_parens) | 261 if (in_parens) |
251 os << ")"; | 262 os << ")"; |
263 } | |
264 | |
265 int | |
266 print_as_scalar (const tree_constant& val) | |
267 { | |
268 int nr = val.rows (); | |
269 int nc = val.columns (); | |
270 return (val.is_scalar_type () | |
271 || val.is_string () | |
272 || (val.is_matrix_type () | |
273 && ((nr == 1 && nc == 1) | |
274 || nr == 0 | |
275 || nc == 0))); | |
276 } | |
277 | |
278 int | |
279 print_as_structure (const tree_constant& val) | |
280 { | |
281 return val.is_map (); | |
252 } | 282 } |
253 | 283 |
254 // Construct return vector of empty matrices. Return empty matrices | 284 // Construct return vector of empty matrices. Return empty matrices |
255 // and/or gripe when appropriate. | 285 // and/or gripe when appropriate. |
256 | 286 |