Skip to main content

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

1/5

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
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
2.4:
numeric_literal ::= decimal_literal | based_literal
note
2.4.1:
decimal_literal ::= numeral [.numeral] [exponent]
note
2.4.1:
numeral ::= digit {[underline] digit}
note
2.4.1:
exponent ::= E [+] numeral | E – numeral
note
2.4.1:
digit ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
note
2.4.2:
based_literal ::=
base # based_numeral [.based_numeral] # [exponent]
note
2.4.2:
base ::= numeral
note
2.4.2:
based_numeral ::=
extended_digit {[underline] extended_digit}
note
2.4.2:
extended_digit ::= digit | A | B | C | D | E | F
note
2.5:
character_literal ::= 'graphic_character'
note
2.6:
string_literal ::= "{string_element}"
note
2.6:
string_element ::= "" | non_quotation_mark_graphic_character
note
2.7:
comment ::= --{non_end_of_line_character}
note
2.8:
pragma_argument_association ::=
[pragma_argument_identifier =>] name
| [pragma_argument_identifier =>] expression
| pragma_argument_aspect_mark => name
| pragma_argument_aspect_mark => expression
note
3.1:
defining_identifier ::= identifier
note
note
3.2.2:
subtype_indication ::= [null_exclusion] subtype_mark [constraint]
note
3.2.2:
subtype_mark ::= subtype_name
note
note
3.3.1:
defining_identifier_list ::=
defining_identifier {, defining_identifier}
note
3.3.2:
number_declaration ::=
defining_identifier_list : constant := static_expression;
note
3.4:
derived_type_definition ::=
[abstract] [limited] new parent_subtype_indication [[and interface_list] record_extension_part]
note
3.5:
range_constraint ::= range range
note
3.5.1:
enumeration_literal_specification ::=
defining_identifier | defining_character_literal
note
3.5.1:
defining_character_literal ::= character_literal
note
3.5.4:
signed_integer_type_definition ::=
range static_simple_expression .. static_simple_expression
note
3.5.4:
modular_type_definition ::= mod static_expression
note
3.5.7:
floating_point_definition ::=
digits static_expression [real_range_specification]
note
3.5.7:
real_range_specification ::=
range static_simple_expression .. static_simple_expression
note
3.5.9:
ordinary_fixed_point_definition ::=
delta static_expression real_range_specification
note
3.5.9:
decimal_fixed_point_definition ::=
delta static_expression digits static_expression [real_range_specification]
note
3.5.9:
digits_constraint ::=
digits static_simple_expression [range_constraint]
note
3.6:
unconstrained_array_definition ::=
array(index_subtype_definition {, index_subtype_definition}) of component_definition
note
3.6:
index_subtype_definition ::= subtype_mark range <>
note
note
3.6:
discrete_subtype_definition ::= discrete_subtype_indication | range
note
3.6:
component_definition ::=
[aliased] subtype_indication
| [aliased] access_definition
note
3.6.1:
index_constraint ::= (discrete_range {, discrete_range})
note
3.6.1:
discrete_range ::= discrete_subtype_indication | range
note
3.7:
unknown_discriminant_part ::= (<>)
note
note
3.7:
default_expression ::= expression
note
3.7.1:
discriminant_constraint ::=
(discriminant_association {, discriminant_association})
note
3.7.1:
discriminant_association ::=
[discriminant_selector_name {'|' discriminant_selector_name} =>] expression
note
3.8:
record_type_definition ::= [[abstract] tagged] [limited] record_definition
note
3.8:
record_definition ::=
record
component_list
end record [record_identifier]
| null record
note
note
note
3.8.1:
variant_part ::=
case discriminant_direct_name is
variant
{variant}
end case;
note
note
3.8.1:
discrete_choice_list ::= discrete_choice {'|' discrete_choice}
note
3.8.1:
discrete_choice ::=
choice_expression | discrete_subtype_indication | range | others
note
3.9.1:
record_extension_part ::= with record_definition
note
3.9.3:
abstract_subprogram_declaration ::=
[overriding_indicator]
subprogram_specification is abstract
[aspect_specification];
note
3.9.4:
interface_type_definition ::=
[limited | task | protected | synchronized] interface [and interface_list]
note
3.9.4:
interface_list ::= interface_subtype_mark {and interface_subtype_mark}
note
3.10:
access_to_object_definition ::=
access [general_access_modifier] subtype_indication
note
3.10:
general_access_modifier ::= all | constant
note
3.10:
access_to_subprogram_definition ::=
access [protected] procedure parameter_profile
| access [protected] function parameter_and_result_profile
note
3.10:
null_exclusion ::= not null
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
3.10.1:
incomplete_type_declaration ::=
type defining_identifier [discriminant_part] [is tagged];
note
3.11:
declarative_part ::= {declarative_item}
note
3.11:
declarative_item ::=
basic_declarative_item | body
note
3.11:
basic_declarative_item ::=
basic_declaration | aspect_clause | use_clause
note
note
4.1:
direct_name ::= identifier | operator_symbol
note
note
4.1:
explicit_dereference ::= name.all
note
4.1:
implicit_dereference ::= name
note
4.1.1:
indexed_component ::= prefix(expression {, expression})
note
note
4.1.3:
selected_component ::= prefix . selector_name
note
4.1.4:
attribute_designator ::=
identifier[(static_expression)]
| Access | Delta | Digits | Mod
note
4.1.4:
range_attribute_reference ::= prefix'range_attribute_designator
note
4.1.4:
range_attribute_designator ::= Range[(static_expression)]
note
4.1.5:
generalized_reference ::= reference_object_name
note
4.1.6:
generalized_indexing ::= indexable_container_object_prefix actual_parameter_part
note
note
4.3.1:
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
4.3.1:
component_choice_list ::=
component_selector_name {'|' component_selector_name}
| others
note
note
4.3.2:
ancestor_part ::= expression | subtype_mark
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
4.3.3:
null_array_aggregate ::= '[' ']'
note
4.3.3:
array_component_association_list ::=
array_component_association {, array_component_association}
note
4.3.3:
iterated_component_association ::=
for defining_identifier in discrete_choice_list => expression
| for iterator_specification => expression
note
4.3.4:
record_delta_aggregate ::=
(base_expression with delta record_component_association_list)
note
4.3.4:
array_delta_aggregate ::=
(base_expression with delta array_component_association_list)
| '[' base_expression with delta array_component_association_list ']'
note
4.3.5:
null_container_aggregate ::= '[' ']'
note
4.3.5:
positional_container_aggregate ::= '[' expression{, expression} ']'
note
4.3.5:
named_container_aggregate ::= '[' container_element_association_list ']'
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
4.3.5:
key_choice_list ::= key_choice {'|' key_choice}
note
4.3.5:
key_choice ::= key_expression | discrete_range
note
4.3.5:
iterated_element_association ::=
for loop_parameter_specification[ use key_expression] => expression
| for iterator_specification[ use key_expression] => expression
note
4.4:
expression ::=
relation {and relation} | relation {and then relation}
| relation {or relation} | relation {or else relation}
| relation {xor relation}
note
4.4:
membership_choice_list ::= membership_choice {'|' membership_choice}
note
4.4:
membership_choice ::= choice_simple_expression | range | subtype_mark
note
4.4:
factor ::= primary [** primary] | abs primary | not primary
note
4.5:
logical_operator ::= and | or | xor
note
4.5:
relational_operator ::= = | /= | < | <= | > | >=
note
4.5:
binary_adding_operator ::= + | – | &
note
4.5:
unary_adding_operator ::= + | –
note
4.5:
multiplying_operator ::= * | / | mod | rem
note
4.5:
highest_precedence_operator ::= ** | abs | not
note
4.5.7:
conditional_expression ::= if_expression | case_expression
note
4.5.7:
if_expression ::=
if condition then dependent_expression
{elsif condition then dependent_expression}
[else dependent_expression]
note
4.5.7:
condition ::= boolean_expression
note
note
4.5.7:
case_expression_alternative ::=
when discrete_choice_list =>
dependent_expression
note
4.5.8:
quantifier ::= all | some
note
4.5.8:
predicate ::= boolean_expression
note
4.5.9:
declare_expression ::=
declare {declare_item}
begin body_expression
note
note
4.5.10:
reduction_attribute_designator ::=
reduction_identifier(reduction_specification)
note
4.5.10:
reduction_specification ::= reducer_name, initial_value_expression
note
4.6:
type_conversion ::=
subtype_mark(expression)
| subtype_mark(name)
note
4.7:
qualified_expression ::=
subtype_mark'(expression) | subtype_mark'aggregate
note
4.8:
subpool_specification ::= (subpool_handle_name)
note
5.1:
sequence_of_statements ::= statement {statement} {label}
note
5.1:
null_statement ::= null;
note
5.1:
label ::= <<label_statement_identifier>>
note
5.1:
statement_identifier ::= direct_name
note
5.2:
assignment_statement ::=
variable_name := expression;
note
5.2.1:
target_name ::= @
note
5.3:
if_statement ::=
if condition then
sequence_of_statements
{elsif condition then
sequence_of_statements}
[else
sequence_of_statements]
end if;
note
5.4:
case_statement ::=
case selecting_expression is
case_statement_alternative
{case_statement_alternative}
end case;
note
5.4:
case_statement_alternative ::=
when discrete_choice_list =>
sequence_of_statements
note
5.5:
loop_statement ::=
[loop_statement_identifier:]
[iteration_scheme] loop
sequence_of_statements
end loop [loop_identifier];
note
note
5.5:
loop_parameter_specification ::=
defining_identifier in [reverse] discrete_subtype_definition
[iterator_filter]
note
5.5:
iterator_filter ::= when condition
note
note
5.5.2:
loop_parameter_subtype_indication ::= subtype_indication | access_definition
note
5.5.3:
iterator_parameter_specification ::=
formal_part
| (defining_identifier{, defining_identifier})
note
5.5.3:
iterator_procedure_call ::=
procedure_name
| procedure_prefix iterator_actual_parameter_part
note
note
5.5.3:
iterator_parameter_association ::=
parameter_association
| parameter_association_with_box
note
5.5.3:
parameter_association_with_box ::=
[ formal_parameter_selector_name => ] <>
note
5.6:
block_statement ::=
[block_statement_identifier:]
[declare
declarative_part]
begin
handled_sequence_of_statements
end [block_identifier];
note
note
5.7:
exit_statement ::=
exit [loop_name] [when condition];
note
5.8:
goto_statement ::= goto label_name;
note
6.1:
subprogram_specification ::=
procedure_specification
| function_specification
note
6.1:
procedure_specification ::=
procedure defining_program_unit_name parameter_profile
note
6.1:
function_specification ::=
function defining_designator parameter_and_result_profile
note
6.1:
defining_program_unit_name ::= [parent_unit_name . ]defining_identifier
note
6.1:
operator_symbol ::= string_literal
note
6.1:
defining_operator_symbol ::= operator_symbol
note
6.1:
parameter_profile ::= [formal_part]
note
6.1:
parameter_and_result_profile ::=
[formal_part] return [null_exclusion] subtype_mark
| [formal_part] return access_definition
note
6.1:
mode ::= [in] | in out | out
note
6.1.2:
global_aspect_definition ::=
null
| Unspecified
| global_mode global_designator
| (global_aspect_element{; global_aspect_element})
note
6.1.2:
global_aspect_element ::=
global_mode global_set
| global_mode all
| global_mode synchronized
note
6.1.2:
basic_global_mode ::= in | in out | out
note
6.1.2:
global_set ::= global_name {, global_name}
note
6.1.2:
global_designator ::= all | synchronized | global_name
note
6.1.2:
global_name ::= object_name | package_name
note
6.4:
procedure_call_statement ::=
procedure_name;
| procedure_prefix actual_parameter_part;
note
6.4:
function_call ::=
function_name
| function_prefix actual_parameter_part
note
6.4:
actual_parameter_part ::=
(parameter_association {, parameter_association})
note
6.4:
parameter_association ::=
[formal_parameter_selector_name =>] explicit_actual_parameter
note
6.4:
explicit_actual_parameter ::= expression | variable_name
note
6.5:
simple_return_statement ::= return [expression];
note
6.5:
extended_return_object_declaration ::=
defining_identifier : [aliased] [constant] return_subtype_indication [:= expression]
[aspect_specification]
note
6.5:
extended_return_statement ::=
return extended_return_object_declaration [do
handled_sequence_of_statements
end return];
note
6.5:
return_subtype_indication ::= subtype_indication | access_definition
note
6.7:
null_procedure_declaration ::=
[overriding_indicator]
procedure_specification is null
[aspect_specification];
note
7.1:
package_declaration ::= package_specification;
note
7.3:
private_type_declaration ::=
type defining_identifier [discriminant_part] is [[abstract] tagged] [limited] private
[aspect_specification];
note
7.3:
private_extension_declaration ::=
type defining_identifier [discriminant_part] is
[abstract] [limited | synchronized] new ancestor_subtype_indication
[and interface_list] with private
[aspect_specification];
note
8.3.1:
overriding_indicator ::= [not] overriding
note
8.4:
use_package_clause ::= use package_name {, package_name};
note
8.4:
use_type_clause ::= use [all] type subtype_mark {, subtype_mark};
note
note
8.5.2:
exception_renaming_declaration ::=
defining_identifier : exception renames exception_name
[aspect_specification];
note
8.5.3:
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_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
note
9.1:
single_task_declaration ::=
task defining_identifier
[aspect_specification] [is
[new interface_list with]
task_definition];
note
9.1:
task_definition ::=
{task_item}
[ private
{task_item}]
end [task_identifier]
note
note
9.4:
protected_type_declaration ::=
protected type defining_identifier [known_discriminant_part]
[aspect_specification] is
[new interface_list with]
protected_definition;
note
9.4:
single_protected_declaration ::=
protected defining_identifier
[aspect_specification] is
[new interface_list with]
protected_definition;
note
9.4:
protected_definition ::=
{ protected_operation_declaration }
[ private
{ protected_element_declaration } ]
end [protected_identifier]
note
9.4:
protected_operation_declaration ::= subprogram_declaration
| entry_declaration
| aspect_clause
note
9.4:
protected_element_declaration ::= protected_operation_declaration
| component_declaration
note
9.4:
protected_body ::=
protected body defining_identifier
[aspect_specification] is
{ protected_operation_item }
end [protected_identifier];
note
9.5:
synchronization_kind ::= By_Entry | By_Protected_Procedure | Optional
note
9.5.2:
accept_statement ::=
accept entry_direct_name [(entry_index)] parameter_profile [do
handled_sequence_of_statements
end [entry_identifier]];
note
9.5.2:
entry_index ::= expression
note
9.5.2:
entry_body_formal_part ::= [(entry_index_specification)] parameter_profile
note
9.5.2:
entry_barrier ::= when condition
note
9.5.3:
entry_call_statement ::= entry_name [actual_parameter_part];
note
9.5.4:
requeue_statement ::= requeue procedure_or_entry_name [with abort];
note
9.6:
delay_until_statement ::= delay until delay_expression;
note
9.6:
delay_relative_statement ::= delay delay_expression;
note
9.7.1:
selective_accept ::=
select
[guard]
select_alternative
{ or
[guard]
select_alternative }
[ else
sequence_of_statements ]
end select;
note
9.7.1:
guard ::= when condition =>
note
note
note
9.7.1:
terminate_alternative ::= terminate;
note
9.7.2:
timed_entry_call ::=
select
entry_call_alternative
or
delay_alternative
end select;
note
note
note
9.7.3:
conditional_entry_call ::=
select
entry_call_alternative
else
sequence_of_statements
end select;
note
9.7.4:
asynchronous_select ::=
select
triggering_alternative
then abort
abortable_part
end select;
note
note
9.7.4:
triggering_statement ::= procedure_or_entry_call | delay_statement
note
9.7.4:
abortable_part ::= sequence_of_statements
note
9.8:
abort_statement ::= abort task_name {, task_name};
note
10.1.1:
compilation ::= {compilation_unit}
note
10.1.1:
library_unit_body ::= subprogram_body | package_body
note
10.1.1:
parent_unit_name ::= name
note
10.1.2:
context_clause ::= {context_item}
note
10.1.2:
context_item ::= with_clause | use_clause
note
10.1.2:
limited_with_clause ::= limited [private] with library_unit_name {, library_unit_name};
note
10.1.2:
nonlimited_with_clause ::= [private] with library_unit_name {, library_unit_name};
note
note
10.1.3:
package_body_stub ::=
package body defining_identifier is separate
[aspect_specification];
note
10.1.3:
task_body_stub ::=
task body defining_identifier is separate
[aspect_specification];
note
10.1.3:
protected_body_stub ::=
protected body defining_identifier is separate
[aspect_specification];
note
10.1.3:
subunit ::= separate (parent_unit_name) proper_body
note
11.1:
exception_declaration ::= defining_identifier_list : exception
[aspect_specification];
note
11.2:
handled_sequence_of_statements ::=
sequence_of_statements
[exception
exception_handler
{exception_handler}]
note
11.2:
choice_parameter_specification ::= defining_identifier
note
11.2:
exception_choice ::= exception_name | others
note
11.3:
raise_statement ::= raise;
| raise exception_name [with string_expression];
note
11.3:
raise_expression ::= raise exception_name [with string_simple_expression]
note
note
12.1:
generic_package_declaration ::=
generic_formal_part package_specification;
note
12.1:
generic_formal_part ::=
generic {generic_formal_parameter_declaration | use_clause}
note
note
12.3:
generic_actual_part ::=
(generic_association {, generic_association})
note
12.3:
generic_association ::=
[generic_formal_parameter_selector_name =>] explicit_generic_actual_parameter
note
12.3:
explicit_generic_actual_parameter ::= expression | variable_name
| subprogram_name | entry_name | subtype_mark
| package_instance_name
note
12.5:
formal_complete_type_declaration ::=
type defining_identifier[discriminant_part] is formal_type_definition
[or use default_subtype_mark] [aspect_specification];
note
12.5:
formal_incomplete_type_declaration ::=
type defining_identifier[discriminant_part] [is tagged]
[or use default_subtype_mark];
note
12.5.1:
formal_private_type_definition ::= [[abstract] tagged] [limited] private
note
12.5.1:
formal_derived_type_definition ::=
[abstract] [limited | synchronized] new subtype_mark [[and interface_list] with private]
note
12.5.2:
formal_discrete_type_definition ::= (<>)
note
12.5.2:
formal_signed_integer_type_definition ::= range <>
note
12.5.2:
formal_modular_type_definition ::= mod <>
note
12.5.2:
formal_floating_point_definition ::= digits <>
note
12.5.2:
formal_ordinary_fixed_point_definition ::= delta <>
note
12.5.2:
formal_decimal_fixed_point_definition ::= delta <> digits <>
note
12.5.3:
formal_array_type_definition ::= array_type_definition
note
12.5.4:
formal_access_type_definition ::= access_type_definition
note
12.5.5:
formal_interface_type_definition ::= interface_type_definition
note
12.6:
formal_concrete_subprogram_declaration ::=
with subprogram_specification [is subprogram_default]
[aspect_specification];
note
12.6:
formal_abstract_subprogram_declaration ::=
with subprogram_specification is abstract [subprogram_default]
[aspect_specification];
note
12.6:
subprogram_default ::= default_name | <> | null
note
12.6:
default_name ::= name
note
12.7:
formal_package_declaration ::=
with package defining_identifier is new generic_package_name formal_package_actual_part
[aspect_specification];
note
12.7:
formal_package_actual_part ::=
([others =>] <>)
| [generic_actual_part]
| (formal_package_association {, formal_package_association} [, others => <>])
note
12.7:
formal_package_association ::=
generic_association
| generic_formal_parameter_selector_name => <>
note
13.1:
local_name ::= direct_name
| direct_name'attribute_designator
| library_unit_name
note
13.1.1:
aspect_specification ::=
with aspect_mark [=> aspect_definition] {,
aspect_mark [=> aspect_definition] }
note
13.1.1:
aspect_mark ::= aspect_identifier['Class]
note
13.3:
attribute_definition_clause ::=
for local_name'attribute_designator use expression;
| for local_name'attribute_designator use name;
note
13.4:
enumeration_representation_clause ::=
for first_subtype_local_name use enumeration_aggregate;
note
13.4:
enumeration_aggregate ::= array_aggregate
note
13.5.1:
record_representation_clause ::=
for first_subtype_local_name use
record [mod_clause]
{component_clause}
end record [local_name];
note
13.5.1:
component_clause ::=
component_local_name at position range first_bit .. last_bit;
note
13.5.1:
position ::= static_expression
note
13.5.1:
first_bit ::= static_simple_expression
note
13.5.1:
last_bit ::= static_simple_expression
note
13.8:
code_statement ::= qualified_expression;
note
13.11.3:
storage_pool_indicator ::= storage_pool_name | null | Standard
note
13.12:
restriction ::= restriction_identifier
| restriction_parameter_identifier => restriction_parameter_argument
note
13.12:
restriction_parameter_argument ::= name | expression
note
H.7:
extended_global_mode ::=
overriding basic_global_mode
note
H.7.1:
formal_group_designator ::= null | all
note
H.7.1:
formal_parameter_name ::=
formal_subtype_mark
| formal_subprogram_name
| formal_access_to_subprogram_object_name
note
H.7.1:
dispatching_operation_specifier ::=
dispatching_operation_name (object_name)
note
J.3:
delta_constraint ::= delta static_simple_expression [range_constraint]
note
J.7:
at_clause ::= for direct_name use at expression;
note
J.8:
mod_clause ::= at mod static_expression;