ROSE 0.11.145.147
sageGeneric.h
Go to the documentation of this file.
1#ifndef _SAGEGENERIC_H
2
3#define _SAGEGENERIC_H 1
4
11
12// note: the comments are right aligned to support code-blocks doxygen 1.3.X :)
13
14#include <Cxx_GrammarVisitorSupport.h>
15#include <type_traits>
16
17#if !defined(NDEBUG)
18#include <typeinfo>
19#include <sstream>
20#endif /* NDEBUG */
21
22#define WITH_BINARY_NODES 0
23#define WITH_UNTYPED_NODES 0
24
25// #include "Cxx_Grammar.h"
26
27// DQ (10/5/2014): We can't include this here.
28// #include "rose.h"
29
30#define SG_UNEXPECTED_NODE(X) (sg::unexpected_node(X, __FILE__, __LINE__))
31#define SG_DEREF(X) (sg::deref(X, __FILE__, __LINE__))
32#define SG_ASSERT_TYPE(SAGENODE, N) (sg::assert_sage_type<SAGENODE>(N, __FILE__, __LINE__))
33#define SG_ERROR_IF(COND, MSG) (sg::report_error_if(COND, MSG, __FILE__, __LINE__))
34
35
37namespace sg
38{
39 //
40 // non sage specific utilities
41
44 template <class T>
45 static inline
46 void unused(const T&) {}
47
49 template <class T1, class T2>
50 struct ConstLike
51 {
52 typedef T2 type;
53 };
54
55 template <class T1, class T2>
56 struct ConstLike<const T1, T2>
57 {
58 typedef const T2 type;
59 };
60
61 //
62 // error reporting
63
65 template <class T, class E>
66 static inline
67 T conv(const E& el)
68 {
69 T res;
70#if !defined(NDEBUG)
71 std::stringstream s;
72
73 s << el;
74 s >> res;
75#endif /* NDEBUG */
76 return res;
77 }
78
79 // \note implemented in SageInterfaceAda.h
80 // \{
81 [[noreturn]]
82 void report_error(std::string desc, const char* file = nullptr, size_t ln = 0);
83
84 [[noreturn]]
85 void unexpected_node(const SgNode& n, const char* file = nullptr, size_t ln = 0);
87
88
89 static inline
90 void report_error_if(bool iserror, const std::string& desc, const char* file = nullptr, size_t ln = 0)
91 {
92 if (!iserror) return;
93
94 report_error(desc, file, ln);
95 }
96
98 template <class T>
99 T& deref(T* ptr, const char* file = 0, size_t ln = 0)
100 {
101 report_error_if(!ptr, "assertion failed: null dereference ", file, ln);
102 return *ptr;
103 }
104
105 template <bool conv>
106 struct ConditionalEnable : std::true_type // enable
107 {};
108
109 template <>
110 struct ConditionalEnable<false> // disable
111 {};
112
113 template <class U, class T>
114 struct EnableConversion : ConditionalEnable<!std::is_same<U,T>::value && std::is_convertible<U,T>::value>
115 {};
116
118 template <class T>
119 struct NotNull
120 {
124 // not explicit to enable auto-conversion
126 : ptr(p)
127 {
128 SG_ERROR_IF(ptr == nullptr, "failed null pointer check.");
129 }
130
131 NotNull(const NotNull&) = default;
132 NotNull& operator=(const NotNull&) = default;
133 ~NotNull() = default;
134
139 template <class U, bool = EnableConversion<U*,T*>::value>
141 : ptr(nn.pointer())
142 {}
143
145 T& operator*() const { return *ptr; }
146
148 T* operator->() const { return ptr; }
149
151 operator T*() const { return ptr; }
152
154 T* pointer() const { return ptr; }
155
156 private:
157 T* ptr; // must be initialized in ctors
158
159 // no default construction
160 NotNull() = delete;
161
162 // NEITHER delete NOR define move ctor/assignment,
163 // to make the compiler use the copy-versions.
164 // NotNull(NotNull&&) = delete;
165 // NotNull& operator(NotNull&&) = delete;
166 };
167
168
169
180 template <class _ReturnType>
182 {
183 typedef _ReturnType ReturnType;
185
187 : res()
188 {}
189
190 explicit
191 DispatchHandler(const ReturnType& defaultval)
192 : res(defaultval)
193 {}
194
195 operator ReturnType() const { return res; }
196
197 protected:
198 ReturnType res;
199 };
200
201
202 //
203 // Sage query functions
204
206 template <class SageNode>
207 static inline
208 SageNode& assume_sage_type(SgNode& n)
209 {
210 return static_cast<SageNode&>(n);
211 }
212
215 template <class SageNode>
216 static inline
217 const SageNode& assume_sage_type(const SgNode& n)
218 {
219 return static_cast<const SageNode&>(n);
220 }
221
222#define GEN_VISIT(X) \
223 void visit(X * n) { rv.handle(*n); }
224
225 template <class RoseVisitor>
227 {
228 // rvalue ctor
229 VisitDispatcher(RoseVisitor&& rosevisitor, std::false_type)
230 : rv(std::move(rosevisitor))
231 {}
232
233 // lvalue ctor
234 VisitDispatcher(const RoseVisitor& rosevisitor, std::true_type)
235 : rv(rosevisitor)
236 {}
237
238 GEN_VISIT(SgAccessModifier)
240 GEN_VISIT(SgAbsOp)
241 GEN_VISIT(SgAdaAccessType)
242 GEN_VISIT(SgAdaAcceptStmt)
243 GEN_VISIT(SgAdaComponentClause)
244 GEN_VISIT(SgAdaDelayStmt)
245 GEN_VISIT(SgAdaEntryDecl)
246 GEN_VISIT(SgAdaExitStmt)
247 GEN_VISIT(SgAdaDiscreteType)
248 GEN_VISIT(SgAdaFloatVal)
249 GEN_VISIT(SgAdaFormalType)
250 GEN_VISIT(SgAdaFormalTypeDecl)
252 GEN_VISIT(SgAdaGenericDecl)
253 GEN_VISIT(SgAdaGenericInstanceDecl)
254 GEN_VISIT(SgAdaGenericDefn)
255 GEN_VISIT(SgAdaIndexConstraint)
256 GEN_VISIT(SgAdaAttributeClause)
257 GEN_VISIT(SgAdaLoopStmt)
258 GEN_VISIT(SgAdaModularType)
259 GEN_VISIT(SgAdaPackageBody)
260 GEN_VISIT(SgAdaPackageBodyDecl)
261 GEN_VISIT(SgAdaPackageSpec)
262 GEN_VISIT(SgAdaPackageSpecDecl)
263 GEN_VISIT(SgAdaPackageSymbol)
264 GEN_VISIT(SgAdaRangeConstraint)
267 GEN_VISIT(SgAdaRenamingDecl)
268 GEN_VISIT(SgAdaSelectStmt)
270 GEN_VISIT(SgAdaSubtype)
271 GEN_VISIT(SgAdaDerivedType)
272 GEN_VISIT(SgAdaAttributeExp)
273 GEN_VISIT(SgAdaTaskBody)
274 GEN_VISIT(SgAdaTaskBodyDecl)
275 GEN_VISIT(SgAdaTaskSpec)
276 GEN_VISIT(SgAdaTaskSpecDecl)
277 GEN_VISIT(SgAdaTaskSymbol)
278 GEN_VISIT(SgAdaRenamingSymbol)
279 GEN_VISIT(SgAdaTaskRefExp)
280 GEN_VISIT(SgAdaRenamingRefExp)
281 GEN_VISIT(SgAdaTaskType)
282 GEN_VISIT(SgAdaTaskTypeDecl)
283 GEN_VISIT(SgAdaTerminateStmt)
284 GEN_VISIT(SgAdaTypeConstraint)
285 GEN_VISIT(SgAddOp)
286 GEN_VISIT(SgAddressOfOp)
287 GEN_VISIT(SgAggregateInitializer)
288 GEN_VISIT(SgAliasSymbol)
289 GEN_VISIT(SgAllocateStatement)
290 GEN_VISIT(SgAndAssignOp)
291 GEN_VISIT(SgAndOp)
292 GEN_VISIT(SgArithmeticIfStatement)
293 GEN_VISIT(SgArrayType)
294 GEN_VISIT(SgArrowExp)
295 GEN_VISIT(SgArrowStarOp)
296 GEN_VISIT(SgAssertStmt)
297 GEN_VISIT(SgAssignInitializer)
298 GEN_VISIT(SgAssignOp)
299 GEN_VISIT(SgAssignStatement)
300 GEN_VISIT(SgAssignedGotoStatement)
301 GEN_VISIT(SgAssociateStatement)
302 GEN_VISIT(SgAsteriskShapeExp)
303 GEN_VISIT(SgAtOp)
304 GEN_VISIT(SgAttribute)
306 GEN_VISIT(SgAutoType)
307 GEN_VISIT(SgAwaitExpression)
308 GEN_VISIT(SgBackspaceStatement)
309 GEN_VISIT(SgBaseClass)
310 GEN_VISIT(SgExpBaseClass)
311 GEN_VISIT(SgBaseClassModifier)
312 GEN_VISIT(SgBasicBlock)
313 GEN_VISIT(SgBidirectionalGraph)
314 GEN_VISIT(SgBinaryOp)
315 GEN_VISIT(SgBitAndOp)
316 GEN_VISIT(SgBitAttribute)
317 GEN_VISIT(SgBitComplementOp)
318 GEN_VISIT(SgBitEqvOp)
319 GEN_VISIT(SgBitOrOp)
320 GEN_VISIT(SgBitXorOp)
321 GEN_VISIT(SgBlockDataStatement)
322 GEN_VISIT(SgBoolValExp)
323 GEN_VISIT(SgBreakStmt)
324 GEN_VISIT(SgBracedInitializer)
326 GEN_VISIT(SgCaseOptionStmt)
327 GEN_VISIT(SgCastExp)
328 GEN_VISIT(SgCatchOptionStmt)
329 GEN_VISIT(SgCatchStatementSeq)
330 GEN_VISIT(SgCharVal)
331 GEN_VISIT(SgChar16Val)
332 GEN_VISIT(SgChar32Val)
333 GEN_VISIT(SgChooseExpression)
334 GEN_VISIT(SgClassDecl_attr)
335 GEN_VISIT(SgClassDeclaration)
336 GEN_VISIT(SgClassDefinition)
337 GEN_VISIT(SgClassNameRefExp)
338 GEN_VISIT(SgClassSymbol)
339 GEN_VISIT(SgClassType)
341 GEN_VISIT(SgClinkageEndStatement)
342 GEN_VISIT(SgClinkageStartStatement)
343 GEN_VISIT(SgCloseStatement)
344 GEN_VISIT(SgColonShapeExp)
345 GEN_VISIT(SgCommaOpExp)
346 GEN_VISIT(SgCommonBlock)
347 GEN_VISIT(SgCommonBlockObject)
348 GEN_VISIT(SgCommonSymbol)
349 GEN_VISIT(SgComplexVal)
350 GEN_VISIT(SgComprehension)
351 GEN_VISIT(SgCompoundAssignOp)
352 GEN_VISIT(SgCompoundInitializer)
353 GEN_VISIT(SgCompoundLiteralExp)
354 GEN_VISIT(SgComputedGotoStatement)
355 GEN_VISIT(SgConcatenationOp)
356 GEN_VISIT(SgConditionalExp)
357 GEN_VISIT(SgConjugateOp)
358 GEN_VISIT(SgConstVolatileModifier)
359 GEN_VISIT(SgConstructorInitializer)
360 GEN_VISIT(SgContainsStatement)
361 GEN_VISIT(SgContinueStmt)
362 GEN_VISIT(SgCtorInitializerList)
363 GEN_VISIT(SgDataStatementGroup)
364 GEN_VISIT(SgDataStatementObject)
365 GEN_VISIT(SgDataStatementValue)
367 GEN_VISIT(SgDeallocateStatement)
368 GEN_VISIT(SgDeclarationModifier)
369 GEN_VISIT(SgDeclarationScope)
370 GEN_VISIT(SgDeclarationStatement)
371 GEN_VISIT(SgDeclType)
372 GEN_VISIT(SgDefaultOptionStmt)
373 GEN_VISIT(SgDefaultSymbol)
375 GEN_VISIT(SgDeleteExp)
376 GEN_VISIT(SgDerivedTypeStatement)
377 GEN_VISIT(SgDesignatedInitializer)
379 GEN_VISIT(SgDictionaryExp)
380 GEN_VISIT(SgDimensionObject)
381 GEN_VISIT(SgDirectory)
382 GEN_VISIT(SgDirectoryList)
383 GEN_VISIT(SgDivAssignOp)
384 GEN_VISIT(SgDivideOp)
385 GEN_VISIT(SgDoWhileStmt)
386 GEN_VISIT(SgDotExp)
387 GEN_VISIT(SgDotStarOp)
388 GEN_VISIT(SgDoubleVal)
389 GEN_VISIT(SgElaboratedTypeModifier)
390 GEN_VISIT(SgElementwiseOp)
391 GEN_VISIT(SgElementwiseAddOp)
392 GEN_VISIT(SgElementwiseDivideOp)
394 GEN_VISIT(SgElementwiseMultiplyOp)
395 GEN_VISIT(SgElementwisePowerOp)
396 GEN_VISIT(SgElementwiseSubtractOp)
397 GEN_VISIT(SgElseDirectiveStatement)
398 GEN_VISIT(SgElseWhereStatement)
400 GEN_VISIT(SgEmptyDeclaration)
402 GEN_VISIT(SgEndfileStatement)
404 GEN_VISIT(SgEntryStatement)
405 GEN_VISIT(SgEnumDeclaration)
406 GEN_VISIT(SgEnumFieldSymbol)
407 GEN_VISIT(SgEnumSymbol)
408 GEN_VISIT(SgEnumType)
409 GEN_VISIT(SgEnumVal)
410 GEN_VISIT(SgEqualityOp)
411 GEN_VISIT(SgEquivalenceStatement)
413 GEN_VISIT(SgExecStatement)
414 GEN_VISIT(SgExponentiationOp)
415 GEN_VISIT(SgExponentiationAssignOp)
416 GEN_VISIT(SgExprListExp)
417 GEN_VISIT(SgExprStatement)
418 GEN_VISIT(SgExpression)
419 GEN_VISIT(SgExpressionRoot)
420 GEN_VISIT(SgFile)
421 GEN_VISIT(SgFileList)
422 GEN_VISIT(SgFloatVal)
423 GEN_VISIT(SgFloat128Val)
424 GEN_VISIT(SgFloat80Val)
425 GEN_VISIT(SgFoldExpression)
426 GEN_VISIT(SgFlushStatement)
427 GEN_VISIT(SgForAllStatement)
428 GEN_VISIT(SgForInitStatement)
429 GEN_VISIT(SgForStatement)
430 GEN_VISIT(SgFormatItem)
431 GEN_VISIT(SgFormatItemList)
432 GEN_VISIT(SgFormatStatement)
433 GEN_VISIT(SgFortranDo)
434 GEN_VISIT(SgFortranIncludeLine)
435 GEN_VISIT(SgFortranNonblockedDo)
436 GEN_VISIT(SgFuncDecl_attr)
437 GEN_VISIT(SgFunctionCallExp)
438 GEN_VISIT(SgFunctionDeclaration)
439 GEN_VISIT(SgFunctionDefinition)
440 GEN_VISIT(SgFunctionParameterScope)
441 GEN_VISIT(SgFunctionModifier)
442 GEN_VISIT(SgFunctionParameterList)
445 GEN_VISIT(SgFunctionRefExp)
446 GEN_VISIT(SgFunctionSymbol)
447 GEN_VISIT(SgFunctionType)
448 GEN_VISIT(SgFunctionTypeSymbol)
449 GEN_VISIT(SgFunctionTypeTable)
450 GEN_VISIT(SgTypeTable)
451 GEN_VISIT(SgGlobal)
452 GEN_VISIT(SgGotoStatement)
453 GEN_VISIT(SgGraph)
454 GEN_VISIT(SgGraphEdge)
455 GEN_VISIT(SgGraphEdgeList)
456 GEN_VISIT(SgGraphNode)
457 GEN_VISIT(SgGraphNodeList)
458 GEN_VISIT(SgGreaterOrEqualOp)
459 GEN_VISIT(SgGreaterThanOp)
460 GEN_VISIT(SgIOItemExpression)
461 GEN_VISIT(SgIOStatement)
463 GEN_VISIT(SgIfDirectiveStatement)
464 GEN_VISIT(SgIfStmt)
467 GEN_VISIT(SgImageControlStatement)
468 GEN_VISIT(SgImagPartOp)
469 GEN_VISIT(SgImplicitStatement)
470 GEN_VISIT(SgImpliedDo)
471 GEN_VISIT(SgImportStatement)
472 GEN_VISIT(SgIncidenceDirectedGraph)
475 GEN_VISIT(SgIncludeFile)
477 GEN_VISIT(SgInitializedName)
478 GEN_VISIT(SgInitializer)
479 GEN_VISIT(SgInquireStatement)
481 GEN_VISIT(SgIntVal)
482 GEN_VISIT(SgIntegerDivideOp)
483 GEN_VISIT(SgIntegerDivideAssignOp)
484 GEN_VISIT(SgInterfaceBody)
485 GEN_VISIT(SgHeaderFileBody)
486 GEN_VISIT(SgHeaderFileReport)
487 GEN_VISIT(SgInterfaceStatement)
488 GEN_VISIT(SgInterfaceSymbol)
489 GEN_VISIT(SgIntrinsicSymbol)
490 GEN_VISIT(SgIsOp)
491 GEN_VISIT(SgIsNotOp)
492 GEN_VISIT(SgIorAssignOp)
493 GEN_VISIT(SgJovialBitType)
494 GEN_VISIT(SgJovialBitVal)
495 GEN_VISIT(SgJovialTableType)
496 GEN_VISIT(SgJovialCompoolStatement)
497 GEN_VISIT(SgJovialForThenStatement)
501 GEN_VISIT(SgJovialTablePresetExp)
502 GEN_VISIT(SgJovialTableStatement)
503 GEN_VISIT(SgKeyDatumPair)
504 GEN_VISIT(SgCudaKernelExecConfig)
505 GEN_VISIT(SgCudaKernelCallExp)
506 GEN_VISIT(SgLabelRefExp)
507 GEN_VISIT(SgLabelStatement)
508 GEN_VISIT(SgJavaLabelStatement)
509 GEN_VISIT(SgLabelSymbol)
510 GEN_VISIT(SgJavaLabelSymbol)
511 GEN_VISIT(SgLambdaCapture)
512 GEN_VISIT(SgLambdaCaptureList)
513 GEN_VISIT(SgLambdaExp)
514 GEN_VISIT(SgLambdaRefExp)
515 GEN_VISIT(SgLeftDivideOp)
516 GEN_VISIT(SgLessOrEqualOp)
517 GEN_VISIT(SgLessThanOp)
518 GEN_VISIT(SgLineDirectiveStatement)
520 GEN_VISIT(SgLinkageModifier)
521 GEN_VISIT(SgListComprehension)
522 GEN_VISIT(SgListExp)
523 GEN_VISIT(SgLocatedNode)
524 GEN_VISIT(SgLocatedNodeSupport)
525 GEN_VISIT(SgLongDoubleVal)
526 GEN_VISIT(SgLongIntVal)
527 GEN_VISIT(SgLongLongIntVal)
528 GEN_VISIT(SgLshiftAssignOp)
529 GEN_VISIT(SgLshiftOp)
530 GEN_VISIT(SgMagicColonExp)
531 GEN_VISIT(SgMatrixExp)
532 GEN_VISIT(SgMatrixTransposeOp)
533 GEN_VISIT(SgMatlabForStatement)
535 GEN_VISIT(SgMemberFunctionRefExp)
536 GEN_VISIT(SgMemberFunctionSymbol)
537 GEN_VISIT(SgMemberFunctionType)
538 GEN_VISIT(SgMembershipOp)
540 GEN_VISIT(SgMinusAssignOp)
541 GEN_VISIT(SgMinusMinusOp)
542 GEN_VISIT(SgMinusOp)
543 GEN_VISIT(SgModAssignOp)
544 GEN_VISIT(SgModOp)
545 GEN_VISIT(SgModifier)
546 GEN_VISIT(SgModifierNodes)
547 GEN_VISIT(SgModifierType)
548 GEN_VISIT(SgModuleStatement)
549 GEN_VISIT(SgModuleSymbol)
550 GEN_VISIT(SgMultAssignOp)
551 GEN_VISIT(SgMultiplyOp)
552 GEN_VISIT(SgName)
553 GEN_VISIT(SgNameGroup)
554 GEN_VISIT(SgNamedType)
555 GEN_VISIT(SgNamelistStatement)
559 GEN_VISIT(SgNamespaceSymbol)
560 GEN_VISIT(SgNaryOp)
561 GEN_VISIT(SgNaryBooleanOp)
562 GEN_VISIT(SgNaryComparisonOp)
563 GEN_VISIT(SgNewExp)
564 GEN_VISIT(SgNode)
565 GEN_VISIT(SgNoexceptOp)
566 GEN_VISIT(SgNotEqualOp)
567 GEN_VISIT(SgNotOp)
568 GEN_VISIT(SgNonMembershipOp)
569 GEN_VISIT(SgNonrealDecl)
570 GEN_VISIT(SgNonrealRefExp)
571 GEN_VISIT(SgNonrealSymbol)
572 GEN_VISIT(SgNonrealType)
573 GEN_VISIT(SgNonrealBaseClass)
574 GEN_VISIT(SgNullExpression)
575 GEN_VISIT(SgNullptrValExp)
576 GEN_VISIT(SgNullStatement)
577 GEN_VISIT(SgNullifyStatement)
578 GEN_VISIT(SgOmpAtomicStatement)
579 GEN_VISIT(SgOmpBarrierStatement)
580 GEN_VISIT(SgOmpCriticalStatement)
581 GEN_VISIT(SgOmpClauseBodyStatement)
582 GEN_VISIT(SgOmpBodyStatement)
583 GEN_VISIT(SgOmpDoStatement)
584 GEN_VISIT(SgOmpFlushStatement)
586 GEN_VISIT(SgOmpForStatement)
587 GEN_VISIT(SgOmpForSimdStatement)
588 GEN_VISIT(SgOmpMasterStatement)
589 GEN_VISIT(SgOmpOrderedStatement)
590 GEN_VISIT(SgOmpParallelStatement)
591 GEN_VISIT(SgOmpSectionStatement)
592 GEN_VISIT(SgOmpSectionsStatement)
593 GEN_VISIT(SgOmpSingleStatement)
594 GEN_VISIT(SgOmpTaskStatement)
595 GEN_VISIT(SgOmpTaskwaitStatement)
597 GEN_VISIT(SgOmpWorkshareStatement)
598 GEN_VISIT(SgOmpTargetStatement)
599 GEN_VISIT(SgOmpTargetDataStatement)
600 GEN_VISIT(SgOmpSimdStatement)
601 GEN_VISIT(SgOmpClause)
602 GEN_VISIT(SgOmpBeginClause)
603 GEN_VISIT(SgOmpCollapseClause)
604 GEN_VISIT(SgOmpCopyinClause)
605 GEN_VISIT(SgOmpCopyprivateClause)
606 GEN_VISIT(SgOmpDefaultClause)
607 GEN_VISIT(SgOmpEndClause)
608 GEN_VISIT(SgOmpExpressionClause)
609 GEN_VISIT(SgOmpFirstprivateClause)
610 GEN_VISIT(SgOmpIfClause)
611 GEN_VISIT(SgOmpFinalClause)
612 GEN_VISIT(SgOmpPriorityClause)
613 GEN_VISIT(SgOmpDeviceClause)
614 GEN_VISIT(SgOmpLastprivateClause)
615 GEN_VISIT(SgOmpNowaitClause)
616 GEN_VISIT(SgOmpNumThreadsClause)
617 GEN_VISIT(SgOmpOrderedClause)
618 GEN_VISIT(SgOmpPrivateClause)
619 GEN_VISIT(SgOmpReductionClause)
620 GEN_VISIT(SgOmpScheduleClause)
621 GEN_VISIT(SgOmpSharedClause)
622 GEN_VISIT(SgOmpUntiedClause)
623 GEN_VISIT(SgOmpMergeableClause)
624 GEN_VISIT(SgOmpVariablesClause)
625 GEN_VISIT(SgOmpMapClause)
626 GEN_VISIT(SgOmpSafelenClause)
627 GEN_VISIT(SgOmpSimdlenClause)
628 GEN_VISIT(SgOmpLinearClause)
629 GEN_VISIT(SgOmpUniformClause)
630 GEN_VISIT(SgOmpAlignedClause)
631 GEN_VISIT(SgOmpProcBindClause)
632 GEN_VISIT(SgOmpAtomicClause)
633 GEN_VISIT(SgOmpInbranchClause)
634 GEN_VISIT(SgOmpNotinbranchClause)
635 GEN_VISIT(SgOmpDependClause)
637 GEN_VISIT(SgOpenStatement)
638 GEN_VISIT(SgOptions)
639 GEN_VISIT(SgOrOp)
640 GEN_VISIT(SgParameterStatement)
642 GEN_VISIT(SgPartialFunctionType)
643 GEN_VISIT(SgPassStatement)
644 GEN_VISIT(SgPlusAssignOp)
645 GEN_VISIT(SgPlusPlusOp)
646 GEN_VISIT(SgPntrArrRefExp)
647 GEN_VISIT(SgPointerAssignOp)
648 GEN_VISIT(SgPointerDerefExp)
649 GEN_VISIT(SgPointerMemberType)
650 GEN_VISIT(SgPointerType)
651 GEN_VISIT(SgPowerOp)
652 GEN_VISIT(SgPragma)
653 GEN_VISIT(SgPragmaDeclaration)
654 GEN_VISIT(SgPrintStatement)
656 GEN_VISIT(SgProgramHeaderStatement)
657 GEN_VISIT(SgProject)
658 GEN_VISIT(SgPseudoDestructorRefExp)
659 GEN_VISIT(SgPythonGlobalStmt)
660 GEN_VISIT(SgPythonPrintStmt)
661 GEN_VISIT(SgQualifiedName)
662 GEN_VISIT(SgQualifiedNameType)
663 GEN_VISIT(SgRangeExp)
664 GEN_VISIT(SgRangeBasedForStatement)
665 GEN_VISIT(SgReadStatement)
666 GEN_VISIT(SgRealPartOp)
667 GEN_VISIT(SgRefExp)
668 GEN_VISIT(SgReferenceType)
669 GEN_VISIT(SgRemOp)
670 GEN_VISIT(SgRenamePair)
671 GEN_VISIT(SgRenameSymbol)
672 GEN_VISIT(SgReplicationOp)
673 GEN_VISIT(SgReturnStmt)
674 GEN_VISIT(SgRewindStatement)
675 GEN_VISIT(SgRshiftAssignOp)
676 GEN_VISIT(SgRshiftOp)
677 GEN_VISIT(SgRvalueReferenceType)
679 GEN_VISIT(SgJavaUnsignedRshiftOp)
680 GEN_VISIT(SgScopeOp)
681 GEN_VISIT(SgScopeStatement)
682 GEN_VISIT(SgSequenceStatement)
683 GEN_VISIT(SgSetComprehension)
684 GEN_VISIT(SgShortVal)
685 GEN_VISIT(SgSizeOfOp)
686 GEN_VISIT(SgAlignOfOp)
687 GEN_VISIT(SgJavaInstanceOfOp)
688 GEN_VISIT(SgSourceFile)
689 GEN_VISIT(SgSpaceshipOp)
690 GEN_VISIT(SgSpawnStmt)
691 GEN_VISIT(SgSyncAllStatement)
692 GEN_VISIT(SgSyncImagesStatement)
693 GEN_VISIT(SgSyncMemoryStatement)
694 GEN_VISIT(SgSyncTeamStatement)
695 GEN_VISIT(SgLockStatement)
696 GEN_VISIT(SgUnlockStatement)
697 GEN_VISIT(SgJavaThrowStatement)
698 GEN_VISIT(SgJavaForEachStatement)
700 GEN_VISIT(SgJavaParameterizedType)
701 GEN_VISIT(SgJavaWildcardType)
704 GEN_VISIT(SgStatement)
707 GEN_VISIT(SgStatementExpression)
709 GEN_VISIT(SgStorageModifier)
710 GEN_VISIT(SgStringConversion)
712 GEN_VISIT(SgStringVal)
713 GEN_VISIT(SgStructureModifier)
714 GEN_VISIT(SgSubscriptExpression)
715 GEN_VISIT(SgSubtractOp)
716 GEN_VISIT(SgSupport)
717 GEN_VISIT(SgSwitchStatement)
718 GEN_VISIT(SgSymbol)
719 GEN_VISIT(SgSymbolTable)
720 GEN_VISIT(SgTemplateArgument)
721 GEN_VISIT(SgTemplateArgumentList)
722 GEN_VISIT(SgTemplateDeclaration)
724 GEN_VISIT(SgTemplateClassSymbol)
726 GEN_VISIT(SgTemplateFunctionRefExp)
727 GEN_VISIT(SgTemplateFunctionSymbol)
732 GEN_VISIT(SgTemplateTypedefSymbol)
734 GEN_VISIT(SgTemplateVariableSymbol)
743 GEN_VISIT(SgTemplateParameter)
744 GEN_VISIT(SgTemplateParameterVal)
745 GEN_VISIT(SgTemplateParameterList)
746 GEN_VISIT(SgTemplateSymbol)
747 GEN_VISIT(SgTemplateType)
748 GEN_VISIT(SgThisExp)
750 GEN_VISIT(SgSuperExp)
751 GEN_VISIT(SgThrowOp)
752 GEN_VISIT(SgToken)
753 GEN_VISIT(SgTryStmt)
754 GEN_VISIT(SgTupleExp)
755 GEN_VISIT(SgType)
756 GEN_VISIT(SgTypeBool)
757 GEN_VISIT(SgTypeChar)
758 GEN_VISIT(SgTypeChar16)
759 GEN_VISIT(SgTypeChar32)
760 GEN_VISIT(SgTypeComplex)
761 GEN_VISIT(SgTypeDefault)
762 GEN_VISIT(SgTypeExpression)
763 GEN_VISIT(SgTypeLabel)
764 GEN_VISIT(SgTypeDouble)
765 GEN_VISIT(SgTypeEllipse)
766 GEN_VISIT(SgTypeFixed)
767 GEN_VISIT(SgTypeFloat)
768 GEN_VISIT(SgTypeFloat128)
769 GEN_VISIT(SgTypeFloat80)
770 GEN_VISIT(SgTypeGlobalVoid)
771 GEN_VISIT(SgTypeIdOp)
772 GEN_VISIT(SgTypeImaginary)
773 GEN_VISIT(SgTypeInt)
774 GEN_VISIT(SgTypeLong)
775 GEN_VISIT(SgTypeLongDouble)
776 GEN_VISIT(SgTypeLongLong)
777 GEN_VISIT(SgTypeModifier)
778 GEN_VISIT(SgTypeMatrix)
779 GEN_VISIT(SgTypeTuple)
780 GEN_VISIT(SgTypeNullptr)
781 GEN_VISIT(SgTypeOfType)
782 GEN_VISIT(SgTypeShort)
784 GEN_VISIT(SgTypeSignedChar)
785 GEN_VISIT(SgTypeSignedInt)
786 GEN_VISIT(SgTypeSignedLong)
787 GEN_VISIT(SgTypeSignedLongLong)
788 GEN_VISIT(SgTypeSignedShort)
789 GEN_VISIT(SgTypeString)
790 GEN_VISIT(SgTypeUnknown)
792 GEN_VISIT(SgTypeUnsignedChar)
793 GEN_VISIT(SgTypeUnsignedInt)
794 GEN_VISIT(SgTypeUnsignedLong)
795 GEN_VISIT(SgTypeUnsignedLongLong)
796 GEN_VISIT(SgTypeUnsignedShort)
797 GEN_VISIT(SgTypeVoid)
798 GEN_VISIT(SgTypeWchar)
799 GEN_VISIT(SgTypedefDeclaration)
800 GEN_VISIT(SgTypedefSeq)
801 GEN_VISIT(SgTypedefSymbol)
802 GEN_VISIT(SgTypedefType)
803 GEN_VISIT(SgUPC_AccessModifier)
804 GEN_VISIT(SgUnaryAddOp)
805 GEN_VISIT(SgUnaryOp)
807 GEN_VISIT(SgUndirectedGraphEdge)
809 GEN_VISIT(SgUnknownFile)
810 GEN_VISIT(SgUnparse_Info)
811 GEN_VISIT(SgUnsignedCharVal)
812 GEN_VISIT(SgUnsignedIntVal)
813 GEN_VISIT(SgUnsignedLongLongIntVal)
814 GEN_VISIT(SgUnsignedLongVal)
815 GEN_VISIT(SgUnsignedShortVal)
816 GEN_VISIT(SgUpcBarrierStatement)
819 GEN_VISIT(SgUpcFenceStatement)
820 GEN_VISIT(SgUpcForAllStatement)
822 GEN_VISIT(SgUpcMythread)
823 GEN_VISIT(SgUpcNotifyStatement)
824 GEN_VISIT(SgUpcThreads)
825 GEN_VISIT(SgUpcWaitStatement)
826 GEN_VISIT(SgUseStatement)
827 GEN_VISIT(SgUserDefinedBinaryOp)
828 GEN_VISIT(SgUserDefinedUnaryOp)
831 GEN_VISIT(SgValueExp)
832 GEN_VISIT(SgVarArgCopyOp)
833 GEN_VISIT(SgVarArgEndOp)
834 GEN_VISIT(SgVarArgOp)
836 GEN_VISIT(SgVarArgStartOp)
837 GEN_VISIT(SgVarRefExp)
838 GEN_VISIT(SgVariableDeclaration)
839 GEN_VISIT(SgVariableDefinition)
840 GEN_VISIT(SgVariableSymbol)
841 GEN_VISIT(SgVariantExpression)
842 GEN_VISIT(SgVariantStatement)
843 GEN_VISIT(SgVoidVal)
844 GEN_VISIT(SgWaitStatement)
846 GEN_VISIT(SgWithStatement)
847 GEN_VISIT(SgWcharVal)
848 GEN_VISIT(SgWhereStatement)
849 GEN_VISIT(SgWhileStmt)
850 GEN_VISIT(SgWriteStatement)
851 GEN_VISIT(SgXorAssignOp)
852 GEN_VISIT(SgYieldExpression)
853 GEN_VISIT(Sg_File_Info)
854 GEN_VISIT(SgTypeCAFTeam)
855 GEN_VISIT(SgCAFWithTeamStatement)
856 GEN_VISIT(SgCAFCoExpression)
857 GEN_VISIT(SgCallExpression)
858 GEN_VISIT(SgTypeCrayPointer)
859 GEN_VISIT(SgJavaImportStatement)
860 GEN_VISIT(SgJavaPackageDeclaration)
861 GEN_VISIT(SgJavaPackageStatement)
864 GEN_VISIT(SgJavaMemberValuePair)
865 GEN_VISIT(SgJavaAnnotation)
866 GEN_VISIT(SgJavaMarkerAnnotation)
868 GEN_VISIT(SgJavaNormalAnnotation)
869 GEN_VISIT(SgJavaTypeExpression)
870 GEN_VISIT(SgJavaQualifiedType)
871 GEN_VISIT(SgClassExp)
872 GEN_VISIT(SgJavaUnionType)
873 GEN_VISIT(SgJavaParameterType)
874 GEN_VISIT(SgAsyncStmt)
875 GEN_VISIT(SgFinishStmt)
876 GEN_VISIT(SgAtStmt)
877 GEN_VISIT(SgAtomicStmt)
878// GEN_VISIT(SgClassPropertyList)
879 GEN_VISIT(SgWhenStmt)
880 GEN_VISIT(SgAtExp)
881 GEN_VISIT(SgFinishExp)
882 GEN_VISIT(SgHereExp)
883 GEN_VISIT(SgDotDotExp)
884 GEN_VISIT(SgAdaOthersExp)
885 GEN_VISIT(SgAdaUnitRefExp)
887 GEN_VISIT(SgAdaDiscriminatedType)
889 GEN_VISIT(SgAdaGenericSymbol)
890
891 GEN_VISIT(SgAdaProtectedBody)
892 GEN_VISIT(SgAdaProtectedBodyDecl)
893 GEN_VISIT(SgAdaProtectedSpec)
894 GEN_VISIT(SgAdaProtectedSpecDecl)
895 GEN_VISIT(SgAdaProtectedSymbol)
896 GEN_VISIT(SgAdaProtectedRefExp)
897 GEN_VISIT(SgAdaProtectedType)
898 GEN_VISIT(SgAdaProtectedTypeDecl)
899 GEN_VISIT(SgAdaDigitsConstraint)
900 GEN_VISIT(SgAdaAncestorInitializer)
901 GEN_VISIT(SgAdaDeltaConstraint)
902 GEN_VISIT(SgAdaSubroutineType)
904 GEN_VISIT(SgAdaFormalPackageDecl)
905 GEN_VISIT(SgAdaFormalPackageSymbol)
906 GEN_VISIT(SgAdaNullConstraint)
907 GEN_VISIT(SgAdaUnscopedBlock)
908 GEN_VISIT(SgAdaVariantDecl)
909 GEN_VISIT(SgAdaVariantWhenStmt)
910 GEN_VISIT(SgJovialLabelDeclaration)
911
912 GEN_VISIT(SgRangeType)
913
914#if WITH_BINARY_NODES
915 GEN_VISIT(SgAsmAarch64AtOperand)
916 GEN_VISIT(SgAsmAarch64BarrierOperand)
917 GEN_VISIT(SgAsmAarch64CImmediateOperand)
918 GEN_VISIT(SgAsmAarch64Instruction)
919 GEN_VISIT(SgAsmAarch64PrefetchOperand)
920 GEN_VISIT(SgAsmAarch64SysMoveOperand)
921 GEN_VISIT(SgAsmBasicString)
922 GEN_VISIT(SgAsmBinaryAdd)
923 GEN_VISIT(SgAsmBinaryAddPostupdate)
924 GEN_VISIT(SgAsmBinaryAddPreupdate)
925 GEN_VISIT(SgAsmBinaryAsr)
926 GEN_VISIT(SgAsmBinaryDivide)
927 GEN_VISIT(SgAsmBinaryExpression)
928 GEN_VISIT(SgAsmBinaryLsl)
929 GEN_VISIT(SgAsmBinaryLsr)
930 GEN_VISIT(SgAsmBinaryMod)
931 GEN_VISIT(SgAsmBinaryMsl)
932 GEN_VISIT(SgAsmBinaryMultiply)
933 GEN_VISIT(SgAsmBinaryRor)
934 GEN_VISIT(SgAsmBinarySubtract)
935 GEN_VISIT(SgAsmBinarySubtractPostupdate)
936 GEN_VISIT(SgAsmBinarySubtractPreupdate)
937 GEN_VISIT(SgAsmBlock)
938 GEN_VISIT(SgAsmCoffStrtab)
939 GEN_VISIT(SgAsmCoffSymbol)
940 GEN_VISIT(SgAsmCoffSymbolList)
941 GEN_VISIT(SgAsmCoffSymbolTable)
942 GEN_VISIT(SgAsmCommonSubExpression)
944 GEN_VISIT(SgAsmConstantExpression)
945 GEN_VISIT(SgAsmDOSExtendedHeader)
946 GEN_VISIT(SgAsmDOSFileHeader)
951 GEN_VISIT(SgAsmDwarfArrayType)
952 GEN_VISIT(SgAsmDwarfBaseType)
953 GEN_VISIT(SgAsmDwarfCatchBlock)
954 GEN_VISIT(SgAsmDwarfClassTemplate)
955 GEN_VISIT(SgAsmDwarfClassType)
956 GEN_VISIT(SgAsmDwarfCommonBlock)
960 GEN_VISIT(SgAsmDwarfCondition)
961 GEN_VISIT(SgAsmDwarfConstType)
962 GEN_VISIT(SgAsmDwarfConstant)
963 GEN_VISIT(SgAsmDwarfConstruct)
964 GEN_VISIT(SgAsmDwarfConstructList)
965 GEN_VISIT(SgAsmDwarfDwarfProcedure)
966 GEN_VISIT(SgAsmDwarfEntryPoint)
968 GEN_VISIT(SgAsmDwarfEnumerator)
969 GEN_VISIT(SgAsmDwarfFileType)
971 GEN_VISIT(SgAsmDwarfFormatLabel)
972 GEN_VISIT(SgAsmDwarfFriend)
975 GEN_VISIT(SgAsmDwarfImportedModule)
976 GEN_VISIT(SgAsmDwarfImportedUnit)
977 GEN_VISIT(SgAsmDwarfInformation)
978 GEN_VISIT(SgAsmDwarfInheritance)
980 GEN_VISIT(SgAsmDwarfInterfaceType)
981 GEN_VISIT(SgAsmDwarfLabel)
982 GEN_VISIT(SgAsmDwarfLexicalBlock)
983 GEN_VISIT(SgAsmDwarfLine)
984 GEN_VISIT(SgAsmDwarfLineList)
985 GEN_VISIT(SgAsmDwarfMacro)
986 GEN_VISIT(SgAsmDwarfMacroList)
987 GEN_VISIT(SgAsmDwarfMember)
988 GEN_VISIT(SgAsmDwarfModule)
989 GEN_VISIT(SgAsmDwarfMutableType)
990 GEN_VISIT(SgAsmDwarfNamelist)
991 GEN_VISIT(SgAsmDwarfNamelistItem)
992 GEN_VISIT(SgAsmDwarfNamespace)
993 GEN_VISIT(SgAsmDwarfPackedType)
994 GEN_VISIT(SgAsmDwarfPartialUnit)
995 GEN_VISIT(SgAsmDwarfPointerType)
997 GEN_VISIT(SgAsmDwarfReferenceType)
998 GEN_VISIT(SgAsmDwarfRestrictType)
999 GEN_VISIT(SgAsmDwarfSetType)
1000 GEN_VISIT(SgAsmDwarfSharedType)
1001 GEN_VISIT(SgAsmDwarfStringType)
1002 GEN_VISIT(SgAsmDwarfStructureType)
1003 GEN_VISIT(SgAsmDwarfSubprogram)
1004 GEN_VISIT(SgAsmDwarfSubrangeType)
1005 GEN_VISIT(SgAsmDwarfSubroutineType)
1008 GEN_VISIT(SgAsmDwarfThrownType)
1009 GEN_VISIT(SgAsmDwarfTryBlock)
1010 GEN_VISIT(SgAsmDwarfTypedef)
1011 GEN_VISIT(SgAsmDwarfUnionType)
1014 GEN_VISIT(SgAsmDwarfUnspecifiedType)
1015 GEN_VISIT(SgAsmDwarfUpcRelaxedType)
1016 GEN_VISIT(SgAsmDwarfUpcSharedType)
1017 GEN_VISIT(SgAsmDwarfUpcStrictType)
1018 GEN_VISIT(SgAsmDwarfVariable)
1019 GEN_VISIT(SgAsmDwarfVariant)
1020 GEN_VISIT(SgAsmDwarfVariantPart)
1021 GEN_VISIT(SgAsmDwarfVolatileType)
1022 GEN_VISIT(SgAsmDwarfWithStmt)
1023 GEN_VISIT(SgAsmElfDynamicEntry)
1024 GEN_VISIT(SgAsmElfDynamicEntryList)
1025 GEN_VISIT(SgAsmElfDynamicSection)
1026 GEN_VISIT(SgAsmElfEHFrameEntryCI)
1028 GEN_VISIT(SgAsmElfEHFrameEntryFD)
1030 GEN_VISIT(SgAsmElfEHFrameSection)
1031 GEN_VISIT(SgAsmElfFileHeader)
1032 GEN_VISIT(SgAsmElfNoteEntry)
1033 GEN_VISIT(SgAsmElfNoteEntryList)
1034 GEN_VISIT(SgAsmElfNoteSection)
1035 GEN_VISIT(SgAsmElfRelocEntry)
1036 GEN_VISIT(SgAsmElfRelocEntryList)
1037 GEN_VISIT(SgAsmElfRelocSection)
1038 GEN_VISIT(SgAsmElfSection)
1039 GEN_VISIT(SgAsmElfSectionTable)
1040 GEN_VISIT(SgAsmElfSectionTableEntry)
1041 GEN_VISIT(SgAsmElfSegmentTable)
1042 GEN_VISIT(SgAsmElfSegmentTableEntry)
1044 GEN_VISIT(SgAsmElfStringSection)
1045 GEN_VISIT(SgAsmElfStrtab)
1046 GEN_VISIT(SgAsmElfSymbol)
1047 GEN_VISIT(SgAsmElfSymbolList)
1048 GEN_VISIT(SgAsmElfSymbolSection)
1049 GEN_VISIT(SgAsmElfSymverDefinedAux)
1054 GEN_VISIT(SgAsmElfSymverEntry)
1055 GEN_VISIT(SgAsmElfSymverEntryList)
1056 GEN_VISIT(SgAsmElfSymverNeededAux)
1058 GEN_VISIT(SgAsmElfSymverNeededEntry)
1061 GEN_VISIT(SgAsmElfSymverSection)
1062 GEN_VISIT(SgAsmExecutableFileFormat)
1063 GEN_VISIT(SgAsmExprListExp)
1064 GEN_VISIT(SgAsmExpression)
1066 GEN_VISIT(SgAsmFloatType)
1067 GEN_VISIT(SgAsmFloatValueExpression)
1068 GEN_VISIT(SgAsmFunction)
1069 GEN_VISIT(SgAsmGenericDLL)
1070 GEN_VISIT(SgAsmGenericDLLList)
1071 GEN_VISIT(SgAsmGenericFile)
1072 GEN_VISIT(SgAsmGenericFileList)
1073 GEN_VISIT(SgAsmGenericFormat)
1074 GEN_VISIT(SgAsmGenericHeader)
1075 GEN_VISIT(SgAsmGenericHeaderList)
1076 GEN_VISIT(SgAsmGenericSection)
1077 GEN_VISIT(SgAsmGenericSectionList)
1078 GEN_VISIT(SgAsmGenericString)
1079 GEN_VISIT(SgAsmGenericStrtab)
1080 GEN_VISIT(SgAsmGenericSymbol)
1081 GEN_VISIT(SgAsmGenericSymbolList)
1083 GEN_VISIT(SgAsmInstruction)
1085 GEN_VISIT(SgAsmIntegerType)
1086 GEN_VISIT(SgAsmInterpretation)
1087 GEN_VISIT(SgAsmInterpretationList)
1088 GEN_VISIT(SgAsmLEEntryPoint)
1089 GEN_VISIT(SgAsmLEEntryTable)
1090 GEN_VISIT(SgAsmLEFileHeader)
1091 GEN_VISIT(SgAsmLENameTable)
1092 GEN_VISIT(SgAsmLEPageTable)
1093 GEN_VISIT(SgAsmLEPageTableEntry)
1094 GEN_VISIT(SgAsmLERelocTable)
1095 GEN_VISIT(SgAsmLESection)
1096 GEN_VISIT(SgAsmLESectionTable)
1097 GEN_VISIT(SgAsmLESectionTableEntry)
1098 GEN_VISIT(SgAsmM68kInstruction)
1100 GEN_VISIT(SgAsmMipsInstruction)
1101 GEN_VISIT(SgAsmNEEntryPoint)
1102 GEN_VISIT(SgAsmNEEntryTable)
1103 GEN_VISIT(SgAsmNEFileHeader)
1104 GEN_VISIT(SgAsmNEModuleTable)
1105 GEN_VISIT(SgAsmNENameTable)
1106 GEN_VISIT(SgAsmNERelocEntry)
1107 GEN_VISIT(SgAsmNERelocTable)
1108 GEN_VISIT(SgAsmNESection)
1109 GEN_VISIT(SgAsmNESectionTable)
1110 GEN_VISIT(SgAsmNESectionTableEntry)
1111 GEN_VISIT(SgAsmNEStringTable)
1112 GEN_VISIT(SgAsmNode)
1113 GEN_VISIT(SgAsmOp)
1114 GEN_VISIT(SgAsmOperandList)
1115 GEN_VISIT(SgAsmPEExportDirectory)
1116 GEN_VISIT(SgAsmPEExportEntry)
1117 GEN_VISIT(SgAsmPEExportEntryList)
1118 GEN_VISIT(SgAsmPEExportSection)
1119 GEN_VISIT(SgAsmPEFileHeader)
1120 GEN_VISIT(SgAsmPEImportDirectory)
1122 GEN_VISIT(SgAsmPEImportItem)
1123 GEN_VISIT(SgAsmPEImportItemList)
1124 GEN_VISIT(SgAsmPEImportSection)
1125 GEN_VISIT(SgAsmPERVASizePair)
1126 GEN_VISIT(SgAsmPERVASizePairList)
1127 GEN_VISIT(SgAsmPESection)
1128 GEN_VISIT(SgAsmPESectionTable)
1129 GEN_VISIT(SgAsmPESectionTableEntry)
1130 GEN_VISIT(SgAsmPEStringSection)
1131 GEN_VISIT(SgAsmPointerType)
1132 GEN_VISIT(SgAsmPowerpcInstruction)
1133 GEN_VISIT(SgAsmRegisterNames)
1135 GEN_VISIT(SgAsmRiscOperation)
1136 GEN_VISIT(SgAsmScalarType)
1137 GEN_VISIT(SgAsmStatement)
1138 GEN_VISIT(SgAsmStaticData)
1139 GEN_VISIT(SgAsmStmt)
1140 GEN_VISIT(SgAsmStoredString)
1141 GEN_VISIT(SgAsmStringStorage)
1142 GEN_VISIT(SgAsmType)
1143 GEN_VISIT(SgAsmUnaryExpression)
1144 GEN_VISIT(SgAsmUnaryMinus)
1145 GEN_VISIT(SgAsmUnaryPlus)
1146 GEN_VISIT(SgAsmUnaryRrx)
1147 GEN_VISIT(SgAsmUnarySignedExtend)
1148 GEN_VISIT(SgAsmUnaryUnsignedExtend)
1149 GEN_VISIT(SgAsmUnaryTruncate)
1150 GEN_VISIT(SgAsmValueExpression)
1151 GEN_VISIT(SgAsmVectorType)
1152 GEN_VISIT(SgAsmVoidType)
1153 GEN_VISIT(SgAsmX86Instruction)
1154 GEN_VISIT(SgAsmBinaryAddressSymbol)
1155 GEN_VISIT(SgAsmBinaryDataSymbol)
1156 GEN_VISIT(SgAsmNullInstruction)
1157
1158 GEN_VISIT(SgAsmJvmModuleMainClass)
1159 GEN_VISIT(SgAsmInstructionList)
1160 GEN_VISIT(SgAsmCilNode)
1161 GEN_VISIT(SgAsmCilAssembly)
1162 GEN_VISIT(SgAsmCilAssemblyOS)
1163 GEN_VISIT(SgAsmCilAssemblyProcessor)
1164 GEN_VISIT(SgAsmCilAssemblyRef)
1165 GEN_VISIT(SgAsmCilAssemblyRefOS)
1167 GEN_VISIT(SgAsmCilClassLayout)
1168 GEN_VISIT(SgAsmCilConstant)
1169 GEN_VISIT(SgAsmCilCustomAttribute)
1170 GEN_VISIT(SgAsmCilDeclSecurity)
1171 GEN_VISIT(SgAsmCilEvent)
1172 GEN_VISIT(SgAsmCilEventMap)
1173 GEN_VISIT(SgAsmCilExportedType)
1174 GEN_VISIT(SgAsmCilField)
1175 GEN_VISIT(SgAsmCilFieldLayout)
1176 GEN_VISIT(SgAsmCilFieldMarshal)
1177 GEN_VISIT(SgAsmCilFieldRVA)
1178 GEN_VISIT(SgAsmCilFile)
1179 GEN_VISIT(SgAsmCilGenericParam)
1181 GEN_VISIT(SgAsmCilImplMap)
1182 GEN_VISIT(SgAsmCilInterfaceImpl)
1183 GEN_VISIT(SgAsmCilManifestResource)
1184 GEN_VISIT(SgAsmCilMemberRef)
1185 GEN_VISIT(SgAsmCilMethodDef)
1186 GEN_VISIT(SgAsmCilMethodImpl)
1187 GEN_VISIT(SgAsmCilMethodSemantics)
1188 GEN_VISIT(SgAsmCilMethodSpec)
1189 GEN_VISIT(SgAsmCilModule)
1190 GEN_VISIT(SgAsmCilModuleRef)
1191 GEN_VISIT(SgAsmCilNestedClass)
1192 GEN_VISIT(SgAsmCilParam)
1193 GEN_VISIT(SgAsmCilProperty)
1194 GEN_VISIT(SgAsmCilPropertyMap)
1195 GEN_VISIT(SgAsmCilStandAloneSig)
1196 GEN_VISIT(SgAsmCilTypeDef)
1197 GEN_VISIT(SgAsmCilTypeRef)
1198 GEN_VISIT(SgAsmCilTypeSpec)
1199 GEN_VISIT(SgAdaParameterList)
1200 GEN_VISIT(SgAsmCilMetadata)
1201 GEN_VISIT(SgAsmCilMetadataRoot)
1202 GEN_VISIT(SgAsmCilDataStream)
1203 GEN_VISIT(SgAsmCilMetadataHeap)
1204 GEN_VISIT(SgAsmCilUint8Heap)
1205 GEN_VISIT(SgAsmCilUint32Heap)
1206 GEN_VISIT(SgAsmCliHeader)
1207
1212 GEN_VISIT(SgAsmUserInstruction)
1213 GEN_VISIT(SgAsmJvmMethodParameters)
1215 GEN_VISIT(SgAsmVoidType)
1216 GEN_VISIT(SgAsmPointerType)
1217
1218 // incomplete
1219#endif /* WITH_BINARY_NODES */
1220
1221/*
1222 GEN_VISIT(SgBinaryComposite)
1223 GEN_VISIT(SgComprehensionList)
1224 *
1225 GEN_VISIT(SgDirectedGraph)
1226 GEN_VISIT(SgDirectedGraphEdge)
1227 GEN_VISIT(SgDirectedGraphNode)
1228
1229 GEN_VISIT(SgUnknownMemberFunctionType)
1230*/
1231
1232 RoseVisitor rv;
1233 };
1234
1235#undef GEN_VISIT
1236
1237 template <class RoseVisitor>
1238 inline
1239 typename std::remove_const<typename std::remove_reference<RoseVisitor>::type>::type
1240 _dispatch(RoseVisitor&& rv, SgNode* n)
1241 {
1242 using RoseVisitorNoref = typename std::remove_reference<RoseVisitor>::type;
1243 using RoseHandler = typename std::remove_const<RoseVisitorNoref>::type;
1244
1245 ASSERT_not_null(n);
1246
1247 VisitDispatcher<RoseHandler> vis( std::forward<RoseVisitor>(rv),
1248 std::is_lvalue_reference<RoseVisitor>()
1249 );
1250
1251 n->accept(vis);
1252 return std::move(vis).rv;
1253 }
1254
1255
1311#if 0
1322#endif
1323
1324 template <class RoseVisitor>
1325 inline
1326 typename std::remove_const<typename std::remove_reference<RoseVisitor>::type>::type
1327 dispatch(RoseVisitor&& rv, SgNode* n)
1328 {
1329 //~ return std::move(rv);
1330 return _dispatch(std::forward<RoseVisitor>(rv), n);
1331 }
1332
1333 template <class RoseVisitor>
1334 inline
1335 typename std::remove_const<typename std::remove_reference<RoseVisitor>::type>::type
1336 dispatch(RoseVisitor&& rv, const SgNode* n)
1337 {
1338 //~ return std::move(rv);
1339 return _dispatch(std::forward<RoseVisitor>(rv), const_cast<SgNode*>(n));
1340 }
1341
1351 template <class SageNode>
1353 {
1354 void handle(SageNode&) {}
1355 };
1356
1364 template <class AncestorNode, class QualSgNode>
1365 struct AncestorTypeFinder : DefaultHandler<const SgProject>
1366 {
1368 typedef std::pair<AncestorNode*, QualSgNode*> Pair;
1369
1370 Pair res;
1371
1373 : Base(), res(NULL, NULL)
1374 {}
1375
1376 // handling of const SgProject is outsourced to DefaultHandler
1377 // thus, AncestorNode = const SgProject does not cause conflicts
1378 using Base::handle;
1379
1380 void handle(QualSgNode& n) { res.second = n.get_parent(); }
1381 void handle(AncestorNode& n) { res.first = &n; }
1382
1383 operator Pair() const { return res; }
1384 };
1385
1388 template <class AncestorNode, class QualSgNode>
1389 AncestorNode* _ancestor(QualSgNode& n)
1390 {
1391 using AncestorFinder = AncestorTypeFinder<AncestorNode, QualSgNode>;
1392
1393 typename AncestorFinder::Pair res(NULL, n.get_parent());
1394
1395 while (res.second != NULL)
1396 {
1397 res = (typename AncestorFinder::Pair) sg::dispatch(AncestorFinder(), res.second);
1398 }
1399
1400 return res.first;
1401 }
1402
1414 template <class AncestorNode>
1415 AncestorNode* ancestor(SgNode* n)
1416 {
1417 if (n == NULL) return NULL;
1418
1419 return _ancestor<AncestorNode>(*n);
1420 }
1421
1423 template <class AncestorNode>
1424 const AncestorNode* ancestor(const SgNode* n)
1425 {
1426 if (n == NULL) return NULL;
1427
1428 return _ancestor<const AncestorNode>(*n);
1429 }
1430
1432 template <class AncestorNode>
1433 AncestorNode& ancestor(SgNode& n)
1434 {
1435 AncestorNode* res = _ancestor<AncestorNode>(n);
1436
1437 ROSE_ASSERT(res);
1438 return *res;
1439 }
1440
1442 template <class AncestorNode>
1443 const AncestorNode& ancestor(const SgNode& n)
1444 {
1445 const AncestorNode* res = _ancestor<const AncestorNode>(n);
1446
1447 ROSE_ASSERT(res);
1448 return *res;
1449 }
1450
1451 namespace
1452 {
1454 template <class SageNode>
1455 struct TypeRecoveryHandler
1456 {
1457 typedef typename ConstLike<SageNode, SgNode>::type SgBaseNode;
1458
1459 TypeRecoveryHandler(const char* f = 0, size_t ln = 0)
1460 : res(NULL), loc(f), loc_ln(ln)
1461 {}
1462
1463 TypeRecoveryHandler(TypeRecoveryHandler&&) = default;
1464 TypeRecoveryHandler& operator=(TypeRecoveryHandler&&) = default;
1465
1466 operator SageNode* ()&& { return res; }
1467
1468 void handle(SgBaseNode& n) { unexpected_node(n, loc, loc_ln); }
1469 void handle(SageNode& n) { res = &n; }
1470
1471 private:
1472 SageNode* res;
1473 const char* loc;
1474 size_t loc_ln;
1475
1476 TypeRecoveryHandler() = delete;
1477 TypeRecoveryHandler(const TypeRecoveryHandler&) = delete;
1478 TypeRecoveryHandler& operator=(const TypeRecoveryHandler&) = delete;
1479 };
1480 }
1481
1482
1491 template <class SageNode>
1492 SageNode* assert_sage_type(SgNode* n, const char* f = 0, size_t ln = 0)
1493 {
1494 return sg::dispatch(TypeRecoveryHandler<SageNode>(f, ln), n);
1495 }
1496
1497 template <class SageNode>
1498 const SageNode* assert_sage_type(const SgNode* n, const char* f = 0, size_t ln = 0)
1499 {
1500 return sg::dispatch(TypeRecoveryHandler<const SageNode>(f, ln), n);
1501 }
1502
1503 template <class SageNode>
1504 SageNode& assert_sage_type(SgNode& n, const char* f = 0, size_t ln = 0)
1505 {
1506 return *sg::dispatch(TypeRecoveryHandler<SageNode>(f, ln), &n);
1507 }
1508
1509 template <class SageNode>
1510 const SageNode& assert_sage_type(const SgNode& n, const char* f = 0, size_t ln = 0)
1511 {
1512 return *sg::dispatch(TypeRecoveryHandler<const SageNode>(f, ln), &n);
1513 }
1515
1516 template <class SageNode>
1517 struct TypeRecovery : DispatchHandler<SageNode*>
1518 {
1519 void handle(SgNode&) { /* res = nullptr; */ }
1520 void handle(SageNode& n) { this->res = &n; }
1521 };
1522
1524 template <class SageNode>
1525 auto ancestor_path(const SgNode& n) -> SageNode*
1526 {
1528 }
1529
1531 template <class SageNode, class... SageNodes>
1532 auto ancestor_path(const SgNode& n) -> decltype(ancestor_path<SageNodes...>(n))
1533 {
1534 if (SageNode* parent = ancestor_path<SageNode>(n))
1535 return ancestor_path<SageNodes...>(*parent);
1536
1537 return nullptr;
1538 }
1539
1540
1543
1544 // base case
1545 template <class SageNode>
1546 auto ancestorPath(const SgNode& n) -> SageNode*
1547 {
1549 }
1550
1551 // general case
1552 template <class SageNode, class... SageNodes>
1553 auto ancestorPath(const SgNode& n) -> decltype(ancestorPath<SageNodes...>(n))
1554 {
1555 if (SageNode* parent = ancestorPath<SageNode>(n))
1556 return ancestorPath<SageNodes...>(*parent);
1557
1558 return nullptr;
1559 }
1561
1562
1565 static inline
1566 void swap_parent(SgNode* lhs, SgNode* rhs)
1567 {
1568 SgNode* tmp = lhs->get_parent();
1569
1570 lhs->set_parent(rhs->get_parent());
1571 rhs->set_parent(tmp);
1572 }
1573
1577 static inline
1578 void swap_parent(void*, void*) {}
1579
1587 template <class SageNode, class SageChild>
1588 void swap_child(SageNode& lhs, SageNode& rhs, SageChild* (SageNode::*getter) () const, void (SageNode::*setter) (SageChild*))
1589 {
1590 SageChild* lhs_child = (lhs.*getter)();
1591 SageChild* rhs_child = (rhs.*getter)();
1592 ROSE_ASSERT(lhs_child && rhs_child);
1593
1594 (lhs.*setter)(rhs_child);
1595 (rhs.*setter)(lhs_child);
1596
1597 swap_parent(lhs_child, rhs_child);
1598 }
1599
1600
1603 template <class SageNode>
1605 {
1606 typedef void (*TransformHandlerFn)(SageNode*);
1607
1608 explicit
1609 TraversalFunction(TransformHandlerFn fun)
1610 : fn(fun)
1611 {}
1612
1613 void handle(SgNode&) { /* ignore */ }
1614 void handle(SageNode& n) { fn(&n); }
1615
1616 TransformHandlerFn fn;
1617 };
1618
1621 template <class SageNode>
1622 static inline
1624 createTraversalFunction(void (* fn)(SageNode*))
1625 {
1626 return TraversalFunction<SageNode>(fn);
1627 }
1628
1629 //
1630 // function type extractor
1631 // see https://stackoverflow.com/questions/28033251/can-you-extract-types-from-template-parameter-function-signature
1632
1633
1634 template <class GVisitor>
1636 {
1637 explicit
1638 TraversalClass(GVisitor gv)
1639 : gvisitor(gv)
1640 //~ : gvisitor(std::move(gv))
1641 {}
1642
1643 void visit(SgNode* n)
1644 {
1645 gvisitor = sg::dispatch(gvisitor, n);
1646 }
1647
1648 // GVisitor&& visitor() { return std::move(gvisitor); }
1649 GVisitor visitor() { return gvisitor; }
1650
1651 GVisitor gvisitor;
1652 };
1653
1654
1655
1662 template <class F>
1663 static inline
1664 F
1665 forAllNodes(F fn, SgNode* root, AstSimpleProcessing::Order order = postorder)
1666 {
1667 ROSE_ASSERT(root);
1668
1669 TraversalClass<F> tt(fn);
1670 //~ TraversalClass<F> tt(std::move(fn));
1671
1672 tt.traverse(root, order);
1673 return tt.visitor();
1674 }
1675
1676 template <class SageNode>
1677 static inline
1678 void
1679 forAllNodes(void (*fn)(SageNode*), SgNode* root, AstSimpleProcessing::Order order = postorder)
1680 {
1681 forAllNodes(createTraversalFunction(fn), root, order);
1682 }
1683
1684#if !defined(NDEBUG)
1685 static inline
1686 std::string nodeType(const SgNode& n)
1687 {
1688 return typeid(n).name();
1689 }
1690
1691 static inline
1692 std::string nodeType(const SgNode* n)
1693 {
1694 if (n == NULL) return "<null>";
1695
1696 return nodeType(*n);
1697 }
1698#endif
1699
1700 template <class GVisitor>
1702 {
1703 explicit
1704 DispatchHelper(GVisitor gv, SgNode* p)
1705 : gvisitor(std::move(gv)), parent(p), cnt(0)
1706 {}
1707
1708 void operator()(SgNode* n)
1709 {
1710 ++cnt;
1711
1712#if 0
1713 if (n == NULL)
1714 {
1715 std::cerr << "succ(" << nodeType(parent) << ", " << cnt << ") is null" << std::endl;
1716 return;
1717 }
1718#endif
1719
1720 if (n != nullptr) gvisitor = sg::dispatch(std::move(gvisitor), n);
1721 }
1722
1723 operator GVisitor()&& { return std::move(gvisitor); }
1724
1725 GVisitor gvisitor;
1726 SgNode* parent;
1727 size_t cnt;
1728 };
1729
1730
1731 template <class GVisitor>
1732 static inline
1734 dispatchHelper(GVisitor gv, SgNode* parent = NULL)
1735 {
1736 return DispatchHelper<GVisitor>(std::move(gv), parent);
1737 }
1738
1739 template <class GVisitor>
1740 static inline
1741 GVisitor traverseChildren(GVisitor gv, SgNode& n)
1742 {
1743 std::vector<SgNode*> successors = n.get_traversalSuccessorContainer();
1744
1745 return std::for_each(successors.begin(), successors.end(), dispatchHelper(std::move(gv), &n));
1746 }
1747
1748 template <class GVisitor>
1749 static inline
1750 GVisitor traverseChildren(GVisitor gv, SgNode* n)
1751 {
1752 return traverseChildren(gv, sg::deref(n));
1753 }
1754
1755 template <class SageParent, class SageChild>
1756 void linkParentChild(SageParent& parent, SageChild& child, void (SageParent::*setter)(SageChild*))
1757 {
1758 (parent.*setter)(&child);
1759 child.set_parent(&parent);
1760 }
1761
1765 template <class SageNode>
1766 typename SageNode::base_node_type&
1767 asBaseType(SageNode& n) { return n; }
1768
1769 template <class SageNode>
1770 const typename SageNode::base_node_type&
1771 asBaseType(const SageNode& n) { return n; }
1772
1773 template <class SageNode>
1774 typename SageNode::base_node_type*
1775 asBaseType(SageNode* n) { return n; }
1776
1777 template <class SageNode>
1778 const typename SageNode::base_node_type*
1779 asBaseType(const SageNode* n) { return n; }
1781}
1782#endif /* _SAGEGENERIC_H */
Class for traversing the AST.
String associated with a binary file.
Expression that adds two operands.
Expression that performs an arithmetic, sign-bit preserving right shift.
Expression that divides the first operand by the second.
Base class for binary expressions.
Expression that performs a logical left shift operation.
Expression that performs a logical, sign-bit non-preserving right shift.
Expression that returns the remainder when dividing the first operand by the second.
Expression that performs a logical left shift operation filling low-order bits with one.
Expression that multiplies two operands.
Expression that performs a right rotate.
Expression that subtracts the second operand from the first.
Instruction basic block.
CIL AssemblyOS node (II.22.3).
CIL AssemblyProcessor node (II.22.4).
CIL AssemblyRefOS node (II.22.6).
CIL AssemblyRefProcessor node (II.22.7).
CIL AssemblyRef node (II.22.5).
CIL Assembly node (II.22.2).
CIL ClassLayout node (II.22.8).
CIL Constant node (II.22.9).
CIL CustomAttribute node (II.22.10).
Base class for CIL branch of binary analysis IR nodes.
CIL DeclSecurity node (II.22.11).
CIL EventMap node (II.22.12).
CIL Event node (II.22.13).
CIL ExportedType node (II.22.14).
CIL FieldLayout node (II.22.16).
CIL FieldMarshal node (II.22.17).
CIL FieldRVA node (II.22.18).
CIL Field node (II.22.15).
CIL File node (II.22.19).
CIL GenericParamConstraint node (II.22.21).
CIL GenericParam node (II.22.20).
CIL ImplMap node (II.22.22).
CIL InterfaceImpl node (II.22.23).
CIL ManifestResource node (II.22.24).
CIL MemberRef node (II.22.25).
CIL SgAsmCilMetadataHeap node.
CIL SgAsmCilMetadataRoot.
Base class for CIL branch of binary analysis IR nodes.
CIL MethodDef node (II.22.26).
CIL MethodImpl node (II.22.27).
CIL MethodSemantics node (II.22.28).
CIL MethodSpec node (II.22.29).
CIL ModuleRef node (II.22.31).
CIL Module node (II.22.30).
CIL NestedClass node (II.22.32).
Base class for CIL branch of binary analysis IR nodes.
CIL Param node (II.22.33).
CIL PropertyMap node (II.22.35).
CIL Property node (II.22.34).
CIL StandAloneSig node (II.22.36).
CIL TypeDef node (II.22.37).
CIL TypeRef node (II.22.38).
CIL TypeSpec node (II.22.39).
Base class for CIL branch of binary analysis IR nodes.
Base class for CIL branch of binary analysis IR nodes.
CIL Managed Code section.
COFF symbol string table.
List of COFF symbols.
Base class for constants.
Represents the file header for DOS executables.
Expression representing a machine register.
List of dynamic linking section entries.
One entry from the dynamic linking table.
ELF section containing dynamic linking information.
List of ELF EH frame CI entries.
ELF error handling frame entry, common information entry.
List of ELF error handling frame descriptor entries.
ELF error handling frame entry frame description entry.
Represents an ELF EH frame section.
Represents the file header of an ELF binary container.
Node to hold list of ELF note entries.
One entry of an ELF notes table.
List of ELF relocation entries.
One entry of an ELF relocation table.
Represents an ELF relocation section.
Represents one entry in an ELF section table.
Represents an ELF section table.
Base class for ELF file sections.
Represents one entry of a segment table.
Represents an ELF segment table.
ELF string table section.
ELF string table.
ELF file section containing symbols.
Represents a single ELF symbol.
List of symbol version aux entries.
Auxiliary data for an ELF Symbol Version.
List of entries for the ELF symbol version definition table.
One entry from an ELF symbol version definition table.
The GNU symbol version definitions.
List of entries from a symbol version table.
Entry in an ELF symbol version table.
Hods a list of symbol version aux entries.
Auxiliary info for needed symbol version.
List of symbol version needed entries.
One entry of the ELF symbol version needed table.
GNU symbol version requirements table.
The ELF symbol version table.
Base class for many binary analysis nodes.
List of expression nodes.
Base class for expressions.
Floating point types.
Represents a synthesized function.
List of pointers to other nodes.
Base class for dynamically linked library information.
List of AST file node pointers.
Base class for binary files.
Basic information about an executable container.
List of generic file headers.
Base class for container file headers.
List of pointers to file sections.
Contiguous region of a file.
Base class for strings related to binary specimens.
Base class for string tables.
Node to hold a list of symbol node pointers.
Registers accessed indirectly.
List of SgAsmInstruction nodes.
Base class for machine instructions.
Base class for integer values.
Represents an interpretation of a binary container.
JVM LocalVariableEntry.
JVM LocalVariableTable attribute.
JVM LocalVariableTypeEntry.
JVM LocalVariableTypeTable attribute.
JVM MethodParametersEntry.
JVM MethodParameters attribute.
JVM ModuleMainClass attribute.
Reference to memory locations.
Represents one MIPS machine instruction.
Base class for all binary analysis IR nodes.
List of operands for an instruction.
List of pointers to other AST nodes.
Export file section.
Windows PE file header.
A list of PE Import Directories.
One import directory per library.
A list of imported items.
A single imported object.
Portable Executable Import Section.
List of SgAsmPERVASizePair AST nodes.
Base class for PE sections.
Represents one PowerPC machine instruction.
An ordered list of registers.
Base class for references to a machine register.
Static representation of instruction semantics.
Base class for scalar types.
Base class for statement-like subclasses.
Represents static data in an executable.
This class represents the concept of a C Assembler statement.
Strings stored in an ELF or PE container.
Strings stored in an ELF or PE container.
Declaration-like nodes that encapsulate multiple instructions.
Base class for synthesized declarations.
Base class for binary types.
Base class for unary expressions.
Expression represting negation.
Expression representing a (no-op) unary plus operation.
Expression representing sign extending.
Expression representing truncation.
Expression representing unsigned extending.
Instructions defined at runtime.
Base class for values.
Base class for vector types.
A type that doesn't represent any data.
Represents one Intel x86 machine instruction.
This class represents the rhs of a variable declaration which includes an optional assignment (e....
This class represents the concept of a block (not a basic block from control flow analysis).
This class represents the notion of a binary operator. It is derived from a SgExpression because oper...
This class represents a boolean value (expression value).
This class represents the notion of a break statement (typically used in a switch statment).
This class represents the concept of a generic call expression.
This class represents the concept of a C and C++ case option (used within a switch statement).
This class represents a cast of one type to another.
This class represents the concept of a catch within a try-catch construct used in C++ exception handl...
This class represents the concept of a C++ sequence of catch statements.
This class represents the concept of a class declaration statement. It includes the concept of an ins...
This class represents the concept of a class definition in C++.
This class represents the concept of a C++ expression built from a class name.
This class represents the concept of a class name within the compiler.
This class represents the concept of a C style extern "C" declaration. But such information (linkage)...
This class represents the concept of a C trinary conditional expression (e.g. "test ?...
This class represents the call of a class constructor to initialize a variable. For example "Foo foo;...
This class represents the concept of a C or C++ continue statement.
This class represents the concept of a contructor initializer list (used in constructor (member funct...
This class represents modifiers for SgDeclaration (declaration statements).
This class represents the concept of a declaration statement.
This class represents the concept of a C or C++ default case within a switch statement.
This class represents the concept of a C++ call to the delete operator.
This class represents a directory within a projects file structure of files and directories.
This class represents the concept of a do-while statement.
This class represents the notion of an value (expression value).
This class represents the concept of an enum declaration.
This class represents the concept of the dynamic execution of a string, file, or code object....
This class represents the concept of a C and C++ expression list.
This class represents the concept of a C or C++ statement which contains a expression.
This class represents the notion of an expression. Expressions are derived from SgLocatedNodes,...
This class represents a source file for a project (which may contian many source files and or directo...
This class represents the notion of an value (expression value).
This class represents the variable declaration or variable initialization withn a for loop.
This class represents the concept of a for loop.
This class represents the concept of a C++ function call (which is an expression).
This class represents the concept of a function declaration statement.
This class represents the concept of a scope in C++ (e.g. global scope, fuction scope,...
This class represents the concept of a declaration list.
This class represents the function being called and must be assembled in the SgFunctionCall with the ...
This class represents the concept of a name and a type. It may be renamed in the future to SgTypeSymb...
This class represents the function type table (stores all function types so that they can be shared i...
This class represents a type for all functions.
This class represents the concept of a namespace definition.
This class represents the concept of a C or C++ goto statement.
This class represents the concept of an "if" construct.
This class represents the notion of a declared variable.
This class represents the notion of an initializer for a variable declaration or expression in a func...
This class represents the physical disequality (often called pointer disequality) operator for langua...
This class represents the physical equality (often called pointer equality) operator for languages th...
This class represents the concept of a C or C++ label statement.
This class represents a lambda expression.
This class represents a list display.
This class represents the notion of an expression or statement which has a position within the source...
This class represents the notion of an value (expression value).
This class represents the concept of a member function declaration statement.
This class represents the member function being called and must be assembled in the SgFunctionCall wi...
This class represents the numeric negation of a value. Not to be confused with SgSubtractOp.
This class is not used in ROSE, but is intended to represent a list of SgModifierTypes (similar to th...
This class represents the base class of a number of IR nodes define modifiers within the C++ grammar.
This class represents strings within the IR nodes.
This class represents the concept of a C++ namespace alias declaration statement.
This class represents the concept of a C++ namespace declaration.
This class represents the concept of a namespace definition.
This class represents the concept of a namespace name within the compiler.
This class represents the notion of an n-ary boolean operation. This node is intended for use with Py...
This class represents the notion of an n-ary comparison operation. This node is intended for use with...
This class represents the notion of an n-ary operator. This node is intended for use with Python.
This class represents the concept of a C++ call to the new operator.
This class represents the base class for all IR nodes within Sage III.
SgNode * get_parent() const
Access function for parent node.
void set_parent(SgNode *parent)
All nodes in the AST contain a reference to a parent node.
virtual std::vector< SgNode * > get_traversalSuccessorContainer()
container of pointers to AST successor nodes used in the traversal overridden in every class by gener...
virtual void accept(ROSE_VisitorPattern &visitor)
support for the classic visitor pattern done in GoF
This class represents an object used to initialize the unparsing.
This class represents a Fortran pointer assignment. It is not some weird compound assignment operator...
This class represents the concept of a C Assembler statement (untested).
This class represents a source project, with a list of SgFile objects and global information about th...
This class represents the concept of a 'global' stmt in Python.
This class represents a OLD concept of the structure require for qualified names when they were in th...
This class represents a OLD concept of the structure require for qualified names when they were in th...
This class represents the "&" operator (applied to any lvalue).
This class represents the concept of a C Assembler statement (untested).
This class was part of CC++ support from a long time ago.
This class represents the concept of a scope in C++ (e.g. global scope, fuction scope,...
This class represents the "sizeof()" operator (applied to any type).
This class is part of the older CC++ concept. It is not a part of C or C++ (this IR node is not used ...
This class represents the GNU extension "statement expression" (thus is non-standard C and C++).
This class represents the notion of a statement.
This class is intended to be a wrapper around SgStatements, allowing them to exist in scopes that onl...
This class represents modifiers specific to storage.
This class represents the conversion of an arbitrary expression to a string. This node is intended fo...
This class represents the base class of a numbr of IR nodes that don't otherwise fit into the existin...
This class represents the concept of a switch.
This class represents the symbol tables used in both SgScopeStatement and the SgFunctionTypeSymbolTab...
This class represents the concept of a name within the compiler.
This class represents template argument within the use of a template to build an instantiation.
This class represents the concept of a template declaration.
This class represents the concept of an instantiated class template.
This class represents the concept of a class definition in C++.
This class represents the concept of a C++ template instantiation directive.
This class represents the concept of an instantiation of function template.
This class represents the concept of an instantiation of member function template or a member functio...
This class represents the "this" operator (can be applied to any member data).
This class represents the C++ throw expression (handled as a unary operator).
This class represents the concept of try statement within the try-catch support for exception handlin...
This class represents a tuple display.
This class represents a C99 complex type.
This class represents a default type used for some IR nodes (see below).
This class represents a C99 complex type.
This class represents a string type used for SgStringVal IR node.
This class represents the base class for all types.
This class represents the notion of a typedef declaration.
This class represents a list of associated typedefs for the SgType IR nodes which reference this list...
This class represents the notion of a unary operator. It is derived from a SgExpression because opera...
This class represents the concept of a C++ using declaration.
This class represents the concept of a C++ using directive.
This class represents the notion of an value (expression value).
This class represents the variable refernece in expressions.
This class represents the concept of a C or C++ variable declaration.
This class represents the definition (initialization) of a variable.
This class represents the concept of a variable name within the compiler (a shared container for the ...
This class represents the concept of a do-while statement.
This class represents the location of the code associated with the IR node in the original source cod...
This namespace contains template functions that operate on the ROSE AST.
Definition sageGeneric.h:38
AncestorNode * _ancestor(QualSgNode &n)
implements the ancestor search
void swap_child(SageNode &lhs, SageNode &rhs, SageChild *(SageNode::*getter)() const, void(SageNode::*setter)(SageChild *))
swaps children (of equal kind) between two ancestor nodes of the same type
auto ancestor_path(const SgNode &n) -> SageNode *
std::remove_const< typenamestd::remove_reference< RoseVisitor >::type >::type dispatch(RoseVisitor &&rv, SgNode *n)
uncovers the type of SgNode and passes it to an function "handle" in RoseVisitor.
SageNode * assert_sage_type(SgNode *n, const char *f=0, size_t ln=0)
asserts that n has type SageNode
T & deref(T *ptr, const char *file=0, size_t ln=0)
dereferences an object (= checked dereference in debug mode)
Definition sageGeneric.h:99
AncestorNode * ancestor(SgNode *n)
finds an ancestor node with a given type
auto ancestorPath(const SgNode &n) -> SageNode *
returns the last parent in an ancestor path
SageNode::base_node_type & asBaseType(SageNode &n)
returns the same node n upcasted to its base type
helper class for _ancestor
projects the constness of T1 on T2
Definition sageGeneric.h:51
struct DefaultHandler
struct DispatchHandler
experimental class for returning non-null pointers
NotNull(NotNull< U > nn)
converting ctor for derived types and non-const versions of T
T * operator->() const
arrow operator returns pointer to object
T * pointer() const
explicit conversion operator
NotNull(T *p)
standard constructor testing that p is not nullptr
T & operator*() const
dereference operator returns reference to object
void visit(SgNode *n)
this method is called at every traversed node.
executes a functor for a specific node type