![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Function Family_Index
function Family_Index (Statement : in Asis.Statement) return Asis.Expression;Expanded Name Asis.Statements.Family_Index
Returns the family-index expression from the specified accept or entry-call statement.
Description
Accept statements are defined by the following syntax:
accept_statement ::=
accept entry_simple_name [(entry_index)]
[formal_part]
[do
sequence_of_statements
end [entry_simple_name]];If the statement is an accept statement, this function returns the associated entry-index expression.
Entry statements are defined by the following syntax:
entry_call_statement ::=
entry_name [actual_parameter_part];The entry name can include an entry index if a family of entries is defined. See "Processing Accept Statements" for moreinformation.
If the statement is an entry-call statement, this function returns the entry-index expression of the associated actual parameter part.
If an entry index does not exist, Asis.Nil_Element is returned.
Parameters
Statement : in Asis.Statement;Specifies the accept or entry-call statement that should be queried. The statement must be of the following kinds:
Element_Kinds Statement_Kinds
A_Statement An_Accept_Statement
An_Entry_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
- function Accept_Body_Statements
- function Accept_Entry_Simple_Name
- function Accept_Parameters
- function Accepted_Entry
- function Called_Name
- function Called_Procedure
- "Processing Accept Statements"
- "Processing Procedure- and Entry-Call Statements"
- package Expressions, "Processing Expressions"
- Ada83 LRM 9.5, Ada95 LRM 9.5
Function For_Loop_Parameter_Specification
function For_Loop_Parameter_Specification (Statement : in Asis.Statement) return Asis.Declaration;Expanded Name Asis.Statements.For_Loop_Parameter_Specification
Returns the declaration of the loop-parameter specification for the specified for loop statement.
Description
Loop statements are partially defined by the following syntax:
loop_statement ::=
[loop_simple_name:]
[iteration_scheme] loop
sequence_of_statements
end loop [loop_simple_name];iteration_scheme ::= while condition
| for loop_parameter_specification
loop_parameter_specification ::=
identifier in [reverse] discrete_rangeThis function returns the loop-parameter specification for the specified loop statement.
The Declarations.Names function returns the An_Entity_Name-_Definition of the loop-parameter specification.
Parameters
Statement : in Asis.Statement;Specifies the loop statement that should be queried. The statement must be of the following kinds:
Element_Kinds Statement_Kinds
A_Statement A_Loop_Statement
Loop_Kinds
A_For_Loop
return Asis.Declaration;The returned element is of the following kind:
Element_Kinds Declaration_Kinds
A_Declaration A_Loop_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 Is_Reverse_Loop_Parameter
- function Loop_Kind
- type Loop_Kinds
- function Loop_Parameter_Range
- function Loop_Simple_Name
- function Loop_Statements
- function While_Condition
- function Declarations.Names
- "Processing Loop Statements"
- Ada83 LRM 5.5, Ada95 LRM 5.5
Function Formal_Parameter
function Formal_Parameter (Parameter : in Asis.Association) return Asis.Element;Expanded Name Asis.Statements.Formal_Parameter
Returns the name associated with the specified parameter.
Description
Parameter associations are partially defined by the following syntax:
parameter_association ::=
[formal_parameter =>] actual_parameterformal_parameter ::= parameter_simple_name
This function returns the formal-parameter name for the specified parameter association.
Parameters are obtained from an Association_List. The list defines the parameter associations for procedure calls, function calls, entry calls, generic instantiations, and pragmas.
The results of the function depend on whether the association Parameter comes from a normalized or unnormalized Association_List.
Description (continued)
If the association is from a normalized list:
- The element returned is An_Entity_Name_Definition from the declaration or specification of the parameter.
- The Elements.Enclosing_Element of the name will be the formal-parameter specification or the generic-parameter declaration.
If the association is from a unnormalized list:
- The element returned is A_Simple_Name if the argument was given in named notation; it is Asis.Nil_Element if the argument was given in positional notation.
- The Elements.Enclosing_Element of the Simple_Name will be the same association element.
Association lists for pragmas are available only in unnormalized form. This occurs because there is no declaration for pragmas, so the arguments cannot be normalized.
See package Environment, "Normalization of Parameter Lists," for more information on normalized and unnormalized lists.
An ASIS implementation may choose to always include defaulted expressions in the Association_List for the parameters not specified. See package Environment, "Default Parameter Processing," for more information.
Parameters
Parameter : in Asis.Association;Specifies the parameter that should be queried. The parameter must be of the following kinds:
Element_Kinds
A_Parameter_Association
An_Argument_Association
return Asis.Element;The returned element is of the following kinds:
Element_Kinds Expression_Kinds
An_Entity_Name_Definition A_Simple_Name
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.
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 Actual_Parameter
- function Call_Parameters
- function Environment.Call_Parameters_Include_Defaults
- function Environment.Is_Formal_Parameter_Named-
_Notation_Supported- function Expressions.Name_Declaration
- function Expressions.Name_Definition
- "Processing Parameter Associations"
- package Environment, "Default Parameter Processing"
- package Environment, "Normalization of Parameter Lists"
- package Expressions, "Processing Expressions"
- Ada83 LRM 6.4, Ada95 LRM 6.4
Function Goto_Label
function Goto_Label (Statement : in Asis.Statement) return Asis.Expression;Expanded Name Asis.Statements.Goto_Label
Returns the expression that represents the label name in the specified goto statement.
Description
Goto statements are defined by the following syntax:
goto_statement ::= goto label_name;
This function returns the label name for the specified goto
statement.Parameters
Statement : in Asis.Statement;Specifies the goto statement that should be queried. The statement must be of the following kinds:
Element_Kinds Statement_Kinds
A_Statement A_Goto_Statement
return Asis.Expression;The returned element is of the following kinds:
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
- "Processing Goto Statements"
- package Expressions, "Processing Expressions"
- Ada83 LRM 5.9, Ada95 LRM 5.9
Function Guard
function Guard (Alternative : in Asis.Select_Alternative) return Asis.Expression;Expanded Name Asis.Statements.Guard
Returns the expression representing the guard condition on the specified selective-wait alternative.
Description
Selective-wait statement select alternatives are partially defined by the following syntax:
Ada83 LRM 9.7.1, Ada95 LRM 9.7.1
select_alternative ::=
[when condition =>]
selective_wait_alternativeThis function returns the guard condition (which follows the reserved word when) for the specified select alternative.
If a guard does not exist, Asis.Nil_Element is returned.
Parameters
Alternative : in Asis.Select_Alternative;Specifies the selective-wait statement alternative that should be queried. The alternative must be of the following kinds:
Element_Kinds Statement_Kinds
A_Select_Alternative A_Delay_Alternative
A_Terminate_Alternative
An_Accept_Alternative
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
Related subprograms and types:
- function Arm_Select_Alternative
- function Else_Statements
- 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"
- package Expressions, "Processing Expressions"
- Ada83 LRM 9.7.1, Ada95 LRM 9.7.1
Function Handler_Statements
function Handler_Statements (Handler : in Asis.Exception_Handler; Include_Pragmas : in Boolean := False) return Asis.Statement_List;Expanded Name Asis.Statements.Handler_Statements
Returns the sequence of statements and, optionally, pragmas associated with the specified exception handler.
Description
Exception handlers are defined by the following syntax:
Ada83 LRM 11.2, Ada95 LRM 11.2
exception_handler ::=
when exception_choice {| exception_choice} =>
sequence_of_statementsThis function returns the sequence of statements for the specified exception-handler arm.
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
Handler : in Asis.Exception_Handler;Specifies the handler that should be queried. The handler must be of the following kind:
Element_Kinds
An_Exception_Handler
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
Function If_Statement_Arm_Kind
function If_Statement_Arm_Kind (Arm : in Asis.If_Statement_Arm) return If_Statement_Arm_Kinds;Expanded Name Asis.Statements.If_Statement_Arm_Kind
Returns the arm kind for the specified arm of an if statement.
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 kind of the specified if-statement arm.
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
return If_Statement_Arm_Kinds;Returns the arm kind for all elements in the above table and Not_An_If_Statement_Arm for all other elements.
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 Arm_Statements
- function Condition_Expression
- type If_Statement_Arm_Kinds
- function If_Statement_Arms
- "Processing If Statements"
- Ada83 LRM 5.3, Ada95 LRM 5.3
Type If_Statement_Arm_Kinds
type If_Statement_Arm_Kinds is (...);Expanded Name Asis.Statements.If_Statement_Arm_Kinds
Describes the if-statement arm kinds that are available.
Description
If-statement processing is based on the concept of arms. An arm is one of:
- The condition and sequence of statements following the if reserved word
- The condition and sequence of statements following each elsif reserved word
- The sequence of statements following the else reserved word
This enumeration describes the names for the arms
The kind of an if-statement arm is returned by the If_State-
ment_Arm_Kind_Function.Enumerations
An_Else_ArmIndicates that an element represents an arm that contains the sequence of statements following the reserved word else.
An_Elsif_ArmIndicates that an element represents an arm that contains the condition and sequence of statements following the reserved word elsif.
An_If_ArmIndicates that an element represents an arm that contains the condition and sequence of statements following the reserved word if.
Not_An_If_Statement_ArmIndicates that the element does not represent an if-statement arm.
Cross-References
- "Processing If Statements"
- Ada83 LRM 5.3, Ada95 LRM 5.3
Function If_Statement_Arms
function If_Statement_Arms (Statement : in Asis.Statement) return Asis.If_Statement_Arm_List;Expanded Name Asis.Statements.If_Statement_Arms
Returns a list of the arms contained in the specified if statement.
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 a list of the arms for the specified if
statement.The arms are returned in their order of appearance in the source code.
Parameters
Statement : in Asis.Statement;Specifies the if statement that should be queried. The statements must be of the following kinds:
Element_Kinds Statement_Kinds
A_Statement An_If_Statement
return Asis.If_Statement_Arm_List;The returned list contains elements of the following kind
Element_Kinds
An_If_Statement_Arm
:
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 Arm_Statements
- function Condition_Expression
- function If_Statement_Arm_Kind
- type If_Statement_Arm_Kinds
- "Processing If Statements"
- Ada83 LRM 5.3, Ada95 LRM 5.3
Rational Software Corporation
http://www.rational.com support@rational.com techpubs@rational.com Copyright © 1993-2001, Rational Software Corporation. All rights reserved. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |