ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sageGeneric.h
Go to the documentation of this file.
1 #ifndef _SAGEGENERIC_H
2 
3 #define _SAGEGENERIC_H
4 
11 
12 // note: the comments are right aligned to support code-blocks doxygen 1.3.X :)
13 
14 #include <stdexcept>
15 
16 #if !defined(NDEBUG)
17 #include <typeinfo>
18 #include <iostream>
19 #endif /* NDEBUG */
20 
21 // #include "Cxx_Grammar.h"
22 #include "rose.h"
23 
24 namespace sg
25 {
26  //
27  // non sage specific utilities
28 
31  template <class T>
32  static inline
33  void unused(const T&) {}
34 
36  template <class T>
37  T& deref(T* ptr)
38  {
39  assert(ptr);
40  return *ptr;
41  }
42 
44  template <class T1, class T2>
45  struct ConstLike
46  {
47  typedef T2 type;
48  };
49 
50  template <class T1, class T2>
51  struct ConstLike<const T1, T2>
52  {
53  typedef const T2 type;
54  };
55 
56  //
57  // error reporting
58 
59  static inline
60  void unexpected_node(const SgNode& n)
61  {
62  sg::unused(n);
63 
64 #if !defined(NDEBUG)
65  std::cerr << typeid(n).name() << std::endl;
66 #endif
67 
68  ROSE_ASSERT(false);
69  throw std::logic_error("Encountered unexpected sage node. Please send a bug report to the maintainer.");
70  }
71 
72  //
73  // Convenience class
74 
75  template <class _ReturnType>
77  {
78  typedef _ReturnType ReturnType;
80 
82  : res()
83  {}
84 
85  explicit
86  DispatchHandler(const ReturnType& defaultval)
87  : res(defaultval)
88  {}
89 
90  operator ReturnType() const { return res; }
91 
92  protected:
94  };
95 
96 
97  //
98  // Sage query functions
99 
101  template <class SageNode>
102  static inline
103  SageNode& assume_sage_type(SgNode& n)
104  {
105  return static_cast<SageNode&>(n);
106  }
107 
110  template <class SageNode>
111  static inline
112  const SageNode& assume_sage_type(const SgNode& n)
113  {
114  return static_cast<const SageNode&>(n);
115  }
116 
119  template <class T>
121  {
122  template <class SageNode>
123  static
124  void dispatch(T& rv, SageNode& node)
125  {
126  rv.handle(node);
127  }
128  };
129 
132  template <class T>
133  struct VisitDispatcher<T*>
134  {
135  template <class SageNode>
136  static
137  void dispatch(T* rv, SageNode& node)
138  {
139  rv->handle(node);
140  }
141  };
142 
144  template <class RoseVisitor, class SageNode>
145  static inline
146  RoseVisitor
147  _dispatch(RoseVisitor rv, SageNode* n)
148  {
149  typedef sg::VisitDispatcher<RoseVisitor> Dispatcher;
150 
151  ROSE_ASSERT( n );
152 
153  switch (n->variantT())
154  {
155  case V_SgName:
156  Dispatcher::dispatch(rv, assume_sage_type<SgName>(*n));
157  break;
158 
159  case V_SgSymbolTable:
160  Dispatcher::dispatch(rv, assume_sage_type<SgSymbolTable>(*n));
161  break;
162 
163  case V_SgPragma:
164  Dispatcher::dispatch(rv, assume_sage_type<SgPragma>(*n));
165  break;
166 
167  case V_SgModifierNodes:
168  Dispatcher::dispatch(rv, assume_sage_type<SgModifierNodes>(*n));
169  break;
170 
172  Dispatcher::dispatch(rv, assume_sage_type<SgConstVolatileModifier>(*n));
173  break;
174 
175  case V_SgStorageModifier:
176  Dispatcher::dispatch(rv, assume_sage_type<SgStorageModifier>(*n));
177  break;
178 
179  case V_SgAccessModifier:
180  Dispatcher::dispatch(rv, assume_sage_type<SgAccessModifier>(*n));
181  break;
182 
184  Dispatcher::dispatch(rv, assume_sage_type<SgFunctionModifier>(*n));
185  break;
186 
188  Dispatcher::dispatch(rv, assume_sage_type<SgUPC_AccessModifier>(*n));
189  break;
190 
191  case V_SgLinkageModifier:
192  Dispatcher::dispatch(rv, assume_sage_type<SgLinkageModifier>(*n));
193  break;
194 
196  Dispatcher::dispatch(rv, assume_sage_type<SgSpecialFunctionModifier>(*n));
197  break;
198 
199  case V_SgTypeModifier:
200  Dispatcher::dispatch(rv, assume_sage_type<SgTypeModifier>(*n));
201  break;
202 
204  Dispatcher::dispatch(rv, assume_sage_type<SgElaboratedTypeModifier>(*n));
205  break;
206 
208  Dispatcher::dispatch(rv, assume_sage_type<SgBaseClassModifier>(*n));
209  break;
210 
212  Dispatcher::dispatch(rv, assume_sage_type<SgDeclarationModifier>(*n));
213  break;
214 
216  Dispatcher::dispatch(rv, assume_sage_type<SgOpenclAccessModeModifier>(*n));
217  break;
218 
219  case V_SgModifier:
220  Dispatcher::dispatch(rv, assume_sage_type<SgModifier>(*n));
221  break;
222 
223  case V_Sg_File_Info:
224  Dispatcher::dispatch(rv, assume_sage_type<Sg_File_Info>(*n));
225  break;
226 
227  case V_SgSourceFile:
228  Dispatcher::dispatch(rv, assume_sage_type<SgSourceFile>(*n));
229  break;
230 
231  case V_SgBinaryComposite:
232  Dispatcher::dispatch(rv, assume_sage_type<SgBinaryComposite>(*n));
233  break;
234 
235  case V_SgUnknownFile:
236  Dispatcher::dispatch(rv, assume_sage_type<SgUnknownFile>(*n));
237  break;
238 
239  case V_SgFile:
240  Dispatcher::dispatch(rv, assume_sage_type<SgFile>(*n));
241  break;
242 
243  case V_SgFileList:
244  Dispatcher::dispatch(rv, assume_sage_type<SgFileList>(*n));
245  break;
246 
247  case V_SgDirectory:
248  Dispatcher::dispatch(rv, assume_sage_type<SgDirectory>(*n));
249  break;
250 
251  case V_SgDirectoryList:
252  Dispatcher::dispatch(rv, assume_sage_type<SgDirectoryList>(*n));
253  break;
254 
255  case V_SgProject:
256  Dispatcher::dispatch(rv, assume_sage_type<SgProject>(*n));
257  break;
258 
259  case V_SgOptions:
260  Dispatcher::dispatch(rv, assume_sage_type<SgOptions>(*n));
261  break;
262 
263  case V_SgUnparse_Info:
264  Dispatcher::dispatch(rv, assume_sage_type<SgUnparse_Info>(*n));
265  break;
266 
267  case V_SgFuncDecl_attr:
268  Dispatcher::dispatch(rv, assume_sage_type<SgFuncDecl_attr>(*n));
269  break;
270 
271  case V_SgClassDecl_attr:
272  Dispatcher::dispatch(rv, assume_sage_type<SgClassDecl_attr>(*n));
273  break;
274 
275  case V_SgTypedefSeq:
276  Dispatcher::dispatch(rv, assume_sage_type<SgTypedefSeq>(*n));
277  break;
278 
280  Dispatcher::dispatch(rv, assume_sage_type<SgFunctionParameterTypeList>(*n));
281  break;
282 
284  Dispatcher::dispatch(rv, assume_sage_type<SgTemplateParameter>(*n));
285  break;
286 
288  Dispatcher::dispatch(rv, assume_sage_type<SgTemplateArgument>(*n));
289  break;
290 
292  Dispatcher::dispatch(rv, assume_sage_type<SgTemplateParameterList>(*n));
293  break;
294 
296  Dispatcher::dispatch(rv, assume_sage_type<SgTemplateArgumentList>(*n));
297  break;
298 
299  case V_SgBitAttribute:
300  Dispatcher::dispatch(rv, assume_sage_type<SgBitAttribute>(*n));
301  break;
302 
303  case V_SgAttribute:
304  Dispatcher::dispatch(rv, assume_sage_type<SgAttribute>(*n));
305  break;
306 
307  case V_SgBaseClass:
308  Dispatcher::dispatch(rv, assume_sage_type<SgBaseClass>(*n));
309  break;
310 
312  Dispatcher::dispatch(rv, assume_sage_type<SgUndirectedGraphEdge>(*n));
313  break;
314 
316  Dispatcher::dispatch(rv, assume_sage_type<SgDirectedGraphEdge>(*n));
317  break;
318 
319  case V_SgGraphNode:
320  Dispatcher::dispatch(rv, assume_sage_type<SgGraphNode>(*n));
321  break;
322 
323  case V_SgGraphEdge:
324  Dispatcher::dispatch(rv, assume_sage_type<SgGraphEdge>(*n));
325  break;
326 
328  Dispatcher::dispatch(rv, assume_sage_type<SgStringKeyedBidirectionalGraph>(*n));
329  break;
330 
332  Dispatcher::dispatch(rv, assume_sage_type<SgIntKeyedBidirectionalGraph>(*n));
333  break;
334 
336  Dispatcher::dispatch(rv, assume_sage_type<SgBidirectionalGraph>(*n));
337  break;
338 
340  Dispatcher::dispatch(rv, assume_sage_type<SgIncidenceDirectedGraph>(*n));
341  break;
342 
344  Dispatcher::dispatch(rv, assume_sage_type<SgIncidenceUndirectedGraph>(*n));
345  break;
346 
347  case V_SgGraph:
348  Dispatcher::dispatch(rv, assume_sage_type<SgGraph>(*n));
349  break;
350 
351  case V_SgGraphNodeList:
352  Dispatcher::dispatch(rv, assume_sage_type<SgGraphNodeList>(*n));
353  break;
354 
355  case V_SgGraphEdgeList:
356  Dispatcher::dispatch(rv, assume_sage_type<SgGraphEdgeList>(*n));
357  break;
358 
359  case V_SgQualifiedName:
360  Dispatcher::dispatch(rv, assume_sage_type<SgQualifiedName>(*n));
361  break;
362 
363  case V_SgNameGroup:
364  Dispatcher::dispatch(rv, assume_sage_type<SgNameGroup>(*n));
365  break;
366 
368  Dispatcher::dispatch(rv, assume_sage_type<SgCommonBlockObject>(*n));
369  break;
370 
371  case V_SgDimensionObject:
372  Dispatcher::dispatch(rv, assume_sage_type<SgDimensionObject>(*n));
373  break;
374 
376  Dispatcher::dispatch(rv, assume_sage_type<SgDataStatementGroup>(*n));
377  break;
378 
380  Dispatcher::dispatch(rv, assume_sage_type<SgDataStatementObject>(*n));
381  break;
382 
384  Dispatcher::dispatch(rv, assume_sage_type<SgDataStatementValue>(*n));
385  break;
386 
387  case V_SgFormatItem:
388  Dispatcher::dispatch(rv, assume_sage_type<SgFormatItem>(*n));
389  break;
390 
391  case V_SgFormatItemList:
392  Dispatcher::dispatch(rv, assume_sage_type<SgFormatItemList>(*n));
393  break;
394 
395  case V_SgTypeTable:
396  Dispatcher::dispatch(rv, assume_sage_type<SgTypeTable>(*n));
397  break;
398 
399  case V_SgSupport:
400  Dispatcher::dispatch(rv, assume_sage_type<SgSupport>(*n));
401  break;
402 
403  case V_SgForStatement:
404  Dispatcher::dispatch(rv, assume_sage_type<SgForStatement>(*n));
405  break;
406 
408  Dispatcher::dispatch(rv, assume_sage_type<SgForInitStatement>(*n));
409  break;
410 
412  Dispatcher::dispatch(rv, assume_sage_type<SgCatchStatementSeq>(*n));
413  break;
414 
416  Dispatcher::dispatch(rv, assume_sage_type<SgFunctionParameterList>(*n));
417  break;
418 
420  Dispatcher::dispatch(rv, assume_sage_type<SgCtorInitializerList>(*n));
421  break;
422 
423  case V_SgBasicBlock:
424  Dispatcher::dispatch(rv, assume_sage_type<SgBasicBlock>(*n));
425  break;
426 
427  case V_SgGlobal:
428  Dispatcher::dispatch(rv, assume_sage_type<SgGlobal>(*n));
429  break;
430 
431  case V_SgIfStmt:
432  Dispatcher::dispatch(rv, assume_sage_type<SgIfStmt>(*n));
433  break;
434 
436  Dispatcher::dispatch(rv, assume_sage_type<SgFunctionDefinition>(*n));
437  break;
438 
439  case V_SgWhileStmt:
440  Dispatcher::dispatch(rv, assume_sage_type<SgWhileStmt>(*n));
441  break;
442 
443  case V_SgDoWhileStmt:
444  Dispatcher::dispatch(rv, assume_sage_type<SgDoWhileStmt>(*n));
445  break;
446 
447  case V_SgSwitchStatement:
448  Dispatcher::dispatch(rv, assume_sage_type<SgSwitchStatement>(*n));
449  break;
450 
451  case V_SgCatchOptionStmt:
452  Dispatcher::dispatch(rv, assume_sage_type<SgCatchOptionStmt>(*n));
453  break;
454 
456  Dispatcher::dispatch(rv, assume_sage_type<SgVariableDeclaration>(*n));
457  break;
458 
460  Dispatcher::dispatch(rv, assume_sage_type<SgVariableDefinition>(*n));
461  break;
462 
463  case V_SgEnumDeclaration:
464  Dispatcher::dispatch(rv, assume_sage_type<SgEnumDeclaration>(*n));
465  break;
466 
467  case V_SgAsmStmt:
468  Dispatcher::dispatch(rv, assume_sage_type<SgAsmStmt>(*n));
469  break;
470 
472  Dispatcher::dispatch(rv, assume_sage_type<SgTypedefDeclaration>(*n));
473  break;
474 
476  Dispatcher::dispatch(rv, assume_sage_type<SgFunctionTypeTable>(*n));
477  break;
478 
479  case V_SgExprStatement:
480  Dispatcher::dispatch(rv, assume_sage_type<SgExprStatement>(*n));
481  break;
482 
483  case V_SgLabelStatement:
484  Dispatcher::dispatch(rv, assume_sage_type<SgLabelStatement>(*n));
485  break;
486 
487  case V_SgCaseOptionStmt:
488  Dispatcher::dispatch(rv, assume_sage_type<SgCaseOptionStmt>(*n));
489  break;
490 
491  case V_SgTryStmt:
492  Dispatcher::dispatch(rv, assume_sage_type<SgTryStmt>(*n));
493  break;
494 
496  Dispatcher::dispatch(rv, assume_sage_type<SgDefaultOptionStmt>(*n));
497  break;
498 
499  case V_SgBreakStmt:
500  Dispatcher::dispatch(rv, assume_sage_type<SgBreakStmt>(*n));
501  break;
502 
503  case V_SgContinueStmt:
504  Dispatcher::dispatch(rv, assume_sage_type<SgContinueStmt>(*n));
505  break;
506 
507  case V_SgReturnStmt:
508  Dispatcher::dispatch(rv, assume_sage_type<SgReturnStmt>(*n));
509  break;
510 
511  case V_SgGotoStatement:
512  Dispatcher::dispatch(rv, assume_sage_type<SgGotoStatement>(*n));
513  break;
514 
515  case V_SgSpawnStmt:
516  Dispatcher::dispatch(rv, assume_sage_type<SgSpawnStmt>(*n));
517  break;
518 
519  case V_SgNullStatement:
520  Dispatcher::dispatch(rv, assume_sage_type<SgNullStatement>(*n));
521  break;
522 
524  Dispatcher::dispatch(rv, assume_sage_type<SgVariantStatement>(*n));
525  break;
526 
528  Dispatcher::dispatch(rv, assume_sage_type<SgPragmaDeclaration>(*n));
529  break;
530 
532  Dispatcher::dispatch(rv, assume_sage_type<SgTemplateDeclaration>(*n));
533  break;
534 
536  Dispatcher::dispatch(rv, assume_sage_type<SgTemplateInstantiationDecl>(*n));
537  break;
538 
540  Dispatcher::dispatch(rv, assume_sage_type<SgTemplateInstantiationDefn>(*n));
541  break;
542 
544  Dispatcher::dispatch(rv, assume_sage_type<SgTemplateInstantiationFunctionDecl>(*n));
545  break;
546 
548  Dispatcher::dispatch(rv, assume_sage_type<SgTemplateInstantiationMemberFunctionDecl>(*n));
549  break;
550 
552  Dispatcher::dispatch(rv, assume_sage_type<SgProgramHeaderStatement>(*n));
553  break;
554 
556  Dispatcher::dispatch(rv, assume_sage_type<SgProcedureHeaderStatement>(*n));
557  break;
558 
559  case V_SgEntryStatement:
560  Dispatcher::dispatch(rv, assume_sage_type<SgEntryStatement>(*n));
561  break;
562 
564  Dispatcher::dispatch(rv, assume_sage_type<SgFortranNonblockedDo>(*n));
565  break;
566 
568  Dispatcher::dispatch(rv, assume_sage_type<SgInterfaceStatement>(*n));
569  break;
570 
572  Dispatcher::dispatch(rv, assume_sage_type<SgParameterStatement>(*n));
573  break;
574 
575  case V_SgCommonBlock:
576  Dispatcher::dispatch(rv, assume_sage_type<SgCommonBlock>(*n));
577  break;
578 
579  case V_SgModuleStatement:
580  Dispatcher::dispatch(rv, assume_sage_type<SgModuleStatement>(*n));
581  break;
582 
583  case V_SgUseStatement:
584  Dispatcher::dispatch(rv, assume_sage_type<SgUseStatement>(*n));
585  break;
586 
588  Dispatcher::dispatch(rv, assume_sage_type<SgStopOrPauseStatement>(*n));
589  break;
590 
591  case V_SgPrintStatement:
592  Dispatcher::dispatch(rv, assume_sage_type<SgPrintStatement>(*n));
593  break;
594 
595  case V_SgReadStatement:
596  Dispatcher::dispatch(rv, assume_sage_type<SgReadStatement>(*n));
597  break;
598 
599  case V_SgWriteStatement:
600  Dispatcher::dispatch(rv, assume_sage_type<SgWriteStatement>(*n));
601  break;
602 
603  case V_SgOpenStatement:
604  Dispatcher::dispatch(rv, assume_sage_type<SgOpenStatement>(*n));
605  break;
606 
607  case V_SgCloseStatement:
608  Dispatcher::dispatch(rv, assume_sage_type<SgCloseStatement>(*n));
609  break;
610 
612  Dispatcher::dispatch(rv, assume_sage_type<SgInquireStatement>(*n));
613  break;
614 
615  case V_SgFlushStatement:
616  Dispatcher::dispatch(rv, assume_sage_type<SgFlushStatement>(*n));
617  break;
618 
620  Dispatcher::dispatch(rv, assume_sage_type<SgBackspaceStatement>(*n));
621  break;
622 
623  case V_SgRewindStatement:
624  Dispatcher::dispatch(rv, assume_sage_type<SgRewindStatement>(*n));
625  break;
626 
628  Dispatcher::dispatch(rv, assume_sage_type<SgEndfileStatement>(*n));
629  break;
630 
631  case V_SgWaitStatement:
632  Dispatcher::dispatch(rv, assume_sage_type<SgWaitStatement>(*n));
633  break;
634 
636  Dispatcher::dispatch(rv, assume_sage_type<SgCAFWithTeamStatement>(*n));
637  break;
638 
639  case V_SgFormatStatement:
640  Dispatcher::dispatch(rv, assume_sage_type<SgFormatStatement>(*n));
641  break;
642 
643  case V_SgFortranDo:
644  Dispatcher::dispatch(rv, assume_sage_type<SgFortranDo>(*n));
645  break;
646 
647  case V_SgForAllStatement:
648  Dispatcher::dispatch(rv, assume_sage_type<SgForAllStatement>(*n));
649  break;
650 
651  case V_SgIOStatement:
652  Dispatcher::dispatch(rv, assume_sage_type<SgIOStatement>(*n));
653  break;
654 
656  Dispatcher::dispatch(rv, assume_sage_type<SgUpcNotifyStatement>(*n));
657  break;
658 
660  Dispatcher::dispatch(rv, assume_sage_type<SgUpcWaitStatement>(*n));
661  break;
662 
664  Dispatcher::dispatch(rv, assume_sage_type<SgUpcBarrierStatement>(*n));
665  break;
666 
668  Dispatcher::dispatch(rv, assume_sage_type<SgUpcFenceStatement>(*n));
669  break;
670 
672  Dispatcher::dispatch(rv, assume_sage_type<SgUpcForAllStatement>(*n));
673  break;
674 
676  Dispatcher::dispatch(rv, assume_sage_type<SgOmpParallelStatement>(*n));
677  break;
678 
680  Dispatcher::dispatch(rv, assume_sage_type<SgOmpSingleStatement>(*n));
681  break;
682 
684  Dispatcher::dispatch(rv, assume_sage_type<SgOmpSimdStatement>(*n));
685  break;
686 
688  Dispatcher::dispatch(rv, assume_sage_type<SgOmpTaskStatement>(*n));
689  break;
690 
691  case V_SgOmpForStatement:
692  Dispatcher::dispatch(rv, assume_sage_type<SgOmpForStatement>(*n));
693  break;
694 
695  case V_SgOmpDoStatement:
696  Dispatcher::dispatch(rv, assume_sage_type<SgOmpDoStatement>(*n));
697  break;
698 
700  Dispatcher::dispatch(rv, assume_sage_type<SgOmpSectionsStatement>(*n));
701  break;
702 
704  Dispatcher::dispatch(rv, assume_sage_type<SgOmpClauseBodyStatement>(*n));
705  break;
706 
708  Dispatcher::dispatch(rv, assume_sage_type<SgOmpAtomicStatement>(*n));
709  break;
710 
712  Dispatcher::dispatch(rv, assume_sage_type<SgOmpMasterStatement>(*n));
713  break;
714 
716  Dispatcher::dispatch(rv, assume_sage_type<SgOmpSectionStatement>(*n));
717  break;
718 
720  Dispatcher::dispatch(rv, assume_sage_type<SgOmpOrderedStatement>(*n));
721  break;
722 
724  Dispatcher::dispatch(rv, assume_sage_type<SgOmpWorkshareStatement>(*n));
725  break;
726 
728  Dispatcher::dispatch(rv, assume_sage_type<SgOmpCriticalStatement>(*n));
729  break;
730 
732  Dispatcher::dispatch(rv, assume_sage_type<SgOmpBodyStatement>(*n));
733  break;
734 
736  Dispatcher::dispatch(rv, assume_sage_type<SgBlockDataStatement>(*n));
737  break;
738 
740  Dispatcher::dispatch(rv, assume_sage_type<SgImplicitStatement>(*n));
741  break;
742 
744  Dispatcher::dispatch(rv, assume_sage_type<SgStatementFunctionStatement>(*n));
745  break;
746 
747  case V_SgWhereStatement:
748  Dispatcher::dispatch(rv, assume_sage_type<SgWhereStatement>(*n));
749  break;
750 
752  Dispatcher::dispatch(rv, assume_sage_type<SgNullifyStatement>(*n));
753  break;
754 
756  Dispatcher::dispatch(rv, assume_sage_type<SgEquivalenceStatement>(*n));
757  break;
758 
760  Dispatcher::dispatch(rv, assume_sage_type<SgDerivedTypeStatement>(*n));
761  break;
762 
764  Dispatcher::dispatch(rv, assume_sage_type<SgAttributeSpecificationStatement>(*n));
765  break;
766 
768  Dispatcher::dispatch(rv, assume_sage_type<SgAllocateStatement>(*n));
769  break;
770 
772  Dispatcher::dispatch(rv, assume_sage_type<SgDeallocateStatement>(*n));
773  break;
774 
776  Dispatcher::dispatch(rv, assume_sage_type<SgContainsStatement>(*n));
777  break;
778 
780  Dispatcher::dispatch(rv, assume_sage_type<SgSequenceStatement>(*n));
781  break;
782 
784  Dispatcher::dispatch(rv, assume_sage_type<SgElseWhereStatement>(*n));
785  break;
786 
788  Dispatcher::dispatch(rv, assume_sage_type<SgArithmeticIfStatement>(*n));
789  break;
790 
791  case V_SgAssignStatement:
792  Dispatcher::dispatch(rv, assume_sage_type<SgAssignStatement>(*n));
793  break;
794 
796  Dispatcher::dispatch(rv, assume_sage_type<SgComputedGotoStatement>(*n));
797  break;
798 
800  Dispatcher::dispatch(rv, assume_sage_type<SgAssignedGotoStatement>(*n));
801  break;
802 
804  Dispatcher::dispatch(rv, assume_sage_type<SgNamelistStatement>(*n));
805  break;
806 
807  case V_SgImportStatement:
808  Dispatcher::dispatch(rv, assume_sage_type<SgImportStatement>(*n));
809  break;
810 
812  Dispatcher::dispatch(rv, assume_sage_type<SgAssociateStatement>(*n));
813  break;
814 
816  Dispatcher::dispatch(rv, assume_sage_type<SgFortranIncludeLine>(*n));
817  break;
818 
820  Dispatcher::dispatch(rv, assume_sage_type<SgNamespaceDeclarationStatement>(*n));
821  break;
822 
824  Dispatcher::dispatch(rv, assume_sage_type<SgNamespaceAliasDeclarationStatement>(*n));
825  break;
826 
828  Dispatcher::dispatch(rv, assume_sage_type<SgNamespaceDefinitionStatement>(*n));
829  break;
830 
832  Dispatcher::dispatch(rv, assume_sage_type<SgUsingDeclarationStatement>(*n));
833  break;
834 
836  Dispatcher::dispatch(rv, assume_sage_type<SgUsingDirectiveStatement>(*n));
837  break;
838 
840  Dispatcher::dispatch(rv, assume_sage_type<SgTemplateInstantiationDirectiveStatement>(*n));
841  break;
842 
844  Dispatcher::dispatch(rv, assume_sage_type<SgClassDeclaration>(*n));
845  break;
846 
847  case V_SgClassDefinition:
848  Dispatcher::dispatch(rv, assume_sage_type<SgClassDefinition>(*n));
849  break;
850 
851  case V_SgScopeStatement:
852  Dispatcher::dispatch(rv, assume_sage_type<SgScopeStatement>(*n));
853  break;
854 
856  Dispatcher::dispatch(rv, assume_sage_type<SgMemberFunctionDeclaration>(*n));
857  break;
858 
860  Dispatcher::dispatch(rv, assume_sage_type<SgFunctionDeclaration>(*n));
861  break;
862 
864  Dispatcher::dispatch(rv, assume_sage_type<SgIncludeDirectiveStatement>(*n));
865  break;
866 
868  Dispatcher::dispatch(rv, assume_sage_type<SgDefineDirectiveStatement>(*n));
869  break;
870 
872  Dispatcher::dispatch(rv, assume_sage_type<SgUndefDirectiveStatement>(*n));
873  break;
874 
876  Dispatcher::dispatch(rv, assume_sage_type<SgIfdefDirectiveStatement>(*n));
877  break;
878 
880  Dispatcher::dispatch(rv, assume_sage_type<SgIfndefDirectiveStatement>(*n));
881  break;
882 
884  Dispatcher::dispatch(rv, assume_sage_type<SgIfDirectiveStatement>(*n));
885  break;
886 
888  Dispatcher::dispatch(rv, assume_sage_type<SgDeadIfDirectiveStatement>(*n));
889  break;
890 
892  Dispatcher::dispatch(rv, assume_sage_type<SgElseDirectiveStatement>(*n));
893  break;
894 
896  Dispatcher::dispatch(rv, assume_sage_type<SgElseifDirectiveStatement>(*n));
897  break;
898 
900  Dispatcher::dispatch(rv, assume_sage_type<SgEndifDirectiveStatement>(*n));
901  break;
902 
904  Dispatcher::dispatch(rv, assume_sage_type<SgLineDirectiveStatement>(*n));
905  break;
906 
908  Dispatcher::dispatch(rv, assume_sage_type<SgWarningDirectiveStatement>(*n));
909  break;
910 
912  Dispatcher::dispatch(rv, assume_sage_type<SgErrorDirectiveStatement>(*n));
913  break;
914 
916  Dispatcher::dispatch(rv, assume_sage_type<SgEmptyDirectiveStatement>(*n));
917  break;
918 
920  Dispatcher::dispatch(rv, assume_sage_type<SgIncludeNextDirectiveStatement>(*n));
921  break;
922 
924  Dispatcher::dispatch(rv, assume_sage_type<SgIdentDirectiveStatement>(*n));
925  break;
926 
928  Dispatcher::dispatch(rv, assume_sage_type<SgLinemarkerDirectiveStatement>(*n));
929  break;
930 
932  Dispatcher::dispatch(rv, assume_sage_type<SgC_PreprocessorDirectiveStatement>(*n));
933  break;
934 
936  Dispatcher::dispatch(rv, assume_sage_type<SgClinkageStartStatement>(*n));
937  break;
938 
940  Dispatcher::dispatch(rv, assume_sage_type<SgClinkageEndStatement>(*n));
941  break;
942 
944  Dispatcher::dispatch(rv, assume_sage_type<SgClinkageDeclarationStatement>(*n));
945  break;
946 
948  Dispatcher::dispatch(rv, assume_sage_type<SgOmpFlushStatement>(*n));
949  break;
950 
952  Dispatcher::dispatch(rv, assume_sage_type<SgOmpBarrierStatement>(*n));
953  break;
954 
956  Dispatcher::dispatch(rv, assume_sage_type<SgOmpTaskwaitStatement>(*n));
957  break;
958 
960  Dispatcher::dispatch(rv, assume_sage_type<SgOmpThreadprivateStatement>(*n));
961  break;
962 
964  Dispatcher::dispatch(rv, assume_sage_type<SgDeclarationStatement>(*n));
965  break;
966 
967  case V_SgExprListExp:
968  Dispatcher::dispatch(rv, assume_sage_type<SgExprListExp>(*n));
969  break;
970 
971  case V_SgVarRefExp:
972  Dispatcher::dispatch(rv, assume_sage_type<SgVarRefExp>(*n));
973  break;
974 
975  case V_SgLabelRefExp:
976  Dispatcher::dispatch(rv, assume_sage_type<SgLabelRefExp>(*n));
977  break;
978 
979  case V_SgClassNameRefExp:
980  Dispatcher::dispatch(rv, assume_sage_type<SgClassNameRefExp>(*n));
981  break;
982 
983  case V_SgFunctionRefExp:
984  Dispatcher::dispatch(rv, assume_sage_type<SgFunctionRefExp>(*n));
985  break;
986 
988  Dispatcher::dispatch(rv, assume_sage_type<SgMemberFunctionRefExp>(*n));
989  break;
990 
991  case V_SgFunctionCallExp:
992  Dispatcher::dispatch(rv, assume_sage_type<SgFunctionCallExp>(*n));
993  break;
994 
995  case V_SgSizeOfOp:
996  Dispatcher::dispatch(rv, assume_sage_type<SgSizeOfOp>(*n));
997  break;
998 
1000  Dispatcher::dispatch(rv, assume_sage_type<SgUpcLocalsizeofExpression>(*n));
1001  break;
1002 
1004  Dispatcher::dispatch(rv, assume_sage_type<SgUpcBlocksizeofExpression>(*n));
1005  break;
1006 
1008  Dispatcher::dispatch(rv, assume_sage_type<SgUpcElemsizeofExpression>(*n));
1009  break;
1010 
1011  case V_SgVarArgStartOp:
1012  Dispatcher::dispatch(rv, assume_sage_type<SgVarArgStartOp>(*n));
1013  break;
1014 
1016  Dispatcher::dispatch(rv, assume_sage_type<SgVarArgStartOneOperandOp>(*n));
1017  break;
1018 
1019  case V_SgVarArgOp:
1020  Dispatcher::dispatch(rv, assume_sage_type<SgVarArgOp>(*n));
1021  break;
1022 
1023  case V_SgVarArgEndOp:
1024  Dispatcher::dispatch(rv, assume_sage_type<SgVarArgEndOp>(*n));
1025  break;
1026 
1027  case V_SgVarArgCopyOp:
1028  Dispatcher::dispatch(rv, assume_sage_type<SgVarArgCopyOp>(*n));
1029  break;
1030 
1031  case V_SgTypeIdOp:
1032  Dispatcher::dispatch(rv, assume_sage_type<SgTypeIdOp>(*n));
1033  break;
1034 
1035  case V_SgConditionalExp:
1036  Dispatcher::dispatch(rv, assume_sage_type<SgConditionalExp>(*n));
1037  break;
1038 
1039  case V_SgNewExp:
1040  Dispatcher::dispatch(rv, assume_sage_type<SgNewExp>(*n));
1041  break;
1042 
1043  case V_SgDeleteExp:
1044  Dispatcher::dispatch(rv, assume_sage_type<SgDeleteExp>(*n));
1045  break;
1046 
1047  case V_SgThisExp:
1048  Dispatcher::dispatch(rv, assume_sage_type<SgThisExp>(*n));
1049  break;
1050 
1051  case V_SgRefExp:
1052  Dispatcher::dispatch(rv, assume_sage_type<SgRefExp>(*n));
1053  break;
1054 
1056  Dispatcher::dispatch(rv, assume_sage_type<SgAggregateInitializer>(*n));
1057  break;
1058 
1060  Dispatcher::dispatch(rv, assume_sage_type<SgConstructorInitializer>(*n));
1061  break;
1062 
1063  case V_SgAssignInitializer:
1064  Dispatcher::dispatch(rv, assume_sage_type<SgAssignInitializer>(*n));
1065  break;
1066 
1067  case V_SgExpressionRoot:
1068  Dispatcher::dispatch(rv, assume_sage_type<SgExpressionRoot>(*n));
1069  break;
1070 
1071  case V_SgMinusOp:
1072  Dispatcher::dispatch(rv, assume_sage_type<SgMinusOp>(*n));
1073  break;
1074 
1075  case V_SgUnaryAddOp:
1076  Dispatcher::dispatch(rv, assume_sage_type<SgUnaryAddOp>(*n));
1077  break;
1078 
1079  case V_SgNotOp:
1080  Dispatcher::dispatch(rv, assume_sage_type<SgNotOp>(*n));
1081  break;
1082 
1083  case V_SgPointerDerefExp:
1084  Dispatcher::dispatch(rv, assume_sage_type<SgPointerDerefExp>(*n));
1085  break;
1086 
1087  case V_SgAddressOfOp:
1088  Dispatcher::dispatch(rv, assume_sage_type<SgAddressOfOp>(*n));
1089  break;
1090 
1091  case V_SgMinusMinusOp:
1092  Dispatcher::dispatch(rv, assume_sage_type<SgMinusMinusOp>(*n));
1093  break;
1094 
1095  case V_SgPlusPlusOp:
1096  Dispatcher::dispatch(rv, assume_sage_type<SgPlusPlusOp>(*n));
1097  break;
1098 
1099  case V_SgBitComplementOp:
1100  Dispatcher::dispatch(rv, assume_sage_type<SgBitComplementOp>(*n));
1101  break;
1102 
1103  case V_SgRealPartOp:
1104  Dispatcher::dispatch(rv, assume_sage_type<SgRealPartOp>(*n));
1105  break;
1106 
1107  case V_SgImagPartOp:
1108  Dispatcher::dispatch(rv, assume_sage_type<SgImagPartOp>(*n));
1109  break;
1110 
1111  case V_SgConjugateOp:
1112  Dispatcher::dispatch(rv, assume_sage_type<SgConjugateOp>(*n));
1113  break;
1114 
1115  case V_SgCastExp:
1116  Dispatcher::dispatch(rv, assume_sage_type<SgCastExp>(*n));
1117  break;
1118 
1119  case V_SgThrowOp:
1120  Dispatcher::dispatch(rv, assume_sage_type<SgThrowOp>(*n));
1121  break;
1122 
1123  case V_SgArrowExp:
1124  Dispatcher::dispatch(rv, assume_sage_type<SgArrowExp>(*n));
1125  break;
1126 
1127  case V_SgDotExp:
1128  Dispatcher::dispatch(rv, assume_sage_type<SgDotExp>(*n));
1129  break;
1130 
1131  case V_SgDotStarOp:
1132  Dispatcher::dispatch(rv, assume_sage_type<SgDotStarOp>(*n));
1133  break;
1134 
1135  case V_SgArrowStarOp:
1136  Dispatcher::dispatch(rv, assume_sage_type<SgArrowStarOp>(*n));
1137  break;
1138 
1139  case V_SgEqualityOp:
1140  Dispatcher::dispatch(rv, assume_sage_type<SgEqualityOp>(*n));
1141  break;
1142 
1143  case V_SgLessThanOp:
1144  Dispatcher::dispatch(rv, assume_sage_type<SgLessThanOp>(*n));
1145  break;
1146 
1147  case V_SgGreaterThanOp:
1148  Dispatcher::dispatch(rv, assume_sage_type<SgGreaterThanOp>(*n));
1149  break;
1150 
1151  case V_SgNotEqualOp:
1152  Dispatcher::dispatch(rv, assume_sage_type<SgNotEqualOp>(*n));
1153  break;
1154 
1155  case V_SgLessOrEqualOp:
1156  Dispatcher::dispatch(rv, assume_sage_type<SgLessOrEqualOp>(*n));
1157  break;
1158 
1159  case V_SgGreaterOrEqualOp:
1160  Dispatcher::dispatch(rv, assume_sage_type<SgGreaterOrEqualOp>(*n));
1161  break;
1162 
1163  case V_SgAddOp:
1164  Dispatcher::dispatch(rv, assume_sage_type<SgAddOp>(*n));
1165  break;
1166 
1167  case V_SgSubtractOp:
1168  Dispatcher::dispatch(rv, assume_sage_type<SgSubtractOp>(*n));
1169  break;
1170 
1171  case V_SgMultiplyOp:
1172  Dispatcher::dispatch(rv, assume_sage_type<SgMultiplyOp>(*n));
1173  break;
1174 
1175  case V_SgDivideOp:
1176  Dispatcher::dispatch(rv, assume_sage_type<SgDivideOp>(*n));
1177  break;
1178 
1179  case V_SgIntegerDivideOp:
1180  Dispatcher::dispatch(rv, assume_sage_type<SgIntegerDivideOp>(*n));
1181  break;
1182 
1183  case V_SgModOp:
1184  Dispatcher::dispatch(rv, assume_sage_type<SgModOp>(*n));
1185  break;
1186 
1187  case V_SgAndOp:
1188  Dispatcher::dispatch(rv, assume_sage_type<SgAndOp>(*n));
1189  break;
1190 
1191  case V_SgOrOp:
1192  Dispatcher::dispatch(rv, assume_sage_type<SgOrOp>(*n));
1193  break;
1194 
1195  case V_SgBitXorOp:
1196  Dispatcher::dispatch(rv, assume_sage_type<SgBitXorOp>(*n));
1197  break;
1198 
1199  case V_SgBitAndOp:
1200  Dispatcher::dispatch(rv, assume_sage_type<SgBitAndOp>(*n));
1201  break;
1202 
1203  case V_SgBitOrOp:
1204  Dispatcher::dispatch(rv, assume_sage_type<SgBitOrOp>(*n));
1205  break;
1206 
1207  case V_SgCommaOpExp:
1208  Dispatcher::dispatch(rv, assume_sage_type<SgCommaOpExp>(*n));
1209  break;
1210 
1211  case V_SgLshiftOp:
1212  Dispatcher::dispatch(rv, assume_sage_type<SgLshiftOp>(*n));
1213  break;
1214 
1215  case V_SgRshiftOp:
1216  Dispatcher::dispatch(rv, assume_sage_type<SgRshiftOp>(*n));
1217  break;
1218 
1219  case V_SgPntrArrRefExp:
1220  Dispatcher::dispatch(rv, assume_sage_type<SgPntrArrRefExp>(*n));
1221  break;
1222 
1223  case V_SgScopeOp:
1224  Dispatcher::dispatch(rv, assume_sage_type<SgScopeOp>(*n));
1225  break;
1226 
1227  case V_SgAssignOp:
1228  Dispatcher::dispatch(rv, assume_sage_type<SgAssignOp>(*n));
1229  break;
1230 
1231  case V_SgPlusAssignOp:
1232  Dispatcher::dispatch(rv, assume_sage_type<SgPlusAssignOp>(*n));
1233  break;
1234 
1235  case V_SgMinusAssignOp:
1236  Dispatcher::dispatch(rv, assume_sage_type<SgMinusAssignOp>(*n));
1237  break;
1238 
1239  case V_SgAndAssignOp:
1240  Dispatcher::dispatch(rv, assume_sage_type<SgAndAssignOp>(*n));
1241  break;
1242 
1243  case V_SgIorAssignOp:
1244  Dispatcher::dispatch(rv, assume_sage_type<SgIorAssignOp>(*n));
1245  break;
1246 
1247  case V_SgMultAssignOp:
1248  Dispatcher::dispatch(rv, assume_sage_type<SgMultAssignOp>(*n));
1249  break;
1250 
1251  case V_SgDivAssignOp:
1252  Dispatcher::dispatch(rv, assume_sage_type<SgDivAssignOp>(*n));
1253  break;
1254 
1255  case V_SgModAssignOp:
1256  Dispatcher::dispatch(rv, assume_sage_type<SgModAssignOp>(*n));
1257  break;
1258 
1259  case V_SgXorAssignOp:
1260  Dispatcher::dispatch(rv, assume_sage_type<SgXorAssignOp>(*n));
1261  break;
1262 
1263  case V_SgLshiftAssignOp:
1264  Dispatcher::dispatch(rv, assume_sage_type<SgLshiftAssignOp>(*n));
1265  break;
1266 
1267  case V_SgRshiftAssignOp:
1268  Dispatcher::dispatch(rv, assume_sage_type<SgRshiftAssignOp>(*n));
1269  break;
1270 
1271  case V_SgConcatenationOp:
1272  Dispatcher::dispatch(rv, assume_sage_type<SgConcatenationOp>(*n));
1273  break;
1274 
1275  case V_SgBoolValExp:
1276  Dispatcher::dispatch(rv, assume_sage_type<SgBoolValExp>(*n));
1277  break;
1278 
1279  case V_SgStringVal:
1280  Dispatcher::dispatch(rv, assume_sage_type<SgStringVal>(*n));
1281  break;
1282 
1283  case V_SgShortVal:
1284  Dispatcher::dispatch(rv, assume_sage_type<SgShortVal>(*n));
1285  break;
1286 
1287  case V_SgCharVal:
1288  Dispatcher::dispatch(rv, assume_sage_type<SgCharVal>(*n));
1289  break;
1290 
1291  case V_SgUnsignedCharVal:
1292  Dispatcher::dispatch(rv, assume_sage_type<SgUnsignedCharVal>(*n));
1293  break;
1294 
1295  case V_SgWcharVal:
1296  Dispatcher::dispatch(rv, assume_sage_type<SgWcharVal>(*n));
1297  break;
1298 
1299  case V_SgUnsignedShortVal:
1300  Dispatcher::dispatch(rv, assume_sage_type<SgUnsignedShortVal>(*n));
1301  break;
1302 
1303  case V_SgIntVal:
1304  Dispatcher::dispatch(rv, assume_sage_type<SgIntVal>(*n));
1305  break;
1306 
1307  case V_SgEnumVal:
1308  Dispatcher::dispatch(rv, assume_sage_type<SgEnumVal>(*n));
1309  break;
1310 
1311  case V_SgUnsignedIntVal:
1312  Dispatcher::dispatch(rv, assume_sage_type<SgUnsignedIntVal>(*n));
1313  break;
1314 
1315  case V_SgLongIntVal:
1316  Dispatcher::dispatch(rv, assume_sage_type<SgLongIntVal>(*n));
1317  break;
1318 
1319  case V_SgLongLongIntVal:
1320  Dispatcher::dispatch(rv, assume_sage_type<SgLongLongIntVal>(*n));
1321  break;
1322 
1324  Dispatcher::dispatch(rv, assume_sage_type<SgUnsignedLongLongIntVal>(*n));
1325  break;
1326 
1327  case V_SgUnsignedLongVal:
1328  Dispatcher::dispatch(rv, assume_sage_type<SgUnsignedLongVal>(*n));
1329  break;
1330 
1331  case V_SgFloatVal:
1332  Dispatcher::dispatch(rv, assume_sage_type<SgFloatVal>(*n));
1333  break;
1334 
1335  case V_SgDoubleVal:
1336  Dispatcher::dispatch(rv, assume_sage_type<SgDoubleVal>(*n));
1337  break;
1338 
1339  case V_SgLongDoubleVal:
1340  Dispatcher::dispatch(rv, assume_sage_type<SgLongDoubleVal>(*n));
1341  break;
1342 
1343  case V_SgUpcThreads:
1344  Dispatcher::dispatch(rv, assume_sage_type<SgUpcThreads>(*n));
1345  break;
1346 
1347  case V_SgUpcMythread:
1348  Dispatcher::dispatch(rv, assume_sage_type<SgUpcMythread>(*n));
1349  break;
1350 
1351  case V_SgComplexVal:
1352  Dispatcher::dispatch(rv, assume_sage_type<SgComplexVal>(*n));
1353  break;
1354 
1355  case V_SgNullExpression:
1356  Dispatcher::dispatch(rv, assume_sage_type<SgNullExpression>(*n));
1357  break;
1358 
1359  case V_SgVariantExpression:
1360  Dispatcher::dispatch(rv, assume_sage_type<SgVariantExpression>(*n));
1361  break;
1362 
1364  Dispatcher::dispatch(rv, assume_sage_type<SgStatementExpression>(*n));
1365  break;
1366 
1367  case V_SgAsmOp:
1368  Dispatcher::dispatch(rv, assume_sage_type<SgAsmOp>(*n));
1369  break;
1370 
1372  Dispatcher::dispatch(rv, assume_sage_type<SgCudaKernelExecConfig>(*n));
1373  break;
1374 
1375  case V_SgCudaKernelCallExp:
1376  Dispatcher::dispatch(rv, assume_sage_type<SgCudaKernelCallExp>(*n));
1377  break;
1378 
1380  Dispatcher::dispatch(rv, assume_sage_type<SgSubscriptExpression>(*n));
1381  break;
1382 
1383  case V_SgColonShapeExp:
1384  Dispatcher::dispatch(rv, assume_sage_type<SgColonShapeExp>(*n));
1385  break;
1386 
1387  case V_SgAsteriskShapeExp:
1388  Dispatcher::dispatch(rv, assume_sage_type<SgAsteriskShapeExp>(*n));
1389  break;
1390 
1391  case V_SgIOItemExpression:
1392  Dispatcher::dispatch(rv, assume_sage_type<SgIOItemExpression>(*n));
1393  break;
1394 
1395  case V_SgImpliedDo:
1396  Dispatcher::dispatch(rv, assume_sage_type<SgImpliedDo>(*n));
1397  break;
1398 
1399  case V_SgExponentiationOp:
1400  Dispatcher::dispatch(rv, assume_sage_type<SgExponentiationOp>(*n));
1401  break;
1402 
1404  Dispatcher::dispatch(rv, assume_sage_type<SgUnknownArrayOrFunctionReference>(*n));
1405  break;
1406 
1408  Dispatcher::dispatch(rv, assume_sage_type<SgActualArgumentExpression>(*n));
1409  break;
1410 
1412  Dispatcher::dispatch(rv, assume_sage_type<SgUserDefinedBinaryOp>(*n));
1413  break;
1414 
1415  case V_SgPointerAssignOp:
1416  Dispatcher::dispatch(rv, assume_sage_type<SgPointerAssignOp>(*n));
1417  break;
1418 
1419  case V_SgCAFCoExpression:
1420  Dispatcher::dispatch(rv, assume_sage_type<SgCAFCoExpression>(*n));
1421  break;
1422 
1424  Dispatcher::dispatch(rv, assume_sage_type<SgDesignatedInitializer>(*n));
1425  break;
1426 
1427  case V_SgInitializer:
1428  Dispatcher::dispatch(rv, assume_sage_type<SgInitializer>(*n));
1429  break;
1430 
1432  Dispatcher::dispatch(rv, assume_sage_type<SgUserDefinedUnaryOp>(*n));
1433  break;
1434 
1436  Dispatcher::dispatch(rv, assume_sage_type<SgPseudoDestructorRefExp>(*n));
1437  break;
1438 
1439  case V_SgUnaryOp:
1440  Dispatcher::dispatch(rv, assume_sage_type<SgUnaryOp>(*n));
1441  break;
1442 
1443  case V_SgBinaryOp:
1444  Dispatcher::dispatch(rv, assume_sage_type<SgBinaryOp>(*n));
1445  break;
1446 
1447  case V_SgValueExp:
1448  Dispatcher::dispatch(rv, assume_sage_type<SgValueExp>(*n));
1449  break;
1450 
1451  case V_SgVariableSymbol:
1452  Dispatcher::dispatch(rv, assume_sage_type<SgVariableSymbol>(*n));
1453  break;
1454 
1456  Dispatcher::dispatch(rv, assume_sage_type<SgFunctionTypeSymbol>(*n));
1457  break;
1458 
1459  case V_SgClassSymbol:
1460  Dispatcher::dispatch(rv, assume_sage_type<SgClassSymbol>(*n));
1461  break;
1462 
1463  case V_SgTemplateSymbol:
1464  Dispatcher::dispatch(rv, assume_sage_type<SgTemplateSymbol>(*n));
1465  break;
1466 
1467  case V_SgEnumSymbol:
1468  Dispatcher::dispatch(rv, assume_sage_type<SgEnumSymbol>(*n));
1469  break;
1470 
1471  case V_SgEnumFieldSymbol:
1472  Dispatcher::dispatch(rv, assume_sage_type<SgEnumFieldSymbol>(*n));
1473  break;
1474 
1475  case V_SgTypedefSymbol:
1476  Dispatcher::dispatch(rv, assume_sage_type<SgTypedefSymbol>(*n));
1477  break;
1478 
1480  Dispatcher::dispatch(rv, assume_sage_type<SgMemberFunctionSymbol>(*n));
1481  break;
1482 
1483  case V_SgLabelSymbol:
1484  Dispatcher::dispatch(rv, assume_sage_type<SgLabelSymbol>(*n));
1485  break;
1486 
1487  case V_SgDefaultSymbol:
1488  Dispatcher::dispatch(rv, assume_sage_type<SgDefaultSymbol>(*n));
1489  break;
1490 
1491  case V_SgNamespaceSymbol:
1492  Dispatcher::dispatch(rv, assume_sage_type<SgNamespaceSymbol>(*n));
1493  break;
1494 
1495  case V_SgIntrinsicSymbol:
1496  Dispatcher::dispatch(rv, assume_sage_type<SgIntrinsicSymbol>(*n));
1497  break;
1498 
1499  case V_SgModuleSymbol:
1500  Dispatcher::dispatch(rv, assume_sage_type<SgModuleSymbol>(*n));
1501  break;
1502 
1503  case V_SgInterfaceSymbol:
1504  Dispatcher::dispatch(rv, assume_sage_type<SgInterfaceSymbol>(*n));
1505  break;
1506 
1507  case V_SgCommonSymbol:
1508  Dispatcher::dispatch(rv, assume_sage_type<SgCommonSymbol>(*n));
1509  break;
1510 
1511  case V_SgRenameSymbol:
1512  Dispatcher::dispatch(rv, assume_sage_type<SgRenameSymbol>(*n));
1513  break;
1514 
1515  case V_SgFunctionSymbol:
1516  Dispatcher::dispatch(rv, assume_sage_type<SgFunctionSymbol>(*n));
1517  break;
1518 
1520  Dispatcher::dispatch(rv, assume_sage_type<SgAsmBinaryAddressSymbol>(*n));
1521  break;
1522 
1524  Dispatcher::dispatch(rv, assume_sage_type<SgAsmBinaryDataSymbol>(*n));
1525  break;
1526 
1527  case V_SgAliasSymbol:
1528  Dispatcher::dispatch(rv, assume_sage_type<SgAliasSymbol>(*n));
1529  break;
1530 
1531  case V_SgSymbol:
1532  Dispatcher::dispatch(rv, assume_sage_type<SgSymbol>(*n));
1533  break;
1534 
1535  case V_SgAsmBlock:
1536  Dispatcher::dispatch(rv, assume_sage_type<SgAsmBlock>(*n));
1537  break;
1538 
1539  case V_SgAsmOperandList:
1540  Dispatcher::dispatch(rv, assume_sage_type<SgAsmOperandList>(*n));
1541  break;
1542 
1543  case V_SgAsmArmInstruction:
1544  Dispatcher::dispatch(rv, assume_sage_type<SgAsmArmInstruction>(*n));
1545  break;
1546 
1547  case V_SgAsmx86Instruction:
1548  Dispatcher::dispatch(rv, assume_sage_type<SgAsmx86Instruction>(*n));
1549  break;
1550 
1552  Dispatcher::dispatch(rv, assume_sage_type<SgAsmPowerpcInstruction>(*n));
1553  break;
1554 
1555  case V_SgAsmInstruction:
1556  Dispatcher::dispatch(rv, assume_sage_type<SgAsmInstruction>(*n));
1557  break;
1558 
1559  case V_SgAsmStatement:
1560  Dispatcher::dispatch(rv, assume_sage_type<SgAsmStatement>(*n));
1561  break;
1562 
1563  case V_SgAsmBinaryAdd:
1564  Dispatcher::dispatch(rv, assume_sage_type<SgAsmBinaryAdd>(*n));
1565  break;
1566 
1567  case V_SgAsmBinarySubtract:
1568  Dispatcher::dispatch(rv, assume_sage_type<SgAsmBinarySubtract>(*n));
1569  break;
1570 
1571  case V_SgAsmBinaryMultiply:
1572  Dispatcher::dispatch(rv, assume_sage_type<SgAsmBinaryMultiply>(*n));
1573  break;
1574 
1575  case V_SgAsmBinaryDivide:
1576  Dispatcher::dispatch(rv, assume_sage_type<SgAsmBinaryDivide>(*n));
1577  break;
1578 
1579  case V_SgAsmBinaryMod:
1580  Dispatcher::dispatch(rv, assume_sage_type<SgAsmBinaryMod>(*n));
1581  break;
1582 
1584  Dispatcher::dispatch(rv, assume_sage_type<SgAsmBinaryAddPreupdate>(*n));
1585  break;
1586 
1588  Dispatcher::dispatch(rv, assume_sage_type<SgAsmBinarySubtractPreupdate>(*n));
1589  break;
1590 
1592  Dispatcher::dispatch(rv, assume_sage_type<SgAsmBinaryAddPostupdate>(*n));
1593  break;
1594 
1596  Dispatcher::dispatch(rv, assume_sage_type<SgAsmBinarySubtractPostupdate>(*n));
1597  break;
1598 
1599  case V_SgAsmBinaryLsl:
1600  Dispatcher::dispatch(rv, assume_sage_type<SgAsmBinaryLsl>(*n));
1601  break;
1602 
1603  case V_SgAsmBinaryLsr:
1604  Dispatcher::dispatch(rv, assume_sage_type<SgAsmBinaryLsr>(*n));
1605  break;
1606 
1607  case V_SgAsmBinaryAsr:
1608  Dispatcher::dispatch(rv, assume_sage_type<SgAsmBinaryAsr>(*n));
1609  break;
1610 
1611  case V_SgAsmBinaryRor:
1612  Dispatcher::dispatch(rv, assume_sage_type<SgAsmBinaryRor>(*n));
1613  break;
1614 
1616  Dispatcher::dispatch(rv, assume_sage_type<SgAsmBinaryExpression>(*n));
1617  break;
1618 
1619  case V_SgAsmUnaryPlus:
1620  Dispatcher::dispatch(rv, assume_sage_type<SgAsmUnaryPlus>(*n));
1621  break;
1622 
1623  case V_SgAsmUnaryMinus:
1624  Dispatcher::dispatch(rv, assume_sage_type<SgAsmUnaryMinus>(*n));
1625  break;
1626 
1627  case V_SgAsmUnaryRrx:
1628  Dispatcher::dispatch(rv, assume_sage_type<SgAsmUnaryRrx>(*n));
1629  break;
1630 
1632  Dispatcher::dispatch(rv, assume_sage_type<SgAsmUnaryArmSpecialRegisterList>(*n));
1633  break;
1634 
1636  Dispatcher::dispatch(rv, assume_sage_type<SgAsmUnaryExpression>(*n));
1637  break;
1638 
1640  Dispatcher::dispatch(rv, assume_sage_type<SgAsmMemoryReferenceExpression>(*n));
1641  break;
1642 
1644  Dispatcher::dispatch(rv, assume_sage_type<SgAsmControlFlagsExpression>(*n));
1645  break;
1646 
1648  Dispatcher::dispatch(rv, assume_sage_type<SgAsmCommonSubExpression>(*n));
1649  break;
1650 
1652  Dispatcher::dispatch(rv, assume_sage_type<SgAsmx86RegisterReferenceExpression>(*n));
1653  break;
1654 
1656  Dispatcher::dispatch(rv, assume_sage_type<SgAsmArmRegisterReferenceExpression>(*n));
1657  break;
1658 
1660  Dispatcher::dispatch(rv, assume_sage_type<SgAsmPowerpcRegisterReferenceExpression>(*n));
1661  break;
1662 
1664  Dispatcher::dispatch(rv, assume_sage_type<SgAsmRegisterReferenceExpression>(*n));
1665  break;
1666 
1668  Dispatcher::dispatch(rv, assume_sage_type<SgAsmIntegerValueExpression>(*n));
1669  break;
1670 
1672  Dispatcher::dispatch(rv, assume_sage_type<SgAsmSingleFloatValueExpression>(*n));
1673  break;
1674 
1676  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDoubleFloatValueExpression>(*n));
1677  break;
1678 
1680  Dispatcher::dispatch(rv, assume_sage_type<SgAsmValueExpression>(*n));
1681  break;
1682 
1683  case V_SgAsmExprListExp:
1684  Dispatcher::dispatch(rv, assume_sage_type<SgAsmExprListExp>(*n));
1685  break;
1686 
1687  case V_SgAsmExpression:
1688  Dispatcher::dispatch(rv, assume_sage_type<SgAsmExpression>(*n));
1689  break;
1690 
1691  case V_SgAsmTypeByte:
1692  Dispatcher::dispatch(rv, assume_sage_type<SgAsmTypeByte>(*n));
1693  break;
1694 
1695  case V_SgAsmTypeWord:
1696  Dispatcher::dispatch(rv, assume_sage_type<SgAsmTypeWord>(*n));
1697  break;
1698 
1699  case V_SgAsmTypeDoubleWord:
1700  Dispatcher::dispatch(rv, assume_sage_type<SgAsmTypeDoubleWord>(*n));
1701  break;
1702 
1703  case V_SgAsmTypeQuadWord:
1704  Dispatcher::dispatch(rv, assume_sage_type<SgAsmTypeQuadWord>(*n));
1705  break;
1706 
1708  Dispatcher::dispatch(rv, assume_sage_type<SgAsmTypeDoubleQuadWord>(*n));
1709  break;
1710 
1712  Dispatcher::dispatch(rv, assume_sage_type<SgAsmTypeSingleFloat>(*n));
1713  break;
1714 
1716  Dispatcher::dispatch(rv, assume_sage_type<SgAsmTypeDoubleFloat>(*n));
1717  break;
1718 
1719  case V_SgAsmType80bitFloat:
1720  Dispatcher::dispatch(rv, assume_sage_type<SgAsmType80bitFloat>(*n));
1721  break;
1722 
1724  Dispatcher::dispatch(rv, assume_sage_type<SgAsmType128bitFloat>(*n));
1725  break;
1726 
1727  case V_SgAsmTypeVector:
1728  Dispatcher::dispatch(rv, assume_sage_type<SgAsmTypeVector>(*n));
1729  break;
1730 
1731  case V_SgAsmType:
1732  Dispatcher::dispatch(rv, assume_sage_type<SgAsmType>(*n));
1733  break;
1734 
1735  case V_SgAsmGenericDLL:
1736  Dispatcher::dispatch(rv, assume_sage_type<SgAsmGenericDLL>(*n));
1737  break;
1738 
1740  Dispatcher::dispatch(rv, assume_sage_type<SgAsmPEImportItemList>(*n));
1741  break;
1742 
1744  Dispatcher::dispatch(rv, assume_sage_type<SgAsmPEImportDirectoryList>(*n));
1745  break;
1746 
1747  case V_SgAsmGenericFormat:
1748  Dispatcher::dispatch(rv, assume_sage_type<SgAsmGenericFormat>(*n));
1749  break;
1750 
1751  case V_SgAsmGenericFile:
1752  Dispatcher::dispatch(rv, assume_sage_type<SgAsmGenericFile>(*n));
1753  break;
1754 
1755  case V_SgAsmElfFileHeader:
1756  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfFileHeader>(*n));
1757  break;
1758 
1759  case V_SgAsmPEFileHeader:
1760  Dispatcher::dispatch(rv, assume_sage_type<SgAsmPEFileHeader>(*n));
1761  break;
1762 
1763  case V_SgAsmNEFileHeader:
1764  Dispatcher::dispatch(rv, assume_sage_type<SgAsmNEFileHeader>(*n));
1765  break;
1766 
1767  case V_SgAsmLEFileHeader:
1768  Dispatcher::dispatch(rv, assume_sage_type<SgAsmLEFileHeader>(*n));
1769  break;
1770 
1771  case V_SgAsmDOSFileHeader:
1772  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDOSFileHeader>(*n));
1773  break;
1774 
1775  case V_SgAsmGenericHeader:
1776  Dispatcher::dispatch(rv, assume_sage_type<SgAsmGenericHeader>(*n));
1777  break;
1778 
1780  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfRelocSection>(*n));
1781  break;
1782 
1784  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfDynamicSection>(*n));
1785  break;
1786 
1788  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfSymbolSection>(*n));
1789  break;
1790 
1792  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfStringSection>(*n));
1793  break;
1794 
1796  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfEHFrameSection>(*n));
1797  break;
1798 
1799  case V_SgAsmElfNoteSection:
1800  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfNoteSection>(*n));
1801  break;
1802 
1804  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfSymverSection>(*n));
1805  break;
1806 
1808  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfSymverDefinedSection>(*n));
1809  break;
1810 
1812  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfSymverNeededSection>(*n));
1813  break;
1814 
1815  case V_SgAsmElfStrtab:
1816  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfStrtab>(*n));
1817  break;
1818 
1819  case V_SgAsmCoffStrtab:
1820  Dispatcher::dispatch(rv, assume_sage_type<SgAsmCoffStrtab>(*n));
1821  break;
1822 
1823  case V_SgAsmGenericStrtab:
1824  Dispatcher::dispatch(rv, assume_sage_type<SgAsmGenericStrtab>(*n));
1825  break;
1826 
1827  case V_SgAsmElfSection:
1828  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfSection>(*n));
1829  break;
1830 
1832  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfSectionTable>(*n));
1833  break;
1834 
1836  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfSegmentTable>(*n));
1837  break;
1838 
1840  Dispatcher::dispatch(rv, assume_sage_type<SgAsmPEImportSection>(*n));
1841  break;
1842 
1844  Dispatcher::dispatch(rv, assume_sage_type<SgAsmPEExportSection>(*n));
1845  break;
1846 
1848  Dispatcher::dispatch(rv, assume_sage_type<SgAsmPEStringSection>(*n));
1849  break;
1850 
1851  case V_SgAsmPESection:
1852  Dispatcher::dispatch(rv, assume_sage_type<SgAsmPESection>(*n));
1853  break;
1854 
1855  case V_SgAsmPESectionTable:
1856  Dispatcher::dispatch(rv, assume_sage_type<SgAsmPESectionTable>(*n));
1857  break;
1858 
1860  Dispatcher::dispatch(rv, assume_sage_type<SgAsmCoffSymbolTable>(*n));
1861  break;
1862 
1864  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDOSExtendedHeader>(*n));
1865  break;
1866 
1867  case V_SgAsmNESection:
1868  Dispatcher::dispatch(rv, assume_sage_type<SgAsmNESection>(*n));
1869  break;
1870 
1871  case V_SgAsmNESectionTable:
1872  Dispatcher::dispatch(rv, assume_sage_type<SgAsmNESectionTable>(*n));
1873  break;
1874 
1875  case V_SgAsmNENameTable:
1876  Dispatcher::dispatch(rv, assume_sage_type<SgAsmNENameTable>(*n));
1877  break;
1878 
1879  case V_SgAsmNEModuleTable:
1880  Dispatcher::dispatch(rv, assume_sage_type<SgAsmNEModuleTable>(*n));
1881  break;
1882 
1883  case V_SgAsmNEStringTable:
1884  Dispatcher::dispatch(rv, assume_sage_type<SgAsmNEStringTable>(*n));
1885  break;
1886 
1887  case V_SgAsmNEEntryTable:
1888  Dispatcher::dispatch(rv, assume_sage_type<SgAsmNEEntryTable>(*n));
1889  break;
1890 
1891  case V_SgAsmNERelocTable:
1892  Dispatcher::dispatch(rv, assume_sage_type<SgAsmNERelocTable>(*n));
1893  break;
1894 
1895  case V_SgAsmLESection:
1896  Dispatcher::dispatch(rv, assume_sage_type<SgAsmLESection>(*n));
1897  break;
1898 
1899  case V_SgAsmLESectionTable:
1900  Dispatcher::dispatch(rv, assume_sage_type<SgAsmLESectionTable>(*n));
1901  break;
1902 
1903  case V_SgAsmLENameTable:
1904  Dispatcher::dispatch(rv, assume_sage_type<SgAsmLENameTable>(*n));
1905  break;
1906 
1907  case V_SgAsmLEPageTable:
1908  Dispatcher::dispatch(rv, assume_sage_type<SgAsmLEPageTable>(*n));
1909  break;
1910 
1911  case V_SgAsmLEEntryTable:
1912  Dispatcher::dispatch(rv, assume_sage_type<SgAsmLEEntryTable>(*n));
1913  break;
1914 
1915  case V_SgAsmLERelocTable:
1916  Dispatcher::dispatch(rv, assume_sage_type<SgAsmLERelocTable>(*n));
1917  break;
1918 
1919  case V_SgAsmGenericSection:
1920  Dispatcher::dispatch(rv, assume_sage_type<SgAsmGenericSection>(*n));
1921  break;
1922 
1923  case V_SgAsmCoffSymbol:
1924  Dispatcher::dispatch(rv, assume_sage_type<SgAsmCoffSymbol>(*n));
1925  break;
1926 
1927  case V_SgAsmElfSymbol:
1928  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfSymbol>(*n));
1929  break;
1930 
1931  case V_SgAsmGenericSymbol:
1932  Dispatcher::dispatch(rv, assume_sage_type<SgAsmGenericSymbol>(*n));
1933  break;
1934 
1936  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfSectionTableEntry>(*n));
1937  break;
1938 
1940  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfSegmentTableEntry>(*n));
1941  break;
1942 
1944  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfSegmentTableEntryList>(*n));
1945  break;
1946 
1947  case V_SgAsmElfRelocEntry:
1948  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfRelocEntry>(*n));
1949  break;
1950 
1952  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfRelocEntryList>(*n));
1953  break;
1954 
1956  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfDynamicEntry>(*n));
1957  break;
1958 
1960  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfDynamicEntryList>(*n));
1961  break;
1962 
1964  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfEHFrameEntryCI>(*n));
1965  break;
1966 
1968  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfEHFrameEntryCIList>(*n));
1969  break;
1970 
1972  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfEHFrameEntryFD>(*n));
1973  break;
1974 
1976  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfEHFrameEntryFDList>(*n));
1977  break;
1978 
1979  case V_SgAsmElfNoteEntry:
1980  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfNoteEntry>(*n));
1981  break;
1982 
1984  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfNoteEntryList>(*n));
1985  break;
1986 
1987  case V_SgAsmElfSymverEntry:
1988  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfSymverEntry>(*n));
1989  break;
1990 
1992  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfSymverEntryList>(*n));
1993  break;
1994 
1996  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfSymverDefinedEntry>(*n));
1997  break;
1998 
2000  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfSymverDefinedEntryList>(*n));
2001  break;
2002 
2004  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfSymverDefinedAux>(*n));
2005  break;
2006 
2008  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfSymverDefinedAuxList>(*n));
2009  break;
2010 
2012  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfSymverNeededEntry>(*n));
2013  break;
2014 
2016  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfSymverNeededEntryList>(*n));
2017  break;
2018 
2020  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfSymverNeededAux>(*n));
2021  break;
2022 
2024  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfSymverNeededAuxList>(*n));
2025  break;
2026 
2027  case V_SgAsmPERVASizePair:
2028  Dispatcher::dispatch(rv, assume_sage_type<SgAsmPERVASizePair>(*n));
2029  break;
2030 
2032  Dispatcher::dispatch(rv, assume_sage_type<SgAsmPEExportDirectory>(*n));
2033  break;
2034 
2035  case V_SgAsmPEExportEntry:
2036  Dispatcher::dispatch(rv, assume_sage_type<SgAsmPEExportEntry>(*n));
2037  break;
2038 
2040  Dispatcher::dispatch(rv, assume_sage_type<SgAsmPEImportDirectory>(*n));
2041  break;
2042 
2043  case V_SgAsmPEImportItem:
2044  Dispatcher::dispatch(rv, assume_sage_type<SgAsmPEImportItem>(*n));
2045  break;
2046 
2048  Dispatcher::dispatch(rv, assume_sage_type<SgAsmPESectionTableEntry>(*n));
2049  break;
2050 
2051  case V_SgAsmNEEntryPoint:
2052  Dispatcher::dispatch(rv, assume_sage_type<SgAsmNEEntryPoint>(*n));
2053  break;
2054 
2055  case V_SgAsmNERelocEntry:
2056  Dispatcher::dispatch(rv, assume_sage_type<SgAsmNERelocEntry>(*n));
2057  break;
2058 
2060  Dispatcher::dispatch(rv, assume_sage_type<SgAsmNESectionTableEntry>(*n));
2061  break;
2062 
2064  Dispatcher::dispatch(rv, assume_sage_type<SgAsmLEPageTableEntry>(*n));
2065  break;
2066 
2067  case V_SgAsmLEEntryPoint:
2068  Dispatcher::dispatch(rv, assume_sage_type<SgAsmLEEntryPoint>(*n));
2069  break;
2070 
2072  Dispatcher::dispatch(rv, assume_sage_type<SgAsmLESectionTableEntry>(*n));
2073  break;
2074 
2076  Dispatcher::dispatch(rv, assume_sage_type<SgAsmGenericSectionList>(*n));
2077  break;
2078 
2080  Dispatcher::dispatch(rv, assume_sage_type<SgAsmGenericHeaderList>(*n));
2081  break;
2082 
2084  Dispatcher::dispatch(rv, assume_sage_type<SgAsmGenericSymbolList>(*n));
2085  break;
2086 
2087  case V_SgAsmElfSymbolList:
2088  Dispatcher::dispatch(rv, assume_sage_type<SgAsmElfSymbolList>(*n));
2089  break;
2090 
2091  case V_SgAsmCoffSymbolList:
2092  Dispatcher::dispatch(rv, assume_sage_type<SgAsmCoffSymbolList>(*n));
2093  break;
2094 
2095  case V_SgAsmGenericDLLList:
2096  Dispatcher::dispatch(rv, assume_sage_type<SgAsmGenericDLLList>(*n));
2097  break;
2098 
2100  Dispatcher::dispatch(rv, assume_sage_type<SgAsmPERVASizePairList>(*n));
2101  break;
2102 
2104  Dispatcher::dispatch(rv, assume_sage_type<SgAsmPEExportEntryList>(*n));
2105  break;
2106 
2107  case V_SgAsmBasicString:
2108  Dispatcher::dispatch(rv, assume_sage_type<SgAsmBasicString>(*n));
2109  break;
2110 
2111  case V_SgAsmStoredString:
2112  Dispatcher::dispatch(rv, assume_sage_type<SgAsmStoredString>(*n));
2113  break;
2114 
2115  case V_SgAsmGenericString:
2116  Dispatcher::dispatch(rv, assume_sage_type<SgAsmGenericString>(*n));
2117  break;
2118 
2119  case V_SgAsmStringStorage:
2120  Dispatcher::dispatch(rv, assume_sage_type<SgAsmStringStorage>(*n));
2121  break;
2122 
2123  case V_SgAsmDwarfMacro:
2124  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfMacro>(*n));
2125  break;
2126 
2127  case V_SgAsmDwarfLine:
2128  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfLine>(*n));
2129  break;
2130 
2131  case V_SgAsmDwarfMacroList:
2132  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfMacroList>(*n));
2133  break;
2134 
2135  case V_SgAsmDwarfLineList:
2136  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfLineList>(*n));
2137  break;
2138 
2139  case V_SgAsmDwarfArrayType:
2140  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfArrayType>(*n));
2141  break;
2142 
2143  case V_SgAsmDwarfClassType:
2144  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfClassType>(*n));
2145  break;
2146 
2148  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfEntryPoint>(*n));
2149  break;
2150 
2152  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfEnumerationType>(*n));
2153  break;
2154 
2156  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfFormalParameter>(*n));
2157  break;
2158 
2160  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfImportedDeclaration>(*n));
2161  break;
2162 
2163  case V_SgAsmDwarfLabel:
2164  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfLabel>(*n));
2165  break;
2166 
2168  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfLexicalBlock>(*n));
2169  break;
2170 
2171  case V_SgAsmDwarfMember:
2172  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfMember>(*n));
2173  break;
2174 
2176  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfPointerType>(*n));
2177  break;
2178 
2180  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfReferenceType>(*n));
2181  break;
2182 
2184  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfCompilationUnit>(*n));
2185  break;
2186 
2188  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfStringType>(*n));
2189  break;
2190 
2192  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfStructureType>(*n));
2193  break;
2194 
2196  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfSubroutineType>(*n));
2197  break;
2198 
2199  case V_SgAsmDwarfTypedef:
2200  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfTypedef>(*n));
2201  break;
2202 
2203  case V_SgAsmDwarfUnionType:
2204  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfUnionType>(*n));
2205  break;
2206 
2208  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfUnspecifiedParameters>(*n));
2209  break;
2210 
2211  case V_SgAsmDwarfVariant:
2212  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfVariant>(*n));
2213  break;
2214 
2216  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfCommonBlock>(*n));
2217  break;
2218 
2220  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfCommonInclusion>(*n));
2221  break;
2222 
2224  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfInheritance>(*n));
2225  break;
2226 
2228  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfInlinedSubroutine>(*n));
2229  break;
2230 
2231  case V_SgAsmDwarfModule:
2232  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfModule>(*n));
2233  break;
2234 
2236  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfPtrToMemberType>(*n));
2237  break;
2238 
2239  case V_SgAsmDwarfSetType:
2240  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfSetType>(*n));
2241  break;
2242 
2244  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfSubrangeType>(*n));
2245  break;
2246 
2247  case V_SgAsmDwarfWithStmt:
2248  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfWithStmt>(*n));
2249  break;
2250 
2252  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfAccessDeclaration>(*n));
2253  break;
2254 
2255  case V_SgAsmDwarfBaseType:
2256  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfBaseType>(*n));
2257  break;
2258 
2260  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfCatchBlock>(*n));
2261  break;
2262 
2263  case V_SgAsmDwarfConstType:
2264  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfConstType>(*n));
2265  break;
2266 
2267  case V_SgAsmDwarfConstant:
2268  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfConstant>(*n));
2269  break;
2270 
2272  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfEnumerator>(*n));
2273  break;
2274 
2275  case V_SgAsmDwarfFileType:
2276  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfFileType>(*n));
2277  break;
2278 
2279  case V_SgAsmDwarfFriend:
2280  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfFriend>(*n));
2281  break;
2282 
2283  case V_SgAsmDwarfNamelist:
2284  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfNamelist>(*n));
2285  break;
2286 
2288  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfNamelistItem>(*n));
2289  break;
2290 
2292  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfPackedType>(*n));
2293  break;
2294 
2296  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfSubprogram>(*n));
2297  break;
2298 
2300  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfTemplateTypeParameter>(*n));
2301  break;
2302 
2304  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfTemplateValueParameter>(*n));
2305  break;
2306 
2308  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfThrownType>(*n));
2309  break;
2310 
2311  case V_SgAsmDwarfTryBlock:
2312  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfTryBlock>(*n));
2313  break;
2314 
2316  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfVariantPart>(*n));
2317  break;
2318 
2319  case V_SgAsmDwarfVariable:
2320  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfVariable>(*n));
2321  break;
2322 
2324  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfVolatileType>(*n));
2325  break;
2326 
2328  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfDwarfProcedure>(*n));
2329  break;
2330 
2332  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfRestrictType>(*n));
2333  break;
2334 
2336  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfInterfaceType>(*n));
2337  break;
2338 
2339  case V_SgAsmDwarfNamespace:
2340  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfNamespace>(*n));
2341  break;
2342 
2344  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfImportedModule>(*n));
2345  break;
2346 
2348  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfUnspecifiedType>(*n));
2349  break;
2350 
2352  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfPartialUnit>(*n));
2353  break;
2354 
2356  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfImportedUnit>(*n));
2357  break;
2358 
2360  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfMutableType>(*n));
2361  break;
2362 
2363  case V_SgAsmDwarfCondition:
2364  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfCondition>(*n));
2365  break;
2366 
2368  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfSharedType>(*n));
2369  break;
2370 
2372  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfFormatLabel>(*n));
2373  break;
2374 
2376  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfFunctionTemplate>(*n));
2377  break;
2378 
2380  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfClassTemplate>(*n));
2381  break;
2382 
2384  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfUpcSharedType>(*n));
2385  break;
2386 
2388  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfUpcStrictType>(*n));
2389  break;
2390 
2392  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfUpcRelaxedType>(*n));
2393  break;
2394 
2396  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfUnknownConstruct>(*n));
2397  break;
2398 
2399  case V_SgAsmDwarfConstruct:
2400  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfConstruct>(*n));
2401  break;
2402 
2404  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfConstructList>(*n));
2405  break;
2406 
2408  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfCompilationUnitList>(*n));
2409  break;
2410 
2412  Dispatcher::dispatch(rv, assume_sage_type<SgAsmDwarfInformation>(*n));
2413  break;
2414 
2416  Dispatcher::dispatch(rv, assume_sage_type<SgAsmExecutableFileFormat>(*n));
2417  break;
2418 
2419  case V_SgAsmInterpretation:
2420  Dispatcher::dispatch(rv, assume_sage_type<SgAsmInterpretation>(*n));
2421  break;
2422 
2424  Dispatcher::dispatch(rv, assume_sage_type<SgAsmInterpretationList>(*n));
2425  break;
2426 
2428  Dispatcher::dispatch(rv, assume_sage_type<SgAsmGenericFileList>(*n));
2429  break;
2430 
2431  case V_SgAsmNode:
2432  Dispatcher::dispatch(rv, assume_sage_type<SgAsmNode>(*n));
2433  break;
2434 
2435  case V_SgInitializedName:
2436  Dispatcher::dispatch(rv, assume_sage_type<SgInitializedName>(*n));
2437  break;
2438 
2439  case V_SgOmpOrderedClause:
2440  Dispatcher::dispatch(rv, assume_sage_type<SgOmpOrderedClause>(*n));
2441  break;
2442 
2443  case V_SgOmpNowaitClause:
2444  Dispatcher::dispatch(rv, assume_sage_type<SgOmpNowaitClause>(*n));
2445  break;
2446 
2447  case V_SgOmpUntiedClause:
2448  Dispatcher::dispatch(rv, assume_sage_type<SgOmpUntiedClause>(*n));
2449  break;
2450 
2451  case V_SgOmpDefaultClause:
2452  Dispatcher::dispatch(rv, assume_sage_type<SgOmpDefaultClause>(*n));
2453  break;
2454 
2455  case V_SgOmpCollapseClause:
2456  Dispatcher::dispatch(rv, assume_sage_type<SgOmpCollapseClause>(*n));
2457  break;
2458 
2459  case V_SgOmpIfClause:
2460  Dispatcher::dispatch(rv, assume_sage_type<SgOmpIfClause>(*n));
2461  break;
2462 
2464  Dispatcher::dispatch(rv, assume_sage_type<SgOmpNumThreadsClause>(*n));
2465  break;
2466 
2468  Dispatcher::dispatch(rv, assume_sage_type<SgOmpExpressionClause>(*n));
2469  break;
2470 
2472  Dispatcher::dispatch(rv, assume_sage_type<SgOmpCopyprivateClause>(*n));
2473  break;
2474 
2475  case V_SgOmpPrivateClause:
2476  Dispatcher::dispatch(rv, assume_sage_type<SgOmpPrivateClause>(*n));
2477  break;
2478 
2480  Dispatcher::dispatch(rv, assume_sage_type<SgOmpFirstprivateClause>(*n));
2481  break;
2482 
2483  case V_SgOmpSharedClause:
2484  Dispatcher::dispatch(rv, assume_sage_type<SgOmpSharedClause>(*n));
2485  break;
2486 
2487  case V_SgOmpCopyinClause:
2488  Dispatcher::dispatch(rv, assume_sage_type<SgOmpCopyinClause>(*n));
2489  break;
2490 
2492  Dispatcher::dispatch(rv, assume_sage_type<SgOmpLastprivateClause>(*n));
2493  break;
2494 
2496  Dispatcher::dispatch(rv, assume_sage_type<SgOmpReductionClause>(*n));
2497  break;
2498 
2500  Dispatcher::dispatch(rv, assume_sage_type<SgOmpVariablesClause>(*n));
2501  break;
2502 
2503  case V_SgOmpScheduleClause:
2504  Dispatcher::dispatch(rv, assume_sage_type<SgOmpScheduleClause>(*n));
2505  break;
2506 
2507  case V_SgOmpClause:
2508  Dispatcher::dispatch(rv, assume_sage_type<SgOmpClause>(*n));
2509  break;
2510 
2511  case V_SgRenamePair:
2512  Dispatcher::dispatch(rv, assume_sage_type<SgRenamePair>(*n));
2513  break;
2514 
2515  case V_SgInterfaceBody:
2516  Dispatcher::dispatch(rv, assume_sage_type<SgInterfaceBody>(*n));
2517  break;
2518 
2520  Dispatcher::dispatch(rv, assume_sage_type<SgLocatedNodeSupport>(*n));
2521  break;
2522 
2523  case V_SgToken:
2524  Dispatcher::dispatch(rv, assume_sage_type<SgToken>(*n));
2525  break;
2526 
2527  //
2528  // Types
2529 
2530  case V_SgTypeUnknown:
2531  Dispatcher::dispatch(rv, assume_sage_type<SgTypeUnknown>(*n));
2532  break;
2533 
2534  case V_SgTypeChar:
2535  Dispatcher::dispatch(rv, assume_sage_type<SgTypeChar>(*n));
2536  break;
2537 
2538  case V_SgTypeSignedChar:
2539  Dispatcher::dispatch(rv, assume_sage_type<SgTypeSignedChar>(*n));
2540  break;
2541 
2542  case V_SgTypeUnsignedChar:
2543  Dispatcher::dispatch(rv, assume_sage_type<SgTypeUnsignedChar>(*n));
2544  break;
2545 
2546  case V_SgTypeShort:
2547  Dispatcher::dispatch(rv, assume_sage_type<SgTypeShort>(*n));
2548  break;
2549 
2550  case V_SgTypeSignedShort:
2551  Dispatcher::dispatch(rv, assume_sage_type<SgTypeSignedShort>(*n));
2552  break;
2553 
2554  case V_SgTypeUnsignedShort:
2555  Dispatcher::dispatch(rv, assume_sage_type<SgTypeUnsignedShort>(*n));
2556  break;
2557 
2558  case V_SgTypeInt:
2559  Dispatcher::dispatch(rv, assume_sage_type<SgTypeInt>(*n));
2560  break;
2561 
2562  case V_SgTypeSignedInt:
2563  Dispatcher::dispatch(rv, assume_sage_type<SgTypeSignedInt>(*n));
2564  break;
2565 
2566  case V_SgTypeUnsignedInt:
2567  Dispatcher::dispatch(rv, assume_sage_type<SgTypeUnsignedInt>(*n));
2568  break;
2569 
2570  case V_SgTypeLong:
2571  Dispatcher::dispatch(rv, assume_sage_type<SgTypeLong>(*n));
2572  break;
2573 
2574  case V_SgTypeSignedLong:
2575  Dispatcher::dispatch(rv, assume_sage_type<SgTypeSignedLong>(*n));
2576  break;
2577 
2578  case V_SgTypeUnsignedLong:
2579  Dispatcher::dispatch(rv, assume_sage_type<SgTypeUnsignedLong>(*n));
2580  break;
2581 
2582  case V_SgTypeVoid:
2583  Dispatcher::dispatch(rv, assume_sage_type<SgTypeVoid>(*n));
2584  break;
2585 
2586  case V_SgTypeGlobalVoid:
2587  Dispatcher::dispatch(rv, assume_sage_type<SgTypeGlobalVoid>(*n));
2588  break;
2589 
2590  case V_SgTypeWchar:
2591  Dispatcher::dispatch(rv, assume_sage_type<SgTypeWchar>(*n));
2592  break;
2593 
2594  case V_SgTypeFloat:
2595  Dispatcher::dispatch(rv, assume_sage_type<SgTypeFloat>(*n));
2596  break;
2597 
2598  case V_SgTypeDouble:
2599  Dispatcher::dispatch(rv, assume_sage_type<SgTypeDouble>(*n));
2600  break;
2601 
2602  case V_SgTypeLongLong:
2603  Dispatcher::dispatch(rv, assume_sage_type<SgTypeLongLong>(*n));
2604  break;
2605 
2607  Dispatcher::dispatch(rv, assume_sage_type<SgTypeSignedLongLong>(*n));
2608  break;
2609 
2611  Dispatcher::dispatch(rv, assume_sage_type<SgTypeUnsignedLongLong>(*n));
2612  break;
2613 
2614  case V_SgTypeLongDouble:
2615  Dispatcher::dispatch(rv, assume_sage_type<SgTypeLongDouble>(*n));
2616  break;
2617 
2618  case V_SgTypeString:
2619  Dispatcher::dispatch(rv, assume_sage_type<SgTypeString>(*n));
2620  break;
2621 
2622  case V_SgTypeBool:
2623  Dispatcher::dispatch(rv, assume_sage_type<SgTypeBool>(*n));
2624  break;
2625 
2626  case V_SgTypeComplex:
2627  Dispatcher::dispatch(rv, assume_sage_type<SgTypeComplex>(*n));
2628  break;
2629 
2630  case V_SgTypeImaginary:
2631  Dispatcher::dispatch(rv, assume_sage_type<SgTypeImaginary>(*n));
2632  break;
2633 
2634  case V_SgTypeDefault:
2635  Dispatcher::dispatch(rv, assume_sage_type<SgTypeDefault>(*n));
2636  break;
2637 
2638  case V_SgPointerMemberType:
2639  Dispatcher::dispatch(rv, assume_sage_type<SgPointerMemberType>(*n));
2640  break;
2641 
2642  case V_SgReferenceType:
2643  Dispatcher::dispatch(rv, assume_sage_type<SgReferenceType>(*n));
2644  break;
2645 
2646  case V_SgTypeCAFTeam:
2647  Dispatcher::dispatch(rv, assume_sage_type<SgTypeCAFTeam>(*n));
2648  break;
2649 
2650  case V_SgClassType:
2651  Dispatcher::dispatch(rv, assume_sage_type<SgClassType>(*n));
2652  break;
2653 
2654  case V_SgTemplateType:
2655  Dispatcher::dispatch(rv, assume_sage_type<SgTemplateType>(*n));
2656  break;
2657 
2658  case V_SgEnumType:
2659  Dispatcher::dispatch(rv, assume_sage_type<SgEnumType>(*n));
2660  break;
2661 
2662  case V_SgTypedefType:
2663  Dispatcher::dispatch(rv, assume_sage_type<SgTypedefType>(*n));
2664  break;
2665 
2666  case V_SgModifierType:
2667  Dispatcher::dispatch(rv, assume_sage_type<SgModifierType>(*n));
2668  break;
2669 
2671  Dispatcher::dispatch(rv, assume_sage_type<SgPartialFunctionModifierType>(*n));
2672  break;
2673 
2674  case V_SgArrayType:
2675  Dispatcher::dispatch(rv, assume_sage_type<SgArrayType>(*n));
2676  break;
2677 
2678  case V_SgTypeEllipse:
2679  Dispatcher::dispatch(rv, assume_sage_type<SgTypeEllipse>(*n));
2680  break;
2681 
2682  case V_SgTypeCrayPointer:
2683  Dispatcher::dispatch(rv, assume_sage_type<SgTypeCrayPointer>(*n));
2684  break;
2685 
2687  Dispatcher::dispatch(rv, assume_sage_type<SgPartialFunctionType>(*n));
2688  break;
2689 
2691  Dispatcher::dispatch(rv, assume_sage_type<SgMemberFunctionType>(*n));
2692  break;
2693 
2694  case V_SgFunctionType:
2695  Dispatcher::dispatch(rv, assume_sage_type<SgFunctionType>(*n));
2696  break;
2697 
2698  case V_SgPointerType:
2699  Dispatcher::dispatch(rv, assume_sage_type<SgPointerType>(*n));
2700  break;
2701 
2702  case V_SgNamedType:
2703  Dispatcher::dispatch(rv, assume_sage_type<SgNamedType>(*n));
2704  break;
2705 
2706  case V_SgQualifiedNameType:
2707  Dispatcher::dispatch(rv, assume_sage_type<SgQualifiedNameType>(*n));
2708  break;
2709 
2710  // intermediary types - should not occur during AST traversal
2711  // \note this list is incomplete
2712  case V_SgNode:
2713  case V_SgLocatedNode:
2714  case V_SgExpression:
2715  case V_SgStatement:
2716  case V_SgNumVariants:
2717  case V_SgType: /* fall-through */
2718  default:
2719  unexpected_node(*n);
2720  }
2721 
2722  return rv;
2723  }
2724 
2725 
2787  template <class RoseVisitor>
2788  inline
2789  RoseVisitor
2790  dispatch(const RoseVisitor& rv, SgNode* n)
2791  {
2792  return _dispatch(rv, n);
2793  }
2794 
2796  template <class RoseVisitor>
2797  inline
2798  RoseVisitor
2799  dispatch(const RoseVisitor& rv, const SgNode* n)
2800  {
2801  return _dispatch(rv, n);
2802  }
2803 
2804  template <class SageNode>
2806  {
2807  void handle(SageNode&) {}
2808  };
2809 
2817  template <class AncestorNode, class QualSgNode>
2818  struct AncestorTypeFinder : DefaultHandler<const SgProject>
2819  {
2821  typedef std::pair<AncestorNode*, QualSgNode*> Pair;
2822 
2824 
2826  : Base(), res(NULL, NULL)
2827  {}
2828 
2829  // handling of const SgProject is outsourced to DefaultHandler
2830  // thus, AncestorNode = const SgProject does not cause conflicts
2831  using Base::handle;
2832 
2833  void handle(QualSgNode& n) { res.second = n.get_parent(); }
2834  void handle(AncestorNode& n) { res.first = &n; }
2835 
2836  operator Pair() const { return res; }
2837  };
2838 
2841  template <class AncestorNode, class QualSgNode>
2842  AncestorNode* _ancestor(QualSgNode& n)
2843  {
2844  typedef AncestorTypeFinder<AncestorNode, QualSgNode> AncestorFinder;
2845 
2846  typename AncestorFinder::Pair res(NULL, n.get_parent());
2847 
2848  while (res.second != NULL)
2849  {
2850  res = sg::dispatch(AncestorFinder(), res.second);
2851  }
2852 
2853  return res.first;
2854  }
2855 
2867  template <class AncestorNode>
2868  AncestorNode* ancestor(SgNode* n)
2869  {
2870  if (n == NULL) return NULL;
2871 
2872  return _ancestor<AncestorNode>(*n);
2873  }
2874 
2876  template <class AncestorNode>
2877  const AncestorNode* ancestor(const SgNode* n)
2878  {
2879  if (n == NULL) return NULL;
2880 
2881  return _ancestor<const AncestorNode>(*n);
2882  }
2883 
2885  template <class AncestorNode>
2886  AncestorNode& ancestor(SgNode& n)
2887  {
2888  AncestorNode* res = _ancestor<AncestorNode>(n);
2889 
2890  ROSE_ASSERT(res);
2891  return *res;
2892  }
2893 
2895  template <class AncestorNode>
2896  const AncestorNode& ancestor(const SgNode& n)
2897  {
2898  const AncestorNode* res = _ancestor<const AncestorNode>(n);
2899 
2900  ROSE_ASSERT(res);
2901  return *res;
2902  }
2903 
2904  template <class SageNode>
2906  {
2908 
2909  SageNode* res;
2910 
2912  : res(NULL)
2913  {}
2914 
2916  void handle(SageNode& n) { res = &n; }
2917 
2918  operator SageNode* () { return res; }
2919  };
2920 
2928  template <class SageNode>
2929  SageNode* assert_sage_type(SgNode* n)
2930  {
2932  }
2933 
2935  template <class SageNode>
2936  const SageNode* assert_sage_type(const SgNode* n)
2937  {
2939  }
2940 
2943  static inline
2944  void swap_parent(SgNode* lhs, SgNode* rhs)
2945  {
2946  SgNode* tmp = lhs->get_parent();
2947 
2948  lhs->set_parent(rhs->get_parent());
2949  rhs->set_parent(tmp);
2950  }
2951 
2955  static inline
2956  void swap_parent(void*, void*) {}
2957 
2965  template <class SageNode, class SageChild>
2966  void swap_child(SageNode& lhs, SageNode& rhs, SageChild* (SageNode::*getter) () const, void (SageNode::*setter) (SageChild*))
2967  {
2968  SageChild* lhs_child = (lhs.*getter)();
2969  SageChild* rhs_child = (rhs.*getter)();
2970  ROSE_ASSERT(lhs_child && rhs_child);
2971 
2972  (lhs.*setter)(rhs_child);
2973  (rhs.*setter)(lhs_child);
2974 
2975  swap_parent(lhs_child, rhs_child);
2976  }
2977 }
2978 #endif /* _SAGEGENERIC_H */