![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Function Accept_Entry_Simple_Name
function Accept_Entry_Simple_Name (Statement : in Asis.Statement) return Asis.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
Statement : in Asis.Statement;Specifies the statement that should be queried. The statement must be of the following kinds:
Element_Kinds Statement_Kinds
A_Statement An_Accept_Statement
return Asis.Simple_Name;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
- function Accept_Body_Statements
- function Accept_Parameters
- function Accepted_Entry
- function Family_Index
- "Processing Accept Statements"
- Ada83 LRM 9.5, Ada95 LRM 9.5
Function Accept_Parameters
function Accept_Parameters (Statement : in Asis.Statement) return Asis.Parameter_Specification_List;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:
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:
- Declarations.Names to obtain the name(s) of a parameter specification
- Declarations.Type_Mark to obtain the type mark of a
parameter- Declarations.Is_Initialized to determine whether the
parameter has a default value- Declarations.Initial_Value to obtain the default value
expressionParameters
Statement : in Asis.Statement;Specifies the statement that should be queried. The statement must be of the following kinds:
Element_Kinds Statement_Kinds
A_Statement An_Accept_Statement
return Asis.Parameter_Specification-_List;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
- function Accept_Body_Statements
- function Accept_Entry_Simple_Name
- function Accepted_Entry
- function Family_Index
- function Declarations.Initial_Value
- function Declarations.Is_Initialized
- function Declarations.Names
- function Declarations.Type_Mark
- "Processing Accept Statements"
- package Environment, "Normalization of Parameter Lists"
- Ada83 LRM 9.5, Ada95 LRM 9.5
Function Accepted_Entry
function Accepted_Entry (Statement : in Asis.Statement) return Asis.Declaration;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:
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
Statement : in Asis.Statement;Specifies the statement that should be queried. The statement must be of the following kinds:
Element_Kinds Statement_Kinds
A_Statement An_Accept_Statement
return Asis.Declaration;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
- function Accept_Body_Statements
- function Accept_Entry_Simple_Name
- function Accept_Parameters
- function Family_Index
- "Processing Accept Statements"
- Ada83 LRM 9.5, Ada95 LRM 9.5
Function Actual_Parameter
function Actual_Parameter (Parameter : in Asis.Association) return Asis.Expression;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_parameterLists of parameter associations are returned by the following functions:
- Call_Parameters (appropriate for procedure and entry calls)
- Declarations.Generic_Parameters
- Expressions.Function_Call_Parameters
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:
pragma ::=
pragma identifier [(argument_association
{, argument_association})];
argument_association ::=
[argument_identifier =>] name
| [argument_identifier =>] expressionA 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:
- An actual parameter value appears in the source code or the parameter has been left to default
- The parameter association has been obtained from a normalized or unnormalized list
The enclosing element for each valid combination is:
- You can use the Expressions.Expression_Type function to obtain the type definition of the expression. However, not all actual parameters are expressions with an Expression_Type. For instance, expressions representing subprograms, packages, and tasks do not have an Expression_Type.
- You can use the Expressions.Name_Definition function to obtain the An_Entity_Name_Definition of the formal parameter from named parameter associations. Pragmas do not have a specification and so have no declaration. Calling Name_Definition with an argument association raises an exception.
Parameters
Parameter : in Asis.Association;Specifies the parameter association that should be queried. The Parameter must be of the following kinds:
Element_Kinds
A_Parameter_Association
An_Argument_Association
return Asis.Expression;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
- function Call_Parameters
- function Formal_Parameter
- function Expressions.Expression_Type
- function Expressions.Kind
- function Expressions.Name_Definition
- "Processing Parameter Associations"
- package Expressions, "Processing Expressions"
- Ada83 LRM 2.8, Ada95 LRM 2.8
- Ada83 LRM 6.4, Ada95 LRM 6.4
Function Arm_Select_Alternative
function Arm_Select_Alternative (Arm : in Asis.Select_Statement_Arm) return Asis.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_alternativeThis function returns the select alternative of the specified selective-wait arm.
Parameters
Arm : in Asis.Select_Statement_Arm;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
return Asis.Select_Alternative;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:
- function Else_Statements
- function Guard
- function Is_Guarded
- function Select_Alternative_Kind
- type Select_Alternative_Kinds
- function Select_Alternative_Statements
- function Select_Statement_Arm_Kind
- type Select_Statement_Arm_Kinds
- function Select_Statement_Arms
- "Processing Selective Waits"
- Ada83 LRM 9.7.1, Ada95 LRM 9.7.1
Function Arm_Statements
function Arm_Statements (Arm : in Asis.If_Statement_Arm; Include_Pragmas : in Boolean := False) return Asis.Statement_List;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:
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.
Element_Kinds Calls to Use
A_Pragma Elements.
Argument_Associations
Is_Predefined
Name
Pragma_Kind
A_Statement Statements.
(most subprograms)
Parameters
Arm : in Asis.If_Statement_Arm;Specifies the if-statement arm that should be queried. The arm must be of the following kind:
Element_Kinds
An_If_Statement_Arm
Include_Pragmas : in Boolean := False;Specifies whether pragma definitions should be included in the returned list.
return Asis.Statement_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:
- function Condition_Expression
- function If_Statement_Arm_Kind
- type If_Statement_Arm_Kinds
- function If_Statement_Arms
- "Processing If Statements"
- Ada83 LRM 5.3, Ada95 LRM 5.3
Function Assignment_Expression
function Assignment_Expression (Statement : in Asis.Statement) return Asis.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
Statement : in Asis.Statement;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
return Asis.Expression;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
Rational Software Corporation
http://www.rational.com support@rational.com techpubs@rational.com Copyright © 1993-2001, Rational Software Corporation. All rights reserved. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |