ROSE
0.11.131.0
|
Contains Ada-specific functionality.
Classes | |
struct | AggregateInfo |
Details of expression aggregates. More... | |
struct | FlatArrayType |
defines the result type for getArrayTypeInfo More... | |
struct | IfInfo |
represents a branch in an if elsif else context (either statement or expression). More... | |
struct | ImportedUnitResult |
describes properties of imported units More... | |
struct | PrimitiveParameterDesc |
struct | TypeDescription |
Typedefs | |
using | StatementRange = std::pair< SgDeclarationStatementPtrList::iterator, SgDeclarationStatementPtrList::iterator > |
using | IfExpressionInfo = IfInfo< SgExpression > |
returns a sequence of if (x) then value the last else does not have | |
using | IfStatementInfo = IfInfo< SgStatement > |
Functions | |
std::vector< IfExpressionInfo > | flattenIfExpressions (SgConditionalExp &n) |
returns a flat representation of if expressions | |
std::vector< IfStatementInfo > | flattenIfStatements (SgIfStmt &n) |
returns a flat representation of if-elsif-else statements | |
long long int | staticIntegralValue (SgExpression *n) |
integer constant folding More... | |
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. More... | |
ImportedUnitResult | importedUnit (const SgImportStatement &impdcl) |
queries properties of an imported unit | |
const SgExpression & | importedElement (const SgImportStatement &n) |
returns the imported element (i.e., the first entry in n's import_list | |
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 + '"'). More... | |
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). More... | |
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. More... | |
SgDeclarationStatement * | associatedDeclaration (const SgSymbol &n) |
returns the associated declaration for symbol n or nullptr if there is none. More... | |
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 | |
void | convertAdaToCxxComments (SgNode *root, bool cxxLineComments=true) |
converts all Ada style comments to C++ comments | |
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. More... | |
bool | withPrivateDefinition (const SgDeclarationStatement *dcl) |
tests if the declaration dcl defines a public type that is completed in a private section. More... | |
bool | withPrivateDefinition (const SgDeclarationStatement &dcl) |
tests if the declaration dcl defines a public type that is completed in a private section. More... | |
bool | unconstrained (const SgArrayType *ty) |
tests if ty is an unconstrained array More... | |
bool | unconstrained (const SgArrayType &ty) |
tests if ty is an unconstrained array More... | |
StatementRange | declsInPackage (SgGlobal &globalScope, const std::string &mainFile) |
returns all statements/declarations in the global scope that were defined in the source file. More... | |
StatementRange | declsInPackage (SgGlobal &globalScope, const SgSourceFile &mainFile) |
returns all statements/declarations in the global scope that were defined in the source file. More... | |
int | firstLastDimension (SgExprListExp &args) |
returns an integer value for args[0] as used by type attributes first and last More... | |
int | firstLastDimension (SgExprListExp *args) |
returns an integer value for args[0] as used by type attributes first and last More... | |
FlatArrayType | getArrayTypeInfo (SgType *atype) |
returns a flattened representation of Ada array types. More... | |
SgRangeExp * | range (const SgAdaAttributeExp *rangeAttribute) |
returns a range for the range attribute rangeAttribute. More... | |
SgRangeExp * | range (const SgAdaAttributeExp &rangeAttribute) |
returns a range for the range attribute rangeAttribute. More... | |
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 | |
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 | isFunctionTryBlock (const SgTryStmt &n) |
returns true iff n is an Ada function try block More... | |
bool | isFunctionTryBlock (const SgTryStmt *n) |
returns true iff n is an Ada function try block More... | |
bool | isPackageTryBlock (const SgTryStmt &n) |
returns true iff n is an Ada package try block More... | |
bool | isPackageTryBlock (const SgTryStmt *n) |
returns true iff n is an Ada package try block More... | |
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 | 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 More... | |
bool | isFixedType (const SgType &ty) |
returns if the type ty is a fixed point type More... | |
bool | resolvesToFixedType (const SgType *ty) |
returns if the type ty resolves to a fixed point type More... | |
bool | resolvesToFixedType (const SgType &ty) |
returns if the type ty resolves to a fixed point type More... | |
bool | isDecimalFixedType (const SgType *ty) |
returns if the type ty is a decimal fixed point type More... | |
bool | isDecimalFixedType (const SgType &ty) |
returns if the type ty is a decimal fixed point type More... | |
SgAdaGenericDecl * | isGenericDecl (const SgDeclarationStatement &n) |
Returns the SgAdaGenericDecl node that makes a declaration (either function/procedure or package) generic. More... | |
SgAdaGenericDecl * | isGenericDecl (const SgDeclarationStatement *n) |
Returns the SgAdaGenericDecl node that makes a declaration (either function/procedure or package) generic. More... | |
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. More... | |
SgAdaGenericDecl * | getGenericDecl (const SgAdaGenericInstanceDecl *n) |
Returns SgAdaGenericDecl for a given SgAdaGenericInstanceDecl. More... | |
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 (SgExpression &) |
returns the type of an expression corrects for some peculiarities in the AST More... | |
TypeDescription | typeOfExpr (SgExpression *) |
returns the type of an expression corrects for some peculiarities in the AST More... | |
SgScopeStatement * | operatorScope (std::string opname, SgTypePtrList argtypes) |
returns the scope where an operator with name opname and argument types in argtypes should be defined. More... | |
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) | |
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 &) |
returns the descriptions for parameters that make an operations primitive | |
std::vector< PrimitiveParameterDesc > | primitiveParameterPositions (const SgFunctionDeclaration *) |
returns the descriptions for parameters that make an operations primitive | |
SgExpressionPtrList | normalizedCallArguments (const SgFunctionCallExp &n) |
returns a list of arguments with named arguments placed at the correct position More... | |
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). More... | |
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. More... | |
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. More... | |
const SgScopeStatement * | logicalParentScope (const SgScopeStatement &s) |
returns the logical parent scope of a scope s. More... | |
const SgScopeStatement * | logicalParentScope (const SgScopeStatement *s) |
returns the logical parent scope of a scope s. More... | |
SgDeclarationStatement * | associatedDeclaration (const SgType &ty) |
returns the decl where ty was defined nullptr if no such declaration can be found. More... | |
SgDeclarationStatement * | associatedDeclaration (const SgType *ty) |
returns the decl where ty was defined nullptr if no such declaration can be found. More... | |
SgType * | baseType (const SgType &ty) |
returns the base type of a type ty More... | |
SgType * | baseType (const SgType *ty) |
returns the base type of a type ty More... | |
SgEnumDeclaration * | baseEnumDeclaration (SgType *ty) |
finds the underlying enum declaration of a type ty More... | |
SgEnumDeclaration * | baseEnumDeclaration (SgType &ty) |
finds the underlying enum declaration of a type ty More... | |
size_t | positionalArgumentLimit (const SgExpressionPtrList &arglst) |
finds the one past the last positional argument (aka the first named argument position). More... | |
size_t | positionalArgumentLimit (const SgExprListExp &args) |
finds the one past the last positional argument (aka the first named argument position). More... | |
size_t | positionalArgumentLimit (const SgExprListExp *args) |
finds the one past the last positional argument (aka the first named argument position). More... | |
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 | |
Variables | |
const std::string | roseOperatorPrefix |
const std::string | packageStandardName |
const std::string | durationTypeName |
const std::string | exceptionName |
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
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) |
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) |
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. |
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. |
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. |
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::isFunctionTryBlock | ( | const SgTryStmt & | n | ) |
returns true iff n is an Ada function try block
bool SageInterface::Ada::isFunctionTryBlock | ( | const SgTryStmt * | n | ) |
returns true iff n is an Ada function try block
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::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
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. |
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. |
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 | ( | SgExpression & | ) |
returns the type of an expression corrects for some peculiarities in the AST
TypeDescription SageInterface::Ada::typeOfExpr | ( | SgExpression * | ) |
returns the type of an expression corrects for some peculiarities in the AST
SgScopeStatement* SageInterface::Ada::operatorScope | ( | std::string | opname, |
SgTypePtrList | argtypes | ||
) |
returns the scope where an operator with name opname and argument types in argtypes should be defined.
opname | the operarator name |
argtypes | a list of argument types |
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
SgExpressionPtrList SageInterface::Ada::normalizedCallArguments | ( | const SgFunctionCallExp & | n | ) |
returns a list of arguments with named arguments placed at the correct position
std::logic_error | when there is no function associated with the call, or when named arguments cannot be identified. For an example for the latter, see test case ancestors.adb |
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.
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.
const 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.
const 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 SgSymbol & | n | ) |
returns the associated declaration for symbol n or nullptr if there is none.
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, etc. 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, etc. until a SgNamedType is found. Returns the declaration of said type.
returns the base type of a type ty
In the following type hierarchy baseTypes(Y) would return { X, S1, S2 } but not Integer.
returns the base type of a type ty
In the following type hierarchy baseTypes(Y) would return { X, S1, S2 } but not Integer.
SgEnumDeclaration* SageInterface::Ada::baseEnumDeclaration | ( | SgType * | ty | ) |
finds the underlying enum declaration of a type ty
in contrast to baseDeclaration, baseEnumDeclaration skips over intermediate SgTypedefDeclarations that introduce a new type or a subtype.
SgEnumDeclaration* SageInterface::Ada::baseEnumDeclaration | ( | SgType & | ty | ) |
finds the underlying enum declaration of a type ty
in contrast to baseDeclaration, baseEnumDeclaration skips over intermediate SgTypedefDeclarations that introduce a new type or a subtype.
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:
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 |