529
|
1 // tree-expr.h -*- C++ -*- |
494
|
2 /* |
|
3 |
|
4 Copyright (C) 1992, 1993, 1994 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 (octave_tree_expr_h) |
|
25 #define octave_tree_expr_h 1 |
|
26 |
|
27 #if defined (__GNUG__) |
|
28 #pragma interface |
|
29 #endif |
|
30 |
529
|
31 #include <time.h> |
494
|
32 #include <stdio.h> |
581
|
33 #include <iostream.h> |
494
|
34 |
529
|
35 #include "variables.h" |
|
36 #include "mappers.h" |
494
|
37 #include "error.h" |
500
|
38 #include "oct-obj.h" |
494
|
39 |
|
40 class tree_constant; |
578
|
41 class tree_statement_list; |
|
42 class tree_argument_list; |
|
43 class tree_parameter_list; |
|
44 class tree_return_list; |
723
|
45 class tree_va_return_list; |
494
|
46 class symbol_record; |
|
47 class symbol_table; |
|
48 |
|
49 class tree_matrix; |
|
50 class tree_builtin; |
|
51 class tree_identifier; |
|
52 class tree_function; |
|
53 class tree_expression; |
|
54 class tree_prefix_expression; |
|
55 class tree_postfix_expression; |
|
56 class tree_unary_expression; |
|
57 class tree_binary_expression; |
|
58 class tree_assignment_expression; |
|
59 class tree_simple_assignment_expression; |
|
60 class tree_multi_assignment_expression; |
|
61 class tree_colon_expression; |
|
62 class tree_index_expression; |
578
|
63 |
|
64 #include "tree-base.h" |
494
|
65 |
578
|
66 // A base class for expressions. |
|
67 |
494
|
68 class |
|
69 tree_expression : public tree |
|
70 { |
|
71 public: |
581
|
72 int in_parens; |
|
73 |
578
|
74 enum type |
|
75 { |
|
76 unknown, |
|
77 assignment, |
|
78 simple_assignment, |
|
79 multi_assignment, |
|
80 add, |
|
81 subtract, |
|
82 multiply, |
|
83 el_mul, |
|
84 divide, |
|
85 el_div, |
|
86 leftdiv, |
|
87 el_leftdiv, |
|
88 power, |
|
89 elem_pow, |
|
90 cmp_lt, |
|
91 cmp_le, |
|
92 cmp_eq, |
|
93 cmp_ge, |
|
94 cmp_gt, |
|
95 cmp_ne, |
|
96 and_and, |
|
97 or_or, |
|
98 and, |
|
99 or, |
|
100 not, |
|
101 unot, |
|
102 uminus, |
|
103 hermitian, |
|
104 transpose, |
|
105 colon, |
|
106 index, |
|
107 increment, |
|
108 decrement, |
|
109 }; |
494
|
110 |
578
|
111 tree_expression (int l = -1, int c = -1) : tree (l, c) |
581
|
112 { |
|
113 in_parens = 0; |
|
114 etype = unknown; |
|
115 } |
494
|
116 |
578
|
117 ~tree_expression (void) { } |
494
|
118 |
666
|
119 virtual int is_multi_val_ret_expression (void) const |
|
120 { return 0; } |
|
121 |
494
|
122 virtual int is_identifier (void) const |
|
123 { return 0; } |
|
124 |
|
125 virtual int is_index_expression (void) const |
|
126 { return 0; } |
|
127 |
|
128 virtual int is_assignment_expression (void) const |
|
129 { return 0; } |
|
130 |
|
131 virtual int is_prefix_expression (void) const |
|
132 { return 0; } |
|
133 |
|
134 virtual void mark_for_possible_ans_assign (void) |
|
135 { panic_impossible (); } |
|
136 |
578
|
137 virtual tree_constant eval (int print) = 0; |
|
138 |
494
|
139 protected: |
578
|
140 type etype; |
494
|
141 }; |
|
142 |
578
|
143 // General matrices. This allows us to construct matrices from |
|
144 // other matrices, variables, and functions. |
|
145 |
494
|
146 class |
|
147 tree_matrix : public tree_expression |
|
148 { |
|
149 public: |
578
|
150 enum dir |
|
151 { |
|
152 md_none, |
|
153 md_right, |
|
154 md_down, |
|
155 }; |
|
156 |
|
157 tree_matrix (void) |
|
158 { |
581
|
159 direction = tree_matrix::md_none; |
578
|
160 element = 0; |
|
161 next = 0; |
|
162 } |
|
163 |
|
164 tree_matrix (tree_expression *e, tree_matrix::dir d) |
|
165 { |
581
|
166 direction = d; |
578
|
167 element = e; |
|
168 next = 0; |
|
169 } |
494
|
170 |
|
171 ~tree_matrix (void); |
|
172 |
578
|
173 tree_matrix *chain (tree_expression *e, tree_matrix::dir d); |
494
|
174 tree_matrix *reverse (void); |
|
175 int length (void); |
|
176 |
|
177 tree_return_list *to_return_list (void); |
|
178 |
|
179 tree_constant eval (int print); |
|
180 |
581
|
181 void print_code (ostream& os); |
|
182 |
494
|
183 private: |
581
|
184 tree_matrix::dir direction; // Direction from the previous element. |
494
|
185 tree_expression *element; |
|
186 tree_matrix *next; |
|
187 }; |
|
188 |
666
|
189 // A base class for objects that can be return multiple values |
|
190 |
|
191 class |
|
192 tree_multi_val_ret : public tree_expression |
|
193 { |
|
194 public: |
|
195 tree_multi_val_ret (int l = -1, int c = -1) : tree_expression (l, c) { } |
|
196 |
|
197 int is_multi_val_ret_expression (void) const |
|
198 { return 1; } |
|
199 |
|
200 tree_constant eval (int print); |
|
201 |
|
202 virtual Octave_object eval (int print, int nargout, |
|
203 const Octave_object& args) = 0; |
|
204 }; |
|
205 |
578
|
206 // A base class for objects that can be evaluated with argument lists. |
494
|
207 |
|
208 class |
666
|
209 tree_fvc : public tree_multi_val_ret |
494
|
210 { |
|
211 public: |
666
|
212 tree_fvc (int l = -1, int c = -1) : tree_multi_val_ret (l, c) { } |
578
|
213 |
494
|
214 virtual int is_constant (void) const |
|
215 { return 0; } |
|
216 |
506
|
217 virtual tree_constant assign (tree_constant& t, const Octave_object& args); |
494
|
218 |
|
219 virtual char *name (void) const |
529
|
220 { panic_impossible (); return 0; } |
494
|
221 |
578
|
222 virtual void bump_value (tree_expression::type) |
494
|
223 { panic_impossible (); } |
|
224 |
|
225 virtual int max_expected_args (void) |
|
226 { panic_impossible (); return 0; } |
|
227 |
|
228 virtual char *fcn_file_name (void) |
529
|
229 { return 0; } |
494
|
230 |
|
231 virtual time_t time_parsed (void) |
|
232 { panic_impossible (); return 0; } |
|
233 |
|
234 virtual int is_system_fcn_file (void) const |
|
235 { return 0; } |
|
236 |
|
237 virtual int save (ostream& os, int mark_as_global = 0, |
|
238 int precision = 17) |
|
239 { panic_impossible (); return 0; } |
|
240 }; |
|
241 |
578
|
242 // Symbols from the symbol table. |
529
|
243 |
494
|
244 class |
|
245 tree_identifier : public tree_fvc |
|
246 { |
|
247 friend class tree_index_expression; |
|
248 |
|
249 public: |
581
|
250 tree_identifier (int l = -1, int c = -1) : tree_fvc (l, c) |
578
|
251 { |
|
252 sym = 0; |
|
253 maybe_do_ans_assign = 0; |
|
254 } |
494
|
255 |
581
|
256 tree_identifier (symbol_record *s, int l = -1, int c = -1) : tree_fvc (l, c) |
578
|
257 { |
|
258 sym = s; |
|
259 maybe_do_ans_assign = 0; |
|
260 } |
494
|
261 |
578
|
262 ~tree_identifier (void) { } |
|
263 |
|
264 int is_identifier (void) const |
|
265 { return 1; } |
494
|
266 |
|
267 char *name (void) const; |
|
268 |
|
269 tree_identifier *define (tree_constant *t); |
|
270 tree_identifier *define (tree_function *t); |
|
271 |
|
272 void document (char *s); |
|
273 |
|
274 tree_constant assign (tree_constant& t); |
506
|
275 tree_constant assign (tree_constant& t, const Octave_object& args); |
500
|
276 |
|
277 int is_defined (void); |
494
|
278 |
578
|
279 void bump_value (tree_expression::type); |
494
|
280 |
|
281 tree_fvc *do_lookup (int& script_file_executed); |
|
282 |
578
|
283 void link_to_global (void) |
|
284 { |
|
285 if (sym) |
|
286 ::link_to_global_variable (sym); |
|
287 } |
|
288 |
494
|
289 void mark_as_formal_parameter (void); |
|
290 |
578
|
291 void mark_for_possible_ans_assign (void) |
|
292 { maybe_do_ans_assign = 1; } |
494
|
293 |
|
294 tree_constant eval (int print); |
|
295 |
506
|
296 Octave_object eval (int print, int nargout, const Octave_object& args); |
494
|
297 |
|
298 void eval_undefined_error (void); |
|
299 |
581
|
300 void print_code (ostream& os); |
|
301 |
494
|
302 private: |
|
303 symbol_record *sym; |
|
304 int maybe_do_ans_assign; |
|
305 }; |
|
306 |
578
|
307 // Index expressions. |
|
308 |
|
309 class |
666
|
310 tree_index_expression : public tree_multi_val_ret |
578
|
311 { |
|
312 public: |
666
|
313 tree_index_expression (int l = -1, int c = -1) : tree_multi_val_ret (l, c) |
578
|
314 { |
|
315 id = 0; |
|
316 list = 0; |
|
317 } |
|
318 |
|
319 tree_index_expression (tree_identifier *i, int l = -1, int c = -1) |
666
|
320 : tree_multi_val_ret (l, c) |
578
|
321 { |
|
322 id = i; |
|
323 list = 0; |
|
324 } |
|
325 |
|
326 tree_index_expression (tree_identifier *i, tree_argument_list *lst, |
|
327 int l = -1, int c = -1) |
666
|
328 : tree_multi_val_ret (l, c) |
578
|
329 { |
|
330 id = i; |
|
331 list = lst; |
|
332 } |
|
333 |
|
334 ~tree_index_expression (void); |
|
335 |
|
336 int is_index_expression (void) const |
|
337 { return 1; } |
|
338 |
|
339 tree_identifier *ident (void) |
|
340 { return id; } |
|
341 |
|
342 tree_argument_list *arg_list (void) |
|
343 { return list; } |
|
344 |
|
345 void mark_for_possible_ans_assign (void) |
|
346 { |
|
347 if (id) |
|
348 id->mark_for_possible_ans_assign (); |
|
349 } |
|
350 |
|
351 tree_constant eval (int print); |
|
352 |
|
353 Octave_object eval (int print, int nargout, const Octave_object& args); |
|
354 |
|
355 void eval_error (void); |
|
356 |
581
|
357 void print_code (ostream& os); |
|
358 |
578
|
359 private: |
|
360 tree_identifier *id; |
|
361 tree_argument_list *list; |
|
362 }; |
|
363 |
|
364 // Prefix expressions. |
|
365 |
|
366 class |
|
367 tree_prefix_expression : public tree_expression |
|
368 { |
|
369 public: |
|
370 tree_prefix_expression (int l = -1, int c = -1) : tree_expression (l, c) |
|
371 { |
|
372 id = 0; |
|
373 etype = unknown; |
|
374 } |
|
375 |
|
376 tree_prefix_expression (tree_identifier *t, tree_expression::type et, |
|
377 int l = -1, int c = -1) |
|
378 : tree_expression (l, c) |
|
379 { |
|
380 id = t; |
|
381 etype = et; |
|
382 } |
|
383 |
|
384 ~tree_prefix_expression (void) |
|
385 { delete id; } |
|
386 |
|
387 tree_constant eval (int print); |
|
388 |
|
389 void eval_error (void); |
|
390 |
|
391 int is_prefix_expression (void) const |
|
392 { return 1; } |
|
393 |
581
|
394 char *oper (void) const; |
|
395 |
|
396 void print_code (ostream& os); |
|
397 |
578
|
398 private: |
|
399 tree_identifier *id; |
|
400 }; |
|
401 |
|
402 // Postfix expressions. |
|
403 |
|
404 class |
|
405 tree_postfix_expression : public tree_expression |
|
406 { |
|
407 public: |
|
408 tree_postfix_expression (int l = -1, int c = -1) : tree_expression (l, c) |
|
409 { |
|
410 id = 0; |
|
411 etype = unknown; |
|
412 } |
|
413 |
|
414 tree_postfix_expression (tree_identifier *t, tree_expression::type et, |
|
415 int l = -1, int c = -1) |
|
416 : tree_expression (l, c) |
|
417 { |
|
418 id = t; |
|
419 etype = et; |
|
420 } |
|
421 |
|
422 ~tree_postfix_expression (void) |
|
423 { delete id; } |
|
424 |
|
425 tree_constant eval (int print); |
|
426 |
|
427 void eval_error (void); |
|
428 |
581
|
429 char *oper (void) const; |
|
430 |
|
431 void print_code (ostream& os); |
|
432 |
578
|
433 private: |
|
434 tree_identifier *id; |
|
435 }; |
|
436 |
|
437 // Unary expressions. |
|
438 |
|
439 class |
|
440 tree_unary_expression : public tree_expression |
|
441 { |
|
442 public: |
|
443 tree_unary_expression (int l = -1, int c = -1) : tree_expression (l, c) |
|
444 { |
|
445 etype = tree_expression::unknown; |
|
446 op = 0; |
|
447 } |
|
448 |
|
449 tree_unary_expression (tree_expression *a, tree_expression::type t, |
|
450 int l = -1, int c = -1) |
|
451 : tree_expression (l, c) |
|
452 { |
|
453 etype = t; |
|
454 op = a; |
|
455 } |
|
456 |
|
457 ~tree_unary_expression (void) |
|
458 { delete op; } |
|
459 |
|
460 tree_constant eval (int print); |
|
461 |
|
462 void eval_error (void); |
|
463 |
581
|
464 char *oper (void) const; |
|
465 |
|
466 void print_code (ostream& os); |
|
467 |
578
|
468 private: |
|
469 tree_expression *op; |
|
470 }; |
|
471 |
|
472 // Binary expressions. |
|
473 |
|
474 class |
|
475 tree_binary_expression : public tree_expression |
|
476 { |
|
477 public: |
|
478 tree_binary_expression (int l = -1, int c = -1) : tree_expression (l, c) |
|
479 { |
|
480 etype = tree_expression::unknown; |
|
481 op1 = 0; |
|
482 op2 = 0; |
|
483 } |
|
484 |
|
485 tree_binary_expression (tree_expression *a, tree_expression *b, |
|
486 tree_expression::type t, int l = -1, int c = -1) |
|
487 : tree_expression (l, c) |
|
488 { |
|
489 etype = t; |
|
490 op1 = a; |
|
491 op2 = b; |
|
492 } |
|
493 |
|
494 ~tree_binary_expression (void) |
|
495 { |
|
496 delete op1; |
|
497 delete op2; |
|
498 } |
|
499 |
|
500 tree_constant eval (int print); |
|
501 |
|
502 void eval_error (void); |
|
503 |
581
|
504 char *oper (void) const; |
|
505 |
|
506 void print_code (ostream& os); |
|
507 |
578
|
508 private: |
|
509 tree_expression *op1; |
|
510 tree_expression *op2; |
|
511 }; |
|
512 |
|
513 // Simple assignment expressions. |
|
514 |
|
515 class |
666
|
516 tree_simple_assignment_expression : public tree_expression |
578
|
517 { |
|
518 public: |
581
|
519 void init (int plhs, int ans_assign) |
|
520 { |
|
521 etype = tree_expression::assignment; |
|
522 lhs = 0; |
|
523 index = 0; |
|
524 rhs = 0; |
|
525 preserve = plhs; |
|
526 ans_ass = ans_assign; |
|
527 } |
|
528 |
|
529 tree_simple_assignment_expression (int plhs = 0, int ans_assign = 0, |
|
530 int l = -1, int c = -1) |
666
|
531 : tree_expression (l, c) |
581
|
532 { init (plhs, ans_assign); } |
578
|
533 |
|
534 tree_simple_assignment_expression (tree_identifier *i, |
|
535 tree_expression *r, |
581
|
536 int plhs = 0, int ans_assign = 0, |
|
537 int l = -1, int c = -1) |
666
|
538 : tree_expression (l, c) |
578
|
539 { |
581
|
540 init (plhs, ans_assign); |
578
|
541 lhs = i; |
|
542 rhs = r; |
|
543 } |
|
544 |
|
545 tree_simple_assignment_expression (tree_index_expression *idx_expr, |
|
546 tree_expression *r, |
581
|
547 int plhs = 0, int ans_assign = 0, |
|
548 int l = -1, int c = -1) |
666
|
549 : tree_expression (l, c) |
578
|
550 { |
581
|
551 init (plhs, ans_assign); |
578
|
552 lhs = idx_expr->ident (); |
|
553 index = idx_expr->arg_list (); |
|
554 rhs = r; |
|
555 } |
|
556 |
|
557 ~tree_simple_assignment_expression (void); |
|
558 |
|
559 tree_identifier *left_hand_side (void) |
|
560 { return lhs; } |
|
561 |
581
|
562 int is_ans_assign (void) |
|
563 { return ans_ass; } |
|
564 |
578
|
565 tree_constant eval (int print); |
|
566 |
666
|
567 int is_assignment_expression (void) const |
|
568 { return 1; } |
|
569 |
578
|
570 void eval_error (void); |
|
571 |
581
|
572 void print_code (ostream& os); |
|
573 |
578
|
574 private: |
|
575 tree_identifier *lhs; |
|
576 tree_argument_list *index; |
|
577 tree_expression *rhs; |
|
578 int preserve; |
581
|
579 int ans_ass; |
578
|
580 }; |
|
581 |
|
582 // Multi-valued assignment expressions. |
|
583 |
|
584 class |
666
|
585 tree_multi_assignment_expression : public tree_multi_val_ret |
578
|
586 { |
|
587 public: |
|
588 tree_multi_assignment_expression (int l = -1, int c = -1) |
666
|
589 : tree_multi_val_ret (l, c) |
578
|
590 { |
|
591 etype = tree_expression::multi_assignment; |
|
592 lhs = 0; |
|
593 rhs = 0; |
|
594 } |
|
595 |
|
596 tree_multi_assignment_expression (tree_return_list *lst, |
666
|
597 tree_multi_val_ret *r, |
578
|
598 int l = -1, int c = -1) |
666
|
599 : tree_multi_val_ret (l, c) |
578
|
600 { |
|
601 etype = tree_expression::multi_assignment; |
|
602 lhs = lst; |
|
603 rhs = r; |
|
604 } |
|
605 |
|
606 ~tree_multi_assignment_expression (void); |
|
607 |
|
608 tree_constant eval (int print); |
|
609 |
|
610 Octave_object eval (int print, int nargout, const Octave_object& args); |
|
611 |
666
|
612 int is_assignment_expression (void) const |
|
613 { return 1; } |
|
614 |
578
|
615 void eval_error (void); |
|
616 |
581
|
617 void print_code (ostream& os); |
|
618 |
578
|
619 private: |
|
620 tree_return_list *lhs; |
666
|
621 tree_multi_val_ret *rhs; |
578
|
622 }; |
|
623 |
|
624 // Colon expressions. |
|
625 |
|
626 class |
|
627 tree_colon_expression : public tree_expression |
|
628 { |
|
629 public: |
|
630 tree_colon_expression (int l = -1, int c = -1) : tree_expression (l, c) |
|
631 { |
|
632 etype = tree_expression::colon; |
|
633 op1 = 0; |
|
634 op2 = 0; |
|
635 op3 = 0; |
|
636 } |
|
637 |
|
638 tree_colon_expression (tree_expression *a, tree_expression *b, |
|
639 int l = -1, int c = -1) |
|
640 : tree_expression (l, c) |
|
641 { |
|
642 etype = tree_expression::colon; |
|
643 op1 = a; |
|
644 op2 = b; |
|
645 op3 = 0; |
|
646 } |
|
647 |
|
648 ~tree_colon_expression (void) |
|
649 { |
|
650 delete op1; |
|
651 delete op2; |
|
652 delete op3; |
|
653 } |
|
654 |
|
655 tree_colon_expression *chain (tree_expression *t); |
|
656 |
|
657 tree_constant eval (int print); |
|
658 |
|
659 void eval_error (const char *s); |
|
660 |
581
|
661 void print_code (ostream& os); |
|
662 |
578
|
663 private: |
|
664 tree_expression *op1; |
|
665 tree_expression *op2; |
|
666 tree_expression *op3; |
|
667 }; |
|
668 |
|
669 // Builtin functions. |
|
670 |
|
671 class |
|
672 tree_builtin : public tree_fvc |
|
673 { |
|
674 public: |
|
675 tree_builtin (const char *nm = 0); |
|
676 |
|
677 tree_builtin (int i_max, int o_max, Mapper_fcn& m_fcn, |
|
678 const char *nm = 0); |
|
679 |
|
680 tree_builtin (int i_max, int o_max, Octave_builtin_fcn f, |
|
681 const char *nm = 0); |
|
682 |
|
683 ~tree_builtin (void) { } |
|
684 |
|
685 // int is_builtin (void) const; |
|
686 |
|
687 int is_mapper_function (void) const |
|
688 { return is_mapper; } |
|
689 |
|
690 tree_constant eval (int print); |
|
691 |
|
692 Octave_object eval (int print, int nargout, const Octave_object& args); |
|
693 |
|
694 char *name (void) const |
|
695 { return my_name; } |
|
696 |
|
697 int max_expected_args (void); |
|
698 |
581
|
699 void print_code (ostream& os) |
|
700 { |
|
701 os << my_name << " can't be printed because it is a builtin function\n"; |
|
702 } |
|
703 |
578
|
704 private: |
|
705 int nargin_max; |
|
706 int nargout_max; |
|
707 int is_mapper; |
|
708 Mapper_fcn mapper_fcn; |
|
709 Octave_builtin_fcn fcn; |
|
710 char *my_name; |
|
711 }; |
|
712 |
|
713 // User defined functions. |
|
714 |
494
|
715 class |
|
716 tree_function : public tree_fvc |
|
717 { |
|
718 public: |
578
|
719 void init (void) |
|
720 { |
|
721 call_depth = 0; |
|
722 param_list = 0; |
|
723 ret_list = 0; |
|
724 sym_tab = 0; |
|
725 cmd_list = 0; |
|
726 file_name = 0; |
|
727 fcn_name = 0; |
|
728 t_parsed = 0; |
|
729 system_fcn_file = 0; |
|
730 num_named_args = 0; |
|
731 num_args_passed = 0; |
|
732 curr_va_arg_number = 0; |
723
|
733 vr_list = 0; |
578
|
734 } |
494
|
735 |
578
|
736 tree_function (int l = -1, int c = -1) : tree_fvc (l, c) |
|
737 { init (); } |
494
|
738 |
578
|
739 tree_function (tree_statement_list *cl, symbol_table *st, |
|
740 int l = -1, int c = -1) |
|
741 : tree_fvc (l, c) |
|
742 { |
|
743 init (); |
|
744 sym_tab = st; |
|
745 cmd_list = cl; |
|
746 } |
|
747 |
|
748 ~tree_function (void) { } |
|
749 |
|
750 // tree_function *define (tree_statement_list *t); |
494
|
751 tree_function *define_param_list (tree_parameter_list *t); |
|
752 tree_function *define_ret_list (tree_parameter_list *t); |
|
753 |
|
754 void stash_fcn_file_name (char * s); |
578
|
755 |
|
756 void stash_fcn_file_time (time_t t) |
|
757 { t_parsed = t; } |
494
|
758 |
578
|
759 char *fcn_file_name (void) |
|
760 { return file_name; } |
|
761 |
|
762 time_t time_parsed (void) |
|
763 { return t_parsed; } |
494
|
764 |
|
765 void mark_as_system_fcn_file (void); |
578
|
766 |
|
767 int is_system_fcn_file (void) const |
|
768 { return system_fcn_file; } |
494
|
769 |
|
770 int takes_varargs (void) const; |
578
|
771 |
|
772 void octave_va_start (void) |
|
773 { curr_va_arg_number = num_named_args; } |
|
774 |
494
|
775 tree_constant octave_va_arg (void); |
|
776 |
723
|
777 int takes_var_return (void) const; |
|
778 |
|
779 void octave_vr_val (const tree_constant& val); |
|
780 |
494
|
781 void stash_function_name (char *s); |
578
|
782 |
|
783 char *function_name (void) |
|
784 { return fcn_name; } |
494
|
785 |
|
786 tree_constant eval (int print); |
|
787 |
506
|
788 Octave_object eval (int print, int nargout, const Octave_object& args); |
494
|
789 |
|
790 int max_expected_args (void); |
|
791 |
|
792 void traceback_error (void); |
|
793 |
581
|
794 void print_code (ostream& os); |
|
795 |
494
|
796 private: |
|
797 int call_depth; |
|
798 tree_parameter_list *param_list; |
|
799 tree_parameter_list *ret_list; |
|
800 symbol_table *sym_tab; |
578
|
801 tree_statement_list *cmd_list; |
494
|
802 char *file_name; |
|
803 char *fcn_name; |
|
804 time_t t_parsed; |
|
805 int system_fcn_file; |
|
806 int num_named_args; |
500
|
807 Octave_object args_passed; |
494
|
808 int num_args_passed; |
508
|
809 int curr_va_arg_number; |
723
|
810 tree_va_return_list *vr_list; |
494
|
811 }; |
|
812 |
|
813 #endif |
|
814 |
|
815 /* |
|
816 ;;; Local Variables: *** |
|
817 ;;; mode: C++ *** |
|
818 ;;; page-delimiter: "^/\\*" *** |
|
819 ;;; End: *** |
|
820 */ |