![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Function Block_Body_Statements
function Block_Body_Statements (Statement : in Asis.Statement; Include_Pragmas : in Boolean := False) return Asis.Statement_List;Expanded Name Asis.Statements.Block_Body_Statements
Returns a list of all statements and, optionally, pragmas present in the specified block statement.
Description
Block statements are defined by the following syntax:
Ada83 LRM 5.6, Ada95 LRM 5.6
block_statement ::=
[block_simple_name:]
[declare
declarative_part]
begin
sequence_of_statements
[exception
exception_handler
{exception_handler}]
end [block_simple_name];This function returns the sequence_of_statements for the specified block 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
Statement : in Asis.Statement;Specifies the block statement that should be queried. The statement must be of the following kind:
Element_Kinds
A_Block_Statement
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
- "Processing Block Statements"
- Ada83 LRM 5.6, Ada95 LRM 5.6
Function Block_Exception_Handlers
function Block_Exception_Handlers (Statement : in Asis.Statement) return Asis.Exception_Handler_List;Expanded Name Asis.Statements.Block_Exception_Handlers
Returns a list of exception handlers in the specified block
statement.Description
Block statements are defined by the following syntax:
Ada83 LRM 5.6, Ada95 LRM 5.6
block_statement ::=
[block_simple_name:]
[declare
declarative_part]
begin
sequence_of_statements
[exception
exception_handler
{exception_handler}]
end [block_simple_name];This function returns a list of the exception handlers for the specified block statement.
The exception handlers are returned in their order of appearance in the source code.
If no exception handlers are defined, Asis.Nil_Element_List is returned.
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 A_Block_Statement
return Asis.Exception_Handler_List;The returned list contains elements of the following kind
Element_Kinds
An_Exception_Handler
:
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 Block Statements"
- Ada83 LRM 5.6, Ada95 LRM 5.6
Function Block_Simple_Name
function Block_Simple_Name (Statement : in Asis.Statement) return Asis.Entity_Name_Definition;Expanded Name Asis.Statements.Block_Simple_Name
Returns the name of the specified block.
Description
Block statements are defined by the following syntax:
Ada83 LRM 5.6, Ada95 LRM 5.6
block_statement ::=
[block_simple_name:]
[declare
declarative_part]
begin
sequence_of_statements
[exception
exception_handler
{exception_handler}]
end [block_simple_name];This function returns the block simple name for the specified block statement.
If the block simple name does not exist, Asis.Nil_Element is returned.
The Elements.Enclosing_Element of the name definition is the block 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 A_Block_Statement
return Asis.Entity_Name_Definition;The returned element is of the following kind:
Element_Kinds
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 Block_Body_Statements
- function Block_Exception_Handlers
- function Declarative_Items
- function Elements.Enclosing_Element
- "Processing Block Statements"
- Ada83 LRM 5.6, Ada95 LRM 5.6
Function Call_Parameters
function Call_Parameters (Statement : in Asis.Statement; Normalized : in Boolean := False) return Asis.Association_List;Expanded Name Asis.Statements.Call_Parameters
Returns a list containing all parameter associations present in the specified procedure- or entry-call statement.
Description
Procedure- and entry-call statements are partially defined by the following syntax:
procedure_call_statement ::=
procedure_name [actual_parameter_part];entry_call_statement ::=
entry_name [actual_parameter_part];The actual parameter part of each statement is partially defined by the following syntax:
actual_parameter_part ::=
(parameter_association
{, parameter_association})parameter_association ::=
[formal_parameter =>] actual_parameterThis function returns a list containing the parameter associations for the specified procedure-call statement or entry-call
statement.Each parameter association references an actual parameter. You can obtain the element representing the actual parameter with the Actual_Parameter function. If named notation is used, each parameter association also references a formal parameter. You can obtain the formal parameter with the Formal_Parameter function.
Description (continued)
An ASIS implementation may choose to always normalize parameter lists and include defaulted parameters in the parameter list. If parameter lists are always normalized, this function behaves as if the Normalized parameter has been specified as True.
- It contains only those arguments that appear in the source code and is ordered according to their order of appearance.
- The parameter associations are not Elements.Is_Equal to a parameter association from a normalized list.
- The associations have formal-parameter names only if named notation was used by the programmer.
- It includes defaulted parameters and is ordered according to their order of appearance in the declaration of the formal parameters.
- The parameter associations are Expressions.Is_Normalized.
- The parameter associations are Declarations.Is_Part_Of-_Implicit.
For more information on parameter names, defaulted parameters, and list normalization, see package Environment, "Default Parameter Processing" and "Normalization of Parameter Lists"; the Environment.Call_Parameters_Include_Defaults function; and the Environment.Call_Parameters_Normalized function.
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 A_Procedure_Call_Statement
An_Entry_Call_Statement
Normalized : in Boolean := False;Specifies whether the parameter list should contain normalized or unnormalized associations.
return Asis.Association_List;The returned list contains elements of the following kind
Element_Kinds
A_Parameter_Association
:
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 Actual_Parameter
- function Formal_Parameter
- function Declarations.Is_Part_Of_Implicit
- function Elements.Is_Equal
- function Environment.Call_Parameters_Include_Defaults
- function Environment.Call_Parameters_Normalized
- function Expressions.Is_Normalized
- "Processing Parameter Associations"
- package Environment, "Default Parameter Processing"
- package Environment, "Normalization of Parameter Lists"
- Ada83 LRM 6.4, Ada95 LRM 6.4
- Ada83 LRM 9.5, Ada95 LRM 9.5
Function Called_Name
function Called_Name (Statement : in Asis.Statement) return Asis.Expression;Expanded Name Asis.Statements.Called_Name
Returns the name of the called procedure or entry for the specified statement.
Description
Procedure- and entry-call statements are defined by the following syntax:
procedure_call_statement ::=
procedure_name [actual_parameter_part];entry_call_statement ::=
entry_name [actual_parameter_part];This function returns the procedure name or entry name for the specified procedure-call statement or entry-call 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 A_Procedure_Call_Statement
An_Entry_Call_Statement
return Asis.Expression;The returned element is of the following kinds:
Element_Kinds Expression_Kinds
An_Expression A_Selected_Component (if an entry family exists)
A_Simple_Name
An_Indexed_Component
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 Procedure- and Entry-Call Statements"
- package Expressions, "Processing Expressions"
- Ada83 LRM 6.4, Ada95 LRM 6.4
- Ada83 LRM 9.5, Ada95 LRM 9.5
Function Called_Procedure
function Called_Procedure (Statement : in Asis.Statement) return Asis.Declaration;Expanded Name Asis.Statements.Called_Procedure
Returns the specification of the procedure or the declaration of the entry called by the specified statement.
Description
Procedure- and entry-call statements are partially defined by the following syntax:
procedure_call_statement ::=
procedure_name [actual_parameter_part];entry_call_statement ::=
entry_name [actual_parameter_part];The declarations for procedures and entries are partially defined by the following syntax:
subprogram_specification ::=
procedure identifier [formal_part]
| function designator [formal_part]
return type_markThis function returns the subprogram specification if the specified statement is a procedure-call statement or the entry declaration if the specified statement is an entry-call 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 A_Procedure_Call_Statement
An_Entry_Call_Statement
return Asis.Declaration;The returned element is of the following kind:
Element_Kinds Declaration_Kinds
A_Declaration A_Procedure_Body_Declaration
A_Procedure_Declaration
A_Procedure_Instantiation
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
- "Processing Procedure- and Entry-Call Statements"
- Ada83 LRM 6.1, Ada95 LRM 6.1
- Ada83 LRM 6.4, Ada95 LRM 6.4
- Ada83 LRM 9.5, Ada95 LRM 9.5
Function Case_Expression
function Case_Expression (Statement : in Asis.Statement) return Asis.Expression;Expanded Name Asis.Statements.Case_Expression
Returns the expression that determines which alternative will be taken for the specified case statement.
Description
Case statements are partially defined by the following syntax:
case_statement ::=
case expression is
case_statement_alternative
{case_statement_alternative}
end case;This function returns the expression for the specified case
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 A_Case_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 Case_Statement_Alternative_Choices
- function Case_Statement_Alternative_Statements
- function Case_Statement_Alternatives
- function Is_When_Others
- "Processing Case Statements"
- package Expressions, "Processing Expressions"
- Ada83 LRM 5.4, Ada95 LRM 5.4
Function Case_Statement_Alternative_Choices
function Case_Statement_Alternative_Choices (Alternative : in Asis.Case_Statement_Alternative) return Asis.Choice_List;Expanded Name Asis.Statements.Case_Statement_Alternative_Choices
Returns a list of the choices defined for the specified case-statement alternative.
Description
Case-statement alternatives are partially defined by the following syntax:
case_statement_alternative ::=
when choice {| choice } =>
sequence_of_statementsThis function returns a list of the choices for the specified case-statement alternative.
The choices are returned in their order of appearance in the source code.
Package Type_Definitions contains functions that can be used to decompose the choices returned.
Parameters
Alternative : in Asis.Case_Statement_Alternative;Specifies the case alternative that should be queried. The alternative must be of the following kind:
Element_Kinds
A_Case_Statement_Alternative
return Asis.Choice_List;The returned list contains elements of the following kind
Element_Kinds
A_Choice
:
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 Case_Expression
- function Case_Statement_Alternative_Statements
- function Case_Statement_Alternatives
- function Is_When_Others
- function Type_Definitions.Choice_Kind
- "Processing Case Statements"
- package Type_Definitions, "Processing Choices"
- Ada83 LRM 5.4, Ada95 LRM 5.4
Function Case_Statement_Alternative_Statements
function Case_Statement_Alternative_Statements (Alternative : in Asis.Case_Statement_Alternative; Include_Pragmas : in Boolean := False) return Asis.Statement_List;Expanded Name Asis.Statements.Case_Statement_Alternative_Statements
Returns a list of all statements and, optionally, pragmas present in the specified case-statement alternative.
Description
Case-statement alternatives are partially defined by the following syntax:
case_statement_alternative ::=
when choice {| choice } =>
sequence_of_statementsThis function returns the sequence of statements for the specified case-statement alternative.
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
Alternative : in Asis.Case_Statement_Alternative;Specifies the case-statement alternative that should be queried. The alternative must be of the following kind:
Element_Kinds
A_Case_Statement_Alternative
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 Case_Expression
- function Case_Statement_Alternative_Choices
- function Case_Statement_Alternatives
- function Is_When_Others
- "Processing Case Statements"
- Ada83 LRM 5.4, Ada95 LRM 5.4
Function Case_Statement_Alternatives
function Case_Statement_Alternatives (Statement : in Asis.Statement) return Asis.Case_Statement_Alternative_List;Expanded Name Asis.Statements.Case_Statement_Alternatives
Returns a list of the alternatives for the specified case statement.
Description
Case statements are partially defined by the following syntax:
case_statement ::=
case expression is
case_statement_alternative
{case_statement_alternative}
end case;This function returns a list of the case-statement alternatives for the specified case statement.
The alternatives are returned in their order of appearance in the source code.
Parameters
Statement : in Asis.Statement;Specifies the case statement that should be queried. The statement must be of the following kinds:
Element_Kinds Statement_Kinds
A_Statement A_Case_Statement_Alternative
return Asis.Case_Statement_Alternative_List;The returned list contains elements of the following kinds
Element_Kinds
A_Case_Statement_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
- function Case_Expression
- function Case_Statement_Alternative_Choices
- function Case_Statement_Alternative_Statements
- function Is_When_Others
- "Processing Case Statements"
- Ada83 LRM 5.4, Ada95 LRM 5.4
Rational Software Corporation
http://www.rational.com support@rational.com techpubs@rational.com Copyright © 1993-2001, Rational Software Corporation. All rights reserved. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |