Mercurial > hg > octave-nkf
comparison libinterp/parse-tree/pt-cell.cc @ 16237:70f465930546
rearrange class heirarchy for tree_cell and tree_matrix
* pt-array-list.h, pt-array-list.cc: New files.
(tree_array_list): New class.
* pt-cell.h, pt-cell.cc (tree_cell): Derive from tree_array_list.
* pt-mat.h, pt-mat.cc (tree_matrix): Derive from tree_array_list.
* oct-parse.in.yy (octave_parser::finish_array_list): New function
adapted from octave_parser::finish_matrix.
(octave_parser::finish_matrix, octave_parser::finish_cell):
Call finish_array_list to do the work.
* pt-arg-list.h: Include symtab.h.
* base-list.h: Include cstdlib.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 09 Mar 2013 18:04:51 -0500 |
parents | 2fc554ffbc28 |
children | d63878346099 |
comparison
equal
deleted
inserted
replaced
16235:c31fd42f9000 | 16237:70f465930546 |
---|---|
25 #endif | 25 #endif |
26 | 26 |
27 #include <iostream> | 27 #include <iostream> |
28 | 28 |
29 #include "Cell.h" | 29 #include "Cell.h" |
30 #include "defun.h" | |
31 #include "error.h" | |
32 #include "oct-obj.h" | 30 #include "oct-obj.h" |
33 #include "pt-arg-list.h" | 31 #include "pt-arg-list.h" |
34 #include "pt-bp.h" | |
35 #include "pt-exp.h" | 32 #include "pt-exp.h" |
36 #include "pt-cell.h" | 33 #include "pt-cell.h" |
37 #include "pt-walk.h" | 34 #include "pt-walk.h" |
38 #include "utils.h" | |
39 #include "ov.h" | 35 #include "ov.h" |
40 #include "variables.h" | |
41 | 36 |
42 octave_value | 37 octave_value |
43 tree_cell::rvalue1 (int) | 38 tree_cell::rvalue1 (int) |
44 { | 39 { |
45 octave_value retval; | 40 octave_value retval; |
105 tree_cell::dup (symbol_table::scope_id scope, | 100 tree_cell::dup (symbol_table::scope_id scope, |
106 symbol_table::context_id context) const | 101 symbol_table::context_id context) const |
107 { | 102 { |
108 tree_cell *new_cell = new tree_cell (0, line (), column ()); | 103 tree_cell *new_cell = new tree_cell (0, line (), column ()); |
109 | 104 |
110 for (const_iterator p = begin (); p != end (); p++) | 105 new_cell->copy_base (*this, scope, context); |
111 { | |
112 const tree_argument_list *elt = *p; | |
113 | |
114 new_cell->append (elt ? elt->dup (scope, context) : 0); | |
115 } | |
116 | |
117 new_cell->copy_base (*this); | |
118 | 106 |
119 return new_cell; | 107 return new_cell; |
120 } | 108 } |
121 | 109 |
122 void | 110 void |