comparison src/pt-decl.cc @ 5861:2a6cb4ed8f1e

[project @ 2006-06-16 05:09:41 by jwe]
author jwe
date Fri, 16 Jun 2006 05:09:42 +0000
parents 4c8a2e4e0717
children 516d3071b34c
comparison
equal deleted inserted replaced
5860:b645066d40ad 5861:2a6cb4ed8f1e
43 { 43 {
44 delete id; 44 delete id;
45 delete expr; 45 delete expr;
46 } 46 }
47 47
48 tree_decl_elt *
49 tree_decl_elt::dup (symbol_table *sym_tab)
50 {
51 return new tree_decl_elt (id ? id->dup (sym_tab) : 0,
52 expr ? expr->dup (sym_tab) : 0);
53 }
54
48 void 55 void
49 tree_decl_elt::accept (tree_walker& tw) 56 tree_decl_elt::accept (tree_walker& tw)
50 { 57 {
51 tw.visit_decl_elt (*this); 58 tw.visit_decl_elt (*this);
52 } 59 }
63 f (*elt); 70 f (*elt);
64 71
65 if (error_state) 72 if (error_state)
66 break; 73 break;
67 } 74 }
75 }
76
77 tree_decl_init_list *
78 tree_decl_init_list::dup (symbol_table *sym_tab)
79 {
80 tree_decl_init_list *new_dil = new tree_decl_init_list ();
81
82 for (iterator p = begin (); p != end (); p++)
83 {
84 tree_decl_elt *elt = *p;
85
86 new_dil->append (elt ? elt->dup (sym_tab) : 0);
87 }
88
89 return new_dil;
68 } 90 }
69 91
70 void 92 void
71 tree_decl_init_list::accept (tree_walker& tw) 93 tree_decl_init_list::accept (tree_walker& tw)
72 { 94 {
131 if (error_state) 153 if (error_state)
132 ::error ("evaluating global command near line %d, column %d", 154 ::error ("evaluating global command near line %d, column %d",
133 line (), column ()); 155 line (), column ());
134 } 156 }
135 157
158 tree_command *
159 tree_global_command::dup (symbol_table *sym_tab)
160 {
161 return new tree_global_command (init_list ? init_list->dup (sym_tab) : 0,
162 line (), column ());
163 }
164
136 // Static. 165 // Static.
137 166
138 void 167 void
139 tree_static_command::do_init (tree_decl_elt& elt) 168 tree_static_command::do_init (tree_decl_elt& elt)
140 { 169 {
175 204
176 if (error_state) 205 if (error_state)
177 ::error ("evaluating static command near line %d, column %d", 206 ::error ("evaluating static command near line %d, column %d",
178 line (), column ()); 207 line (), column ());
179 } 208 }
209 }
210
211 tree_command *
212 tree_static_command::dup (symbol_table *sym_tab)
213 {
214 return new tree_static_command (init_list ? init_list->dup (sym_tab) : 0,
215 line (), column ());
180 } 216 }
181 217
182 /* 218 /*
183 ;;; Local Variables: *** 219 ;;; Local Variables: ***
184 ;;; mode: C++ *** 220 ;;; mode: C++ ***