1
|
1 // Tree classes. -*- C++ -*- |
|
2 /* |
|
3 |
|
4 Copyright (C) 1992, 1993 John W. Eaton |
|
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 |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
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 |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
21 |
|
22 */ |
|
23 |
|
24 #if !defined (_tree_h) |
|
25 #define _tree_h 1 |
|
26 |
|
27 // This seems to leave vt$tree undefined with g++ 2.3.3. |
|
28 #if 0 |
|
29 #ifdef __GNUG__ |
|
30 #pragma interface |
|
31 #endif |
|
32 #endif |
|
33 |
|
34 #include <stdio.h> |
|
35 |
|
36 class ostrstream; |
|
37 |
|
38 #include "builtins.h" |
|
39 #include "tree-base.h" |
|
40 #include "tree-const.h" |
|
41 |
|
42 class symbol_record; |
|
43 class symbol_table; |
|
44 |
|
45 #ifndef TREE_FCN_TYPEDEFS |
|
46 #define TREE_FCN_TYPEDEFS 1 |
|
47 |
|
48 typedef tree_constant (*Text_fcn)(int, char **); |
|
49 typedef tree_constant* (*General_fcn)(tree_constant *, int, int); |
|
50 |
|
51 #endif |
|
52 |
|
53 #ifndef NULL_TREE |
|
54 #define NULL_TREE (tree *) NULL |
|
55 #endif |
|
56 |
|
57 #ifndef NULL_TREE_CONST |
|
58 #define NULL_TREE_CONST (tree_constant *) NULL |
|
59 #endif |
|
60 |
|
61 /* |
|
62 * Forward declarations. |
|
63 */ |
|
64 class tree; |
|
65 class tree_constant_rep; |
|
66 class tree_constant; |
|
67 class tree_matrix; |
|
68 class tree_builtin; |
|
69 class tree_identifier; |
|
70 class tree_function; |
|
71 class tree_expression; |
|
72 class tree_prefix_expression; |
|
73 class tree_postfix_expression; |
|
74 class tree_unary_expression; |
|
75 class tree_binary_expression; |
|
76 class tree_assignment_expression; |
|
77 class tree_simple_assignment_expression; |
|
78 class tree_multi_assignment_expression; |
|
79 class tree_colon_expression; |
|
80 class tree_index_expression; |
|
81 class tree_argument_list; |
|
82 class tree_parameter_list; |
|
83 class tree_return_list; |
|
84 class tree_word_list; |
|
85 class tree_command; |
|
86 class tree_command_list; |
|
87 class tree_while_command; |
|
88 class tree_for_command; |
|
89 class tree_if_command; |
|
90 class tree_break_command; |
|
91 class tree_continue_command; |
|
92 class tree_return_command; |
|
93 class tree_word_list_command;; |
|
94 class tree_plot_limits; |
|
95 class tree_plot_range; |
|
96 class tree_subplot; |
|
97 class tree_subplot_using; |
|
98 class tree_subplot_style; |
|
99 class tree_subplot_list; |
|
100 class tree_plot_command; |
|
101 |
|
102 /* |
|
103 * General matrices. This allows us to construct matrices from |
|
104 * other matrices, variables, and functions. |
|
105 */ |
|
106 class |
|
107 tree_matrix : public tree |
|
108 { |
|
109 public: |
|
110 tree_matrix (void); |
|
111 tree_matrix (tree *t, tree::matrix_dir d); |
|
112 |
|
113 ~tree_matrix (void); |
|
114 |
|
115 tree_matrix *chain (tree *t, tree::matrix_dir d); |
|
116 tree_matrix *reverse (void); |
|
117 int length (void); |
|
118 |
|
119 tree_return_list *to_return_list (void); |
|
120 |
|
121 tree_constant eval (int print); |
|
122 |
|
123 private: |
|
124 tree::matrix_dir dir; // Direction to the next element. |
|
125 tree *element; |
|
126 tree_matrix *next; |
|
127 }; |
|
128 |
|
129 /* |
|
130 * Builtin functions. |
|
131 */ |
|
132 class |
|
133 tree_builtin : public tree |
|
134 { |
|
135 public: |
|
136 tree_builtin (void); |
|
137 tree_builtin (int i_max, int o_max, Mapper_fcn& m_fcn, symbol_record *s); |
|
138 tree_builtin (int i_max, int o_max, Text_fcn t_fcn, symbol_record *s); |
|
139 tree_builtin (int i_max, int o_max, General_fcn t_fcn, symbol_record *s); |
|
140 |
|
141 ~tree_builtin (void); |
|
142 |
|
143 int is_builtin (void); |
|
144 |
|
145 tree_constant eval (int print); |
|
146 |
|
147 tree_constant *eval (int print, int nargout); |
|
148 |
|
149 tree_constant eval (int argc, char **argv, int print); |
|
150 |
|
151 tree_constant *eval (tree_constant *args, int n_in, int n_out, int print); |
|
152 |
|
153 tree *def (void); |
|
154 char *name (void); |
|
155 |
|
156 int max_expected_args (void); |
|
157 |
|
158 private: |
|
159 int nargin_max; |
|
160 int nargout_max; |
|
161 Mapper_fcn mapper_fcn; |
|
162 Text_fcn text_fcn; |
|
163 General_fcn general_fcn; |
|
164 symbol_record *sym; // Is this really needed? It points back |
|
165 // to the symbol record that contains this |
|
166 // builtin function... |
|
167 }; |
|
168 |
|
169 /* |
|
170 * Symbols from the symbol table. |
|
171 */ |
|
172 class |
|
173 tree_identifier : public tree |
|
174 { |
|
175 friend class tree_index_expression; |
|
176 |
|
177 public: |
|
178 tree_identifier (void); |
|
179 tree_identifier (symbol_record *s); |
|
180 |
|
181 ~tree_identifier (void); |
|
182 |
|
183 int is_identifier (void); |
|
184 |
|
185 tree *def (void); |
|
186 char *name (void); |
|
187 symbol_record *symrec (void); |
|
188 |
|
189 tree_identifier *define (tree_constant *t); |
|
190 tree_identifier *define (tree_function *t); |
|
191 |
|
192 void document (char *s); |
|
193 |
|
194 tree_constant assign (tree_constant& t); |
|
195 tree_constant assign (tree_constant& t, tree_constant *args, int nargs); |
|
196 |
|
197 void bump_value (tree::expression_type); |
|
198 |
|
199 int parse_m_file (int exec_script = 1); |
|
200 int parse_m_file (char *mf, int exec_script = 1); |
|
201 void parse_m_file (FILE *mfile, char *mf); |
|
202 |
|
203 tree *do_lookup (int& script_file_executed); |
|
204 |
|
205 void mark_as_formal_parameter (void); |
|
206 |
|
207 tree_constant eval (int print); |
|
208 |
|
209 tree_constant *eval (int print, int nargout); |
|
210 |
|
211 tree_constant eval (int argc, char **argv, int print); |
|
212 |
|
213 tree_constant *eval (tree_constant *args, int n_in, int n_out, int print); |
|
214 |
|
215 void eval_undefined_error (void); |
|
216 |
|
217 private: |
|
218 symbol_record *sym; |
|
219 }; |
|
220 |
|
221 /* |
|
222 * User defined functions. |
|
223 */ |
|
224 class |
|
225 tree_function : public tree |
|
226 { |
|
227 public: |
|
228 tree_function (void); |
|
229 tree_function (tree *cl, symbol_table *st); |
|
230 |
|
231 ~tree_function (void); |
|
232 |
|
233 tree_function *define (tree *t); |
|
234 tree_function *define_param_list (tree_parameter_list *t); |
|
235 tree_function *define_ret_list (tree_parameter_list *t); |
|
236 |
|
237 void stash_m_file_name (char * s); |
|
238 void stash_m_file_time (time_t t); |
|
239 |
|
240 char *m_file_name (void); |
|
241 time_t time_parsed (void); |
|
242 |
|
243 tree_constant eval (int print); |
|
244 |
|
245 tree_constant *eval (int print, int nargout); |
|
246 |
|
247 tree_constant eval (int argc, char **argv, int print); |
|
248 |
|
249 tree_constant *eval (tree_constant *args, int n_in, int n_out, int print); |
|
250 |
|
251 int max_expected_args (void); |
|
252 |
|
253 private: |
|
254 int call_depth; |
|
255 tree_parameter_list *param_list; |
|
256 tree_parameter_list *ret_list; |
|
257 symbol_table *sym_tab; |
|
258 tree *cmd_list; |
|
259 time_t t_parsed; |
|
260 char *file_name; |
|
261 }; |
|
262 |
|
263 /* |
|
264 * A base class for expressions. |
|
265 */ |
|
266 class |
|
267 tree_expression : public tree |
|
268 { |
|
269 public: |
|
270 tree_expression (void); |
|
271 |
|
272 ~tree_expression (void); |
|
273 |
|
274 tree_constant eval (int print); |
|
275 |
|
276 protected: |
|
277 expression_type etype; |
|
278 }; |
|
279 |
|
280 /* |
|
281 * Prefix expressions. |
|
282 */ |
|
283 class |
|
284 tree_prefix_expression : public tree_expression |
|
285 { |
|
286 public: |
|
287 tree_prefix_expression (void); |
|
288 tree_prefix_expression (tree_identifier *t, tree::expression_type et); |
|
289 |
|
290 ~tree_prefix_expression (void); |
|
291 |
|
292 tree_constant eval (int print); |
|
293 |
|
294 private: |
|
295 tree_identifier *id; |
|
296 }; |
|
297 |
|
298 /* |
|
299 * Postfix expressions. |
|
300 */ |
|
301 class |
|
302 tree_postfix_expression : public tree_expression |
|
303 { |
|
304 public: |
|
305 tree_postfix_expression (void); |
|
306 tree_postfix_expression (tree_identifier *t, tree::expression_type et); |
|
307 |
|
308 ~tree_postfix_expression (void); |
|
309 |
|
310 tree_constant eval (int print); |
|
311 |
|
312 private: |
|
313 tree_identifier *id; |
|
314 }; |
|
315 |
|
316 /* |
|
317 * Unary expressions. |
|
318 */ |
|
319 class |
|
320 tree_unary_expression : public tree_expression |
|
321 { |
|
322 public: |
|
323 tree_unary_expression (void); |
|
324 tree_unary_expression (tree *a, tree::expression_type t); |
|
325 |
|
326 ~tree_unary_expression (void); |
|
327 |
|
328 tree_constant eval (int print); |
|
329 |
|
330 private: |
|
331 tree *op; |
|
332 }; |
|
333 |
|
334 /* |
|
335 * Binary expressions. |
|
336 */ |
|
337 class |
|
338 tree_binary_expression : public tree_expression |
|
339 { |
|
340 public: |
|
341 tree_binary_expression (void); |
|
342 tree_binary_expression (tree *a, tree *b, tree::expression_type t); |
|
343 |
|
344 ~tree_binary_expression (void); |
|
345 |
|
346 tree_constant eval (int print); |
|
347 |
|
348 private: |
|
349 tree *op1; |
|
350 tree *op2; |
|
351 }; |
|
352 |
|
353 /* |
|
354 * Assignment expressions. |
|
355 */ |
|
356 class |
|
357 tree_assignment_expression : public tree_expression |
|
358 { |
|
359 public: |
|
360 int in_parens; |
|
361 |
|
362 tree_assignment_expression (void); |
|
363 |
|
364 ~tree_assignment_expression (void); |
|
365 |
|
366 tree_constant eval (int print); |
|
367 |
|
368 int is_assignment_expression (void); |
|
369 }; |
|
370 |
|
371 /* |
|
372 * Simple assignment expressions. |
|
373 */ |
|
374 class |
|
375 tree_simple_assignment_expression : public tree_assignment_expression |
|
376 { |
|
377 public: |
|
378 tree_simple_assignment_expression (void); |
|
379 tree_simple_assignment_expression (tree_identifier *i, tree *r); |
|
380 tree_simple_assignment_expression (tree_index_expression *idx_expr, tree *r); |
|
381 |
|
382 ~tree_simple_assignment_expression (void); |
|
383 |
|
384 tree_constant eval (int print); |
|
385 |
|
386 private: |
|
387 tree_identifier *lhs; |
|
388 tree_argument_list *index; |
|
389 tree *rhs; |
|
390 }; |
|
391 |
|
392 /* |
|
393 * Multi-valued assignment expressions. |
|
394 */ |
|
395 class |
|
396 tree_multi_assignment_expression : public tree_assignment_expression |
|
397 { |
|
398 public: |
|
399 tree_multi_assignment_expression (void); |
|
400 tree_multi_assignment_expression (tree_return_list *l, tree *r); |
|
401 |
|
402 ~tree_multi_assignment_expression (void); |
|
403 |
|
404 tree_constant eval (int print); |
|
405 |
|
406 tree_constant *eval (int print, int nargout); |
|
407 |
|
408 private: |
|
409 tree_return_list *lhs; |
|
410 tree *rhs; |
|
411 }; |
|
412 |
|
413 /* |
|
414 * Colon expressions. |
|
415 */ |
|
416 class |
|
417 tree_colon_expression : public tree_expression |
|
418 { |
|
419 public: |
|
420 tree_colon_expression (void); |
|
421 tree_colon_expression (tree *a, tree *b); |
|
422 |
|
423 ~tree_colon_expression (void); |
|
424 |
|
425 tree_colon_expression *chain (tree *t); |
|
426 |
|
427 tree_constant eval (int print); |
|
428 |
|
429 private: |
|
430 tree *op1; |
|
431 tree *op2; |
|
432 tree *op3; |
|
433 }; |
|
434 |
|
435 /* |
|
436 * Index expressions. |
|
437 */ |
|
438 class |
|
439 tree_index_expression : public tree_expression |
|
440 { |
|
441 public: |
|
442 tree_index_expression (void); |
|
443 tree_index_expression (tree_identifier *i); |
|
444 tree_index_expression (tree_identifier *i, tree_argument_list *l); |
|
445 |
|
446 ~tree_index_expression (void); |
|
447 |
|
448 int is_index_expression (void); |
|
449 |
|
450 tree_identifier *ident (void); |
|
451 |
|
452 tree_argument_list *arg_list (void); |
|
453 |
|
454 tree_constant eval (int print); |
|
455 |
|
456 tree_constant *eval (int print, int nargout); |
|
457 |
|
458 private: |
|
459 tree_identifier *id; |
|
460 tree_argument_list *list; |
|
461 }; |
|
462 |
|
463 /* |
|
464 * Argument lists. |
|
465 */ |
|
466 class |
|
467 tree_argument_list : public tree |
|
468 { |
|
469 public: |
|
470 tree_argument_list (void); |
|
471 tree_argument_list (tree *t); |
|
472 |
|
473 ~tree_argument_list (void); |
|
474 |
|
475 tree_argument_list *chain (tree *t); |
|
476 tree_argument_list *reverse (void); |
|
477 int length (void); |
|
478 |
|
479 tree_argument_list *next_elem (void); |
|
480 |
|
481 tree_constant *convert_to_const_vector (int& nargs); |
|
482 |
|
483 tree_constant eval (int print); |
|
484 |
|
485 private: |
|
486 tree *arg; |
|
487 tree_argument_list *next; |
|
488 }; |
|
489 |
|
490 /* |
|
491 * Parameter lists. Almost like argument lists, except that the |
|
492 * elements are only supposed to be identifiers, never constants or |
|
493 * expressions. |
|
494 */ |
|
495 class |
|
496 tree_parameter_list : public tree |
|
497 { |
|
498 public: |
|
499 tree_parameter_list (void); |
|
500 tree_parameter_list (tree_identifier *t); |
|
501 |
|
502 ~tree_parameter_list (void); |
|
503 |
|
504 tree_parameter_list *chain (tree_identifier *t); |
|
505 tree_parameter_list *reverse (void); |
|
506 int length (void); |
|
507 |
|
508 char *name (void); |
|
509 |
|
510 void mark_as_formal_parameters (void); |
|
511 |
|
512 tree_identifier *define (tree_constant *t); |
|
513 |
|
514 tree_parameter_list *next_elem (void); |
|
515 |
|
516 tree_constant eval (int print); |
|
517 |
|
518 private: |
|
519 tree_identifier *param; |
|
520 tree_parameter_list *next; |
|
521 }; |
|
522 |
|
523 /* |
|
524 * Return lists. Almost like parameter lists, except that the |
|
525 * elements may also be index expressions. |
|
526 */ |
|
527 class |
|
528 tree_return_list : public tree |
|
529 { |
|
530 public: |
|
531 tree_return_list (void); |
|
532 tree_return_list (tree_identifier *t); |
|
533 tree_return_list (tree_index_expression *t); |
|
534 |
|
535 ~tree_return_list (void); |
|
536 |
|
537 tree_return_list *chain (tree_identifier *t); |
|
538 tree_return_list *chain (tree_index_expression *t); |
|
539 tree_return_list *reverse (void); |
|
540 int length (void); |
|
541 |
|
542 tree_index_expression *idx_expr (void); |
|
543 |
|
544 tree_return_list *next_elem (void); |
|
545 |
|
546 tree_constant eval (int print); |
|
547 |
|
548 private: |
|
549 tree_index_expression *retval; |
|
550 tree_return_list *next; |
|
551 }; |
|
552 |
|
553 /* |
|
554 * Word lists. |
|
555 */ |
|
556 class |
|
557 tree_word_list : public tree |
|
558 { |
|
559 public: |
|
560 tree_word_list (void); |
|
561 tree_word_list (char *s); |
|
562 |
|
563 ~tree_word_list (void); |
|
564 |
|
565 tree_word_list *chain (char *s); |
|
566 tree_word_list *reverse (void); |
|
567 int length (void); |
|
568 |
|
569 char *name (void); |
|
570 |
|
571 tree_word_list *next_elem (void); |
|
572 |
|
573 tree_constant eval (int print); |
|
574 |
|
575 private: |
|
576 char *word; |
|
577 tree_word_list *next; |
|
578 }; |
|
579 |
|
580 /* |
|
581 * A base class for commands. |
|
582 */ |
|
583 class |
|
584 tree_command : public tree |
|
585 { |
|
586 }; |
|
587 |
|
588 /* |
|
589 * A command or two to be executed. |
|
590 */ |
|
591 class |
|
592 tree_command_list : public tree_command |
|
593 { |
|
594 public: |
|
595 tree_command_list (void); |
|
596 tree_command_list (tree *t); |
|
597 |
|
598 ~tree_command_list (void); |
|
599 |
|
600 tree_command_list *chain (tree *t); |
|
601 tree_command_list *reverse (void); |
|
602 |
|
603 void set_print_flag (int print); |
|
604 |
|
605 tree_constant eval (int print); |
|
606 |
|
607 private: |
|
608 tree *command; // Command to execute. |
|
609 int print_flag; // Print result of eval for this command? |
|
610 tree_command_list *next; // Next command in list. |
|
611 }; |
|
612 |
|
613 /* |
|
614 * While. |
|
615 */ |
|
616 class |
|
617 tree_while_command : public tree_command |
|
618 { |
|
619 public: |
|
620 tree_while_command (void); |
|
621 tree_while_command (tree *e); |
|
622 tree_while_command (tree *e, tree *l); |
|
623 |
|
624 ~tree_while_command (void); |
|
625 |
|
626 tree_constant eval (int print); |
|
627 |
|
628 private: |
|
629 tree *expr; // Expression to test. |
|
630 tree *list; // List of commands to execute. |
|
631 }; |
|
632 |
|
633 /* |
|
634 * For. |
|
635 */ |
|
636 class |
|
637 tree_for_command : public tree_command |
|
638 { |
|
639 public: |
|
640 tree_for_command (void); |
117
|
641 tree_for_command (tree_index_expression *id, tree *e, tree *l); |
1
|
642 |
|
643 ~tree_for_command (void); |
|
644 |
|
645 tree_constant eval (int print); |
|
646 |
|
647 private: |
117
|
648 tree_index_expression *id; // Identifier to modify. |
1
|
649 tree *expr; // Expression to evaluate. |
|
650 tree *list; // List of commands to execute. |
|
651 }; |
|
652 |
|
653 /* |
|
654 * Simple if. |
|
655 */ |
|
656 class |
|
657 tree_if_command : public tree_command |
|
658 { |
|
659 public: |
|
660 tree_if_command (void); |
|
661 tree_if_command (tree *t); |
|
662 tree_if_command (tree *e, tree *t); |
|
663 |
|
664 ~tree_if_command (void); |
|
665 |
|
666 tree_if_command *chain (tree *t); |
|
667 tree_if_command *chain (tree *t1, tree *t2); |
|
668 tree_if_command *reverse (void); |
|
669 |
|
670 tree_constant eval (int print); |
|
671 |
|
672 private: |
|
673 tree *expr; // Expression to test. |
|
674 tree *list; // Commands to execute. |
|
675 tree_if_command *next; // Next if command. |
|
676 }; |
|
677 |
|
678 /* |
|
679 * Break. |
|
680 */ |
|
681 class |
|
682 tree_break_command : public tree_command |
|
683 { |
|
684 public: |
|
685 tree_break_command (void); |
|
686 |
|
687 ~tree_break_command (void); |
|
688 |
|
689 tree_constant eval (int print); |
|
690 }; |
|
691 |
|
692 /* |
|
693 * Continue. |
|
694 */ |
|
695 class |
|
696 tree_continue_command : public tree_command |
|
697 { |
|
698 public: |
|
699 tree_continue_command (void); |
|
700 |
|
701 ~tree_continue_command (void); |
|
702 |
|
703 tree_constant eval (int print); |
|
704 }; |
|
705 |
|
706 /* |
|
707 * Return. |
|
708 */ |
|
709 class |
|
710 tree_return_command : public tree_command |
|
711 { |
|
712 public: |
|
713 tree_return_command (void); |
|
714 |
|
715 ~tree_return_command (void); |
|
716 |
|
717 tree_constant eval (int print); |
|
718 }; |
|
719 |
|
720 /* |
|
721 * Functions that take a list of strings as arguments. |
|
722 */ |
|
723 class |
|
724 tree_word_list_command : public tree_command |
|
725 { |
|
726 public: |
|
727 tree_word_list_command (void); |
|
728 tree_word_list_command (tree_identifier *id, tree_word_list *wl); |
|
729 |
|
730 ~tree_word_list_command (void); |
|
731 |
|
732 tree_constant eval (int print); |
|
733 |
|
734 private: |
|
735 tree_identifier *ident; |
|
736 tree_word_list *word_list; |
|
737 }; |
|
738 |
|
739 class |
|
740 tree_plot_command : public tree_command |
|
741 { |
|
742 public: |
|
743 tree_plot_command (void); |
|
744 tree_plot_command (tree_subplot_list *plt, int nd); |
|
745 tree_plot_command (tree_subplot_list *plt, tree_plot_limits *rng, int nd); |
|
746 |
|
747 ~tree_plot_command (void); |
|
748 |
|
749 tree_constant eval (int print); |
|
750 |
|
751 private: |
|
752 int ndim; |
|
753 tree_plot_limits *range; |
|
754 tree_subplot_list *plot_list; |
|
755 }; |
|
756 |
|
757 class |
|
758 tree_subplot_list : public tree |
|
759 { |
|
760 public: |
|
761 tree_subplot_list (void); |
|
762 tree_subplot_list (tree *data); |
|
763 tree_subplot_list (tree_subplot_list *t); |
|
764 tree_subplot_list (tree_subplot_using *u, tree *t, tree_subplot_style *s); |
|
765 |
|
766 ~tree_subplot_list (void); |
|
767 |
|
768 tree_subplot_list *set_data (tree *data); |
|
769 |
|
770 tree_subplot_list *chain (tree_subplot_list *t); |
|
771 |
|
772 tree_subplot_list *reverse (void); |
|
773 |
|
774 tree_subplot_list *next_elem (void); |
|
775 |
|
776 tree_constant eval (int print); |
|
777 // tree_constant *eval (int print, int nargout); |
|
778 |
|
779 int print (int ndim, ostrstream& plot_buf); |
|
780 |
|
781 private: |
|
782 tree *plot_data; |
|
783 tree_subplot_using *using; |
|
784 tree *title; |
|
785 tree_subplot_style *style; |
|
786 tree_subplot_list *next; |
|
787 }; |
|
788 |
|
789 class |
|
790 tree_plot_limits : public tree |
|
791 { |
|
792 public: |
|
793 tree_plot_limits (void); |
|
794 tree_plot_limits (tree_plot_range *xlim); |
|
795 tree_plot_limits (tree_plot_range *xlim, tree_plot_range *ylim); |
|
796 tree_plot_limits (tree_plot_range *xlim, tree_plot_range *ylim, |
|
797 tree_plot_range *zlim); |
|
798 |
|
799 ~tree_plot_limits (void); |
|
800 |
|
801 tree_constant eval (int print); |
|
802 |
|
803 void print (int print, ostrstream& plot_buf); |
|
804 |
|
805 private: |
|
806 tree_plot_range *x_range; |
|
807 tree_plot_range *y_range; |
|
808 tree_plot_range *z_range; |
|
809 }; |
|
810 |
|
811 class |
|
812 tree_plot_range : public tree |
|
813 { |
|
814 public: |
|
815 tree_plot_range (void); |
|
816 tree_plot_range (tree *l, tree *u); |
|
817 |
|
818 ~tree_plot_range (void); |
|
819 |
|
820 tree_constant eval (int print); |
|
821 |
|
822 void print (ostrstream& plot_buf); |
|
823 |
|
824 private: |
|
825 tree *lower; |
|
826 tree *upper; |
|
827 }; |
|
828 |
|
829 class |
|
830 tree_subplot_using : public tree |
|
831 { |
|
832 public: |
|
833 tree_subplot_using (void); |
|
834 tree_subplot_using (tree *fmt); |
|
835 |
|
836 ~tree_subplot_using (void); |
|
837 |
|
838 tree_subplot_using *set_format (tree *fmt); |
|
839 |
|
840 tree_subplot_using *add_qualifier (tree *t); |
|
841 |
|
842 tree_constant eval (int print); |
|
843 |
|
844 int print (int ndim, int n_max, ostrstream& plot_buf); |
|
845 |
|
846 private: |
|
847 int qualifier_count; |
|
848 tree *x[4]; |
|
849 tree *scanf_fmt; |
|
850 }; |
|
851 |
|
852 class |
|
853 tree_subplot_style : public tree |
|
854 { |
|
855 public: |
|
856 tree_subplot_style (void); |
|
857 tree_subplot_style (char *s); |
|
858 tree_subplot_style (char *s, tree *lt); |
|
859 tree_subplot_style (char *s, tree *lt, tree *pt); |
|
860 |
|
861 ~tree_subplot_style (void); |
|
862 |
|
863 tree_constant eval (int print); |
|
864 |
|
865 int print (ostrstream& plot_buf); |
|
866 |
|
867 private: |
|
868 char *style; |
|
869 tree *linetype; |
|
870 tree *pointtype; |
|
871 }; |
|
872 |
|
873 #endif |
|
874 |
|
875 /* |
|
876 ;;; Local Variables: *** |
|
877 ;;; mode: C++ *** |
|
878 ;;; page-delimiter: "^/\\*" *** |
|
879 ;;; End: *** |
|
880 */ |