TOC PREV NEXT INDEX DOC LIST MASTER INDEX




Function Accept_Entry_Simple_Name

Expanded Name Asis.Statements.Accept_Entry_Simple_Name

Returns the name of the specified accept statement.

Description

Accept statements are partially defined by the following syntax:

Ada83 LRM 9.5, Ada95 LRM 9.5 
accept_statement ::=
  accept entry_simple_name [(entry_index)]
   [formal_part]
  [do
   sequence_of_statements
  end [entry_simple_name]];

This function returns the entry simple name for the specified accept statement.

Parameters

Specifies the statement that should be queried. The statement must be of the following kinds:
Element_Kinds
Statement_Kinds
A_Statement
An_Accept_Statement

The returned element is of the following kind:
Element_Kinds
Expression_Kinds
An_Expression
A_Simple_Name

Errors

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if a parameter references a library variable that is no longer open, or a parameter is specified that is not appropriate for the query.

Examples

Cross-References

Related subprograms:

Related concepts:


Function Accept_Parameters

Expanded Name Asis.Statements.Accept_Parameters

Returns a list of the parameters defined in the formal part of the specified accept statement.

Description

Accept statements are partially defined by the following syntax:

Ada83 LRM 9.5, Ada95 LRM 9.5 

accept_statement ::=
  accept entry_simple_name [(entry_index)]
   [formal_part]
  [do
   sequence_of_statements
  end [entry_simple_name]];

This function returns the formal part of the specified accept statement.

The parameters are returned in their order of definition in the source code.

If the accept statement does not include a formal part, Asis.Nil_Element_List is returned.

Results of this subprogram can vary between ASIS implementations. An implementation can choose to transform all multiple-name parameter specifications into an equivalent series of individual specifications (Ada83 LRM 6.1(4), Ada95 LRM 6.1). See package Environment, "Normalization of Parameter Lists" for more information.

Rational ASIS does not transform formal-parameter lists.

For further processing on the returned list use:

Parameters

Specifies the statement that should be queried. The statement must be of the following kinds:
Element_Kinds
Statement_Kinds
A_Statement
An_Accept_Statement

The returned list contains elements of the following kinds:
Element_Kinds
Declaration_Kinds
A_Declaration
A_Parameter_Specification

Errors

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if a parameter references a library variable that is no longer open, or a parameter is specified that is not appropriate for the query.

Examples

Cross-References

Related subprograms:

Related concepts:


Function Accepted_Entry

Expanded Name Asis.Statements.Accepted_Entry

Returns the declaration of the entry for the specified accept statement.

Description

Accept statements are partially defined by the following syntax:

Ada83 LRM 9.5, Ada95 LRM 9.5 

accept_statement ::=
  accept entry_simple_name [(entry_index)]
   [formal_part]
  [do
   sequence_of_statements
  end [entry_simple_name]];

This function returns the declaration of the entry simple name for the specified accept statement.

Parameters

Specifies the statement that should be queried. The statement must be of the following kinds:
Element_Kinds
Statement_Kinds
A_Statement
An_Accept_Statement

The returned element is of the following kind:
Element_Kinds

An_Entry_Declaration

Errors

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if a parameter references a library variable that is no longer open, or a parameter is specified that is not appropriate for the query.

Asis_Failed is raised and Environment.Status is set to Obsolete_Reference_Error if a parameter is part of an obsolete compilation unit.

Examples

Cross-References

Related subprograms:

Related concepts:


Function Actual_Parameter

Expanded Name Asis.Statements.Actual_Parameter

Returns the actual parameter of the specified parameter
association or the name or expression of the specified argument association.

Description

This function accepts parameter-association elements and argument-association elements, as described in the following sections. Click on a topic for more information:

For details about this function's parameters, errors, and cross- references, click here.

Parameter Associations

Parameter associations are partially defined by the following syntax:

Ada83 LRM 6.4, Ada95 LRM 6.4 
actual_parameter_part ::=
  (parameter_association
   {, parameter_association})

 parameter_association ::=
  [formal_parameter =>] actual_parameter

Lists of parameter associations are returned by the following functions:

If Parameter represents a parameter association, this function returns an element that represents the actual parameter.

Argument Associations

Argument associations are defined by the following syntax:

Ada83 LRM 2.8, Ada95 LRM 2.8

 pragma ::=
  pragma identifier [(argument_association
   {, argument_association})];

 argument_association ::=
   [argument_identifier =>] name
  | [argument_identifier =>] expression

A list of argument associations is returned by the following function:

If Parameter represents an argument association, this function returns an element that represents the name or expression.

Description of Associations

An association is a pairing of a name and a value. In parameter associations, the formal parameter is the name and the actual parameter is the value. In argument associations, the argument identifier is the name and the expression or name is the value.

Lists of parameter associations can be obtained in unnormalized or normalized form. Lists of argument associations can be obtained only in unnormalized form.

Unnormalized associations are called actual associations because they represent the actual content of the source code. The ordering of parameters in the association or argument list is identical to the ordering of the parameters in the source code. Only if named notation was used in the source code will the name portion of the parameter or argument association exist. See the Formal_Parameter function for more information.

