ROSE 0.11.145.192
|
Contains Ada-specific functionality.
Classes | |
struct | AggregateInfo |
struct | DominantArgInfo |
struct | FlatArrayType |
struct | IfInfo |
represents a branch in an if elsif else context (either statement or expression). More... | |
struct | ImportedUnitResult |
struct | OperatorScopeInfo |
struct | PrimitiveParameterDesc |
struct | PrimitiveSignatureElementsDesc |
struct | RecordField |
struct | ScopePath |
stores a path from an innermost scope to the global scope (not part of the path) in form of a sequence of Sage nodes that represent scopes (SgScopeStatements or SgDeclarationStatements). More... | |
struct | TypeDescription |
Typedefs | |
using | StatementRange = std::pair< SgDeclarationStatementPtrList::iterator, SgDeclarationStatementPtrList::iterator > |
using | FlatArrayTypeBase = std::tuple< SgArrayType *, SgExpressionPtrList, bool > |
defines the result type for getArrayTypeInfo | |
using | RecordFieldBase = std::tuple< const SgSymbol * > |
using | IfExpressionInfo = IfInfo< SgExpression > |
returns a sequence of if (x) then value the last else does not have | |
using | IfStatementInfo = IfInfo< SgStatement > |
using | TypeDescriptionBase = std::tuple< SgType *, bool, std::vector< SgAdaTypeConstraint * > > |
using | DominantArgInfoBase = std::tuple< const SgType *, std::size_t > |
using | OperatorScopeInfoBase = std::tuple< SgScopeStatement *, std::size_t > |
using | ImportedUnitResultBase = std::tuple< std::string, const SgDeclarationStatement *, const SgAdaRenamingDecl *, const SgExpression * > |
describes properties of imported units | |
using | AggregateInfoBase = std::tuple< SgAdaAncestorInitializer *, SgExpressionPtrList::const_iterator, SgExpressionPtrList::const_iterator > |
Details of expression aggregates. | |
using | PrimitiveParameterDescBase = std::tuple< size_t, const SgInitializedName *, const SgDeclarationStatement * > |
using | PrimitiveSignatureElementsDescBase = std::tuple< const SgDeclarationStatement *, std::vector< PrimitiveParameterDesc > > |
Functions | |
SgInitializedName & | declOf (const SgEnumVal &) |
returns the declaration of the enum value | |
SgType & | standardType (const std::string &name) |
returns a type from the standard package with name name . | |
std::vector< IfExpressionInfo > | flattenIfExpressions (const SgConditionalExp &n) |
returns a flat representation of if expressions | |
std::vector< IfStatementInfo > | flattenIfStatements (const SgIfStmt &n) |
returns a flat representation of if-elsif-else statements | |
long long int | staticIntegralValue (SgExpression *n) |
integer constant folding | |
SgExpression * | underlyingExpr (const SgStatement *s) |
returns the expression of an expression statement, or nullptr if s is some other node | |
const SgScopeStatement * | correspondingBody (const SgScopeStatement *scope) |
returns the body scope (aka definition) of a task, package, or protected object. | |
DominantArgInfo | operatorArgumentWithNamedRootIfAvail (const SgTypePtrList &argtypes) |
OperatorScopeInfo | operatorScope (const std::string &opname, const SgTypePtrList &argtypes) |
returns the scope where an operator with name opname and argument types in argtypes shall be declared. | |
std::vector< ImportedUnitResult > | importedUnits (const SgImportStatement &impdcl) |
queries properties of all units in an import statement | |
SgScopeStatement * | pkgStandardScope () |
do not use, this is temporary | |
std::string | convertRoseOperatorNameToAdaName (const std::string &nameInRose) |
takes a function name as used in ROSE and converts it to a name in Ada (i.e., '"' + operator_text + '"'). | |
std::string | convertRoseOperatorNameToAdaOperator (const std::string &nameInRose) |
takes a function name as used in ROSE and converts it to an operator in Ada (i.e., operator_text). | |
SgExpressionPtrList | normalizedCallArguments2 (const SgFunctionCallExp &n, const SgFunctionParameterList &arglist, bool withDefaultArguments=false) |
returns a list of arguments with named arguments placed at the correct position by taking into account the supplied argument list. | |
std::size_t | normalizedArgumentPosition (const SgFunctionCallExp &call, const SgExpression &arg) |
returns the parameter position of arg in the callee, after the parameters have been normalized. | |
const SgScopeStatement * | canonicalScope (const SgScopeStatement *scope) |
returns the canonical scope of some Ada scope scope . | |
const SgScopeStatement & | canonicalScope (const SgScopeStatement &scope) |
bool | sameCanonicalScope (const SgScopeStatement *lhs, const SgScopeStatement *rhs) |
tests if lhs and have the same canonical scope. | |
SgDeclarationStatement * | associatedDeclaration (const SgSymbol &n) |
returns the associated declaration for symbol n or nullptr if there is none. | |
bool | explicitNullProcedure (const SgFunctionDefinition &fndef) |
returns true, iff fndef is the body of an explicit null procedure | |
bool | explicitNullRecord (const SgClassDefinition &recdef) |
returns true, iff recdef is the body of an explicit null record | |
SgFunctionSymbol * | findPubliclyVisibleFunction (SgFunctionSymbol &fnsym, const SgFunctionType &drvFunTy, const SgNamedType &dervTy) |
finds the function symbol for a publicly accessible function. | |
bool | isAttribute (const SgAdaAttributeExp &attr, const std::string &attrname) |
tests if attr is an attribute with name attrname . | |
bool | isAnyAccessAttribute (const SgAdaAttributeExp &attr) |
tests if attr is an access attribute | |
SgExprListExp * | isPragma (const SgPragmaDeclaration &prgdcl, const std::string &pragmaname) |
tests if prgdcl is a pragma with name pragmaname . | |
SgNodePtrList | unparsedChildren (SgNode &n) |
returns a container of children nodes that are relevant for unparsing. | |
ScopePath | pathToGlobal (const SgScopeStatement &n) |
Constructs a path from a scope statement to the top-level (global) scope. | |
bool | withPrivateDefinition (const SgDeclarationStatement *dcl) |
tests if the declaration dcl defines a public type that is completed in a private section. | |
bool | withPrivateDefinition (const SgDeclarationStatement &dcl) |
tests if the declaration dcl defines a public type that is completed in a private section. | |
bool | unconstrained (const SgArrayType *ty) |
tests if ty is an unconstrained array | |
bool | unconstrained (const SgArrayType &ty) |
tests if ty is an unconstrained array | |
bool | anonymousAccess (const SgType *ty) |
tests if ty is an anonymous access type | |
bool | anonymousAccess (const SgType &ty) |
tests if ty is an anonymous access type | |
StatementRange | declsInPackage (SgGlobal &globalScope, const std::string &mainFile) |
returns all statements/declarations in the global scope that were defined in the source file. | |
StatementRange | declsInPackage (SgGlobal &globalScope, const SgSourceFile &mainFile) |
returns all statements/declarations in the global scope that were defined in the source file. | |
int | firstLastDimension (SgExprListExp &args) |
returns an integer value for args[0] as used by type attributes first and last | |
int | firstLastDimension (SgExprListExp *args) |
returns an integer value for args[0] as used by type attributes first and last | |
FlatArrayType | getArrayTypeInfo (SgType *atype) |
returns a flattened representation of Ada array types. | |
FlatArrayType | getArrayTypeInfo (SgType &atype) |
returns a flattened representation of Ada array types. | |
std::vector< RecordField > | getAllRecordFields (const SgClassDefinition &rec) |
returns all fields (defined and inherited) of a record. | |
std::vector< RecordField > | getAllRecordFields (const SgClassDefinition *rec) |
returns all fields (defined and inherited) of a record. | |
SgRangeExp * | range (const SgAdaAttributeExp *rangeAttribute) |
returns a range for the range attribute rangeAttribute . | |
SgRangeExp * | range (const SgAdaAttributeExp &rangeAttribute) |
returns a range for the range attribute rangeAttribute . | |
bool | denotesRange (const SgExpression &e) |
returns true if the expression e denotes a range | |
bool | denotesRange (const SgExpression *e) |
returns true if the expression e denotes a range | |
SgAdaPackageSpecDecl & | getSpecificationDeclaration (const SgAdaPackageBodyDecl &bodyDecl) |
returns the declaration node for the package specification | |
SgAdaPackageSpecDecl * | getSpecificationDeclaration (const SgAdaPackageBodyDecl *bodyDecl) |
returns the declaration node for the package specification | |
SgAdaPackageBodyDecl & | getPackageBodyDeclaration (const SgAdaPackageSpecDecl &specDecl) |
returns the declaration node for the package body, if available | |
SgAdaPackageBodyDecl * | getPackageBodyDeclaration (const SgAdaPackageSpecDecl *specDecl) |
returns the declaration node for the package body, if available | |
SgAdaPackageSpec & | getSpecificationDefinition (const SgAdaPackageBody &body) |
returns the specification definition (scope) of the package body | |
SgAdaPackageSpec * | getSpecificationDefinition (const SgAdaPackageBody *body) |
returns the specification definition (scope) of the package body | |
SgAdaPackageBody & | getBodyDefinition (const SgAdaPackageSpec &spec) |
returns the body definition (scope) of the package specification | |
SgAdaPackageBody * | getBodyDefinition (const SgAdaPackageSpec *spec) |
returns the body definition (scope) of the package specification | |
SgDeclarationStatement & | getSpecificationDeclaration (const SgAdaTaskBodyDecl &bodyDecl) |
returns the declaration node (either SgAdaTaskSpecDecl or SgAdaTaskTypeDecl) for the task specification | |
SgDeclarationStatement * | getSpecificationDeclaration (const SgAdaTaskBodyDecl *bodyDecl) |
returns the declaration node (either SgAdaTaskSpecDecl or SgAdaTaskTypeDecl) for the task specification | |
SgDeclarationStatement & | getSpecificationDeclaration (const SgAdaProtectedBodyDecl &bodyDecl) |
returns the declaration node (either SgAdaProtectedSpecDecl or SgAdaProtectedTypeDecl) for the protected object specification | |
SgDeclarationStatement * | getSpecificationDeclaration (const SgAdaProtectedBodyDecl *bodyDecl) |
returns the declaration node (either SgAdaProtectedSpecDecl or SgAdaProtectedTypeDecl) for the protected object specification | |
SgStatementPtrList::iterator | declarationLimit (SgStatementPtrList &list) |
returns the iterator to one past the last declaration (the limit) in the statement sequence. | |
SgStatementPtrList::iterator | declarationLimit (SgBasicBlock &block) |
returns the iterator to one past the last declaration (the limit) in the statement sequence. | |
SgStatementPtrList::iterator | declarationLimit (SgBasicBlock *block) |
returns the iterator to one past the last declaration (the limit) in the statement sequence. | |
SgStatementPtrList::const_iterator | declarationLimit (const SgStatementPtrList &list) |
returns the iterator to one past the last declaration (the limit) in the statement sequence. | |
SgStatementPtrList::const_iterator | declarationLimit (const SgBasicBlock &block) |
returns the iterator to one past the last declaration (the limit) in the statement sequence. | |
SgStatementPtrList::const_iterator | declarationLimit (const SgBasicBlock *block) |
returns the iterator to one past the last declaration (the limit) in the statement sequence. | |
bool | tryFollowsDeclarativeBlock (const SgTryStmt &n) |
returns true iff n is a try block following a declarative region | |
bool | tryFollowsDeclarativeBlock (const SgTryStmt *n) |
returns true iff n is a try block following a declarative region | |
bool | isPackageTryBlock (const SgTryStmt &n) |
returns true iff n is an Ada package try block | |
bool | isPackageTryBlock (const SgTryStmt *n) |
returns true iff n is an Ada package try block | |
bool | hasUnknownDiscriminants (const SgAdaDiscriminatedTypeDecl &n) |
returns true iff n has an unknown discriminant part | |
bool | hasUnknownDiscriminants (const SgAdaDiscriminatedTypeDecl *n) |
returns true iff n has an unknown discriminant part | |
bool | isOutInoutArgument (const SgFunctionCallExp &call, const SgExpression &arg) |
returns true if arg is a used as l-value in the call | |
bool | isOutInoutArgument (const SgFunctionCallExp *call, const SgExpression *arg) |
returns true if arg is a used as l-value in the call | |
bool | isModularType (const SgType &ty) |
return if the type ty is the corresponding universal type representation in ROSE | |
bool | isModularType (const SgType *ty) |
return if the type ty is the corresponding universal type representation in ROSE | |
bool | isIntegerType (const SgType &ty) |
return if the type ty is the corresponding universal type representation in ROSE | |
bool | isIntegerType (const SgType *ty) |
return if the type ty is the corresponding universal type representation in ROSE | |
bool | isFloatingPointType (const SgType &ty) |
return if the type ty is the corresponding universal type representation in ROSE | |
bool | isFloatingPointType (const SgType *ty) |
return if the type ty is the corresponding universal type representation in ROSE | |
bool | isDiscreteType (const SgType *ty) |
return if the type ty is the corresponding universal type representation in ROSE | |
bool | isDiscreteType (const SgType &ty) |
return if the type ty is the corresponding universal type representation in ROSE | |
bool | isBooleanType (const SgType *ty) |
return if the type ty is the corresponding universal type representation in ROSE | |
bool | isBooleanType (const SgType &ty) |
return if the type ty is the corresponding universal type representation in ROSE | |
bool | isFixedType (const SgType *ty) |
returns if the type ty is a fixed point type | |
bool | isFixedType (const SgType &ty) |
returns if the type ty is a fixed point type | |
bool | isScalarType (const SgType *ty) |
returns true if ty refers to a scalar type | |
bool | isScalarType (const SgType &ty) |
returns true if ty refers to a scalar type | |
bool | isDiscreteArrayType (const SgType &ty) |
returns true if ty refers to a discrete array type | |
bool | isDiscreteArrayType (const SgType *ty) |
returns true if ty refers to a discrete array type | |
bool | resolvesToFixedType (const SgType *ty) |
returns if the type ty resolves to a fixed point type | |
bool | resolvesToFixedType (const SgType &ty) |
returns if the type ty resolves to a fixed point type | |
bool | isDecimalFixedType (const SgType *ty) |
returns if the type ty is a decimal fixed point type | |
bool | isDecimalFixedType (const SgType &ty) |
returns if the type ty is a decimal fixed point type | |
boost::optional< bool > | booleanConstant (const SgExpression *e) |
if e denotes an Ada boolean constant, it is returned; otherwise an empty result is returned. | |
boost::optional< bool > | booleanConstant (const SgExpression &e) |
if e denotes an Ada boolean constant, it is returned; otherwise an empty result is returned. | |
SgAdaGenericDecl * | isGenericDecl (const SgDeclarationStatement &n) |
Returns the SgAdaGenericDecl node that makes a declaration (either function/procedure or package) generic. | |
SgAdaGenericDecl * | isGenericDecl (const SgDeclarationStatement *n) |
Returns the SgAdaGenericDecl node that makes a declaration (either function/procedure or package) generic. | |
bool | unitRefDenotesGenericInstance (const SgAdaUnitRefExp &n) |
returns true iff n refers to a generic declaration from inside said declaration false otherwise (e.g., if n does not refer to a generic unit) | |
bool | unitRefDenotesGenericInstance (const SgAdaUnitRefExp *n) |
returns true iff n refers to a generic declaration from inside said declaration false otherwise (e.g., if n does not refer to a generic unit) | |
SgAdaGenericDecl & | getGenericDecl (const SgAdaGenericInstanceDecl &n) |
Returns SgAdaGenericDecl for a given SgAdaGenericInstanceDecl. | |
SgAdaGenericDecl * | getGenericDecl (const SgAdaGenericInstanceDecl *n) |
Returns SgAdaGenericDecl for a given SgAdaGenericInstanceDecl. | |
SgAdaDiscriminatedTypeDecl * | getAdaDiscriminatedTypeDecl (const SgDeclarationStatement &n) |
returns the SgAdaDiscriminatedTypeDecl iff n is discriminated null otherwise | |
SgAdaDiscriminatedTypeDecl * | getAdaDiscriminatedTypeDecl (const SgDeclarationStatement *n) |
returns the SgAdaDiscriminatedTypeDecl iff n is discriminated null otherwise | |
bool | hasSeparatedBody (const SgDeclarationStatement &dcl) |
tests if the declaration decl corresponds to a stub (aka separated unit) | |
bool | hasSeparatedBody (const SgDeclarationStatement *dcl) |
tests if the declaration decl corresponds to a stub (aka separated unit) | |
bool | isSeparatedBody (const SgDeclarationStatement &n) |
returns true iff n is a unit definition that has been separated | |
bool | isSeparatedBody (const SgDeclarationStatement *n) |
returns true iff n is a unit definition that has been separated | |
bool | isSeparatedDefinition (const SgFunctionDeclaration &n) |
returns true iff n is a separated function definition is separated | |
bool | isSeparatedDefinition (const SgFunctionDeclaration *n) |
returns true iff n is a separated function definition is separated | |
TypeDescription | typeRoot (SgType &) |
returns the most fundamental type after skipping subtypes, typedefs, etc. | |
TypeDescription | typeRoot (SgType *) |
returns the most fundamental type after skipping subtypes, typedefs, etc. | |
TypeDescription | typeOfExpr (const SgExpression &) |
returns the type of an expression corrects for some peculiarities in the AST | |
TypeDescription | typeOfExpr (const SgExpression *) |
returns the type of an expression corrects for some peculiarities in the AST | |
SgType * | baseOfAccessType (const SgType *ty) |
returns the base type if ty is an access type | |
SgType * | baseOfAccessType (const SgType &ty) |
returns the base type if ty is an access type | |
SgScopeStatement & | operatorScope (const std::string &opname, const SgType &ty) |
returns the scope where an operator associated with type ty shall be declared. | |
SgScopeStatement * | operatorScope (const std::string &opname, const SgType *ty) |
returns the scope where an operator associated with type ty shall be declared. | |
SgScopeStatement * | declarationScope (const SgType *ty) |
returns the scope where type ty has been declared | |
SgScopeStatement * | declarationScope (const SgType &ty) |
returns the scope where type ty has been declared | |
AggregateInfo | splitAggregate (const SgExprListExp &exp) |
returns the ancestor initializer, if exp refers to an extension aggregate null otherwise | |
AggregateInfo | splitAggregate (const SgExprListExp *exp) |
returns the ancestor initializer, if exp refers to an extension aggregate null otherwise | |
SgAdaPackageSpecDecl * | renamedPackage (const SgAdaRenamingDecl &n) |
returns a package spec decl if the declaration n renames a package returns nullptr otherwise | |
SgAdaPackageSpecDecl * | renamedPackage (const SgAdaRenamingDecl *n) |
returns a package spec decl if the declaration n renames a package returns nullptr otherwise | |
bool | isFunction (const SgFunctionType &ty) |
returns true iff ty refers to a function type (as opposed to procedure) | |
bool | isFunction (const SgFunctionType *ty) |
returns true iff ty refers to a function type (as opposed to procedure) | |
bool | isFunction (const SgAdaSubroutineType &ty) |
returns true iff ty refers to a function type (as opposed to procedure) | |
bool | isFunction (const SgAdaSubroutineType *ty) |
returns true iff ty refers to a function type (as opposed to procedure) | |
const SgFunctionType * | functionType (const SgFunctionSymbol *fnsy) |
returns the static type of the function symbol fnsy | |
const SgFunctionType & | functionType (const SgFunctionSymbol &fnsy) |
returns the static type of the function symbol fnsy | |
bool | isObjectRenaming (const SgAdaRenamingDecl *dcl) |
returns true iff ty refers to an object renaming | |
bool | isObjectRenaming (const SgAdaRenamingDecl &dcl) |
returns true iff ty refers to an object renaming | |
bool | isExceptionRenaming (const SgAdaRenamingDecl *dcl) |
returns true iff ty refers to an exception renaming | |
bool | isExceptionRenaming (const SgAdaRenamingDecl &dcl) |
returns true iff ty refers to an exception renaming | |
std::vector< PrimitiveParameterDesc > | primitiveParameterPositions (const SgFunctionDeclaration &fn) |
returns the descriptions for parameters that make an operation primitive. | |
std::vector< PrimitiveParameterDesc > | primitiveParameterPositions (const SgFunctionDeclaration *fn) |
returns the descriptions for parameters that make an operation primitive. | |
PrimitiveSignatureElementsDesc | primitiveSignatureElements (const SgFunctionDeclaration &) |
returns the descriptions for result type and parameters that make an operation primitive. | |
PrimitiveSignatureElementsDesc | primitiveSignatureElements (const SgFunctionDeclaration *) |
returns the descriptions for result type and parameters that make an operation primitive. | |
const SgVariableDeclaration * | exceptionTypeDecl (const SgVariableDeclaration &n) |
returns n or a pointer to n if n declares an exception type. | |
const SgVariableDeclaration * | exceptionTypeDecl (const SgVariableDeclaration *n) |
returns n or a pointer to n if n declares an exception type. | |
SgVariableDeclaration * | exceptionTypeDecl (SgVariableDeclaration &n) |
returns n or a pointer to n if n declares an exception type. | |
SgVariableDeclaration * | exceptionTypeDecl (SgVariableDeclaration *n) |
returns n or a pointer to n if n declares an exception type. | |
SgExpressionPtrList | normalizedCallArguments (const SgFunctionCallExp &n, bool withDefaultArguments=false) |
attempts to identify the argument list automatically and uses it to invoke the preceding normalizedCallArguments2 function. | |
SgFunctionParameterList * | calleeParameterList (const SgFunctionCallExp &n) |
returns the function parameter list of the associated callee (if available). | |
SgFunctionParameterList * | calleeParameterList (const SgFunctionCallExp *n) |
returns the function parameter list of the associated callee (if available). | |
std::tuple< const SgScopeStatement *, const SgSymbol * > | findSymbolInContext (std::string id, const SgScopeStatement &scope, const SgScopeStatement *limit=nullptr) |
finds the symbol with Naming tips in the context of scope or its logical parents in the range [scope, limit). | |
SgScopeStatement * | overridingScope (const SgExprListExp &args, const std::vector< PrimitiveParameterDesc > &primitiveArgs) |
returns the overriding scope of a primitive function based on the associated arguments as defined by the argument list args and the primitive argument positions defined by primitiveArgs . | |
SgScopeStatement * | overridingScope (const SgExprListExp *args, const std::vector< PrimitiveParameterDesc > &primitiveArgs) |
returns the overriding scope of a primitive function based on the associated arguments as defined by the argument list args and the primitive argument positions defined by primitiveArgs . | |
SgScopeStatement * | logicalParentScope (const SgScopeStatement &s) |
returns the logical parent scope of a scope s. | |
SgScopeStatement * | logicalParentScope (const SgScopeStatement *s) |
returns the logical parent scope of a scope s. | |
SgDeclarationStatement * | associatedDeclaration (const SgType &ty) |
returns the decl where ty was defined nullptr if no such declaration can be found. | |
SgDeclarationStatement * | associatedDeclaration (const SgType *ty) |
returns the decl where ty was defined nullptr if no such declaration can be found. | |
SgType * | baseType (const SgType &ty) |
returns the base type of a type ty | |
SgType * | baseType (const SgType *ty) |
returns the base type of a type ty | |
SgEnumDeclaration * | baseEnumDeclaration (const SgType *ty) |
finds the underlying enum declaration of a type ty | |
SgEnumDeclaration * | baseEnumDeclaration (const SgType &ty) |
finds the underlying enum declaration of a type ty | |
SgEnumType * | characterBaseType (SgEnumType *ty) |
checks if the type is based on one of the Standard character types. | |
SgEnumType * | characterBaseType (SgEnumType &ty) |
checks if the type is based on one of the Standard character types. | |
bool | isReverseForLoop (const SgForStatement *n) |
returns true, iff n is a reverse for loop; returns false otherwise | |
bool | isReverseForLoop (const SgForStatement &n) |
returns true, iff n is a reverse for loop; returns false otherwise | |
bool | isReverseForLoop (const SgForInitStatement *n) |
returns true, iff n is a reverse for loop; returns false otherwise | |
bool | isReverseForLoop (const SgForInitStatement &n) |
returns true, iff n is a reverse for loop; returns false otherwise | |
size_t | positionalArgumentLimit (const SgExpressionPtrList &arglst) |
finds the one past the last positional argument (aka the first named argument position). | |
size_t | positionalArgumentLimit (const SgExprListExp &args) |
finds the one past the last positional argument (aka the first named argument position). | |
size_t | positionalArgumentLimit (const SgExprListExp *args) |
finds the one past the last positional argument (aka the first named argument position). | |
bool | blockExistsInSource (const SgBasicBlock *blk) |
checks if the block blk is present in the Ada source code. | |
bool | blockExistsInSource (const SgBasicBlock &blk) |
checks if the block blk is present in the Ada source code. | |
void | simpleTraversal (std::function< void(SgNode *)> &&fn, SgNode *root) |
Traverses all AST nodes in an unspecified order. | |
void | simpleTraversal (std::function< void(SgNode *)> &&fn, StatementRange roots) |
Traverses all AST nodes in an unspecified order. | |
void | conversionTraversal (std::function< void(SgNode *)> &&fn, SgNode *root) |
void | conversionTraversal (std::function< void(SgNode *)> &&fn, StatementRange roots) |
bool | systemPackage (const SgScopeStatement &n) |
returns true if the scope n is part of a system package | |
bool | systemPackage (const SgScopeStatement *n) |
returns true if the scope n is part of a system package | |
long long int | convertIntegerLiteral (const char *img) |
converts text to constant values | |
std::string | convertStringLiteral (const char *img) |
converts text to constant values | |
long double | convertRealLiteral (const char *img) |
converts text to constant values | |
char | convertCharLiteral (const char *img) |
converts text to constant values | |
void | copyFileInfo (SgLocatedNode &tgt, const SgLocatedNode &src) |
copies the source code location from src to tgt . | |
void | setSourcePositionInSubtreeToCompilerGenerated (SgLocatedNode *n) |
sets source position in entire subtree of n to compiler generated | |
void | setSourcePositionInSubtreeToCompilerGenerated (SgLocatedNode &n) |
sets source position in entire subtree of n to compiler generated | |
void | convertAdaToCxxComments (SgNode *root, bool cxxLineComments=true) |
/} | |
void | convertToCaseSensitiveSymbolTables (SgNode *root) |
converts all symbol tables from case insensitive to case sensitive | |
void | convertToOperatorRepresentation (SgNode *root, bool convertCallSyntax=false, bool convertNamedArguments=false) |
converts AST from a function call representation to operator form for fundamental operator declarations. | |
Variables | |
const std::string | roseOperatorPrefix |
const std::string | packageStandardName |
const std::string | durationTypeName |
const std::string | exceptionName |
using SageInterface::Ada::StatementRange = typedef std::pair<SgDeclarationStatementPtrList::iterator, SgDeclarationStatementPtrList::iterator> |
Definition at line 198 of file sageInterfaceAda.h.
using SageInterface::Ada::FlatArrayTypeBase = typedef std::tuple<SgArrayType*, SgExpressionPtrList, bool > |
defines the result type for getArrayTypeInfo
Definition at line 226 of file sageInterfaceAda.h.
using SageInterface::Ada::RecordFieldBase = typedef std::tuple<const SgSymbol*> |
Definition at line 260 of file sageInterfaceAda.h.
using SageInterface::Ada::IfExpressionInfo = typedef IfInfo<SgExpression> |
returns a sequence of if (x) then value the last else does not have
Definition at line 302 of file sageInterfaceAda.h.
using SageInterface::Ada::IfStatementInfo = typedef IfInfo<SgStatement> |
Definition at line 303 of file sageInterfaceAda.h.
using SageInterface::Ada::TypeDescriptionBase = typedef std::tuple<SgType*, bool, std::vector<SgAdaTypeConstraint*> > |
Definition at line 557 of file sageInterfaceAda.h.
using SageInterface::Ada::DominantArgInfoBase = typedef std::tuple<const SgType*, std::size_t> |
Definition at line 610 of file sageInterfaceAda.h.
using SageInterface::Ada::OperatorScopeInfoBase = typedef std::tuple<SgScopeStatement*, std::size_t> |
Definition at line 624 of file sageInterfaceAda.h.
using SageInterface::Ada::ImportedUnitResultBase = typedef std::tuple< std::string, const SgDeclarationStatement*, const SgAdaRenamingDecl*, const SgExpression* > |
describes properties of imported units
Definition at line 673 of file sageInterfaceAda.h.
using SageInterface::Ada::AggregateInfoBase = typedef std::tuple< SgAdaAncestorInitializer*, SgExpressionPtrList::const_iterator, SgExpressionPtrList::const_iterator > |
Details of expression aggregates.
Definition at line 720 of file sageInterfaceAda.h.
using SageInterface::Ada::PrimitiveParameterDescBase = typedef std::tuple<size_t, const SgInitializedName*, const SgDeclarationStatement*> |
Definition at line 788 of file sageInterfaceAda.h.
using SageInterface::Ada::PrimitiveSignatureElementsDescBase = typedef std::tuple< const SgDeclarationStatement* , std::vector<PrimitiveParameterDesc> > |
Definition at line 833 of file sageInterfaceAda.h.
bool SageInterface::Ada::withPrivateDefinition | ( | const SgDeclarationStatement * | dcl | ) |
tests if the declaration dcl
defines a public type that is completed in a private section.
bool SageInterface::Ada::withPrivateDefinition | ( | const SgDeclarationStatement & | dcl | ) |
tests if the declaration dcl
defines a public type that is completed in a private section.
bool SageInterface::Ada::unconstrained | ( | const SgArrayType * | ty | ) |
tests if ty
is an unconstrained array
bool SageInterface::Ada::unconstrained | ( | const SgArrayType & | ty | ) |
tests if ty
is an unconstrained array
bool SageInterface::Ada::anonymousAccess | ( | const SgType * | ty | ) |
tests if ty
is an anonymous access type
bool SageInterface::Ada::anonymousAccess | ( | const SgType & | ty | ) |
tests if ty
is an anonymous access type
StatementRange SageInterface::Ada::declsInPackage | ( | SgGlobal & | globalScope, |
const std::string & | mainFile | ||
) |
returns all statements/declarations in the global scope that were defined in the source file.
globalScope | a reference to the global scope |
mainfile | a reference to the main source file (name) |
mainFile
In other words, the declarations in the with'ed packages are excluded from the returned range.
StatementRange SageInterface::Ada::declsInPackage | ( | SgGlobal & | globalScope, |
const SgSourceFile & | mainFile | ||
) |
returns all statements/declarations in the global scope that were defined in the source file.
globalScope | a reference to the global scope |
mainfile | a reference to the main source file (name) |
mainFile
In other words, the declarations in the with'ed packages are excluded from the returned range.
int SageInterface::Ada::firstLastDimension | ( | SgExprListExp & | args | ) |
returns an integer value for args[0] as used by type attributes first and last
throws | an exception if args[0] cannot be constant folded |
int SageInterface::Ada::firstLastDimension | ( | SgExprListExp * | args | ) |
returns an integer value for args[0] as used by type attributes first and last
throws | an exception if args[0] cannot be constant folded |
FlatArrayType SageInterface::Ada::getArrayTypeInfo | ( | SgType * | atype | ) |
returns a flattened representation of Ada array types.
atype | the type of the array to be flattened. |
atype
is not an arraytype, a pair <nullptr, empty vector> is returned otherwise a pair of an array pointer, and a vector of index ranges. Index ranges can be specified in terms of a range (SgRangeExp), a type attribute (SgAdaAttributeExp), or full type range (SgTypeExpression). (the expressions are part of the AST and MUST NOT BE DELETED). FlatArrayType SageInterface::Ada::getArrayTypeInfo | ( | SgType & | atype | ) |
returns a flattened representation of Ada array types.
atype | the type of the array to be flattened. |
atype
is not an arraytype, a pair <nullptr, empty vector> is returned otherwise a pair of an array pointer, and a vector of index ranges. Index ranges can be specified in terms of a range (SgRangeExp), a type attribute (SgAdaAttributeExp), or full type range (SgTypeExpression). (the expressions are part of the AST and MUST NOT BE DELETED). SgType & SageInterface::Ada::standardType | ( | const std::string & | name | ) |
returns a type from the standard package with name name
.
the | name of a type in the standard package |
std::vector< RecordField > SageInterface::Ada::getAllRecordFields | ( | const SgClassDefinition & | rec | ) |
returns all fields (defined and inherited) of a record.
rec | the class definition for which the fields are sought |
std::vector< RecordField > SageInterface::Ada::getAllRecordFields | ( | const SgClassDefinition * | rec | ) |
returns all fields (defined and inherited) of a record.
rec | the class definition for which the fields are sought |
long long int SageInterface::Ada::staticIntegralValue | ( | SgExpression * | n | ) |
integer constant folding
an | exception otherwise. |
SgRangeExp * SageInterface::Ada::range | ( | const SgAdaAttributeExp * | rangeAttribute | ) |
returns a range for the range attribute rangeAttribute
.
a | std::runtime_error if the rangeAttribute uses an index specification that is not an integral constant expression. |
rangeAttribute
is not null SgRangeExp * SageInterface::Ada::range | ( | const SgAdaAttributeExp & | rangeAttribute | ) |
returns a range for the range attribute rangeAttribute
.
a | std::runtime_error if the rangeAttribute uses an index specification that is not an integral constant expression. |
rangeAttribute
is not null const SgScopeStatement * SageInterface::Ada::correspondingBody | ( | const SgScopeStatement * | scope | ) |
returns the body scope (aka definition) of a task, package, or protected object.
scope | a task, package, protected object spec or body |
given a spec or body, the function returns the body, null otherwise e.g., getBodyScope(SgAdaPackageSpec) -> SgAdaPackageBody getBodyScope(SgAdaPackageBody) -> SgAdaPackageBody getBodyScope(SgFunctionDefinition) -> nullptr
bool SageInterface::Ada::tryFollowsDeclarativeBlock | ( | const SgTryStmt & | n | ) |
returns true iff n
is a try block following a declarative region
bool SageInterface::Ada::tryFollowsDeclarativeBlock | ( | const SgTryStmt * | n | ) |
returns true iff n
is a try block following a declarative region
bool SageInterface::Ada::isPackageTryBlock | ( | const SgTryStmt & | n | ) |
returns true iff n
is an Ada package try block
bool SageInterface::Ada::isPackageTryBlock | ( | const SgTryStmt * | n | ) |
returns true iff n
is an Ada package try block
bool SageInterface::Ada::isFixedType | ( | const SgType * | ty | ) |
returns if the type ty is a fixed point type
also return true for decimal fixed points
bool SageInterface::Ada::isFixedType | ( | const SgType & | ty | ) |
returns if the type ty is a fixed point type
also return true for decimal fixed points
bool SageInterface::Ada::isScalarType | ( | const SgType * | ty | ) |
returns true if ty refers to a scalar type
true if the ty's root type is a modular type, signed integer type, enumeration type, discrete type, fixed type, decimal fixed type, or enum type.
bool SageInterface::Ada::isScalarType | ( | const SgType & | ty | ) |
returns true if ty refers to a scalar type
true if the ty's root type is a modular type, signed integer type, enumeration type, discrete type, fixed type, decimal fixed type, or enum type.
bool SageInterface::Ada::resolvesToFixedType | ( | const SgType * | ty | ) |
returns if the type ty resolves to a fixed point type
also return true for decimal fixed points
bool SageInterface::Ada::resolvesToFixedType | ( | const SgType & | ty | ) |
returns if the type ty resolves to a fixed point type
also return true for decimal fixed points
bool SageInterface::Ada::isDecimalFixedType | ( | const SgType * | ty | ) |
returns if the type ty is a decimal fixed point type
implementation is incomplete and only detects formal decimal fixed point constraints
bool SageInterface::Ada::isDecimalFixedType | ( | const SgType & | ty | ) |
returns if the type ty is a decimal fixed point type
implementation is incomplete and only detects formal decimal fixed point constraints
boost::optional< bool > SageInterface::Ada::booleanConstant | ( | const SgExpression * | e | ) |
if e denotes an Ada boolean constant, it is returned; otherwise an empty result is returned.
the function does not perform any constant folding
boost::optional< bool > SageInterface::Ada::booleanConstant | ( | const SgExpression & | e | ) |
if e denotes an Ada boolean constant, it is returned; otherwise an empty result is returned.
the function does not perform any constant folding
SgAdaGenericDecl * SageInterface::Ada::isGenericDecl | ( | const SgDeclarationStatement & | n | ) |
Returns the SgAdaGenericDecl node that makes a declaration (either function/procedure or package) generic.
n | a declaration that is possibly part of a generic declaration. |
n
, where n
is a either function/procedure or package that is declared directly under an SgAdaGenericDecl; nullptr otherwise.For a subtree SgAdaGenericDecl->SgAdaGenericDefn->n, the SgAdaGenericDecl node is returned.
SgAdaGenericDecl * SageInterface::Ada::isGenericDecl | ( | const SgDeclarationStatement * | n | ) |
Returns the SgAdaGenericDecl node that makes a declaration (either function/procedure or package) generic.
n | a declaration that is possibly part of a generic declaration. |
n
, where n
is a either function/procedure or package that is declared directly under an SgAdaGenericDecl; nullptr otherwise.For a subtree SgAdaGenericDecl->SgAdaGenericDefn->n, the SgAdaGenericDecl node is returned.
SgAdaGenericDecl & SageInterface::Ada::getGenericDecl | ( | const SgAdaGenericInstanceDecl & | n | ) |
Returns SgAdaGenericDecl for a given SgAdaGenericInstanceDecl.
skips over intermediate renaming declarations.
SgAdaGenericDecl * SageInterface::Ada::getGenericDecl | ( | const SgAdaGenericInstanceDecl * | n | ) |
Returns SgAdaGenericDecl for a given SgAdaGenericInstanceDecl.
skips over intermediate renaming declarations.
TypeDescription SageInterface::Ada::typeOfExpr | ( | const SgExpression & | ) |
returns the type of an expression corrects for some peculiarities in the AST
TypeDescription SageInterface::Ada::typeOfExpr | ( | const SgExpression * | ) |
returns the type of an expression corrects for some peculiarities in the AST
returns the base type if ty is an access type
ty | some type |
returns the base type if ty is an access type
ty | some type |
OperatorScopeInfo SageInterface::Ada::operatorScope | ( | const std::string & | opname, |
const SgTypePtrList & | argtypes | ||
) |
returns the scope where an operator with name opname
and argument types in argtypes
shall be declared.
opname | the operator name |
argtypes | a list of argument types |
SgScopeStatement & SageInterface::Ada::operatorScope | ( | const std::string & | opname, |
const SgType & | ty | ||
) |
returns the scope where an operator associated with type ty
shall be declared.
opname | the operator name |
ty | the type name |
SgScopeStatement * SageInterface::Ada::operatorScope | ( | const std::string & | opname, |
const SgType * | ty | ||
) |
returns the scope where an operator associated with type ty
shall be declared.
opname | the operator name |
ty | the type name |
SgScopeStatement * SageInterface::Ada::declarationScope | ( | const SgType * | ty | ) |
returns the scope where type ty
has been declared
ty | some type |
SgScopeStatement * SageInterface::Ada::declarationScope | ( | const SgType & | ty | ) |
returns the scope where type ty
has been declared
ty | some type |
std::string SageInterface::Ada::convertRoseOperatorNameToAdaName | ( | const std::string & | nameInRose | ) |
takes a function name as used in ROSE and converts it to a name in Ada (i.e., '"' + operator_text + '"').
if nameInRose
does not name an operator, then the name is returned as is.
std::string SageInterface::Ada::convertRoseOperatorNameToAdaOperator | ( | const std::string & | nameInRose | ) |
takes a function name as used in ROSE and converts it to an operator in Ada (i.e., operator_text).
if nameInRose
does not name an operator, an empty string is returned
const SgFunctionType * SageInterface::Ada::functionType | ( | const SgFunctionSymbol * | fnsy | ) |
returns the static type of the function symbol fnsy
const SgFunctionType & SageInterface::Ada::functionType | ( | const SgFunctionSymbol & | fnsy | ) |
returns the static type of the function symbol fnsy
std::vector< PrimitiveParameterDesc > SageInterface::Ada::primitiveParameterPositions | ( | const SgFunctionDeclaration & | fn | ) |
returns the descriptions for parameters that make an operation primitive.
(e.g., derived types, tagged types, and anonymous access types of those.)
Other sources tie the notion of primitive arguments to tagged types. e.g., https://en.wikibooks.org/wiki/Ada_Programming/Object_Orientation#Primitive_operations . accessed on 04/01/26.
std::vector< PrimitiveParameterDesc > SageInterface::Ada::primitiveParameterPositions | ( | const SgFunctionDeclaration * | fn | ) |
returns the descriptions for parameters that make an operation primitive.
(e.g., derived types, tagged types, and anonymous access types of those.)
Other sources tie the notion of primitive arguments to tagged types. e.g., https://en.wikibooks.org/wiki/Ada_Programming/Object_Orientation#Primitive_operations . accessed on 04/01/26.
PrimitiveSignatureElementsDesc SageInterface::Ada::primitiveSignatureElements | ( | const SgFunctionDeclaration & | ) |
returns the descriptions for result type and parameters that make an operation primitive.
(e.g., derived types, tagged types, and anonymous access types of those.)
PrimitiveSignatureElementsDesc SageInterface::Ada::primitiveSignatureElements | ( | const SgFunctionDeclaration * | ) |
returns the descriptions for result type and parameters that make an operation primitive.
(e.g., derived types, tagged types, and anonymous access types of those.)
const SgVariableDeclaration * SageInterface::Ada::exceptionTypeDecl | ( | const SgVariableDeclaration & | n | ) |
returns n
or a pointer to n
if n
declares an exception type.
n | an exception declaration candidate |
const SgVariableDeclaration * SageInterface::Ada::exceptionTypeDecl | ( | const SgVariableDeclaration * | n | ) |
returns n
or a pointer to n
if n
declares an exception type.
n | an exception declaration candidate |
SgVariableDeclaration * SageInterface::Ada::exceptionTypeDecl | ( | SgVariableDeclaration & | n | ) |
returns n
or a pointer to n
if n
declares an exception type.
n | an exception declaration candidate |
SgVariableDeclaration * SageInterface::Ada::exceptionTypeDecl | ( | SgVariableDeclaration * | n | ) |
returns n
or a pointer to n
if n
declares an exception type.
n | an exception declaration candidate |
SgExpressionPtrList SageInterface::Ada::normalizedCallArguments2 | ( | const SgFunctionCallExp & | n, |
const SgFunctionParameterList & | arglist, | ||
bool | withDefaultArguments = false |
||
) |
returns a list of arguments with named arguments placed at the correct position by taking into account the supplied argument list.
n | the call expression |
arglist | a argument list |
withDefaultArguments | true if defaulted arguments should get filled in. if false, defaulted arguments are represented by a nullptr |
std::logic_error | when named arguments cannot be identified. |
SgExpressionPtrList SageInterface::Ada::normalizedCallArguments | ( | const SgFunctionCallExp & | n, |
bool | withDefaultArguments = false |
||
) |
attempts to identify the argument list automatically and uses it to invoke the preceding normalizedCallArguments2 function.
n | the call expression |
withDefaultArguments | true if defaulted arguments should get filled in. if false, defaulted arguments are represented by a nullptr |
std::logic_error | when there is no function associated with the call. or when normalizedCallArguments2 throws. |
SgFunctionParameterList * SageInterface::Ada::calleeParameterList | ( | const SgFunctionCallExp & | n | ) |
returns the function parameter list of the associated callee (if available).
n | a function call expression |
SgFunctionParameterList * SageInterface::Ada::calleeParameterList | ( | const SgFunctionCallExp * | n | ) |
returns the function parameter list of the associated callee (if available).
n | a function call expression |
std::size_t SageInterface::Ada::normalizedArgumentPosition | ( | const SgFunctionCallExp & | call, |
const SgExpression & | arg | ||
) |
returns the parameter position of arg in the callee, after the parameters have been normalized.
a | std::logic_error when a position cannot be found. |
assume declaration: procedure X(left, right : integer := 1); and call: X(right => 3) then normalizedArgumentPosition(call, "3") -> 1
std::tuple< const SgScopeStatement *, const SgSymbol * > SageInterface::Ada::findSymbolInContext | ( | std::string | id, |
const SgScopeStatement & | scope, | ||
const SgScopeStatement * | limit = nullptr |
||
) |
finds the symbol with Naming tips in the context of scope or its logical parents in the range [scope, limit).
name | an identifier of the sought symbol |
scope | current scope |
limit | the scope in the chain that terminates the search (this scope will not be considered) |
a scope can contain multiple symbols with the same name, so the caller may iterate over the remaining names using the scope's accessor functions (next_XXX_symbol).
SgScopeStatement * SageInterface::Ada::overridingScope | ( | const SgExprListExp & | args, |
const std::vector< PrimitiveParameterDesc > & | primitiveArgs | ||
) |
returns the overriding scope of a primitive function based on the associated arguments as defined by the argument list args
and the primitive argument positions defined by primitiveArgs
.
primitiveParameterPositions
SgScopeStatement * SageInterface::Ada::overridingScope | ( | const SgExprListExp * | args, |
const std::vector< PrimitiveParameterDesc > & | primitiveArgs | ||
) |
returns the overriding scope of a primitive function based on the associated arguments as defined by the argument list args
and the primitive argument positions defined by primitiveArgs
.
primitiveParameterPositions
const SgScopeStatement * SageInterface::Ada::canonicalScope | ( | const SgScopeStatement * | scope | ) |
returns the canonical scope of some Ada scope scope
.
The canonical scope of an entity is its declarative scope e.g., The canonical scope of an SgAdaPackageBody is its spec, a SgAdaPackageSpec
SgScopeStatement * SageInterface::Ada::logicalParentScope | ( | const SgScopeStatement & | s | ) |
returns the logical parent scope of a scope s.
Compared to si::getEnclosingScope, this function returns the spec as the logical parent for Ada bodies (e.g., packages, tasks, protected objects). Otherwise, the parent scope is the same as returned by si::getEnclosingScope.
SgScopeStatement * SageInterface::Ada::logicalParentScope | ( | const SgScopeStatement * | s | ) |
returns the logical parent scope of a scope s.
Compared to si::getEnclosingScope, this function returns the spec as the logical parent for Ada bodies (e.g., packages, tasks, protected objects). Otherwise, the parent scope is the same as returned by si::getEnclosingScope.
SgDeclarationStatement * SageInterface::Ada::associatedDeclaration | ( | const SgType & | ty | ) |
returns the decl where ty
was defined nullptr if no such declaration can be found.
Skips over intermediate derived types, subtypes, access (pointer) types until a SgNamedType is found. Returns the declaration of said type.
SgDeclarationStatement * SageInterface::Ada::associatedDeclaration | ( | const SgType * | ty | ) |
returns the decl where ty
was defined nullptr if no such declaration can be found.
Skips over intermediate derived types, subtypes, access (pointer) types until a SgNamedType is found. Returns the declaration of said type.
returns the base type of a type ty
In the following type hierarchy baseType(Y) -> S1 -> X but not Integer.
returns the base type of a type ty
In the following type hierarchy baseType(Y) -> S1 -> X but not Integer.
SgEnumDeclaration * SageInterface::Ada::baseEnumDeclaration | ( | const SgType * | ty | ) |
finds the underlying enum declaration of a type ty
baseEnumDeclaration skips over intermediate SgTypedefDeclarations that introduce a new type (
SgEnumDeclaration * SageInterface::Ada::baseEnumDeclaration | ( | const SgType & | ty | ) |
finds the underlying enum declaration of a type ty
baseEnumDeclaration skips over intermediate SgTypedefDeclarations that introduce a new type (
SgEnumType * SageInterface::Ada::characterBaseType | ( | SgEnumType * | ty | ) |
checks if the type is based on one of the Standard character types.
SgEnumType * SageInterface::Ada::characterBaseType | ( | SgEnumType & | ty | ) |
checks if the type is based on one of the Standard character types.
size_t SageInterface::Ada::positionalArgumentLimit | ( | const SgExpressionPtrList & | arglst | ) |
finds the one past the last positional argument (aka the first named argument position).
examples:
size_t SageInterface::Ada::positionalArgumentLimit | ( | const SgExprListExp & | args | ) |
finds the one past the last positional argument (aka the first named argument position).
examples:
size_t SageInterface::Ada::positionalArgumentLimit | ( | const SgExprListExp * | args | ) |
finds the one past the last positional argument (aka the first named argument position).
examples:
bool SageInterface::Ada::blockExistsInSource | ( | const SgBasicBlock * | blk | ) |
checks if the block blk
is present in the Ada source code.
blk | a reference or pointer to a ROSE basic block object. |
bool SageInterface::Ada::blockExistsInSource | ( | const SgBasicBlock & | blk | ) |
checks if the block blk
is present in the Ada source code.
blk | a reference or pointer to a ROSE basic block object. |
SgFunctionSymbol * SageInterface::Ada::findPubliclyVisibleFunction | ( | SgFunctionSymbol & | fnsym, |
const SgFunctionType & | drvFunTy, | ||
const SgNamedType & | dervTy | ||
) |
finds the function symbol for a publicly accessible function.
fnsym | the function symbol (maybe be private) |
drvFunTy | the derived function type |
dervTy | the derived type for which the symbol is sought |
bool SageInterface::Ada::isAnyAccessAttribute | ( | const SgAdaAttributeExp & | attr | ) |
tests if attr
is an access attribute
either 'access, 'unchecked_access, or 'unrestricted_access.
SgExprListExp * SageInterface::Ada::isPragma | ( | const SgPragmaDeclaration & | prgdcl, |
const std::string & | pragmaname | ||
) |
tests if prgdcl
is a pragma with name pragmaname
.
prgdcl | the pragma declaration |
pragmaname | the name to test for |
the | pragmas argument list (possibly empty) if prgdcl is a pragmaname pragma; nullptr otherwise. |
Traverses all AST nodes in an unspecified order.
Only traverses edges that are commonly traversed by ROSE's standard traversal mechanism.
fn | a functor that queries and possibly transforms the AST |
root | a singular root node (all subtrees are traversed) |
roots | a statement range of root nodes. |
fn
is typically a functor that collects all nodes that need to be converted in a first pass. An update pass, triggered by fn's destructor carries out the actual transformations of the collected nodes. void SageInterface::Ada::simpleTraversal | ( | std::function< void(SgNode *)> && | fn, |
StatementRange | roots | ||
) |
Traverses all AST nodes in an unspecified order.
Only traverses edges that are commonly traversed by ROSE's standard traversal mechanism.
fn | a functor that queries and possibly transforms the AST |
root | a singular root node (all subtrees are traversed) |
roots | a statement range of root nodes. |
fn
is typically a functor that collects all nodes that need to be converted in a first pass. An update pass, triggered by fn's destructor carries out the actual transformations of the collected nodes. void SageInterface::Ada::conversionTraversal | ( | std::function< void(SgNode *)> && | fn, |
SgNode * | root | ||
) |
void SageInterface::Ada::conversionTraversal | ( | std::function< void(SgNode *)> && | fn, |
StatementRange | roots | ||
) |
ScopePath SageInterface::Ada::pathToGlobal | ( | const SgScopeStatement & | n | ) |
Constructs a path from a scope statement to the top-level (global) scope.
The path contains [n, global)
n | innermost scope |
void SageInterface::Ada::setSourcePositionInSubtreeToCompilerGenerated | ( | SgLocatedNode * | n | ) |
sets source position in entire subtree of n
to compiler generated
void SageInterface::Ada::setSourcePositionInSubtreeToCompilerGenerated | ( | SgLocatedNode & | n | ) |
sets source position in entire subtree of n
to compiler generated
void SageInterface::Ada::convertAdaToCxxComments | ( | SgNode * | root, |
bool | cxxLineComments = true |
||
) |
/}
converts all Ada style comments to C++ comments
void SageInterface::Ada::convertToOperatorRepresentation | ( | SgNode * | root, |
bool | convertCallSyntax = false , |
||
bool | convertNamedArguments = false |
||
) |
converts AST from a function call representation to operator form for fundamental operator declarations.
root | the subtree is traversed to find operator calls (using the traversal mechanism) |
convertCallSyntax | false, only convert those calls where get_uses_operator_syntax() returns false true, convert all calls (may result in invalid Ada) |
convertNamedArguments | not relevant, when convertCallSyntax == false true, named arguments are resolved false, named arguments are preserved |