ROSE
0.11.98.0
|
Contains Ada-specific functionality.
Classes | |
struct | AggregateInfo |
Details of expression aggregates. More... | |
struct | IfInfo |
represents a branch in an if elsif else context (either statement or expression). More... | |
struct | PrimitiveParameterDesc |
Typedefs | |
using | StatementRange = std::pair< SgDeclarationStatementPtrList::iterator, SgDeclarationStatementPtrList::iterator > |
using | FlatArrayType = std::pair< SgArrayType *, std::vector< SgExpression * > > |
defines the result type for getArrayTypeInfo | |
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 | |
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... | |
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 & | getBodyDeclaration (const SgAdaPackageSpecDecl &specDecl) |
returns the declaration node for the package body, if available | |
SgAdaPackageBodyDecl * | getBodyDeclaration (const SgAdaPackageSpecDecl *specDecl) |
returns the declaration node for the package body, if available | |
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 | 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 | 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... | |
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 | |
SgType * | typeRoot (SgType &) |
returns the most fundamental type after skipping derived types, subtypes, typedefs, etc. | |
SgType * | typeRoot (SgType *) |
returns the most fundamental type after skipping derived types, subtypes, typedefs, etc. | |
SgType * | typeOfExpr (SgExpression &) |
returns the type of an expression corrects for some peculiarities in the AST More... | |
SgType * | typeOfExpr (SgExpression *) |
returns the type of an expression corrects for some peculiarities in the AST More... | |
SgScopeStatement * | scopeOfTypedecl (const SgType &ty) |
returns the scope where ty was defined | |
SgScopeStatement * | scopeOfTypedecl (const SgType *ty) |
returns the scope where ty was defined | |
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 | 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 | |
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... | |
SgDeclarationStatement * | baseDeclaration (SgType &ty) |
finds the type declaration of a type ty More... | |
SgDeclarationStatement * | baseDeclaration (SgType *ty) |
finds the type declaration 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. |
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::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.
SgType* SageInterface::ada::typeOfExpr | ( | SgExpression & | ) |
returns the type of an expression corrects for some peculiarities in the AST
SgType* SageInterface::ada::typeOfExpr | ( | SgExpression * | ) |
returns the type of an expression corrects for some peculiarities in the AST
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
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.
SgDeclarationStatement* SageInterface::ada::baseDeclaration | ( | SgType & | ty | ) |
finds the type declaration of a type ty
Skips over intermediate derived types, subtypes, etc. until a SgNamedType is found. Returns the declaration of said type.
SgDeclarationStatement* SageInterface::ada::baseDeclaration | ( | SgType * | ty | ) |
finds the type declaration of a type ty
Skips over intermediate derived types, subtypes, etc. until a SgNamedType is found. Returns the declaration of said type.
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 |