Normalized associations are called artificial associations because they are constructed by ASIS. Normalized associations do not return the parameters as they were specified in the source code of the calling sequence or generic instantiation. Rather, they return the parameters in the order of their declaration from the subprogram, entry, or generic.

In a normalized list, one association exists for each formal parameter, even if the source-code calling sequence or generic instantiation does not include that parameter. If a formal parameter does not appear in the source code, the formal parameter must have been given a default expression in the subprogram, entry, or generic declaration. The actual parameter for a formal parameter that does not appear in the source code, and is left to default, references this default expression.

Because of variations in Ada library implementation, all ASIS implementations are not able to return unnormalized parameter- association lists. See package Environment, "Default Parameter Processing" and "Normalization of Parameter Lists" for more information.

Enclosing Elements

The Elements.Enclosing_Element of an actual parameter depends on whether:

The enclosing element for each valid combination is:
Appears in Source
Normalized
List


Enclosing Element

Y
Y
Artificial association
Y
N
Actual association
N
Y
The parameter declaration containing the default expression
N
N
Will not appear in the association list

For further analysis:

Parameters

Specifies the parameter association that should be queried. The Parameter must be of the following kinds:
Element_Kinds

A_Parameter_Association
An_Argument_Association

The returned element is of the following kind:
Element_Kinds

An_Expression

Errors

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if a parameter references a library variable that is no longer open, or a parameter is specified that is not appropriate for the query.

Asis_Failed is raised and Environment.Status is set to Obsolete_Reference_Error if a parameter is part of an obsolete compilation unit.

Examples

Cross-References

Related subprograms:

Related concepts:


Function Arm_Select_Alternative

Expanded Name Asis.Statements.Arm_Select_Alternative

Returns the select alternative for the specified arm of the selective-wait select statement.

Description

Selective-wait select statements are defined by the following syntax:

Ada83 LRM 9.7.1, Ada95 LRM 9.7.1

 selective_wait ::=
  select
   select_alternative
  {or
   select_alternative}
  [else
   sequence_of_statements]
  end select;

 select_alternative ::=
  [when condition =>]
   selective_wait_alternative

This function returns the select alternative of the specified selective-wait arm.

Parameters

Specifies the select arm that should be queried. The arm should be one of the following kinds:
Element_Kinds
Select_Statement_Arm_Kind
A_Select_Statement_Arm
A_Selective_Wait_Select_Arm
A_Selective_Wait_Or_Arm

The returned element is of the following kind:
Element_Kinds

A_Select_Alternative

Errors

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if a parameter references a library variable that is no longer open, or a parameter is specified that is not appropriate for the query.

Examples

Cross-References

Related subprograms and types:

Related concepts:


Function Arm_Statements

Expanded Name Asis.Statements.Arm_Statements

Returns a list of all statements and, optionally, pragmas present in the specified if statement arm.

Description

If statements are defined by the following syntax:

Ada83 LRM 5.3, Ada95 LRM 5.3

 if_statement ::=
  if condition then
   sequence_of_statements
  {elsif condition then
   sequence_of_statements}
  [else
   sequence_of_statements]
  end if;

This function returns the sequence of statements for the specified arm of an if statement.

Statements and pragmas are returned in their order of appearance in the source code. A_Pragma elements do not appear in the list unless Include_Pragmas has been specified as True.

For further analysis:
Element_Kinds
Calls to Use
A_Pragma
Elements.
Argument_Associations
Is_Predefined
Name
Pragma_Kind

A_Statement
Statements.
(most subprograms)

Parameters

Specifies the if-statement arm that should be queried. The arm must be of the following kind:
Element_Kinds

An_If_Statement_Arm

Specifies whether pragma definitions should be included in the returned list.

The returned list contains elements of the following kinds:
Element_Kinds

A_Pragma

A_Statement

Errors

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if a parameter references a library variable that is no longer open, or a parameter is specified that is not appropriate for the query.

Examples

Cross-References

Related subprograms and types:

Related concepts:


Function Assignment_Expression

Expanded Name Asis.Statements.Assignment_Expression

Returns the expression component of the specified assignment statement.

Description

Assignment statements are defined by the following syntax:

Ada83 LRM 5.2, Ada95 LRM 5.2 
assignment_statement ::=
  variable_name ::= expression;

This function returns the expression of the specified assignment statement.

Parameters

Specifies the assignment statement that should be queried. The statement must be of the following kinds:
Element_Kinds
Statement_Kinds
A_Statement
An_Assignment_Statement

The returned element is of the following kind:
Element_Kinds

An_Expression

Errors

Asis_Inappropriate_Element is raised and Environment.Status is set to Value_Error if a parameter references a library variable that is no longer open, or a parameter is specified that is not appropriate for the query.

Examples

Cross-References

Related subprogram:

Related concepts:


Rational Software Corporation  http://www.rational.com
support@rational.com
techpubs@rational.com
Copyright © 1993-2001, Rational Software Corporation. All rights reserved.
TOC PREV NEXT INDEX DOC LIST MASTER INDEX TECHNOTES APEX TIPS