ROSE 0.11.145.141
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 <class U, class T, bool conv>
106 struct IfConvertible3 {}; // not convertible
107
108 template <class U, class T>
109 struct IfConvertible3<U,T,true> : std::true_type // convertible
110 {};
111
112 template <class U, class T>
113 struct IsConvertible : IfConvertible3<U, T, !std::is_same<U,T>::value && std::is_convertible<U,T>::value>
114 {};
115
117 template <class T>
118 struct NotNull
119 {
120 // not explicit to enable auto-conversion
121 NotNull(T* p)
122 : ptr(p)
123 {
124 if (ptr == nullptr)
125 throw std::runtime_error{"failed null pointer check."};
126 }
127
128 ~NotNull() = default;
129 NotNull(const NotNull&) = default;
130 NotNull& operator=(const NotNull&) = default;
131
132 // when U is a derived type, or a non-const version of T
133 template <class U, bool conv = IsConvertible<U*,T*>::value>
135 : ptr(nn.ptr)
136 {}
137
139 T& operator*() const { return *ptr; }
140
142 T* operator->() const { return ptr; }
143
145 operator T*() const { return ptr; }
146
148 T* pointer() const { return ptr; }
149
150 private:
151 T* ptr; // must be initialized in ctors
152
153 // no default construction
154 NotNull() = delete;
155
156 // NEITHER delete NOR define move ctor/assignment,
157 // to make the compiler use the copy-versions.
158 // NotNull(NotNull&&) = delete;
159 // NotNull& operator(NotNull&&) = delete;
160 };
161
162
163
174 template <class _ReturnType>
176 {
177 typedef _ReturnType ReturnType;
179
181 : res()
182 {}
183
184 explicit
185 DispatchHandler(const ReturnType& defaultval)
186 : res(defaultval)
187 {}
188
189 operator ReturnType() const { return res; }
190
191 protected:
192 ReturnType res;
193 };
194
195
196 //
197 // Sage query functions
198
200 template <class SageNode>
201 static inline
202 SageNode& assume_sage_type(SgNode& n)
203 {
204 return static_cast<SageNode&>(n);
205 }
206
209 template <class SageNode>
210 static inline
211 const SageNode& assume_sage_type(const SgNode& n)
212 {
213 return static_cast<const SageNode&>(n);
214 }
215
216#define GEN_VISIT(X) \
217 void visit(X * n) { rv.handle(*n); }
218
219 template <class RoseVisitor>
221 {
222 // rvalue ctor
223 VisitDispatcher(RoseVisitor&& rosevisitor, std::false_type)
224 : rv(std::move(rosevisitor))
225 {}
226
227 // lvalue ctor
228 VisitDispatcher(const RoseVisitor& rosevisitor, std::true_type)
229 : rv(rosevisitor)
230 {}
231
232 GEN_VISIT(SgAccessModifier)
234 GEN_VISIT(SgAbsOp)
235 GEN_VISIT(SgAdaAccessType)
236 GEN_VISIT(SgAdaAcceptStmt)
237 GEN_VISIT(SgAdaComponentClause)
238 GEN_VISIT(SgAdaDelayStmt)
239 GEN_VISIT(SgAdaEntryDecl)
240 GEN_VISIT(SgAdaExitStmt)
241 GEN_VISIT(SgAdaDiscreteType)
242 GEN_VISIT(SgAdaFloatVal)
243 GEN_VISIT(SgAdaFormalType)
244 GEN_VISIT(SgAdaFormalTypeDecl)
246 GEN_VISIT(SgAdaGenericDecl)
247 GEN_VISIT(SgAdaGenericInstanceDecl)
248 GEN_VISIT(SgAdaGenericDefn)
249 GEN_VISIT(SgAdaIndexConstraint)
250 GEN_VISIT(SgAdaAttributeClause)
251 GEN_VISIT(SgAdaLoopStmt)
252 GEN_VISIT(SgAdaModularType)
253 GEN_VISIT(SgAdaPackageBody)
254 GEN_VISIT(SgAdaPackageBodyDecl)
255 GEN_VISIT(SgAdaPackageSpec)
256 GEN_VISIT(SgAdaPackageSpecDecl)
257 GEN_VISIT(SgAdaPackageSymbol)
258 GEN_VISIT(SgAdaRangeConstraint)
261 GEN_VISIT(SgAdaRenamingDecl)
262 GEN_VISIT(SgAdaSelectStmt)
264 GEN_VISIT(SgAdaSubtype)
265 GEN_VISIT(SgAdaDerivedType)
266 GEN_VISIT(SgAdaAttributeExp)
267 GEN_VISIT(SgAdaTaskBody)
268 GEN_VISIT(SgAdaTaskBodyDecl)
269 GEN_VISIT(SgAdaTaskSpec)
270 GEN_VISIT(SgAdaTaskSpecDecl)
271 GEN_VISIT(SgAdaTaskSymbol)
272 GEN_VISIT(SgAdaRenamingSymbol)
273 GEN_VISIT(SgAdaTaskRefExp)
274 GEN_VISIT(SgAdaRenamingRefExp)
275 GEN_VISIT(SgAdaTaskType)
276 GEN_VISIT(SgAdaTaskTypeDecl)
277 GEN_VISIT(SgAdaTerminateStmt)
278 GEN_VISIT(SgAdaTypeConstraint)
279 GEN_VISIT(SgAddOp)
280 GEN_VISIT(SgAddressOfOp)
281 GEN_VISIT(SgAggregateInitializer)
282 GEN_VISIT(SgAliasSymbol)
283 GEN_VISIT(SgAllocateStatement)
284 GEN_VISIT(SgAndAssignOp)
285 GEN_VISIT(SgAndOp)
286 GEN_VISIT(SgArithmeticIfStatement)
287 GEN_VISIT(SgArrayType)
288 GEN_VISIT(SgArrowExp)
289 GEN_VISIT(SgArrowStarOp)
290 GEN_VISIT(SgAssertStmt)
291 GEN_VISIT(SgAssignInitializer)
292 GEN_VISIT(SgAssignOp)
293 GEN_VISIT(SgAssignStatement)
294 GEN_VISIT(SgAssignedGotoStatement)
295 GEN_VISIT(SgAssociateStatement)
296 GEN_VISIT(SgAsteriskShapeExp)
297 GEN_VISIT(SgAtOp)
298 GEN_VISIT(SgAttribute)
300 GEN_VISIT(SgAutoType)
301 GEN_VISIT(SgAwaitExpression)
302 GEN_VISIT(SgBackspaceStatement)
303 GEN_VISIT(SgBaseClass)
304 GEN_VISIT(SgExpBaseClass)
305 GEN_VISIT(SgBaseClassModifier)
306 GEN_VISIT(SgBasicBlock)
307 GEN_VISIT(SgBidirectionalGraph)
308 GEN_VISIT(SgBinaryOp)
309 GEN_VISIT(SgBitAndOp)
310 GEN_VISIT(SgBitAttribute)
311 GEN_VISIT(SgBitComplementOp)
312 GEN_VISIT(SgBitEqvOp)
313 GEN_VISIT(SgBitOrOp)
314 GEN_VISIT(SgBitXorOp)
315 GEN_VISIT(SgBlockDataStatement)
316 GEN_VISIT(SgBoolValExp)
317 GEN_VISIT(SgBreakStmt)
318 GEN_VISIT(SgBracedInitializer)
320 GEN_VISIT(SgCaseOptionStmt)
321 GEN_VISIT(SgCastExp)
322 GEN_VISIT(SgCatchOptionStmt)
323 GEN_VISIT(SgCatchStatementSeq)
324 GEN_VISIT(SgCharVal)
325 GEN_VISIT(SgChar16Val)
326 GEN_VISIT(SgChar32Val)
327 GEN_VISIT(SgChooseExpression)
328 GEN_VISIT(SgClassDecl_attr)
329 GEN_VISIT(SgClassDeclaration)
330 GEN_VISIT(SgClassDefinition)
331 GEN_VISIT(SgClassNameRefExp)
332 GEN_VISIT(SgClassSymbol)
333 GEN_VISIT(SgClassType)
335 GEN_VISIT(SgClinkageEndStatement)
336 GEN_VISIT(SgClinkageStartStatement)
337 GEN_VISIT(SgCloseStatement)
338 GEN_VISIT(SgColonShapeExp)
339 GEN_VISIT(SgCommaOpExp)
340 GEN_VISIT(SgCommonBlock)
341 GEN_VISIT(SgCommonBlockObject)
342 GEN_VISIT(SgCommonSymbol)
343 GEN_VISIT(SgComplexVal)
344 GEN_VISIT(SgComprehension)
345 GEN_VISIT(SgCompoundAssignOp)
346 GEN_VISIT(SgCompoundInitializer)
347 GEN_VISIT(SgCompoundLiteralExp)
348 GEN_VISIT(SgComputedGotoStatement)
349 GEN_VISIT(SgConcatenationOp)
350 GEN_VISIT(SgConditionalExp)
351 GEN_VISIT(SgConjugateOp)
352 GEN_VISIT(SgConstVolatileModifier)
353 GEN_VISIT(SgConstructorInitializer)
354 GEN_VISIT(SgContainsStatement)
355 GEN_VISIT(SgContinueStmt)
356 GEN_VISIT(SgCtorInitializerList)
357 GEN_VISIT(SgDataStatementGroup)
358 GEN_VISIT(SgDataStatementObject)
359 GEN_VISIT(SgDataStatementValue)
361 GEN_VISIT(SgDeallocateStatement)
362 GEN_VISIT(SgDeclarationModifier)
363 GEN_VISIT(SgDeclarationScope)
364 GEN_VISIT(SgDeclarationStatement)
365 GEN_VISIT(SgDeclType)
366 GEN_VISIT(SgDefaultOptionStmt)
367 GEN_VISIT(SgDefaultSymbol)
369 GEN_VISIT(SgDeleteExp)
370 GEN_VISIT(SgDerivedTypeStatement)
371 GEN_VISIT(SgDesignatedInitializer)
373 GEN_VISIT(SgDictionaryExp)
374 GEN_VISIT(SgDimensionObject)
375 GEN_VISIT(SgDirectory)
376 GEN_VISIT(SgDirectoryList)
377 GEN_VISIT(SgDivAssignOp)
378 GEN_VISIT(SgDivideOp)
379 GEN_VISIT(SgDoWhileStmt)
380 GEN_VISIT(SgDotExp)
381 GEN_VISIT(SgDotStarOp)
382 GEN_VISIT(SgDoubleVal)
383 GEN_VISIT(SgElaboratedTypeModifier)
384 GEN_VISIT(SgElementwiseOp)
385 GEN_VISIT(SgElementwiseAddOp)
386 GEN_VISIT(SgElementwiseDivideOp)
388 GEN_VISIT(SgElementwiseMultiplyOp)
389 GEN_VISIT(SgElementwisePowerOp)
390 GEN_VISIT(SgElementwiseSubtractOp)
391 GEN_VISIT(SgElseDirectiveStatement)
392 GEN_VISIT(SgElseWhereStatement)
394 GEN_VISIT(SgEmptyDeclaration)
396 GEN_VISIT(SgEndfileStatement)
398 GEN_VISIT(SgEntryStatement)
399 GEN_VISIT(SgEnumDeclaration)
400 GEN_VISIT(SgEnumFieldSymbol)
401 GEN_VISIT(SgEnumSymbol)
402 GEN_VISIT(SgEnumType)
403 GEN_VISIT(SgEnumVal)
404 GEN_VISIT(SgEqualityOp)
405 GEN_VISIT(SgEquivalenceStatement)
407 GEN_VISIT(SgExecStatement)
408 GEN_VISIT(SgExponentiationOp)
409 GEN_VISIT(SgExponentiationAssignOp)
410 GEN_VISIT(SgExprListExp)
411 GEN_VISIT(SgExprStatement)
412 GEN_VISIT(SgExpression)
413 GEN_VISIT(SgExpressionRoot)
414 GEN_VISIT(SgFile)
415 GEN_VISIT(SgFileList)
416 GEN_VISIT(SgFloatVal)
417 GEN_VISIT(SgFloat128Val)
418 GEN_VISIT(SgFloat80Val)
419 GEN_VISIT(SgFoldExpression)
420 GEN_VISIT(SgFlushStatement)
421 GEN_VISIT(SgForAllStatement)
422 GEN_VISIT(SgForInitStatement)
423 GEN_VISIT(SgForStatement)
424 GEN_VISIT(SgFormatItem)
425 GEN_VISIT(SgFormatItemList)
426 GEN_VISIT(SgFormatStatement)
427 GEN_VISIT(SgFortranDo)
428 GEN_VISIT(SgFortranIncludeLine)
429 GEN_VISIT(SgFortranNonblockedDo)
430 GEN_VISIT(SgFuncDecl_attr)
431 GEN_VISIT(SgFunctionCallExp)
432 GEN_VISIT(SgFunctionDeclaration)
433 GEN_VISIT(SgFunctionDefinition)
434 GEN_VISIT(SgFunctionParameterScope)
435 GEN_VISIT(SgFunctionModifier)
436 GEN_VISIT(SgFunctionParameterList)
439 GEN_VISIT(SgFunctionRefExp)
440 GEN_VISIT(SgFunctionSymbol)
441 GEN_VISIT(SgFunctionType)
442 GEN_VISIT(SgFunctionTypeSymbol)
443 GEN_VISIT(SgFunctionTypeTable)
444 GEN_VISIT(SgTypeTable)
445 GEN_VISIT(SgGlobal)
446 GEN_VISIT(SgGotoStatement)
447 GEN_VISIT(SgGraph)
448 GEN_VISIT(SgGraphEdge)
449 GEN_VISIT(SgGraphEdgeList)
450 GEN_VISIT(SgGraphNode)
451 GEN_VISIT(SgGraphNodeList)
452 GEN_VISIT(SgGreaterOrEqualOp)
453 GEN_VISIT(SgGreaterThanOp)
454 GEN_VISIT(SgIOItemExpression)
455 GEN_VISIT(SgIOStatement)
457 GEN_VISIT(SgIfDirectiveStatement)
458 GEN_VISIT(SgIfStmt)
461 GEN_VISIT(SgImageControlStatement)
462 GEN_VISIT(SgImagPartOp)
463 GEN_VISIT(SgImplicitStatement)
464 GEN_VISIT(SgImpliedDo)
465 GEN_VISIT(SgImportStatement)
466 GEN_VISIT(SgIncidenceDirectedGraph)
469 GEN_VISIT(SgIncludeFile)
471 GEN_VISIT(SgInitializedName)
472 GEN_VISIT(SgInitializer)
473 GEN_VISIT(SgInquireStatement)
475 GEN_VISIT(SgIntVal)
476 GEN_VISIT(SgIntegerDivideOp)
477 GEN_VISIT(SgIntegerDivideAssignOp)
478 GEN_VISIT(SgInterfaceBody)
479 GEN_VISIT(SgHeaderFileBody)
480 GEN_VISIT(SgHeaderFileReport)
481 GEN_VISIT(SgInterfaceStatement)
482 GEN_VISIT(SgInterfaceSymbol)
483 GEN_VISIT(SgIntrinsicSymbol)
484 GEN_VISIT(SgIsOp)
485 GEN_VISIT(SgIsNotOp)
486 GEN_VISIT(SgIorAssignOp)
487 GEN_VISIT(SgJovialBitType)
488 GEN_VISIT(SgJovialBitVal)
489 GEN_VISIT(SgJovialTableType)
490 GEN_VISIT(SgJovialCompoolStatement)
491 GEN_VISIT(SgJovialForThenStatement)
495 GEN_VISIT(SgJovialTablePresetExp)
496 GEN_VISIT(SgJovialTableStatement)
497 GEN_VISIT(SgKeyDatumPair)
498 GEN_VISIT(SgCudaKernelExecConfig)
499 GEN_VISIT(SgCudaKernelCallExp)
500 GEN_VISIT(SgLabelRefExp)
501 GEN_VISIT(SgLabelStatement)
502 GEN_VISIT(SgJavaLabelStatement)
503 GEN_VISIT(SgLabelSymbol)
504 GEN_VISIT(SgJavaLabelSymbol)
505 GEN_VISIT(SgLambdaCapture)
506 GEN_VISIT(SgLambdaCaptureList)
507 GEN_VISIT(SgLambdaExp)
508 GEN_VISIT(SgLambdaRefExp)
509 GEN_VISIT(SgLeftDivideOp)
510 GEN_VISIT(SgLessOrEqualOp)
511 GEN_VISIT(SgLessThanOp)
512 GEN_VISIT(SgLineDirectiveStatement)
514 GEN_VISIT(SgLinkageModifier)
515 GEN_VISIT(SgListComprehension)
516 GEN_VISIT(SgListExp)
517 GEN_VISIT(SgLocatedNode)
518 GEN_VISIT(SgLocatedNodeSupport)
519 GEN_VISIT(SgLongDoubleVal)
520 GEN_VISIT(SgLongIntVal)
521 GEN_VISIT(SgLongLongIntVal)
522 GEN_VISIT(SgLshiftAssignOp)
523 GEN_VISIT(SgLshiftOp)
524 GEN_VISIT(SgMagicColonExp)
525 GEN_VISIT(SgMatrixExp)
526 GEN_VISIT(SgMatrixTransposeOp)
527 GEN_VISIT(SgMatlabForStatement)
529 GEN_VISIT(SgMemberFunctionRefExp)
530 GEN_VISIT(SgMemberFunctionSymbol)
531 GEN_VISIT(SgMemberFunctionType)
532 GEN_VISIT(SgMembershipOp)
534 GEN_VISIT(SgMinusAssignOp)
535 GEN_VISIT(SgMinusMinusOp)
536 GEN_VISIT(SgMinusOp)
537 GEN_VISIT(SgModAssignOp)
538 GEN_VISIT(SgModOp)
539 GEN_VISIT(SgModifier)
540 GEN_VISIT(SgModifierNodes)
541 GEN_VISIT(SgModifierType)
542 GEN_VISIT(SgModuleStatement)
543 GEN_VISIT(SgModuleSymbol)
544 GEN_VISIT(SgMultAssignOp)
545 GEN_VISIT(SgMultiplyOp)
546 GEN_VISIT(SgName)
547 GEN_VISIT(SgNameGroup)
548 GEN_VISIT(SgNamedType)
549 GEN_VISIT(SgNamelistStatement)
553 GEN_VISIT(SgNamespaceSymbol)
554 GEN_VISIT(SgNaryOp)
555 GEN_VISIT(SgNaryBooleanOp)
556 GEN_VISIT(SgNaryComparisonOp)
557 GEN_VISIT(SgNewExp)
558 GEN_VISIT(SgNode)
559 GEN_VISIT(SgNoexceptOp)
560 GEN_VISIT(SgNotEqualOp)
561 GEN_VISIT(SgNotOp)
562 GEN_VISIT(SgNonMembershipOp)
563 GEN_VISIT(SgNonrealDecl)
564 GEN_VISIT(SgNonrealRefExp)
565 GEN_VISIT(SgNonrealSymbol)
566 GEN_VISIT(SgNonrealType)
567 GEN_VISIT(SgNonrealBaseClass)
568 GEN_VISIT(SgNullExpression)
569 GEN_VISIT(SgNullptrValExp)
570 GEN_VISIT(SgNullStatement)
571 GEN_VISIT(SgNullifyStatement)
572 GEN_VISIT(SgOmpAtomicStatement)
573 GEN_VISIT(SgOmpBarrierStatement)
574 GEN_VISIT(SgOmpCriticalStatement)
575 GEN_VISIT(SgOmpClauseBodyStatement)
576 GEN_VISIT(SgOmpBodyStatement)
577 GEN_VISIT(SgOmpDoStatement)
578 GEN_VISIT(SgOmpFlushStatement)
580 GEN_VISIT(SgOmpForStatement)
581 GEN_VISIT(SgOmpForSimdStatement)
582 GEN_VISIT(SgOmpMasterStatement)
583 GEN_VISIT(SgOmpOrderedStatement)
584 GEN_VISIT(SgOmpParallelStatement)
585 GEN_VISIT(SgOmpSectionStatement)
586 GEN_VISIT(SgOmpSectionsStatement)
587 GEN_VISIT(SgOmpSingleStatement)
588 GEN_VISIT(SgOmpTaskStatement)
589 GEN_VISIT(SgOmpTaskwaitStatement)
591 GEN_VISIT(SgOmpWorkshareStatement)
592 GEN_VISIT(SgOmpTargetStatement)
593 GEN_VISIT(SgOmpTargetDataStatement)
594 GEN_VISIT(SgOmpSimdStatement)
595 GEN_VISIT(SgOmpClause)
596 GEN_VISIT(SgOmpBeginClause)
597 GEN_VISIT(SgOmpCollapseClause)
598 GEN_VISIT(SgOmpCopyinClause)
599 GEN_VISIT(SgOmpCopyprivateClause)
600 GEN_VISIT(SgOmpDefaultClause)
601 GEN_VISIT(SgOmpEndClause)
602 GEN_VISIT(SgOmpExpressionClause)
603 GEN_VISIT(SgOmpFirstprivateClause)
604 GEN_VISIT(SgOmpIfClause)
605 GEN_VISIT(SgOmpFinalClause)
606 GEN_VISIT(SgOmpPriorityClause)
607 GEN_VISIT(SgOmpDeviceClause)
608 GEN_VISIT(SgOmpLastprivateClause)
609 GEN_VISIT(SgOmpNowaitClause)
610 GEN_VISIT(SgOmpNumThreadsClause)
611 GEN_VISIT(SgOmpOrderedClause)
612 GEN_VISIT(SgOmpPrivateClause)
613 GEN_VISIT(SgOmpReductionClause)
614 GEN_VISIT(SgOmpScheduleClause)
615 GEN_VISIT(SgOmpSharedClause)
616 GEN_VISIT(SgOmpUntiedClause)
617 GEN_VISIT(SgOmpMergeableClause)
618 GEN_VISIT(SgOmpVariablesClause)
619 GEN_VISIT(SgOmpMapClause)
620 GEN_VISIT(SgOmpSafelenClause)
621 GEN_VISIT(SgOmpSimdlenClause)
622 GEN_VISIT(SgOmpLinearClause)
623 GEN_VISIT(SgOmpUniformClause)
624 GEN_VISIT(SgOmpAlignedClause)
625 GEN_VISIT(SgOmpProcBindClause)
626 GEN_VISIT(SgOmpAtomicClause)
627 GEN_VISIT(SgOmpInbranchClause)
628 GEN_VISIT(SgOmpNotinbranchClause)
629 GEN_VISIT(SgOmpDependClause)
631 GEN_VISIT(SgOpenStatement)
632 GEN_VISIT(SgOptions)
633 GEN_VISIT(SgOrOp)
634 GEN_VISIT(SgParameterStatement)
636 GEN_VISIT(SgPartialFunctionType)
637 GEN_VISIT(SgPassStatement)
638 GEN_VISIT(SgPlusAssignOp)
639 GEN_VISIT(SgPlusPlusOp)
640 GEN_VISIT(SgPntrArrRefExp)
641 GEN_VISIT(SgPointerAssignOp)
642 GEN_VISIT(SgPointerDerefExp)
643 GEN_VISIT(SgPointerMemberType)
644 GEN_VISIT(SgPointerType)
645 GEN_VISIT(SgPowerOp)
646 GEN_VISIT(SgPragma)
647 GEN_VISIT(SgPragmaDeclaration)
648 GEN_VISIT(SgPrintStatement)
650 GEN_VISIT(SgProgramHeaderStatement)
651 GEN_VISIT(SgProject)
652 GEN_VISIT(SgPseudoDestructorRefExp)
653 GEN_VISIT(SgPythonGlobalStmt)
654 GEN_VISIT(SgPythonPrintStmt)
655 GEN_VISIT(SgQualifiedName)
656 GEN_VISIT(SgQualifiedNameType)
657 GEN_VISIT(SgRangeExp)
658 GEN_VISIT(SgRangeBasedForStatement)
659 GEN_VISIT(SgReadStatement)
660 GEN_VISIT(SgRealPartOp)
661 GEN_VISIT(SgRefExp)
662 GEN_VISIT(SgReferenceType)
663 GEN_VISIT(SgRemOp)
664 GEN_VISIT(SgRenamePair)
665 GEN_VISIT(SgRenameSymbol)
666 GEN_VISIT(SgReplicationOp)
667 GEN_VISIT(SgReturnStmt)
668 GEN_VISIT(SgRewindStatement)
669 GEN_VISIT(SgRshiftAssignOp)
670 GEN_VISIT(SgRshiftOp)
671 GEN_VISIT(SgRvalueReferenceType)
673 GEN_VISIT(SgJavaUnsignedRshiftOp)
674 GEN_VISIT(SgScopeOp)
675 GEN_VISIT(SgScopeStatement)
676 GEN_VISIT(SgSequenceStatement)
677 GEN_VISIT(SgSetComprehension)
678 GEN_VISIT(SgShortVal)
679 GEN_VISIT(SgSizeOfOp)
680 GEN_VISIT(SgAlignOfOp)
681 GEN_VISIT(SgJavaInstanceOfOp)
682 GEN_VISIT(SgSourceFile)
683 GEN_VISIT(SgSpaceshipOp)
684 GEN_VISIT(SgSpawnStmt)
685 GEN_VISIT(SgSyncAllStatement)
686 GEN_VISIT(SgSyncImagesStatement)
687 GEN_VISIT(SgSyncMemoryStatement)
688 GEN_VISIT(SgSyncTeamStatement)
689 GEN_VISIT(SgLockStatement)
690 GEN_VISIT(SgUnlockStatement)
691 GEN_VISIT(SgJavaThrowStatement)
692 GEN_VISIT(SgJavaForEachStatement)
694 GEN_VISIT(SgJavaParameterizedType)
695 GEN_VISIT(SgJavaWildcardType)
698 GEN_VISIT(SgStatement)
701 GEN_VISIT(SgStatementExpression)
703 GEN_VISIT(SgStorageModifier)
704 GEN_VISIT(SgStringConversion)
706 GEN_VISIT(SgStringVal)
707 GEN_VISIT(SgStructureModifier)
708 GEN_VISIT(SgSubscriptExpression)
709 GEN_VISIT(SgSubtractOp)
710 GEN_VISIT(SgSupport)
711 GEN_VISIT(SgSwitchStatement)
712 GEN_VISIT(SgSymbol)
713 GEN_VISIT(SgSymbolTable)
714 GEN_VISIT(SgTemplateArgument)
715 GEN_VISIT(SgTemplateArgumentList)
716 GEN_VISIT(SgTemplateDeclaration)
718 GEN_VISIT(SgTemplateClassSymbol)
720 GEN_VISIT(SgTemplateFunctionRefExp)
721 GEN_VISIT(SgTemplateFunctionSymbol)
726 GEN_VISIT(SgTemplateTypedefSymbol)
728 GEN_VISIT(SgTemplateVariableSymbol)
737 GEN_VISIT(SgTemplateParameter)
738 GEN_VISIT(SgTemplateParameterVal)
739 GEN_VISIT(SgTemplateParameterList)
740 GEN_VISIT(SgTemplateSymbol)
741 GEN_VISIT(SgTemplateType)
742 GEN_VISIT(SgThisExp)
744 GEN_VISIT(SgSuperExp)
745 GEN_VISIT(SgThrowOp)
746 GEN_VISIT(SgToken)
747 GEN_VISIT(SgTryStmt)
748 GEN_VISIT(SgTupleExp)
749 GEN_VISIT(SgType)
750 GEN_VISIT(SgTypeBool)
751 GEN_VISIT(SgTypeChar)
752 GEN_VISIT(SgTypeChar16)
753 GEN_VISIT(SgTypeChar32)
754 GEN_VISIT(SgTypeComplex)
755 GEN_VISIT(SgTypeDefault)
756 GEN_VISIT(SgTypeExpression)
757 GEN_VISIT(SgTypeLabel)
758 GEN_VISIT(SgTypeDouble)
759 GEN_VISIT(SgTypeEllipse)
760 GEN_VISIT(SgTypeFixed)
761 GEN_VISIT(SgTypeFloat)
762 GEN_VISIT(SgTypeFloat128)
763 GEN_VISIT(SgTypeFloat80)
764 GEN_VISIT(SgTypeGlobalVoid)
765 GEN_VISIT(SgTypeIdOp)
766 GEN_VISIT(SgTypeImaginary)
767 GEN_VISIT(SgTypeInt)
768 GEN_VISIT(SgTypeLong)
769 GEN_VISIT(SgTypeLongDouble)
770 GEN_VISIT(SgTypeLongLong)
771 GEN_VISIT(SgTypeModifier)
772 GEN_VISIT(SgTypeMatrix)
773 GEN_VISIT(SgTypeTuple)
774 GEN_VISIT(SgTypeNullptr)
775 GEN_VISIT(SgTypeOfType)
776 GEN_VISIT(SgTypeShort)
778 GEN_VISIT(SgTypeSignedChar)
779 GEN_VISIT(SgTypeSignedInt)
780 GEN_VISIT(SgTypeSignedLong)
781 GEN_VISIT(SgTypeSignedLongLong)
782 GEN_VISIT(SgTypeSignedShort)
783 GEN_VISIT(SgTypeString)
784 GEN_VISIT(SgTypeUnknown)
786 GEN_VISIT(SgTypeUnsignedChar)
787 GEN_VISIT(SgTypeUnsignedInt)
788 GEN_VISIT(SgTypeUnsignedLong)
789 GEN_VISIT(SgTypeUnsignedLongLong)
790 GEN_VISIT(SgTypeUnsignedShort)
791 GEN_VISIT(SgTypeVoid)
792 GEN_VISIT(SgTypeWchar)
793 GEN_VISIT(SgTypedefDeclaration)
794 GEN_VISIT(SgTypedefSeq)
795 GEN_VISIT(SgTypedefSymbol)
796 GEN_VISIT(SgTypedefType)
797 GEN_VISIT(SgUPC_AccessModifier)
798 GEN_VISIT(SgUnaryAddOp)
799 GEN_VISIT(SgUnaryOp)
801 GEN_VISIT(SgUndirectedGraphEdge)
803 GEN_VISIT(SgUnknownFile)
804 GEN_VISIT(SgUnparse_Info)
805 GEN_VISIT(SgUnsignedCharVal)
806 GEN_VISIT(SgUnsignedIntVal)
807 GEN_VISIT(SgUnsignedLongLongIntVal)
808 GEN_VISIT(SgUnsignedLongVal)
809 GEN_VISIT(SgUnsignedShortVal)
810 GEN_VISIT(SgUpcBarrierStatement)
813 GEN_VISIT(SgUpcFenceStatement)
814 GEN_VISIT(SgUpcForAllStatement)
816 GEN_VISIT(SgUpcMythread)
817 GEN_VISIT(SgUpcNotifyStatement)
818 GEN_VISIT(SgUpcThreads)
819 GEN_VISIT(SgUpcWaitStatement)
820 GEN_VISIT(SgUseStatement)
821 GEN_VISIT(SgUserDefinedBinaryOp)
822 GEN_VISIT(SgUserDefinedUnaryOp)
825 GEN_VISIT(SgValueExp)
826 GEN_VISIT(SgVarArgCopyOp)
827 GEN_VISIT(SgVarArgEndOp)
828 GEN_VISIT(SgVarArgOp)
830 GEN_VISIT(SgVarArgStartOp)
831 GEN_VISIT(SgVarRefExp)
832 GEN_VISIT(SgVariableDeclaration)
833 GEN_VISIT(SgVariableDefinition)
834 GEN_VISIT(SgVariableSymbol)
835 GEN_VISIT(SgVariantExpression)
836 GEN_VISIT(SgVariantStatement)
837 GEN_VISIT(SgVoidVal)
838 GEN_VISIT(SgWaitStatement)
840 GEN_VISIT(SgWithStatement)
841 GEN_VISIT(SgWcharVal)
842 GEN_VISIT(SgWhereStatement)
843 GEN_VISIT(SgWhileStmt)
844 GEN_VISIT(SgWriteStatement)
845 GEN_VISIT(SgXorAssignOp)
846 GEN_VISIT(SgYieldExpression)
847 GEN_VISIT(Sg_File_Info)
848 GEN_VISIT(SgTypeCAFTeam)
849 GEN_VISIT(SgCAFWithTeamStatement)
850 GEN_VISIT(SgCAFCoExpression)
851 GEN_VISIT(SgCallExpression)
852 GEN_VISIT(SgTypeCrayPointer)
853 GEN_VISIT(SgJavaImportStatement)
854 GEN_VISIT(SgJavaPackageDeclaration)
855 GEN_VISIT(SgJavaPackageStatement)
858 GEN_VISIT(SgJavaMemberValuePair)
859 GEN_VISIT(SgJavaAnnotation)
860 GEN_VISIT(SgJavaMarkerAnnotation)
862 GEN_VISIT(SgJavaNormalAnnotation)
863 GEN_VISIT(SgJavaTypeExpression)
864 GEN_VISIT(SgJavaQualifiedType)
865 GEN_VISIT(SgClassExp)
866 GEN_VISIT(SgJavaUnionType)
867 GEN_VISIT(SgJavaParameterType)
868 GEN_VISIT(SgAsyncStmt)
869 GEN_VISIT(SgFinishStmt)
870 GEN_VISIT(SgAtStmt)
871 GEN_VISIT(SgAtomicStmt)
872// GEN_VISIT(SgClassPropertyList)
873 GEN_VISIT(SgWhenStmt)
874 GEN_VISIT(SgAtExp)
875 GEN_VISIT(SgFinishExp)
876 GEN_VISIT(SgHereExp)
877 GEN_VISIT(SgDotDotExp)
878 GEN_VISIT(SgAdaOthersExp)
879 GEN_VISIT(SgAdaUnitRefExp)
881 GEN_VISIT(SgAdaDiscriminatedType)
883 GEN_VISIT(SgAdaGenericSymbol)
884
885 GEN_VISIT(SgAdaProtectedBody)
886 GEN_VISIT(SgAdaProtectedBodyDecl)
887 GEN_VISIT(SgAdaProtectedSpec)
888 GEN_VISIT(SgAdaProtectedSpecDecl)
889 GEN_VISIT(SgAdaProtectedSymbol)
890 GEN_VISIT(SgAdaProtectedRefExp)
891 GEN_VISIT(SgAdaProtectedType)
892 GEN_VISIT(SgAdaProtectedTypeDecl)
893 GEN_VISIT(SgAdaDigitsConstraint)
894 GEN_VISIT(SgAdaAncestorInitializer)
895 GEN_VISIT(SgAdaDeltaConstraint)
896 GEN_VISIT(SgAdaSubroutineType)
898 GEN_VISIT(SgAdaFormalPackageDecl)
899 GEN_VISIT(SgAdaFormalPackageSymbol)
900 GEN_VISIT(SgAdaNullConstraint)
901 GEN_VISIT(SgAdaUnscopedBlock)
902 GEN_VISIT(SgAdaVariantDecl)
903 GEN_VISIT(SgAdaVariantWhenStmt)
904 GEN_VISIT(SgJovialLabelDeclaration)
905
906 GEN_VISIT(SgRangeType)
907
908#if WITH_BINARY_NODES
909 GEN_VISIT(SgAsmAarch64AtOperand)
910 GEN_VISIT(SgAsmAarch64BarrierOperand)
911 GEN_VISIT(SgAsmAarch64CImmediateOperand)
912 GEN_VISIT(SgAsmAarch64Instruction)
913 GEN_VISIT(SgAsmAarch64PrefetchOperand)
914 GEN_VISIT(SgAsmAarch64SysMoveOperand)
915 GEN_VISIT(SgAsmBasicString)
916 GEN_VISIT(SgAsmBinaryAdd)
917 GEN_VISIT(SgAsmBinaryAddPostupdate)
918 GEN_VISIT(SgAsmBinaryAddPreupdate)
919 GEN_VISIT(SgAsmBinaryAsr)
920 GEN_VISIT(SgAsmBinaryDivide)
921 GEN_VISIT(SgAsmBinaryExpression)
922 GEN_VISIT(SgAsmBinaryLsl)
923 GEN_VISIT(SgAsmBinaryLsr)
924 GEN_VISIT(SgAsmBinaryMod)
925 GEN_VISIT(SgAsmBinaryMsl)
926 GEN_VISIT(SgAsmBinaryMultiply)
927 GEN_VISIT(SgAsmBinaryRor)
928 GEN_VISIT(SgAsmBinarySubtract)
929 GEN_VISIT(SgAsmBinarySubtractPostupdate)
930 GEN_VISIT(SgAsmBinarySubtractPreupdate)
931 GEN_VISIT(SgAsmBlock)
932 GEN_VISIT(SgAsmCoffStrtab)
933 GEN_VISIT(SgAsmCoffSymbol)
934 GEN_VISIT(SgAsmCoffSymbolList)
935 GEN_VISIT(SgAsmCoffSymbolTable)
936 GEN_VISIT(SgAsmCommonSubExpression)
938 GEN_VISIT(SgAsmConstantExpression)
939 GEN_VISIT(SgAsmDOSExtendedHeader)
940 GEN_VISIT(SgAsmDOSFileHeader)
945 GEN_VISIT(SgAsmDwarfArrayType)
946 GEN_VISIT(SgAsmDwarfBaseType)
947 GEN_VISIT(SgAsmDwarfCatchBlock)
948 GEN_VISIT(SgAsmDwarfClassTemplate)
949 GEN_VISIT(SgAsmDwarfClassType)
950 GEN_VISIT(SgAsmDwarfCommonBlock)
954 GEN_VISIT(SgAsmDwarfCondition)
955 GEN_VISIT(SgAsmDwarfConstType)
956 GEN_VISIT(SgAsmDwarfConstant)
957 GEN_VISIT(SgAsmDwarfConstruct)
958 GEN_VISIT(SgAsmDwarfConstructList)
959 GEN_VISIT(SgAsmDwarfDwarfProcedure)
960 GEN_VISIT(SgAsmDwarfEntryPoint)
962 GEN_VISIT(SgAsmDwarfEnumerator)
963 GEN_VISIT(SgAsmDwarfFileType)
965 GEN_VISIT(SgAsmDwarfFormatLabel)
966 GEN_VISIT(SgAsmDwarfFriend)
969 GEN_VISIT(SgAsmDwarfImportedModule)
970 GEN_VISIT(SgAsmDwarfImportedUnit)
971 GEN_VISIT(SgAsmDwarfInformation)
972 GEN_VISIT(SgAsmDwarfInheritance)
974 GEN_VISIT(SgAsmDwarfInterfaceType)
975 GEN_VISIT(SgAsmDwarfLabel)
976 GEN_VISIT(SgAsmDwarfLexicalBlock)
977 GEN_VISIT(SgAsmDwarfLine)
978 GEN_VISIT(SgAsmDwarfLineList)
979 GEN_VISIT(SgAsmDwarfMacro)
980 GEN_VISIT(SgAsmDwarfMacroList)
981 GEN_VISIT(SgAsmDwarfMember)
982 GEN_VISIT(SgAsmDwarfModule)
983 GEN_VISIT(SgAsmDwarfMutableType)
984 GEN_VISIT(SgAsmDwarfNamelist)
985 GEN_VISIT(SgAsmDwarfNamelistItem)
986 GEN_VISIT(SgAsmDwarfNamespace)
987 GEN_VISIT(SgAsmDwarfPackedType)
988 GEN_VISIT(SgAsmDwarfPartialUnit)
989 GEN_VISIT(SgAsmDwarfPointerType)
991 GEN_VISIT(SgAsmDwarfReferenceType)
992 GEN_VISIT(SgAsmDwarfRestrictType)
993 GEN_VISIT(SgAsmDwarfSetType)
994 GEN_VISIT(SgAsmDwarfSharedType)
995 GEN_VISIT(SgAsmDwarfStringType)
996 GEN_VISIT(SgAsmDwarfStructureType)
997 GEN_VISIT(SgAsmDwarfSubprogram)
998 GEN_VISIT(SgAsmDwarfSubrangeType)
999 GEN_VISIT(SgAsmDwarfSubroutineType)
1002 GEN_VISIT(SgAsmDwarfThrownType)
1003 GEN_VISIT(SgAsmDwarfTryBlock)
1004 GEN_VISIT(SgAsmDwarfTypedef)
1005 GEN_VISIT(SgAsmDwarfUnionType)
1008 GEN_VISIT(SgAsmDwarfUnspecifiedType)
1009 GEN_VISIT(SgAsmDwarfUpcRelaxedType)
1010 GEN_VISIT(SgAsmDwarfUpcSharedType)
1011 GEN_VISIT(SgAsmDwarfUpcStrictType)
1012 GEN_VISIT(SgAsmDwarfVariable)
1013 GEN_VISIT(SgAsmDwarfVariant)
1014 GEN_VISIT(SgAsmDwarfVariantPart)
1015 GEN_VISIT(SgAsmDwarfVolatileType)
1016 GEN_VISIT(SgAsmDwarfWithStmt)
1017 GEN_VISIT(SgAsmElfDynamicEntry)
1018 GEN_VISIT(SgAsmElfDynamicEntryList)
1019 GEN_VISIT(SgAsmElfDynamicSection)
1020 GEN_VISIT(SgAsmElfEHFrameEntryCI)
1022 GEN_VISIT(SgAsmElfEHFrameEntryFD)
1024 GEN_VISIT(SgAsmElfEHFrameSection)
1025 GEN_VISIT(SgAsmElfFileHeader)
1026 GEN_VISIT(SgAsmElfNoteEntry)
1027 GEN_VISIT(SgAsmElfNoteEntryList)
1028 GEN_VISIT(SgAsmElfNoteSection)
1029 GEN_VISIT(SgAsmElfRelocEntry)
1030 GEN_VISIT(SgAsmElfRelocEntryList)
1031 GEN_VISIT(SgAsmElfRelocSection)
1032 GEN_VISIT(SgAsmElfSection)
1033 GEN_VISIT(SgAsmElfSectionTable)
1034 GEN_VISIT(SgAsmElfSectionTableEntry)
1035 GEN_VISIT(SgAsmElfSegmentTable)
1036 GEN_VISIT(SgAsmElfSegmentTableEntry)
1038 GEN_VISIT(SgAsmElfStringSection)
1039 GEN_VISIT(SgAsmElfStrtab)
1040 GEN_VISIT(SgAsmElfSymbol)
1041 GEN_VISIT(SgAsmElfSymbolList)
1042 GEN_VISIT(SgAsmElfSymbolSection)
1043 GEN_VISIT(SgAsmElfSymverDefinedAux)
1048 GEN_VISIT(SgAsmElfSymverEntry)
1049 GEN_VISIT(SgAsmElfSymverEntryList)
1050 GEN_VISIT(SgAsmElfSymverNeededAux)
1052 GEN_VISIT(SgAsmElfSymverNeededEntry)
1055 GEN_VISIT(SgAsmElfSymverSection)
1056 GEN_VISIT(SgAsmExecutableFileFormat)
1057 GEN_VISIT(SgAsmExprListExp)
1058 GEN_VISIT(SgAsmExpression)
1060 GEN_VISIT(SgAsmFloatType)
1061 GEN_VISIT(SgAsmFloatValueExpression)
1062 GEN_VISIT(SgAsmFunction)
1063 GEN_VISIT(SgAsmGenericDLL)
1064 GEN_VISIT(SgAsmGenericDLLList)
1065 GEN_VISIT(SgAsmGenericFile)
1066 GEN_VISIT(SgAsmGenericFileList)
1067 GEN_VISIT(SgAsmGenericFormat)
1068 GEN_VISIT(SgAsmGenericHeader)
1069 GEN_VISIT(SgAsmGenericHeaderList)
1070 GEN_VISIT(SgAsmGenericSection)
1071 GEN_VISIT(SgAsmGenericSectionList)
1072 GEN_VISIT(SgAsmGenericString)
1073 GEN_VISIT(SgAsmGenericStrtab)
1074 GEN_VISIT(SgAsmGenericSymbol)
1075 GEN_VISIT(SgAsmGenericSymbolList)
1077 GEN_VISIT(SgAsmInstruction)
1079 GEN_VISIT(SgAsmIntegerType)
1080 GEN_VISIT(SgAsmInterpretation)
1081 GEN_VISIT(SgAsmInterpretationList)
1082 GEN_VISIT(SgAsmLEEntryPoint)
1083 GEN_VISIT(SgAsmLEEntryTable)
1084 GEN_VISIT(SgAsmLEFileHeader)
1085 GEN_VISIT(SgAsmLENameTable)
1086 GEN_VISIT(SgAsmLEPageTable)
1087 GEN_VISIT(SgAsmLEPageTableEntry)
1088 GEN_VISIT(SgAsmLERelocTable)
1089 GEN_VISIT(SgAsmLESection)
1090 GEN_VISIT(SgAsmLESectionTable)
1091 GEN_VISIT(SgAsmLESectionTableEntry)
1092 GEN_VISIT(SgAsmM68kInstruction)
1094 GEN_VISIT(SgAsmMipsInstruction)
1095 GEN_VISIT(SgAsmNEEntryPoint)
1096 GEN_VISIT(SgAsmNEEntryTable)
1097 GEN_VISIT(SgAsmNEFileHeader)
1098 GEN_VISIT(SgAsmNEModuleTable)
1099 GEN_VISIT(SgAsmNENameTable)
1100 GEN_VISIT(SgAsmNERelocEntry)
1101 GEN_VISIT(SgAsmNERelocTable)
1102 GEN_VISIT(SgAsmNESection)
1103 GEN_VISIT(SgAsmNESectionTable)
1104 GEN_VISIT(SgAsmNESectionTableEntry)
1105 GEN_VISIT(SgAsmNEStringTable)
1106 GEN_VISIT(SgAsmNode)
1107 GEN_VISIT(SgAsmOp)
1108 GEN_VISIT(SgAsmOperandList)
1109 GEN_VISIT(SgAsmPEExportDirectory)
1110 GEN_VISIT(SgAsmPEExportEntry)
1111 GEN_VISIT(SgAsmPEExportEntryList)
1112 GEN_VISIT(SgAsmPEExportSection)
1113 GEN_VISIT(SgAsmPEFileHeader)
1114 GEN_VISIT(SgAsmPEImportDirectory)
1116 GEN_VISIT(SgAsmPEImportItem)
1117 GEN_VISIT(SgAsmPEImportItemList)
1118 GEN_VISIT(SgAsmPEImportSection)
1119 GEN_VISIT(SgAsmPERVASizePair)
1120 GEN_VISIT(SgAsmPERVASizePairList)
1121 GEN_VISIT(SgAsmPESection)
1122 GEN_VISIT(SgAsmPESectionTable)
1123 GEN_VISIT(SgAsmPESectionTableEntry)
1124 GEN_VISIT(SgAsmPEStringSection)
1125 GEN_VISIT(SgAsmPointerType)
1126 GEN_VISIT(SgAsmPowerpcInstruction)
1127 GEN_VISIT(SgAsmRegisterNames)
1129 GEN_VISIT(SgAsmRiscOperation)
1130 GEN_VISIT(SgAsmScalarType)
1131 GEN_VISIT(SgAsmStatement)
1132 GEN_VISIT(SgAsmStaticData)
1133 GEN_VISIT(SgAsmStmt)
1134 GEN_VISIT(SgAsmStoredString)
1135 GEN_VISIT(SgAsmStringStorage)
1136 GEN_VISIT(SgAsmType)
1137 GEN_VISIT(SgAsmUnaryExpression)
1138 GEN_VISIT(SgAsmUnaryMinus)
1139 GEN_VISIT(SgAsmUnaryPlus)
1140 GEN_VISIT(SgAsmUnaryRrx)
1141 GEN_VISIT(SgAsmUnarySignedExtend)
1142 GEN_VISIT(SgAsmUnaryUnsignedExtend)
1143 GEN_VISIT(SgAsmUnaryTruncate)
1144 GEN_VISIT(SgAsmValueExpression)
1145 GEN_VISIT(SgAsmVectorType)
1146 GEN_VISIT(SgAsmVoidType)
1147 GEN_VISIT(SgAsmX86Instruction)
1148 GEN_VISIT(SgAsmBinaryAddressSymbol)
1149 GEN_VISIT(SgAsmBinaryDataSymbol)
1150 GEN_VISIT(SgAsmNullInstruction)
1151
1152 GEN_VISIT(SgAsmJvmModuleMainClass)
1153 GEN_VISIT(SgAsmInstructionList)
1154 GEN_VISIT(SgAsmCilNode)
1155 GEN_VISIT(SgAsmCilAssembly)
1156 GEN_VISIT(SgAsmCilAssemblyOS)
1157 GEN_VISIT(SgAsmCilAssemblyProcessor)
1158 GEN_VISIT(SgAsmCilAssemblyRef)
1159 GEN_VISIT(SgAsmCilAssemblyRefOS)
1161 GEN_VISIT(SgAsmCilClassLayout)
1162 GEN_VISIT(SgAsmCilConstant)
1163 GEN_VISIT(SgAsmCilCustomAttribute)
1164 GEN_VISIT(SgAsmCilDeclSecurity)
1165 GEN_VISIT(SgAsmCilEvent)
1166 GEN_VISIT(SgAsmCilEventMap)
1167 GEN_VISIT(SgAsmCilExportedType)
1168 GEN_VISIT(SgAsmCilField)
1169 GEN_VISIT(SgAsmCilFieldLayout)
1170 GEN_VISIT(SgAsmCilFieldMarshal)
1171 GEN_VISIT(SgAsmCilFieldRVA)
1172 GEN_VISIT(SgAsmCilFile)
1173 GEN_VISIT(SgAsmCilGenericParam)
1175 GEN_VISIT(SgAsmCilImplMap)
1176 GEN_VISIT(SgAsmCilInterfaceImpl)
1177 GEN_VISIT(SgAsmCilManifestResource)
1178 GEN_VISIT(SgAsmCilMemberRef)
1179 GEN_VISIT(SgAsmCilMethodDef)
1180 GEN_VISIT(SgAsmCilMethodImpl)
1181 GEN_VISIT(SgAsmCilMethodSemantics)
1182 GEN_VISIT(SgAsmCilMethodSpec)
1183 GEN_VISIT(SgAsmCilModule)
1184 GEN_VISIT(SgAsmCilModuleRef)
1185 GEN_VISIT(SgAsmCilNestedClass)
1186 GEN_VISIT(SgAsmCilParam)
1187 GEN_VISIT(SgAsmCilProperty)
1188 GEN_VISIT(SgAsmCilPropertyMap)
1189 GEN_VISIT(SgAsmCilStandAloneSig)
1190 GEN_VISIT(SgAsmCilTypeDef)
1191 GEN_VISIT(SgAsmCilTypeRef)
1192 GEN_VISIT(SgAsmCilTypeSpec)
1193 GEN_VISIT(SgAdaParameterList)
1194 GEN_VISIT(SgAsmCilMetadata)
1195 GEN_VISIT(SgAsmCilMetadataRoot)
1196 GEN_VISIT(SgAsmCilDataStream)
1197 GEN_VISIT(SgAsmCilMetadataHeap)
1198 GEN_VISIT(SgAsmCilUint8Heap)
1199 GEN_VISIT(SgAsmCilUint32Heap)
1200 GEN_VISIT(SgAsmCliHeader)
1201
1206 GEN_VISIT(SgAsmUserInstruction)
1207 GEN_VISIT(SgAsmJvmMethodParameters)
1209 GEN_VISIT(SgAsmVoidType)
1210 GEN_VISIT(SgAsmPointerType)
1211
1212 // incomplete
1213#endif /* WITH_BINARY_NODES */
1214
1215/*
1216 GEN_VISIT(SgBinaryComposite)
1217 GEN_VISIT(SgComprehensionList)
1218 *
1219 GEN_VISIT(SgDirectedGraph)
1220 GEN_VISIT(SgDirectedGraphEdge)
1221 GEN_VISIT(SgDirectedGraphNode)
1222
1223 GEN_VISIT(SgUnknownMemberFunctionType)
1224*/
1225
1226 RoseVisitor rv;
1227 };
1228
1229#undef GEN_VISIT
1230
1231 template <class RoseVisitor>
1232 inline
1233 typename std::remove_const<typename std::remove_reference<RoseVisitor>::type>::type
1234 _dispatch(RoseVisitor&& rv, SgNode* n)
1235 {
1236 using RoseVisitorNoref = typename std::remove_reference<RoseVisitor>::type;
1237 using RoseHandler = typename std::remove_const<RoseVisitorNoref>::type;
1238
1239 ASSERT_not_null(n);
1240
1241 VisitDispatcher<RoseHandler> vis( std::forward<RoseVisitor>(rv),
1242 std::is_lvalue_reference<RoseVisitor>()
1243 );
1244
1245 n->accept(vis);
1246 return std::move(vis).rv;
1247 }
1248
1249
1305#if 0
1316#endif
1317
1318 template <class RoseVisitor>
1319 inline
1320 typename std::remove_const<typename std::remove_reference<RoseVisitor>::type>::type
1321 dispatch(RoseVisitor&& rv, SgNode* n)
1322 {
1323 //~ return std::move(rv);
1324 return _dispatch(std::forward<RoseVisitor>(rv), n);
1325 }
1326
1327 template <class RoseVisitor>
1328 inline
1329 typename std::remove_const<typename std::remove_reference<RoseVisitor>::type>::type
1330 dispatch(RoseVisitor&& rv, const SgNode* n)
1331 {
1332 //~ return std::move(rv);
1333 return _dispatch(std::forward<RoseVisitor>(rv), const_cast<SgNode*>(n));
1334 }
1335
1345 template <class SageNode>
1347 {
1348 void handle(SageNode&) {}
1349 };
1350
1358 template <class AncestorNode, class QualSgNode>
1359 struct AncestorTypeFinder : DefaultHandler<const SgProject>
1360 {
1362 typedef std::pair<AncestorNode*, QualSgNode*> Pair;
1363
1364 Pair res;
1365
1367 : Base(), res(NULL, NULL)
1368 {}
1369
1370 // handling of const SgProject is outsourced to DefaultHandler
1371 // thus, AncestorNode = const SgProject does not cause conflicts
1372 using Base::handle;
1373
1374 void handle(QualSgNode& n) { res.second = n.get_parent(); }
1375 void handle(AncestorNode& n) { res.first = &n; }
1376
1377 operator Pair() const { return res; }
1378 };
1379
1382 template <class AncestorNode, class QualSgNode>
1383 AncestorNode* _ancestor(QualSgNode& n)
1384 {
1385 using AncestorFinder = AncestorTypeFinder<AncestorNode, QualSgNode>;
1386
1387 typename AncestorFinder::Pair res(NULL, n.get_parent());
1388
1389 while (res.second != NULL)
1390 {
1391 res = (typename AncestorFinder::Pair) sg::dispatch(AncestorFinder(), res.second);
1392 }
1393
1394 return res.first;
1395 }
1396
1408 template <class AncestorNode>
1409 AncestorNode* ancestor(SgNode* n)
1410 {
1411 if (n == NULL) return NULL;
1412
1413 return _ancestor<AncestorNode>(*n);
1414 }
1415
1417 template <class AncestorNode>
1418 const AncestorNode* ancestor(const SgNode* n)
1419 {
1420 if (n == NULL) return NULL;
1421
1422 return _ancestor<const AncestorNode>(*n);
1423 }
1424
1426 template <class AncestorNode>
1427 AncestorNode& ancestor(SgNode& n)
1428 {
1429 AncestorNode* res = _ancestor<AncestorNode>(n);
1430
1431 ROSE_ASSERT(res);
1432 return *res;
1433 }
1434
1436 template <class AncestorNode>
1437 const AncestorNode& ancestor(const SgNode& n)
1438 {
1439 const AncestorNode* res = _ancestor<const AncestorNode>(n);
1440
1441 ROSE_ASSERT(res);
1442 return *res;
1443 }
1444
1445 namespace
1446 {
1448 template <class SageNode>
1449 struct TypeRecoveryHandler
1450 {
1451 typedef typename ConstLike<SageNode, SgNode>::type SgBaseNode;
1452
1453 TypeRecoveryHandler(const char* f = 0, size_t ln = 0)
1454 : res(NULL), loc(f), loc_ln(ln)
1455 {}
1456
1457 TypeRecoveryHandler(TypeRecoveryHandler&&) = default;
1458 TypeRecoveryHandler& operator=(TypeRecoveryHandler&&) = default;
1459
1460 operator SageNode* ()&& { return res; }
1461
1462 void handle(SgBaseNode& n) { unexpected_node(n, loc, loc_ln); }
1463 void handle(SageNode& n) { res = &n; }
1464
1465 private:
1466 SageNode* res;
1467 const char* loc;
1468 size_t loc_ln;
1469
1470 TypeRecoveryHandler() = delete;
1471 TypeRecoveryHandler(const TypeRecoveryHandler&) = delete;
1472 TypeRecoveryHandler& operator=(const TypeRecoveryHandler&) = delete;
1473 };
1474 }
1475
1476
1485 template <class SageNode>
1486 SageNode* assert_sage_type(SgNode* n, const char* f = 0, size_t ln = 0)
1487 {
1488 return sg::dispatch(TypeRecoveryHandler<SageNode>(f, ln), n);
1489 }
1490
1491 template <class SageNode>
1492 const SageNode* assert_sage_type(const SgNode* n, const char* f = 0, size_t ln = 0)
1493 {
1494 return sg::dispatch(TypeRecoveryHandler<const SageNode>(f, ln), n);
1495 }
1496
1497 template <class SageNode>
1498 SageNode& assert_sage_type(SgNode& n, const char* f = 0, size_t ln = 0)
1499 {
1500 return *sg::dispatch(TypeRecoveryHandler<SageNode>(f, ln), &n);
1501 }
1502
1503 template <class SageNode>
1504 const SageNode& assert_sage_type(const SgNode& n, const char* f = 0, size_t ln = 0)
1505 {
1506 return *sg::dispatch(TypeRecoveryHandler<const SageNode>(f, ln), &n);
1507 }
1509
1510 template <class SageNode>
1511 struct TypeRecovery : DispatchHandler<SageNode*>
1512 {
1513 void handle(SgNode&) { /* res = nullptr; */ }
1514 void handle(SageNode& n) { this->res = &n; }
1515 };
1516
1517 template <class SageNode>
1518 auto ancestor_path(const SgNode& n) -> SageNode*
1519 {
1521 }
1522
1523 template <class SageNode, class... SageNodes>
1524 auto ancestor_path(const SgNode& n) -> decltype(ancestor_path<SageNodes...>(n))
1525 {
1526 if (SageNode* parent = ancestor_path<SageNode>(n))
1527 return ancestor_path<SageNodes...>(*parent);
1528
1529 return nullptr;
1530 }
1531
1534 static inline
1535 void swap_parent(SgNode* lhs, SgNode* rhs)
1536 {
1537 SgNode* tmp = lhs->get_parent();
1538
1539 lhs->set_parent(rhs->get_parent());
1540 rhs->set_parent(tmp);
1541 }
1542
1546 static inline
1547 void swap_parent(void*, void*) {}
1548
1556 template <class SageNode, class SageChild>
1557 void swap_child(SageNode& lhs, SageNode& rhs, SageChild* (SageNode::*getter) () const, void (SageNode::*setter) (SageChild*))
1558 {
1559 SageChild* lhs_child = (lhs.*getter)();
1560 SageChild* rhs_child = (rhs.*getter)();
1561 ROSE_ASSERT(lhs_child && rhs_child);
1562
1563 (lhs.*setter)(rhs_child);
1564 (rhs.*setter)(lhs_child);
1565
1566 swap_parent(lhs_child, rhs_child);
1567 }
1568
1569
1572 template <class SageNode>
1574 {
1575 typedef void (*TransformHandlerFn)(SageNode*);
1576
1577 explicit
1578 TraversalFunction(TransformHandlerFn fun)
1579 : fn(fun)
1580 {}
1581
1582 void handle(SgNode&) { /* ignore */ }
1583 void handle(SageNode& n) { fn(&n); }
1584
1585 TransformHandlerFn fn;
1586 };
1587
1590 template <class SageNode>
1591 static inline
1593 createTraversalFunction(void (* fn)(SageNode*))
1594 {
1595 return TraversalFunction<SageNode>(fn);
1596 }
1597
1598 //
1599 // function type extractor
1600 // see https://stackoverflow.com/questions/28033251/can-you-extract-types-from-template-parameter-function-signature
1601
1602
1603 template <class GVisitor>
1605 {
1606 explicit
1607 TraversalClass(GVisitor gv)
1608 : gvisitor(gv)
1609 //~ : gvisitor(std::move(gv))
1610 {}
1611
1612 void visit(SgNode* n)
1613 {
1614 gvisitor = sg::dispatch(gvisitor, n);
1615 }
1616
1617 // GVisitor&& visitor() { return std::move(gvisitor); }
1618 GVisitor visitor() { return gvisitor; }
1619
1620 GVisitor gvisitor;
1621 };
1622
1623
1624
1631 template <class F>
1632 static inline
1633 F
1634 forAllNodes(F fn, SgNode* root, AstSimpleProcessing::Order order = postorder)
1635 {
1636 ROSE_ASSERT(root);
1637
1638 TraversalClass<F> tt(fn);
1639 //~ TraversalClass<F> tt(std::move(fn));
1640
1641 tt.traverse(root, order);
1642 return tt.visitor();
1643 }
1644
1645 template <class SageNode>
1646 static inline
1647 void
1648 forAllNodes(void (*fn)(SageNode*), SgNode* root, AstSimpleProcessing::Order order = postorder)
1649 {
1650 forAllNodes(createTraversalFunction(fn), root, order);
1651 }
1652
1653#if !defined(NDEBUG)
1654 static inline
1655 std::string nodeType(const SgNode& n)
1656 {
1657 return typeid(n).name();
1658 }
1659
1660 static inline
1661 std::string nodeType(const SgNode* n)
1662 {
1663 if (n == NULL) return "<null>";
1664
1665 return nodeType(*n);
1666 }
1667#endif
1668
1669 template <class GVisitor>
1671 {
1672 explicit
1673 DispatchHelper(GVisitor gv, SgNode* p)
1674 : gvisitor(std::move(gv)), parent(p), cnt(0)
1675 {}
1676
1677 void operator()(SgNode* n)
1678 {
1679 ++cnt;
1680
1681#if 0
1682 if (n == NULL)
1683 {
1684 std::cerr << "succ(" << nodeType(parent) << ", " << cnt << ") is null" << std::endl;
1685 return;
1686 }
1687#endif
1688
1689 if (n != nullptr) gvisitor = sg::dispatch(std::move(gvisitor), n);
1690 }
1691
1692 operator GVisitor()&& { return std::move(gvisitor); }
1693
1694 GVisitor gvisitor;
1695 SgNode* parent;
1696 size_t cnt;
1697 };
1698
1699
1700 template <class GVisitor>
1701 static inline
1703 dispatchHelper(GVisitor gv, SgNode* parent = NULL)
1704 {
1705 return DispatchHelper<GVisitor>(std::move(gv), parent);
1706 }
1707
1708 template <class GVisitor>
1709 static inline
1710 GVisitor traverseChildren(GVisitor gv, SgNode& n)
1711 {
1712 std::vector<SgNode*> successors = n.get_traversalSuccessorContainer();
1713
1714 return std::for_each(successors.begin(), successors.end(), dispatchHelper(std::move(gv), &n));
1715 }
1716
1717 template <class GVisitor>
1718 static inline
1719 GVisitor traverseChildren(GVisitor gv, SgNode* n)
1720 {
1721 return traverseChildren(gv, sg::deref(n));
1722 }
1723
1724 template <class SageParent, class SageChild>
1725 void linkParentChild(SageParent& parent, SageChild& child, void (SageParent::*setter)(SageChild*))
1726 {
1727 (parent.*setter)(&child);
1728 child.set_parent(&parent);
1729 }
1730
1734 template <class SageNode>
1735 typename SageNode::base_node_type&
1736 asBaseType(SageNode& n) { return n; }
1737
1738 template <class SageNode>
1739 const typename SageNode::base_node_type&
1740 asBaseType(const SageNode& n) { return n; }
1741
1742 template <class SageNode>
1743 typename SageNode::base_node_type*
1744 asBaseType(SageNode* n) { return n; }
1745
1746 template <class SageNode>
1747 const typename SageNode::base_node_type*
1748 asBaseType(const SageNode* n) { return n; }
1750}
1751#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
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
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
T * operator->() const
arrow operator returns pointer to object
T * pointer() const
explicit conversion operator
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