ROSE  0.11.50.0
Classes | Typedefs | Functions
SageInterface::ada Namespace Reference

Description

Contains Ada-specific functionality.

Classes

struct  PrimitiveParameterDesc
 
struct  VariantEntry
 
struct  VariantInfo
 

Typedefs

typedef std::pair< SgArrayType *, std::vector< SgExpression * > > FlatArrayType
 defines the result type for flattenArrayType
 

Functions

VariantInfo variantInfo (const SgAdaVariantFieldDecl *n)
 returns basic information about the variant declaration
 
int getSharedControlDepth (const VariantInfo &prev, const VariantInfo &next)
 get the depth of shared of control variables
 
bool haveSameConditionAt (const VariantInfo &prev, const VariantInfo &next, int i)
 test if prev and next have the same variant condition at position i
 
VariantEntry getVariant (const VariantInfo &prev, int i)
 get the control/conditions of the i th entry.
 
SgDeclarationStatementPtrList::const_iterator findVariantConditionChange (SgDeclarationStatementPtrList::const_iterator begin, SgDeclarationStatementPtrList::const_iterator end, const SgAdaVariantFieldDecl *lastVariant)
 finds the next statement in the range [begin, end) that has a different variant condition than lastVariant
 
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
 
bool withPrivateDefinition (const SgDeclarationStatement *dcl)
 tests if the declaration dcl defines a type that is completed in a private section. More...
 
bool withPrivateDefinition (const SgDeclarationStatement &dcl)
 tests if the declaration dcl defines a 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...
 
FlatArrayType getArrayTypeInfo (SgType *atype)
 returns a flattened representation of Ada array types. More...
 
SgRangeExprange (const SgAdaAttributeExp *rangeAttribute)
 returns a range for the range attribute rangeAttribute. More...
 
SgRangeExprange (const SgAdaAttributeExp &rangeAttribute)
 returns a range for the range attribute rangeAttribute. More...
 
SgAdaPackageSpecDeclgetSpecificationDeclaration (const SgAdaPackageBodyDecl &bodyDecl)
 returns the declaration node for the package specification
 
SgAdaPackageSpecDeclgetSpecificationDeclaration (const SgAdaPackageBodyDecl *bodyDecl)
 returns the declaration node for the package specification
 
SgAdaPackageBodyDeclgetBodyDeclaration (const SgAdaPackageSpecDecl &specDecl)
 returns the declaration node for the package body, if available
 
SgAdaPackageBodyDeclgetBodyDeclaration (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 try block More...
 
bool isFunctionTryBlock (const SgTryStmt *n)
 returns true iff n is an Ada 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
 
SgAdaDiscriminatedTypeDeclgetAdaDiscriminatedTypeDecl (const SgDeclarationStatement &n)
 returns the SgAdaDiscriminatedTypeDecl iff n is discriminated null otherwise
 
SgAdaDiscriminatedTypeDeclgetAdaDiscriminatedTypeDecl (const SgDeclarationStatement *n)
 returns the SgAdaDiscriminatedTypeDecl iff n is discriminated null otherwise
 
std::vector< PrimitiveParameterDescprimitiveParameterPositions (const SgFunctionDeclaration &)
 returns the descriptions for parameters that make an operations primitive
 
std::vector< PrimitiveParameterDescprimitiveParameterPositions (const SgFunctionDeclaration *)
 returns the descriptions for parameters that make an operations primitive
 
SgScopeStatementoverridingScope (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...
 
SgScopeStatementoverridingScope (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...
 
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...
 
int convertIntLiteral (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
 

Function Documentation

bool SageInterface::ada::withPrivateDefinition ( const SgDeclarationStatement dcl)

tests if the declaration dcl defines a type that is completed in a private section.

Returns
true, iff dcl is completed in a private section.
Precondition
dcl is not null and points to a first-nondefining declaration.
bool SageInterface::ada::withPrivateDefinition ( const SgDeclarationStatement dcl)

tests if the declaration dcl defines a type that is completed in a private section.

Returns
true, iff dcl is completed in a private section.
Precondition
dcl is not null and points to a first-nondefining declaration.
bool SageInterface::ada::unconstrained ( const SgArrayType ty)

tests if ty is an unconstrained array

Returns
true iff ty is unconstrained
bool SageInterface::ada::unconstrained ( const SgArrayType ty)

tests if ty is an unconstrained array

Returns
true iff ty is unconstrained
FlatArrayType SageInterface::ada::getArrayTypeInfo ( SgType atype)

returns a flattened representation of Ada array types.

Parameters
atypethe type of the array to be flattened.
Returns
iff is not an arraytype, a pair <nullptr, empty vector> is returned otherwise a pair of a 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).
Precondition
atype is not null.
SgRangeExp* SageInterface::ada::range ( const SgAdaAttributeExp rangeAttribute)

returns a range for the range attribute rangeAttribute.

Returns
a range if rangeAttribute is a range attribute and a range expression is in the AST; nullptr otherwise.
Exceptions
astd::runtime_error if the rangeAttribute uses an index specification that is not an integral constant expression.
Precondition
rangeAttribute is not null
SgRangeExp* SageInterface::ada::range ( const SgAdaAttributeExp rangeAttribute)

returns a range for the range attribute rangeAttribute.

Returns
a range if rangeAttribute is a range attribute and a range expression is in the AST; nullptr otherwise.
Exceptions
astd::runtime_error if the rangeAttribute uses an index specification that is not an integral constant expression.
Precondition
rangeAttribute is not null
bool SageInterface::ada::isFunctionTryBlock ( const SgTryStmt n)

returns true iff n is an Ada try block

Note
an ada try block is a function block, whose non-declarative range includes exactly one try stmt. In this case, the begin and end block-syntax can be omitted.
bool SageInterface::ada::isFunctionTryBlock ( const SgTryStmt n)

returns true iff n is an Ada try block

Note
an ada try block is a function block, whose non-declarative range includes exactly one try stmt. In this case, the begin and end block-syntax can be omitted.
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.

Returns
the scope of an overriding argument (incl. the original associated type); nullptr if no such scope can be found.
Note
does not resolve conflicting scopes
See also
also 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.

Returns
the scope of an overriding argument (incl. the original associated type); nullptr if no such scope can be found.
Note
does not resolve conflicting scopes
See also
also primitiveParameterPositions
size_t SageInterface::ada::positionalArgumentLimit ( const SgExprListExp args)

finds the one past the last positional argument (aka the first named argument position).

Returns
one past the index of the last positional argument.

examples:

  • argument lists without positional arguments => 0
  • argument lists without named arguments => args.size()
  • empty argument lists => 0
  • (1, 2, LEN => 3) => 2
size_t SageInterface::ada::positionalArgumentLimit ( const SgExprListExp args)

finds the one past the last positional argument (aka the first named argument position).

Returns
one past the index of the last positional argument.

examples:

  • argument lists without positional arguments => 0
  • argument lists without named arguments => args.size()
  • empty argument lists => 0
  • (1, 2, LEN => 3) => 2