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