P.1 Syntax Rules
danger
This Reference Manual output has not been verified, and may contain omissions or errors. Report any problems on the tracking issue
This subclause lists the complete syntax of the language in the order it appears in this Reference Manual. See 1.1.4 for a description of the notation used.
note
note
2.3:
|
|
|
|
|
identifier_start ::=
letter_uppercase
|
letter_lowercase
|
letter_titlecase
|
letter_modifier
|
letter_other
|
number_letter
note
2.3:
|
|
|
identifier_extend ::=
mark_non_spacing
|
mark_spacing_combining
|
number_decimal
|
punctuation_connector
note
note
note
note
note
note
note
note
note
note
2.8:
[pragma_argument_
| [pragma_argument_
| pragma_argument_
| pragma_argument_
pragma_argument_association ::=
[pragma_argument_
identifier
=>] name
| [pragma_argument_
identifier
=>] expression
| pragma_argument_
aspect_mark
=> name
| pragma_argument_
aspect_mark
=> expression
note
3.1:
|
|
|
|
|
|
basic_declaration ::=
type_declaration
| subtype_declaration
|
object_declaration
| number_declaration
|
subprogram_declaration
| abstract_subprogram_declaration
|
null_procedure_declaration
| expression_function_declaration
|
package_declaration
| renaming_declaration
|
exception_declaration
| generic_declaration
|
generic_instantiation
note
note
3.2.1:
|
|
|
type_declaration ::=
full_type_declaration
|
incomplete_type_declaration
|
private_type_declaration
|
private_extension_declaration
note
3.2.1:
type
[
|
|
full_type_declaration ::=
type
defining_identifier
[known_discriminant_part
] is type_definition
[
aspect_specification
];|
task_type_declaration
|
protected_type_declaration
note
3.2.2:
subtype
[
subtype_declaration ::=
subtype
defining_identifier
is subtype_indication
[
aspect_specification
];note
note
note
note
note
3.3.1:
[
|
[
|
[
|
|
object_declaration ::=
defining_identifier_list
: [aliased] [constant] subtype_indication
[:= expression
][
aspect_specification
];|
defining_identifier_list
: [aliased] [constant] access_definition
[:= expression
][
aspect_specification
];|
defining_identifier_list
: [aliased] [constant] array_type_definition
[:= expression
][
aspect_specification
];|
single_task_declaration
|
single_protected_declaration
note
note
note
3.4:
[abstract] [limited] new parent_
derived_type_definition ::=
[abstract] [limited] new parent_
subtype_indication
[[and interface_list
] record_extension_part
]note
note
3.5.1:
(
enumeration_type_definition ::=
(
enumeration_literal_specification
{, enumeration_literal_specification
})note
note
note
note
note
note
note
note
note
note
note
3.5.9:
delta static_
decimal_fixed_point_definition ::=
delta static_
expression
digits static_expression
[real_range_specification
]note
note
note
3.6:
array(
unconstrained_array_definition ::=
array(
index_subtype_definition
{, index_subtype_definition
}) of component_definition
note
note
3.6:
array (
constrained_array_definition ::=
array (
discrete_subtype_definition
{, discrete_subtype_definition
}) of component_definition
note
note
note
note
note
note
note
note
3.7:
[
|
[
discriminant_specification ::=
defining_identifier_list
: [null_exclusion
] subtype_mark
[:= default_expression
][
aspect_specification
] |
defining_identifier_list
: access_definition
[:= default_expression
][
aspect_specification
] note
note
note
3.7.1:
[discriminant_
discriminant_association ::=
[discriminant_
selector_name
{'|' discriminant_selector_name
} =>] expression
note
note
note
note
note
3.8:
[
component_declaration ::=
defining_identifier_list
: component_definition
[:= default_expression
][
aspect_specification
];note
note
note
note
note
note
3.9.3:
[
[
abstract_subprogram_declaration ::=
[
overriding_indicator
]subprogram_specification
is abstract[
aspect_specification
];note
3.9.4:
[limited | task | protected | synchronized] interface [and
interface_type_definition ::=
[limited | task | protected | synchronized] interface [and
interface_list
]note
note
3.10:
[
| [
access_type_definition ::=
[
null_exclusion
] access_to_object_definition
| [
null_exclusion
] access_to_subprogram_definition
note
note
note
3.10:
access [protected] procedure
| access [protected] function
access_to_subprogram_definition ::=
access [protected] procedure
parameter_profile
| access [protected] function
parameter_and_result_profile
note
note
3.10:
[
| [
| [
access_definition ::=
[
null_exclusion
] access [constant] subtype_mark
| [
null_exclusion
] access [protected] procedure parameter_profile
| [
null_exclusion
] access [protected] function parameter_and_result_profile
note
note
note
note
note
note
note
note
note
note
note
note
note
note
note
note
note
note
4.3:
|
aggregate ::=
record_aggregate
| extension_aggregate
| array_aggregate
|
delta_aggregate
| container_aggregate
note
note
4.3.1:
| null record
record_component_association_list ::=
record_component_association
{, record_component_association
}| null record
note
4.3.1:
[
|
record_component_association ::=
[
component_choice_list
=>] expression
|
component_choice_list
=> <>note
note
note
note
note
4.3.3:
(
| (
| (
| '['
| '['
positional_array_aggregate ::=
(
expression
, expression
{, expression
})| (
expression
{, expression
}, others => expression
)| (
expression
{, expression
}, others => <>)| '['
expression
{, expression
}[, others => expression
] ']'| '['
expression
{, expression
}, others => <> ']'note
note
4.3.3:
(
| '['
named_array_aggregate ::=
(
array_component_association_list
)| '['
array_component_association_list
']' note
4.3.3:
array_component_association_list ::=
array_component_association
{, array_component_association
}note
4.3.3:
|
|
array_component_association ::=
discrete_choice_list
=> expression
|
discrete_choice_list
=> <>|
iterated_component_association
note
4.3.3:
for
| for
iterated_component_association ::=
for
defining_identifier
in discrete_choice_list
=> expression
| for
iterator_specification
=> expression
note
note
note
4.3.4:
(base_
| '[' base_
array_delta_aggregate ::=
(base_
expression
with delta array_component_association_list
)| '[' base_
expression
with delta array_component_association_list
']'note
4.3.5:
|
|
container_aggregate ::=
null_container_aggregate
|
positional_container_aggregate
|
named_container_aggregate
note
note
note
note
4.3.5:
container_element_association_list ::=
container_element_association
{, container_element_association
}note
4.3.5:
|
|
container_element_association ::=
key_choice_list
=> expression
|
key_choice_list
=> <>|
iterated_element_association
note
note
note
4.3.5:
for
| for
iterated_element_association ::=
for
loop_parameter_specification
[ use key_expression
] => expression
| for
iterator_specification
[ use key_expression
] => expression
note
4.4:
|
|
|
|
choice_expression ::=
choice_relation
{and choice_relation
}|
choice_relation
{or choice_relation
}|
choice_relation
{xor choice_relation
}|
choice_relation
{and then choice_relation
}|
choice_relation
{or else choice_relation
}note
note
4.4:
| tested_
|
relation ::=
simple_expression
[relational_operator
simple_expression
]| tested_
simple_expression
[not] in membership_choice_list
|
raise_expression
note
note
note
note
note
4.4:
|
| (
| (
primary ::=
numeric_literal
| null | string_literal
| aggregate
|
name
| allocator
| (expression
)| (
conditional_expression
) | (quantified_expression
)| (
declare_expression
)note
note
note
note
note
note
note
note
4.5.7:
if
{elsif
[else dependent_
if_expression ::=
if
condition
then dependent_expression
{elsif
condition
then dependent_expression
}[else dependent_
expression
]note
note
4.5.7:
case selecting_
case_expression ::=
case selecting_
expression
iscase_expression_alternative
{,case_expression_alternative
}note
note
4.5.8:
for
| for
quantified_expression ::=
for
quantifier
loop_parameter_specification
=> predicate
| for
quantifier
iterator_specification
=> predicate
note
note
note
note
note
4.5.10:
|
reduction_attribute_reference ::=
value_sequence
'reduction_attribute_designator
|
prefix
'reduction_attribute_designator
note
4.5.10:
'[' [parallel[(
value_sequence ::=
'[' [parallel[(
chunk_specification
)] [aspect_specification
]]iterated_element_association
']'note
note
note
note
note
4.8:
new [
| new [
allocator ::=
new [
subpool_specification
] subtype_indication
| new [
subpool_specification
] qualified_expression
note
note
5.1:
|
|
|
|
|
|
simple_statement ::=
null_statement
|
assignment_statement
| exit_statement
|
goto_statement
| procedure_call_statement
|
simple_return_statement
| entry_call_statement
|
requeue_statement
| delay_statement
|
abort_statement
| raise_statement
|
code_statement
note
5.1:
|
|
|
|
compound_statement ::=
if_statement
| case_statement
|
loop_statement
| block_statement
|
extended_return_statement
|
parallel_block_statement
|
accept_statement
| select_statement
note
note
note
note
note
note
5.3:
if
{elsif
[else
end if;
if_statement ::=
if
condition
thensequence_of_statements
{elsif
condition
thensequence_of_statements
}[else
sequence_of_statements
]end if;
note
5.4:
case selecting_
{
end case;
case_statement ::=
case selecting_
expression
iscase_statement_alternative
{
case_statement_alternative
}end case;
note
note
5.5:
[loop_
[
end loop [loop_
loop_statement ::=
[loop_
statement_identifier
:][
iteration_scheme
] loopsequence_of_statements
end loop [loop_
identifier
];note
5.5:
| for
| for
| [parallel [
for
| parallel [(
for
| parallel [(
for
iteration_scheme ::=
while condition
| for
loop_parameter_specification
| for
iterator_specification
| [parallel [
aspect_specification
]]for
procedural_iterator
| parallel [(
chunk_specification
)] [aspect_specification
]for
loop_parameter_specification
| parallel [(
chunk_specification
)] [aspect_specification
]for
iterator_specification
note
5.5:
integer_
|
chunk_specification ::=
integer_
simple_expression
|
defining_identifier
in discrete_subtype_definition
note
5.5:
[
loop_parameter_specification ::=
defining_identifier
in [reverse] discrete_subtype_definition
[
iterator_filter
]note
5.5.2:
[
|
[
iterator_specification ::=
defining_identifier
[: loop_parameter_subtype_indication
] in [reverse] iterator_name
[
iterator_filter
]|
defining_identifier
[: loop_parameter_subtype_indication
] of [reverse] iterable_name
[
iterator_filter
]note
note
5.5.3:
[
procedural_iterator ::=
iterator_parameter_specification
of iterator_procedure_call
[
iterator_filter
]note
5.5.3:
| (
iterator_parameter_specification ::=
formal_part
| (
defining_identifier
{, defining_identifier
})note
note
5.5.3:
(
iterator_actual_parameter_part ::=
(
iterator_parameter_association
{, iterator_parameter_association
})note
note
note
5.6:
[block_
[declare
begin
end [block_
block_statement ::=
[block_
statement_identifier
:][declare
declarative_part
]begin
handled_sequence_of_statements
end [block_
identifier
];note
5.6.1:
parallel [(
and
{and
end do;
parallel_block_statement ::=
parallel [(
chunk_specification
)] [aspect_specification
] dosequence_of_statements
and
sequence_of_statements
{and
sequence_of_statements
}end do;
note
6.1:
[
[
subprogram_declaration ::=
[
overriding_indicator
]subprogram_specification
[
aspect_specification
];note
note
note
note
note
note
note
note
note
note
6.1:
[
| [
parameter_and_result_profile ::=
[
formal_part
] return [null_exclusion
] subtype_mark
| [
formal_part
] return access_definition
note
note
6.1:
[
|
[
parameter_specification ::=
defining_identifier_list
: [aliased] mode
[null_exclusion
] subtype_mark
[:= default_expression
][
aspect_specification
]|
defining_identifier_list
: access_definition
[:= default_expression
][
aspect_specification
]note
note
6.1.2:
null
| Unspecified
|
| (
global_aspect_definition ::=
null
| Unspecified
|
global_mode
global_designator
| (
global_aspect_element
{; global_aspect_element
})note
note
note
note
note
note
6.3:
[
[
begin
end [
subprogram_body ::=
[
overriding_indicator
]subprogram_specification
[
aspect_specification
] isdeclarative_part
begin
handled_sequence_of_statements
end [
designator
];note
note
note
note
note
note
note
6.5:
[
extended_return_object_declaration ::=
defining_identifier
: [aliased] [constant] return_subtype_indication
[:= expression
][
aspect_specification
] note
6.5:
return
end return];
extended_return_statement ::=
return
extended_return_object_declaration
[dohandled_sequence_of_statements
end return];
note
note
6.7:
[
[
null_procedure_declaration ::=
[
overriding_indicator
]procedure_specification
is null[
aspect_specification
];note
6.8:
[
(
[
| [
[
expression_function_declaration ::=
[
overriding_indicator
]function_specification
is(
expression
)[
aspect_specification
];| [
overriding_indicator
]function_specification
isaggregate
[
aspect_specification
];note
note
7.1:
package
[
{
[private
{
end [[
package_specification ::=
package
defining_program_unit_name
[
aspect_specification
] is{
basic_declarative_item
}[private
{
basic_declarative_item
}]end [[
parent_unit_name
.]identifier
]note
7.2:
package body
[
[begin
end [[
package_body ::=
package body
defining_program_unit_name
[
aspect_specification
] isdeclarative_part
[begin
handled_sequence_of_statements
]end [[
parent_unit_name
.]identifier
];note
7.3:
type
[
private_type_declaration ::=
type
defining_identifier
[discriminant_part
] is [[abstract] tagged] [limited] private[
aspect_specification
];note
7.3:
type
[abstract] [limited | synchronized] new ancestor_
[and
[
private_extension_declaration ::=
type
defining_identifier
[discriminant_part
] is[abstract] [limited | synchronized] new ancestor_
subtype_indication
[and
interface_list
] with private[
aspect_specification
];note
note
note
note
8.5:
|
|
|
|
renaming_declaration ::=
object_renaming_declaration
|
exception_renaming_declaration
|
package_renaming_declaration
|
subprogram_renaming_declaration
|
generic_renaming_declaration
note
8.5.1:
[
|
[
object_renaming_declaration ::=
defining_identifier
[: [null_exclusion
] subtype_mark
] renames object_name
[
aspect_specification
];|
defining_identifier
: access_definition
renames object_name
[
aspect_specification
];note
8.5.2:
[
exception_renaming_declaration ::=
defining_identifier
: exception renames exception_name
[
aspect_specification
];note
8.5.3:
package
[
package_renaming_declaration ::=
package
defining_program_unit_name
renames package_name
[
aspect_specification
];note
8.5.4:
[
[
subprogram_renaming_declaration ::=
[
overriding_indicator
]subprogram_specification
renames callable_entity_name
[
aspect_specification
];note
8.5.5:
generic package
[
| generic procedure
[
| generic function
[
generic_renaming_declaration ::=
generic package
defining_program_unit_name
renames generic_package_name
[
aspect_specification
];| generic procedure
defining_program_unit_name
renames generic_procedure_name
[
aspect_specification
];| generic function
defining_program_unit_name
renames generic_function_name
[
aspect_specification
];note
9.1:
task type
[
[new
task_type_declaration ::=
task type
defining_identifier
[known_discriminant_part
][
aspect_specification
] [is[new
interface_list
with]task_definition
];note
9.1:
task
[
[new
single_task_declaration ::=
task
defining_identifier
[
aspect_specification
] [is[new
interface_list
with]task_definition
];note
note
note
9.1:
task body
[
begin
end [task_
task_body ::=
task body
defining_identifier
[
aspect_specification
] isdeclarative_part
begin
handled_sequence_of_statements
end [task_
identifier
];note
9.4:
protected type
[
[new
protected_type_declaration ::=
protected type
defining_identifier
[known_discriminant_part
][
aspect_specification
] is[new
interface_list
with]protected_definition
;note
9.4:
protected
[
[new
single_protected_declaration ::=
protected
defining_identifier
[
aspect_specification
] is[new
interface_list
with]protected_definition
;note
9.4:
{
[ private
{
end [protected_
protected_definition ::=
{
protected_operation_declaration
}[ private
{
protected_element_declaration
} ]end [protected_
identifier
]note
note
note
9.4:
protected body
[
{
end [protected_
protected_body ::=
protected body
defining_identifier
[
aspect_specification
] is{
protected_operation_item
}end [protected_
identifier
];note
9.4:
|
|
|
|
|
protected_operation_item ::=
subprogram_declaration
|
subprogram_body
|
null_procedure_declaration
|
expression_function_declaration
|
entry_body
|
aspect_clause
note
note
9.5.2:
[
entry
[
entry_declaration ::=
[
overriding_indicator
]entry
defining_identifier
[(discrete_subtype_definition
)] parameter_profile
[
aspect_specification
];note
9.5.2:
accept entry_
end [entry_
accept_statement ::=
accept entry_
direct_name
[(entry_index
)] parameter_profile
[dohandled_sequence_of_statements
end [entry_
identifier
]];note
note
9.5.2:
entry
[
begin
end [entry_
entry_body ::=
entry
defining_identifier
entry_body_formal_part
[
aspect_specification
]entry_barrier
isdeclarative_part
begin
handled_sequence_of_statements
end [entry_
identifier
];note
note
9.5.2:
for
entry_index_specification ::=
for
defining_identifier
in discrete_subtype_definition
[aspect_specification
] note
note
note
note
note
9.7:
|
|
|
select_statement ::=
selective_accept
|
timed_entry_call
|
conditional_entry_call
|
asynchronous_select
note
9.7.1:
select
[
{ or
[
[ else
end select;
selective_accept ::=
select
[
guard
]select_alternative
{ or
[
guard
]select_alternative
}[ else
sequence_of_statements
]end select;
note
note
note
note
note
note
note
note
9.7.3:
select
else
end select;
conditional_entry_call ::=
select
entry_call_alternative
else
sequence_of_statements
end select;
note
note
note
note
note
note
note
10.1.1:
|
| [private]
library_item ::=
[private] library_unit_declaration
|
library_unit_body
| [private]
library_unit_renaming_declaration
note
10.1.1:
|
library_unit_declaration ::=
subprogram_declaration
| package_declaration
|
generic_declaration
| generic_instantiation
note
10.1.1:
|
|
library_unit_renaming_declaration ::=
package_renaming_declaration
|
generic_renaming_declaration
|
subprogram_renaming_declaration
note
note
note
note
note
10.1.3:
|
body_stub ::=
subprogram_body_stub
| package_body_stub
|
task_body_stub
| protected_body_stub
note
10.1.3:
[
[
subprogram_body_stub ::=
[
overriding_indicator
]subprogram_specification
is separate[
aspect_specification
];note
note
note
10.1.3:
protected body
[
protected_body_stub ::=
protected body
defining_identifier
is separate[
aspect_specification
];note
note
note
11.2:
[exception
{
handled_sequence_of_statements ::=
sequence_of_statements
[exception
exception_handler
{
exception_handler
}]note
11.2:
when [
exception_handler ::=
when [
choice_parameter_specification
:] exception_choice
{'|' exception_choice
} =>sequence_of_statements
note
note
note
note
note
12.1:
[
generic_subprogram_declaration ::=
generic_formal_part
subprogram_specification
[
aspect_specification
];note
note
note
12.1:
|
|
|
generic_formal_parameter_declaration ::=
formal_object_declaration
|
formal_type_declaration
|
formal_subprogram_declaration
|
formal_package_declaration
note
12.3:
package
new generic_package_
[
| [
procedure
new generic_procedure_
[
| [
function
new generic_function_
[
generic_instantiation ::=
package
defining_program_unit_name
isnew generic_package_
name
[generic_actual_part
][
aspect_specification
];| [
overriding_indicator
]procedure
defining_program_unit_name
isnew generic_procedure_
name
[generic_actual_part
][
aspect_specification
];| [
overriding_indicator
]function
defining_designator
isnew generic_function_
name
[generic_actual_part
][
aspect_specification
];note
note
12.3:
[generic_formal_parameter_
generic_association ::=
[generic_formal_parameter_
selector_name
=>] explicit_generic_actual_parameter
note
12.3:
| subprogram_
| package_instance_
explicit_generic_actual_parameter ::=
expression
| variable_name
| subprogram_
name
| entry_name
| subtype_mark
| package_instance_
name
note
12.4:
[
|
[
formal_object_declaration ::=
defining_identifier_list
: mode
[null_exclusion
] subtype_mark
[:= default_expression
][
aspect_specification
];|
defining_identifier_list
: mode
access_definition
[:= default_expression
][
aspect_specification
];note
12.5:
|
formal_type_declaration ::=
formal_complete_type_declaration
|
formal_incomplete_type_declaration
note
12.5:
type
[or use default_
formal_complete_type_declaration ::=
type
defining_identifier
[discriminant_part
] is formal_type_definition
[or use default_
subtype_mark
] [aspect_specification
];note
12.5:
type
[or use default_
formal_incomplete_type_declaration ::=
type
defining_identifier
[discriminant_part
] [is tagged][or use default_
subtype_mark
];note
12.5:
|
|
|
|
|
|
|
|
|
|
formal_type_definition ::=
formal_private_type_definition
|
formal_derived_type_definition
|
formal_discrete_type_definition
|
formal_signed_integer_type_definition
|
formal_modular_type_definition
|
formal_floating_point_definition
|
formal_ordinary_fixed_point_definition
|
formal_decimal_fixed_point_definition
|
formal_array_type_definition
|
formal_access_type_definition
|
formal_interface_type_definition
note
note
12.5.1:
[abstract] [limited | synchronized] new
formal_derived_type_definition ::=
[abstract] [limited | synchronized] new
subtype_mark
[[and interface_list
] with private]note
note
note
note
note
note
note
note
note
note
12.6:
|
formal_subprogram_declaration ::=
formal_concrete_subprogram_declaration
|
formal_abstract_subprogram_declaration
note
12.6:
with
[
formal_concrete_subprogram_declaration ::=
with
subprogram_specification
[is subprogram_default
][
aspect_specification
];note
12.6:
with
[
formal_abstract_subprogram_declaration ::=
with
subprogram_specification
is abstract [subprogram_default
][
aspect_specification
];note
note
12.7:
with package
[
formal_package_declaration ::=
with package
defining_identifier
is new generic_package_name
formal_package_actual_part
[
aspect_specification
];note
12.7:
([others =>] <>)
| [
| (
formal_package_actual_part ::=
([others =>] <>)
| [
generic_actual_part
]| (
formal_package_association
{, formal_package_association
} [, others => <>])note
12.7:
| generic_formal_parameter_
formal_package_association ::=
generic_association
| generic_formal_parameter_
selector_name
=> <>note
13.1:
|
|
|
aspect_clause ::=
attribute_definition_clause
|
enumeration_representation_clause
|
record_representation_clause
|
at_clause
note
note
13.1.1:
with
aspect_specification ::=
with
aspect_mark
[=> aspect_definition
] {,aspect_mark
[=> aspect_definition
] }note
note
note
13.3:
for
| for
attribute_definition_clause ::=
for
local_name
'attribute_designator
use expression
;| for
local_name
'attribute_designator
use name
;note
note
note
13.5.1:
for first_subtype_
record [
{
end record [
record_representation_clause ::=
for first_subtype_
local_name
userecord [
mod_clause
]{
component_clause
}end record [
local_name
];note
note
note
note
note
note
13.12:
| restriction_parameter_
restriction ::=
restriction_identifier
| restriction_parameter_
identifier
=> restriction_parameter_argument
note
note
note
H.7.1:
|
| (
formal_parameter_set ::=
formal_group_designator
|
formal_parameter_name
| (
formal_parameter_name
{, formal_parameter_name
})note
note
H.7.1:
formal_
| formal_subprogram_
| formal_access_to_subprogram_object_
formal_parameter_name ::=
formal_
subtype_mark
| formal_subprogram_
name
| formal_access_to_subprogram_object_
name
note
H.7.1:
| (
dispatching_operation_set ::=
dispatching_operation_specifier
| (
dispatching_operation_specifier
{, dispatching_operation_specifier
})note
note
note