1741
|
1 /* |
|
2 |
1827
|
3 Copyright (C) 1996 John W. Eaton |
1741
|
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 |
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
|
21 */ |
|
22 |
|
23 #if defined (__GNUG__) |
|
24 #pragma implementation |
|
25 #endif |
|
26 |
|
27 #ifdef HAVE_CONFIG_H |
|
28 #include <config.h> |
|
29 #endif |
|
30 |
|
31 #include <iostream.h> |
|
32 #include <strstream.h> |
|
33 |
|
34 #include "defun.h" |
|
35 #include "error.h" |
|
36 #include "gripes.h" |
|
37 #include "help.h" |
|
38 #include "input.h" |
|
39 #include "oct-obj.h" |
|
40 #include "pager.h" |
|
41 #include "pt-const.h" |
|
42 #include "pt-exp.h" |
|
43 #include "pt-fvc.h" |
|
44 #include "pt-misc.h" |
|
45 #include "pt-mvr.h" |
|
46 #include "user-prefs.h" |
|
47 #include "utils.h" |
|
48 |
|
49 // Nonzero means we're returning from a function. |
|
50 extern int returning; |
|
51 |
|
52 // Nonzero means we're breaking out of a loop or function body. |
|
53 extern int breaking; |
|
54 |
|
55 // Prefix expressions. |
|
56 |
|
57 tree_prefix_expression::~tree_prefix_expression (void) |
|
58 { |
|
59 delete id; |
|
60 } |
|
61 |
2086
|
62 octave_value |
1827
|
63 tree_prefix_expression::eval (bool print) |
1741
|
64 { |
2086
|
65 octave_value retval; |
1741
|
66 |
|
67 if (error_state) |
|
68 return retval; |
|
69 |
|
70 if (id) |
|
71 { |
|
72 id->bump_value (etype); |
|
73 if (error_state) |
|
74 eval_error (); |
|
75 else |
|
76 { |
|
77 retval = id->eval (print); |
|
78 if (error_state) |
|
79 { |
2086
|
80 retval = octave_value (); |
1741
|
81 if (error_state) |
|
82 eval_error (); |
|
83 } |
|
84 } |
|
85 } |
|
86 return retval; |
|
87 } |
|
88 |
|
89 char * |
|
90 tree_prefix_expression::oper (void) const |
|
91 { |
|
92 static char *op; |
|
93 switch (etype) |
|
94 { |
|
95 case tree_expression::increment: |
|
96 op = "++"; |
|
97 break; |
|
98 |
|
99 case tree_expression::decrement: |
|
100 op = "--"; |
|
101 break; |
|
102 |
|
103 default: |
|
104 op = "<unknown>"; |
|
105 break; |
|
106 } |
|
107 return op; |
|
108 } |
|
109 |
|
110 void |
|
111 tree_prefix_expression::eval_error (void) |
|
112 { |
|
113 if (error_state > 0) |
|
114 { |
|
115 char *op = oper (); |
|
116 |
|
117 ::error ("evaluating prefix operator `%s' near line %d, column %d", |
|
118 op, line (), column ()); |
|
119 } |
|
120 } |
|
121 |
|
122 void |
|
123 tree_prefix_expression::print_code (ostream& os) |
|
124 { |
|
125 print_code_indent (os); |
|
126 |
|
127 if (in_parens) |
|
128 os << "("; |
|
129 |
|
130 os << oper (); |
|
131 |
|
132 if (id) |
|
133 id->print_code (os); |
|
134 |
|
135 if (in_parens) |
|
136 os << ")"; |
|
137 } |
|
138 |
|
139 // Postfix expressions. |
|
140 |
|
141 tree_postfix_expression::~tree_postfix_expression (void) |
|
142 { |
|
143 delete id; |
|
144 } |
|
145 |
2086
|
146 octave_value |
1827
|
147 tree_postfix_expression::eval (bool print) |
1741
|
148 { |
2086
|
149 octave_value retval; |
1741
|
150 |
|
151 if (error_state) |
|
152 return retval; |
|
153 |
|
154 if (id) |
|
155 { |
|
156 retval = id->eval (print); |
|
157 id->bump_value (etype); |
|
158 if (error_state) |
|
159 { |
2086
|
160 retval = octave_value (); |
1741
|
161 if (error_state) |
|
162 eval_error (); |
|
163 } |
|
164 } |
|
165 return retval; |
|
166 } |
|
167 |
|
168 char * |
|
169 tree_postfix_expression::oper (void) const |
|
170 { |
|
171 static char *op; |
|
172 switch (etype) |
|
173 { |
|
174 case tree_expression::increment: |
|
175 op = "++"; |
|
176 break; |
|
177 |
|
178 case tree_expression::decrement: |
|
179 op = "--"; |
|
180 break; |
|
181 |
|
182 default: |
|
183 op = "<unknown>"; |
|
184 break; |
|
185 } |
|
186 return op; |
|
187 } |
|
188 |
|
189 void |
|
190 tree_postfix_expression::eval_error (void) |
|
191 { |
|
192 if (error_state > 0) |
|
193 { |
|
194 char *op = oper (); |
|
195 |
|
196 ::error ("evaluating postfix operator `%s' near line %d, column %d", |
|
197 op, line (), column ()); |
|
198 } |
|
199 } |
|
200 |
|
201 void |
|
202 tree_postfix_expression::print_code (ostream& os) |
|
203 { |
|
204 print_code_indent (os); |
|
205 |
|
206 if (in_parens) |
|
207 os << "("; |
|
208 |
|
209 if (id) |
|
210 id->print_code (os); |
|
211 |
|
212 os << oper (); |
|
213 |
|
214 if (in_parens) |
|
215 os << ")"; |
|
216 } |
|
217 |
|
218 // Unary expressions. |
|
219 |
2086
|
220 octave_value |
1827
|
221 tree_unary_expression::eval (bool /* print */) |
1741
|
222 { |
|
223 if (error_state) |
2086
|
224 return octave_value (); |
1741
|
225 |
2086
|
226 octave_value retval; |
1741
|
227 |
|
228 switch (etype) |
|
229 { |
|
230 case tree_expression::not: |
|
231 case tree_expression::uminus: |
|
232 case tree_expression::hermitian: |
|
233 case tree_expression::transpose: |
|
234 if (op) |
|
235 { |
2086
|
236 octave_value u = op->eval (false); |
1741
|
237 if (error_state) |
|
238 eval_error (); |
|
239 else if (u.is_defined ()) |
|
240 { |
|
241 retval = do_unary_op (u, etype); |
|
242 if (error_state) |
|
243 { |
2086
|
244 retval = octave_value (); |
1741
|
245 if (error_state) |
|
246 eval_error (); |
|
247 } |
|
248 } |
|
249 } |
|
250 break; |
|
251 |
|
252 default: |
|
253 ::error ("unary operator %d not implemented", etype); |
|
254 break; |
|
255 } |
|
256 |
|
257 return retval; |
|
258 } |
|
259 |
|
260 char * |
|
261 tree_unary_expression::oper (void) const |
|
262 { |
|
263 static char *op; |
|
264 switch (etype) |
|
265 { |
|
266 case tree_expression::not: |
|
267 op = "!"; |
|
268 break; |
|
269 |
|
270 case tree_expression::uminus: |
|
271 op = "-"; |
|
272 break; |
|
273 |
|
274 case tree_expression::hermitian: |
|
275 op = "'"; |
|
276 break; |
|
277 |
|
278 case tree_expression::transpose: |
|
279 op = ".'"; |
|
280 break; |
|
281 |
|
282 default: |
|
283 op = "<unknown>"; |
|
284 break; |
|
285 } |
|
286 return op; |
|
287 } |
|
288 |
|
289 void |
|
290 tree_unary_expression::eval_error (void) |
|
291 { |
|
292 if (error_state > 0) |
|
293 { |
|
294 char *op = oper (); |
|
295 |
|
296 ::error ("evaluating unary operator `%s' near line %d, column %d", |
|
297 op, line (), column ()); |
|
298 } |
|
299 } |
|
300 |
|
301 void |
|
302 tree_unary_expression::print_code (ostream& os) |
|
303 { |
|
304 print_code_indent (os); |
|
305 |
|
306 if (in_parens) |
|
307 os << "("; |
|
308 |
|
309 switch (etype) |
|
310 { |
|
311 case tree_expression::not: |
|
312 case tree_expression::uminus: |
|
313 os << oper (); |
|
314 if (op) |
|
315 op->print_code (os); |
|
316 break; |
|
317 |
|
318 case tree_expression::hermitian: |
|
319 case tree_expression::transpose: |
|
320 if (op) |
|
321 op->print_code (os); |
|
322 os << oper (); |
|
323 break; |
|
324 |
|
325 default: |
|
326 os << oper (); |
|
327 if (op) |
|
328 op->print_code (os); |
|
329 break; |
|
330 } |
|
331 |
|
332 if (in_parens) |
|
333 os << ")"; |
|
334 } |
|
335 |
|
336 // Binary expressions. |
|
337 |
2086
|
338 octave_value |
1827
|
339 tree_binary_expression::eval (bool /* print */) |
1741
|
340 { |
|
341 if (error_state) |
2086
|
342 return octave_value (); |
1741
|
343 |
2086
|
344 octave_value retval; |
1741
|
345 |
|
346 switch (etype) |
|
347 { |
|
348 case tree_expression::add: |
|
349 case tree_expression::subtract: |
|
350 case tree_expression::multiply: |
|
351 case tree_expression::el_mul: |
|
352 case tree_expression::divide: |
|
353 case tree_expression::el_div: |
|
354 case tree_expression::leftdiv: |
|
355 case tree_expression::el_leftdiv: |
|
356 case tree_expression::power: |
|
357 case tree_expression::elem_pow: |
|
358 case tree_expression::cmp_lt: |
|
359 case tree_expression::cmp_le: |
|
360 case tree_expression::cmp_eq: |
|
361 case tree_expression::cmp_ge: |
|
362 case tree_expression::cmp_gt: |
|
363 case tree_expression::cmp_ne: |
|
364 case tree_expression::and: |
|
365 case tree_expression::or: |
|
366 if (op1) |
|
367 { |
2086
|
368 octave_value a = op1->eval (false); |
1741
|
369 if (error_state) |
|
370 eval_error (); |
|
371 else if (a.is_defined () && op2) |
|
372 { |
2086
|
373 octave_value b = op2->eval (false); |
1741
|
374 if (error_state) |
|
375 eval_error (); |
|
376 else if (b.is_defined ()) |
|
377 { |
|
378 retval = do_binary_op (a, b, etype); |
|
379 if (error_state) |
|
380 { |
2086
|
381 retval = octave_value (); |
1741
|
382 if (error_state) |
|
383 eval_error (); |
|
384 } |
|
385 } |
|
386 } |
|
387 } |
|
388 break; |
|
389 |
|
390 case tree_expression::and_and: |
|
391 case tree_expression::or_or: |
|
392 { |
1827
|
393 bool result = false; |
1741
|
394 if (op1) |
|
395 { |
2086
|
396 octave_value a = op1->eval (false); |
1741
|
397 if (error_state) |
|
398 { |
|
399 eval_error (); |
|
400 break; |
|
401 } |
|
402 |
1827
|
403 bool a_true = a.is_true (); |
1741
|
404 if (error_state) |
|
405 { |
|
406 eval_error (); |
|
407 break; |
|
408 } |
|
409 |
|
410 if (a_true) |
|
411 { |
|
412 if (etype == tree_expression::or_or) |
|
413 { |
1827
|
414 result = true; |
1741
|
415 goto done; |
|
416 } |
|
417 } |
|
418 else |
|
419 { |
|
420 if (etype == tree_expression::and_and) |
|
421 { |
1827
|
422 result = false; |
1741
|
423 goto done; |
|
424 } |
|
425 } |
|
426 |
|
427 if (op2) |
|
428 { |
2086
|
429 octave_value b = op2->eval (false); |
1741
|
430 if (error_state) |
|
431 { |
|
432 eval_error (); |
|
433 break; |
|
434 } |
|
435 |
|
436 result = b.is_true (); |
|
437 if (error_state) |
|
438 { |
|
439 eval_error (); |
|
440 break; |
|
441 } |
|
442 } |
|
443 } |
|
444 done: |
2086
|
445 retval = octave_value ((double) result); |
1741
|
446 } |
|
447 break; |
|
448 |
|
449 default: |
|
450 ::error ("binary operator %d not implemented", etype); |
|
451 break; |
|
452 } |
|
453 |
|
454 return retval; |
|
455 } |
|
456 |
|
457 char * |
|
458 tree_binary_expression::oper (void) const |
|
459 { |
|
460 static char *op; |
|
461 switch (etype) |
|
462 { |
|
463 case tree_expression::add: |
|
464 op = "+"; |
|
465 break; |
|
466 |
|
467 case tree_expression::subtract: |
|
468 op = "-"; |
|
469 break; |
|
470 |
|
471 case tree_expression::multiply: |
|
472 op = "*"; |
|
473 break; |
|
474 |
|
475 case tree_expression::el_mul: |
|
476 op = ".*"; |
|
477 break; |
|
478 |
|
479 case tree_expression::divide: |
|
480 op = "/"; |
|
481 break; |
|
482 |
|
483 case tree_expression::el_div: |
|
484 op = "./"; |
|
485 break; |
|
486 |
|
487 case tree_expression::leftdiv: |
|
488 op = "\\"; |
|
489 break; |
|
490 |
|
491 case tree_expression::el_leftdiv: |
|
492 op = ".\\"; |
|
493 break; |
|
494 |
|
495 case tree_expression::power: |
|
496 op = "^"; |
|
497 break; |
|
498 |
|
499 case tree_expression::elem_pow: |
|
500 op = ".^"; |
|
501 break; |
|
502 |
|
503 case tree_expression::cmp_lt: |
|
504 op = "<"; |
|
505 break; |
|
506 |
|
507 case tree_expression::cmp_le: |
|
508 op = "<="; |
|
509 break; |
|
510 |
|
511 case tree_expression::cmp_eq: |
|
512 op = "=="; |
|
513 break; |
|
514 |
|
515 case tree_expression::cmp_ge: |
|
516 op = ">="; |
|
517 break; |
|
518 |
|
519 case tree_expression::cmp_gt: |
|
520 op = ">"; |
|
521 break; |
|
522 |
|
523 case tree_expression::cmp_ne: |
|
524 op = "!="; |
|
525 break; |
|
526 |
|
527 case tree_expression::and_and: |
|
528 op = "&&"; |
|
529 break; |
|
530 |
|
531 case tree_expression::or_or: |
|
532 op = "||"; |
|
533 break; |
|
534 |
|
535 case tree_expression::and: |
|
536 op = "&"; |
|
537 break; |
|
538 |
|
539 case tree_expression::or: |
|
540 op = "|"; |
|
541 break; |
|
542 |
|
543 default: |
|
544 op = "<unknown>"; |
|
545 break; |
|
546 } |
|
547 return op; |
|
548 } |
|
549 |
|
550 void |
|
551 tree_binary_expression::eval_error (void) |
|
552 { |
|
553 if (error_state > 0) |
|
554 { |
|
555 char *op = oper (); |
|
556 |
|
557 ::error ("evaluating binary operator `%s' near line %d, column %d", |
|
558 op, line (), column ()); |
|
559 } |
|
560 } |
|
561 |
|
562 void |
|
563 tree_binary_expression::print_code (ostream& os) |
|
564 { |
|
565 print_code_indent (os); |
|
566 |
|
567 if (in_parens) |
|
568 os << "("; |
|
569 |
|
570 if (op1) |
|
571 op1->print_code (os); |
|
572 |
|
573 os << " " << oper () << " "; |
|
574 |
|
575 if (op2) |
|
576 op2->print_code (os); |
|
577 |
|
578 if (in_parens) |
|
579 os << ")"; |
|
580 } |
|
581 |
|
582 // Simple assignment expressions. |
|
583 |
|
584 tree_simple_assignment_expression::tree_simple_assignment_expression |
1827
|
585 (tree_identifier *i, tree_expression *r, bool plhs, bool ans_assign, |
1741
|
586 int l, int c) |
|
587 : tree_expression (l, c) |
|
588 { |
|
589 init (plhs, ans_assign); |
|
590 lhs = new tree_indirect_ref (i); |
|
591 rhs = r; |
|
592 } |
|
593 |
|
594 tree_simple_assignment_expression::tree_simple_assignment_expression |
1827
|
595 (tree_index_expression *idx_expr, tree_expression *r, bool plhs, |
|
596 bool ans_assign, int l, int c) |
1741
|
597 : tree_expression (l, c) |
|
598 { |
|
599 init (plhs, ans_assign); |
|
600 lhs_idx_expr = idx_expr; // cache this -- we may need to delete it. |
|
601 lhs = idx_expr->ident (); |
|
602 index = idx_expr->arg_list (); |
|
603 rhs = r; |
|
604 } |
|
605 |
|
606 tree_simple_assignment_expression::~tree_simple_assignment_expression (void) |
|
607 { |
|
608 if (! preserve) |
|
609 { |
|
610 if (lhs_idx_expr) |
|
611 delete lhs_idx_expr; |
|
612 else |
|
613 delete lhs; |
|
614 } |
|
615 |
|
616 delete rhs; |
|
617 } |
|
618 |
1827
|
619 bool |
1741
|
620 tree_simple_assignment_expression::left_hand_side_is_identifier_only (void) |
|
621 { |
|
622 return lhs->is_identifier_only (); |
|
623 } |
|
624 |
|
625 tree_identifier * |
|
626 tree_simple_assignment_expression::left_hand_side_id (void) |
|
627 { |
|
628 return lhs->ident (); |
|
629 } |
|
630 |
2086
|
631 octave_value |
1827
|
632 tree_simple_assignment_expression::eval (bool print) |
1741
|
633 { |
|
634 assert (etype == tree_expression::assignment); |
|
635 |
2086
|
636 octave_value retval; |
1741
|
637 |
|
638 if (error_state) |
|
639 return retval; |
|
640 |
|
641 if (rhs) |
|
642 { |
2086
|
643 octave_value rhs_val = rhs->eval (false); |
1741
|
644 if (error_state) |
|
645 { |
|
646 eval_error (); |
|
647 } |
|
648 else if (rhs_val.is_undefined ()) |
|
649 { |
|
650 error ("value on right hand side of assignment is undefined"); |
|
651 eval_error (); |
|
652 } |
|
653 else if (! index) |
|
654 { |
|
655 retval = lhs->assign (rhs_val); |
|
656 if (error_state) |
|
657 eval_error (); |
|
658 } |
|
659 else |
|
660 { |
|
661 // Extract the arguments into a simple vector. |
|
662 |
2086
|
663 octave_value_list args = index->convert_to_const_vector (); |
1741
|
664 |
|
665 if (error_state) |
|
666 eval_error (); |
|
667 else |
|
668 { |
|
669 int nargin = args.length (); |
|
670 |
|
671 if (error_state) |
|
672 eval_error (); |
|
673 else if (nargin > 0) |
|
674 { |
|
675 retval = lhs->assign (rhs_val, args); |
|
676 if (error_state) |
|
677 eval_error (); |
|
678 } |
|
679 } |
|
680 } |
|
681 } |
|
682 |
|
683 if (! error_state && print && retval.is_defined ()) |
1755
|
684 retval.print_with_name (lhs->name ()); |
1741
|
685 |
|
686 return retval; |
|
687 } |
|
688 |
|
689 void |
|
690 tree_simple_assignment_expression::eval_error (void) |
|
691 { |
|
692 if (error_state > 0) |
|
693 { |
|
694 int l = line (); |
|
695 int c = column (); |
1827
|
696 |
1741
|
697 if (l != -1 && c != -1) |
|
698 ::error ("evaluating assignment expression near line %d, column %d", |
|
699 l, c); |
|
700 } |
|
701 } |
|
702 |
|
703 void |
|
704 tree_simple_assignment_expression::print_code (ostream& os) |
|
705 { |
|
706 print_code_indent (os); |
|
707 |
|
708 if (in_parens) |
|
709 os << "("; |
|
710 |
|
711 if (! is_ans_assign ()) |
|
712 { |
|
713 if (lhs) |
|
714 lhs->print_code (os); |
|
715 |
|
716 if (index) |
|
717 { |
|
718 os << " ("; |
|
719 index->print_code (os); |
|
720 os << ")"; |
|
721 } |
|
722 |
|
723 os << " = "; |
|
724 } |
|
725 |
|
726 if (rhs) |
|
727 rhs->print_code (os); |
|
728 |
|
729 if (in_parens) |
|
730 os << ")"; |
|
731 } |
|
732 |
|
733 // Colon expressions. |
|
734 |
1827
|
735 bool |
1741
|
736 tree_colon_expression::is_range_constant (void) const |
|
737 { |
1827
|
738 bool tmp = (op1 && op1->is_constant () |
|
739 && op2 && op2->is_constant ()); |
1741
|
740 |
|
741 return op3 ? (tmp && op3->is_constant ()) : tmp; |
|
742 } |
|
743 |
|
744 tree_colon_expression * |
|
745 tree_colon_expression::chain (tree_expression *t) |
|
746 { |
|
747 tree_colon_expression *retval = 0; |
|
748 if (! op1 || op3) |
|
749 ::error ("invalid colon expression"); |
|
750 else |
|
751 { |
|
752 op3 = op2; // Stupid syntax. |
|
753 op2 = t; |
|
754 |
|
755 retval = this; |
|
756 } |
|
757 return retval; |
|
758 } |
|
759 |
2086
|
760 octave_value |
1827
|
761 tree_colon_expression::eval (bool /* print */) |
1741
|
762 { |
2086
|
763 octave_value retval; |
1741
|
764 |
|
765 if (error_state || ! op1 || ! op2) |
|
766 return retval; |
|
767 |
2086
|
768 octave_value tmp = op1->eval (false); |
1741
|
769 |
|
770 if (tmp.is_undefined ()) |
|
771 { |
|
772 eval_error ("invalid null value in colon expression"); |
|
773 return retval; |
|
774 } |
|
775 |
|
776 double base = tmp.double_value (); |
|
777 |
|
778 if (error_state) |
|
779 { |
|
780 error ("colon expression elements must be scalars"); |
|
781 eval_error ("evaluating colon expression"); |
|
782 return retval; |
|
783 } |
|
784 |
1827
|
785 tmp = op2->eval (false); |
1741
|
786 |
|
787 if (tmp.is_undefined ()) |
|
788 { |
|
789 eval_error ("invalid null value in colon expression"); |
|
790 return retval; |
|
791 } |
|
792 |
|
793 double limit = tmp.double_value (); |
|
794 |
|
795 if (error_state) |
|
796 { |
|
797 error ("colon expression elements must be scalars"); |
|
798 eval_error ("evaluating colon expression"); |
|
799 return retval; |
|
800 } |
|
801 |
|
802 double inc = 1.0; |
|
803 if (op3) |
|
804 { |
1827
|
805 tmp = op3->eval (false); |
1741
|
806 |
|
807 if (tmp.is_undefined ()) |
|
808 { |
|
809 eval_error ("invalid null value in colon expression"); |
|
810 return retval; |
|
811 } |
|
812 |
|
813 inc = tmp.double_value (); |
|
814 |
|
815 if (error_state) |
|
816 { |
|
817 error ("colon expression elements must be scalars"); |
|
818 eval_error ("evaluating colon expression"); |
|
819 return retval; |
|
820 } |
|
821 } |
|
822 |
2086
|
823 retval = octave_value (base, limit, inc); |
1741
|
824 |
|
825 if (error_state) |
|
826 { |
|
827 if (error_state) |
|
828 eval_error ("evaluating colon expression"); |
2086
|
829 return octave_value (); |
1741
|
830 } |
|
831 |
|
832 return retval; |
|
833 } |
|
834 |
|
835 void |
|
836 tree_colon_expression::eval_error (const char *s) |
|
837 { |
|
838 if (error_state > 0) |
|
839 ::error ("%s near line %d column %d", s, line (), column ()); |
|
840 } |
|
841 |
|
842 void |
|
843 tree_colon_expression::print_code (ostream& os) |
|
844 { |
|
845 print_code_indent (os); |
|
846 |
|
847 if (in_parens) |
|
848 os << "("; |
|
849 |
|
850 if (op1) |
|
851 op1->print_code (os); |
|
852 |
|
853 // Stupid syntax. |
|
854 |
|
855 if (op3) |
|
856 { |
|
857 os << ":"; |
|
858 op3->print_code (os); |
|
859 } |
|
860 |
|
861 if (op2) |
|
862 { |
|
863 os << ":"; |
|
864 op2->print_code (os); |
|
865 } |
|
866 |
|
867 if (in_parens) |
|
868 os << ")"; |
|
869 } |
|
870 |
|
871 |
|
872 /* |
|
873 ;;; Local Variables: *** |
|
874 ;;; mode: C++ *** |
|
875 ;;; End: *** |
|
876 */ |