4 #ifndef ASTCOMBINEDPROCESSING_C
5 #define ASTCOMBINEDPROCESSING_C
16 template <
class I,
class S>
23 template <
class I,
class S>
31 template <
class I,
class S>
36 traversals.push_back(t);
39 template <
class I,
class S>
47 template <
class I,
class S>
49 ::InheritedAttributeTypeList *
59 result->reserve(numberOfTraversals);
63 typename TraversalPtrList::iterator t = tBegin;
64 typename InheritedAttributeTypeList::iterator i
65 = inheritedValues->begin();
66 typename InheritedAttributeTypeList::const_iterator iEnd
67 = inheritedValues->end();
69 while (t != tEnd && i != iEnd)
70 result->push_back((*t++)->evaluateInheritedAttribute(astNode, *i++));
71 ROSE_ASSERT(t == tEnd && i == iEnd);
72 ROSE_ASSERT(result->size() == numberOfTraversals);
79 template <
class I,
class S>
81 ::SynthesizedAttributeTypeList *
96 = synthesizedAttributes.size();
100 attributesForTraversal(M);
104 result->reserve(numberOfTraversals);
106 typename TraversalPtrList::size_type i;
109 for (i = 0; i < numberOfTraversals; i++)
111 for (j = 0; j < M; j++)
112 attributesForTraversal[j] = (*synthesizedAttributes[j])[i];
115 traversals[i]->evaluateSynthesizedAttribute(
117 (*inheritedValues)[i],
118 attributesForTraversal));
123 for (j = 0; j < M; j++)
124 delete synthesizedAttributes[j];
129 delete inheritedValues;
134 template <
class I,
class S>
136 ::SynthesizedAttributeTypeList *
146 typename TraversalPtrList::size_type i;
147 for (i = 0; i < numberOfTraversals; i++)
149 = traversals[i]->defaultSynthesizedAttribute((*inheritedValues)[i]);
151 typename TraversalPtrList::iterator i = traversals.begin();
152 typename SynthesizedAttributeTypeList::iterator j
154 typename InheritedAttributeTypPtrList::iterator k
155 = inheritedValues->begin();
157 *j++ = (*i++)->defaultSynthesizedAttribute(*k++);
163 template <
class I,
class S>
172 tBegin = traversals.begin();
173 tEnd = traversals.end();
174 numberOfTraversals = traversals.size();
177 typename TraversalPtrList::iterator t;
178 for (t = tBegin; t != tEnd; ++t)
179 (*t)->atTraversalStart();
182 template <
class I,
class S>
188 typename TraversalPtrList::iterator t;
189 for (t = tBegin; t != tEnd; ++t)
190 (*t)->atTraversalEnd();
195 template <
class I,
class S>
202 template <
class I,
class S>
210 template <
class I,
class S>
218 template <
class I,
class S>
226 template <
class I,
class S>
228 ::InheritedAttributeTypeList *
242 typename TraversalPtrList::iterator t =
tBegin;
243 typename InheritedAttributeTypeList::iterator i
244 = inheritedValues->begin();
245 typename InheritedAttributeTypeList::const_iterator iEnd
246 = inheritedValues->end();
248 while (t !=
tEnd && i != iEnd)
250 ROSE_ASSERT(t ==
tEnd && i == iEnd);
258 template <
class I,
class S>
260 ::SynthesizedAttributeTypeList *
275 = synthesizedAttributes.size();
279 attributesForTraversal(M);
285 typename TraversalPtrList::size_type i;
290 for (j = 0; j < M; j++)
291 attributesForTraversal[j] = (*synthesizedAttributes[j])[i];
296 (*inheritedValues)[i],
297 attributesForTraversal));
302 for (j = 0; j < M; j++)
303 delete synthesizedAttributes[j];
308 delete inheritedValues;
313 template <
class I,
class S>
315 ::SynthesizedAttributeTypeList *
324 typename TraversalPtrList::size_type i;
327 =
traversals[i]->defaultSynthesizedAttribute((*inheritedValues)[i]);
332 template <
class I,
class S>
346 typename TraversalPtrList::iterator t;
348 (*t)->atTraversalStart();
351 template <
class I,
class S>
357 typename TraversalPtrList::iterator t;
359 (*t)->atTraversalEnd();
398 ::InheritedAttributeTypeList *
412 typename TraversalPtrList::iterator t =
tBegin;
413 typename InheritedAttributeTypeList::iterator i
414 = inheritedValues->begin();
415 typename InheritedAttributeTypeList::const_iterator iEnd
416 = inheritedValues->end();
418 while (t !=
tEnd && i != iEnd)
420 ROSE_ASSERT(t ==
tEnd && i == iEnd);
442 typename TraversalPtrList::iterator t;
444 (*t)->atTraversalStart();
453 typename TraversalPtrList::iterator t;
455 (*t)->atTraversalEnd();
464 typename TraversalPtrList::iterator t =
tBegin;
465 typename InheritedAttributeTypeList::iterator i
466 = inheritedValues->begin();
467 typename InheritedAttributeTypeList::const_iterator iEnd
468 = inheritedValues->end();
471 while (t !=
tEnd && i != iEnd)
473 ROSE_ASSERT(t ==
tEnd && i == iEnd);
478 delete inheritedValues;
516 ::SynthesizedAttributeTypeList *
528 typename SynthesizedAttributesList::size_type M
529 = synthesizedAttributes.size();
533 attributesForTraversal(M, NULL);
538 typename TraversalPtrList::size_type i;
539 typename SynthesizedAttributesList::size_type j;
543 for (j = 0; j < M; j++)
544 attributesForTraversal[j] = (*synthesizedAttributes[j])[i];
547 =
traversals[i]->evaluateSynthesizedAttribute(
549 attributesForTraversal);
555 for (j = 0; j < M; j++)
556 delete synthesizedAttributes[j];
563 ::SynthesizedAttributeTypeList *
571 typename TraversalPtrList::size_type i;
573 (*result)[i] =
traversals[i]->defaultSynthesizedAttribute();
592 typename TraversalPtrList::iterator t;
594 (*t)->atTraversalStart();
603 typename TraversalPtrList::iterator t;
605 (*t)->atTraversalEnd();