Browsable Ada 2005 Grammar

CC-BY

Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: ada/ada2005/txl/lehyaric-cordy/extracted
Source used for this grammar: Bruno Le Hyaric, James R. Cordy, TXL Basis Grammar for Ada 2005, version 1.5, July 2010 [Project]

Summary

Syntax

program ::=
	compilation
identifier ::=
	id
	wide_identifier
wide_identifier ::=
	"[" stringlit "]"
numeric_literal ::=
	decimal_literal
	based_literal
character_literal ::=
	charlit
string_literal ::=
	stringlit
pragma ::=
	"pragma" id blocksemi
	"pragma" id pragma_arguments blocksemi
pragma_arguments ::=
	"(" {pragma_argument_association ","}+ ")"
semi ::=
	";" NL
blocksemi ::=
	";" NL
unitsemi ::=
	";" (NL NL)
eol ::=
	NL
blockeol ::=
	NL
colon ::=
	":"
colon_equals ::=
	":="
arrow ::=
	"=>"
pragma_argument_association ::=
	identifier_arrow? expression
identifier_arrow ::=
	identifier arrow
basic_declaration ::=
	type_declaration
	subtype_declaration
	object_declaration
	number_declaration
	subprogram_declaration
	abstract_subprogram_declaration
	null_procedure_declaration
	package_declaration
	renaming_declaration
	exception_declaration
	generic_declaration
	generic_instantiation
	pragma
defining_identifier ::=
	identifier
type_declaration ::=
	full_type_declaration
	incomplete_type_declaration
	private_type_declaration
	private_extension_declaration
full_type_declaration ::=
	"type" defining_identifier known_discriminant_part? "is" type_definition blocksemi
	task_type_declaration
	protected_type_declaration
type_definition ::=
	enumeration_type_definition
	integer_type_definition
	real_type_definition
	array_type_definition
	record_type_definition
	access_type_definition
	derived_type_definition
	interface_type_definition
subtype_declaration ::=
	"subtype" defining_identifier "is" subtype_indication semi
subtype_indication ::=
	null_exclusion? subtype_mark constraint?
subtype_mark ::=
	name
constraint ::=
	scalar_constraint
	composite_constraint
scalar_constraint ::=
	range_constraint
	digits_constraint
	delta_constraint
composite_constraint ::=
	index_constraint
	discriminant_constraint
object_declaration ::=
	defining_identifier_list colon "aliased"? "constant"? subtype_access_or_array_type_definition object_declaration_expression? semi
	single_task_declaration
	single_protected_declaration
subtype_access_or_array_type_definition ::=
	subtype_indication
	access_definition
	array_type_definition
object_declaration_expression ::=
	colon_equals expression
defining_identifier_list ::=
	{defining_identifier ","}+
number_declaration ::=
	defining_identifier_list colon "constant" colon_equals expression semi
derived_type_definition ::=
	"abstract"? "limited"? "new" subtype_indication interface_and_record_extension_specification?
interface_and_record_extension_specification ::=
	"and" interface_list record_extension_part?
	record_extension_part
range_constraint ::=
	"range" range
range ::=
	range_attribute_reference
	simple_expression SP ".." SP simple_expression
enumeration_type_definition ::=
	"(" {enumeration_literal_specification ","}+ ")"
enumeration_literal_specification ::=
	defining_identifier
	defining_character_literal
defining_character_literal ::=
	character_literal
integer_type_definition ::=
	signed_integer_type_definition
	modular_type_definition
signed_integer_type_definition ::=
	"range" simple_expression SP ".." SP simple_expression
modular_type_definition ::=
	"mod" expression
real_type_definition ::=
	floating_point_definition
	fixed_point_definition
floating_point_definition ::=
	"digits" expression real_range_specification?
real_range_specification ::=
	"range" simple_expression SP ".." SP simple_expression
fixed_point_definition ::=
	ordinary_fixed_point_definition
	decimal_fixed_point_definition
ordinary_fixed_point_definition ::=
	"delta" expression real_range_specification
decimal_fixed_point_definition ::=
	"delta" expression "digits" expression real_range_specification?
digits_constraint ::=
	"digits" expression range_constraint?
array_type_definition ::=
	unconstrained_array_definition
	constrained_array_definition
unconstrained_array_definition ::=
	"array" "(" {index_subtype_definition ","}+ ")" "of" component_definition
index_subtype_definition ::=
	subtype_mark "range" "<>"
constrained_array_definition ::=
	"array" "(" {discrete_subtype_definition ","}+ ")" "of" component_definition
discrete_subtype_definition ::=
	subtype_indication
	range
component_definition ::=
	"aliased"? subtype_indication
	"aliased"? access_definition
index_constraint ::=
	"(" {discrete_range ","}+ ")"
discrete_range ::=
	subtype_indication
	range
discriminant_part ::=
	unknown_discriminant_part
	known_discriminant_part
unknown_discriminant_part ::=
	"(" "<>" ")"
known_discriminant_part ::=
	"(" discriminant_specification_list ")"
discriminant_specification_list ::=
	discriminant_specification semi_discriminant_specification*
semi_discriminant_specification ::=
	";" discriminant_specification
discriminant_specification ::=
	defining_identifier_list colon null_exclusion? subtype_mark discriminant_specification_default?
	defining_identifier_list colon access_definition discriminant_specification_default?
discriminant_specification_default ::=
	colon_equals default_expression
default_expression ::=
	expression
discriminant_constraint ::=
	"(" {discriminant_association ","}* ")"
discriminant_association ::=
	discriminant_selector_name_arrow? expression
discriminant_selector_name_arrow ::=
	selector_name or_selector_name* arrow
or_selector_name ::=
	orbar selector_name
orbar ::=
	"|"
	"!"
record_type_definition ::=
	record_type_definition_tagged? "limited"? record_definition
record_type_definition_tagged ::=
	"abstract"? "tagged"
record_definition ::=
	IN eol "record" IN eol component_list EX "end" "record" EX
	"null" "record"
component_list ::=
	component_item+
	component_item* variant_part
	"null" semi
component_item ::=
	component_declaration
	aspect_clause
	pragma
component_declaration ::=
	defining_identifier_list colon component_definition component_declaration_default? semi
component_declaration_default ::=
	colon_equals default_expression
variant_part ::=
	"case" direct_name "is" IN blockeol variant+ EX "end" "case" blocksemi
variant ::=
	"when" discrete_choice_list arrow component_list
discrete_choice_list ::=
	discrete_choice or_discrete_choice*
or_discrete_choice ::=
	orbar discrete_choice
discrete_choice ::=
	expression
	discrete_range
	"others"
record_extension_part ::=
	"with" record_definition
abstract_subprogram_declaration ::=
	overriding_indicator? subprogram_specification "is" "abstract" blocksemi
interface_type_definition ::=
	interface_type_definition_modifier? "interface" interface_type_definition_list?
interface_type_definition_modifier ::=
	"limited"
	"task"
	"protected"
	"synchronized"
interface_type_definition_list ::=
	"and" interface_list
interface_list ::=
	subtype_mark
	subtype_mark "and" interface_list
access_type_definition ::=
	null_exclusion? access_to_object_definition
	null_exclusion? access_to_subprogram_definition
access_to_object_definition ::=
	"access" general_access_modifier? subtype_indication
general_access_modifier ::=
	"all"
	"constant"
access_to_subprogram_definition ::=
	"access" "protected"? "procedure" parameter_profile
	"access" "protected"? "function" parameter_and_result_profile
null_exclusion ::=
	"not" "null"
access_definition ::=
	null_exclusion? "access" "constant"? subtype_mark
	null_exclusion? "access" "protected"? "procedure" parameter_profile
	null_exclusion? "access" "protected"? "function" parameter_and_result_profile
incomplete_type_declaration ::=
	"type" defining_identifier discriminant_part? incomplete_type_declaration_modifier? blocksemi
incomplete_type_declaration_modifier ::=
	"is" "tagged"
declarative_part ::=
	declarative_item*
declarative_item ::=
	basic_declarative_item
	body
basic_declarative_item ::=
	basic_declaration
	aspect_clause
	use_clause
body ::=
	proper_body
	body_stub
proper_body ::=
	subprogram_body
	package_body
	task_body
	protected_body
name ::=
	direct_name name_component*
	character_literal
name_component ::=
	explicit_dereference_component
	indexed_slice_type_conv_or_function_call_component
	selected_component_component
	attribute_reference_component
indexed_slice_type_conv_or_function_call_component ::=
	"(" {index_or_parameter_value ","}+ ")"
index_or_parameter_value ::=
	expression
	discrete_range
	parameter_association
direct_name ::=
	identifier
	operator_symbol
prefix ::=
	name
explicit_dereference ::=
	name explicit_dereference_component
explicit_dereference_component ::=
	"." "all"
implicit_dereference ::=
	name
indexed_component ::=
	prefix indexed_component_component
indexed_component_component ::=
	"(" {index_expression ","}+ ")"
index_expression ::=
	expression
slice ::=
	prefix slice_component
slice_component ::=
	"(" discrete_range ")"
selected_component ::=
	prefix selected_component_component
selected_component_component ::=
	"." selector_name
selector_name ::=
	identifier
	character_literal
	operator_symbol
attribute_reference ::=
	prefix attribute_reference_component
attribute_reference_component ::=
	SPOFF "'" attribute_designator SPON
attribute_designator ::=
	identifier attribute_designator_expression?
	"access"
	"delta"
	"digits"
attribute_designator_expression ::=
	"(" expression ")"
range_attribute_reference ::=
	prefix SPOFF "'" range_attribute_designator
range_attribute_designator ::=
	"range" SPON range_attribute_designator_expression?
range_attribute_designator_expression ::=
	"(" expression ")"
aggregate ::=
	record_aggregate
	extension_aggregate
	array_aggregate
record_aggregate ::=
	"(" record_component_association_list ")"
record_component_association_list ::=
	{record_component_association ","}+
	"null" "record"
record_component_association ::=
	expression
	component_choice_list arrow expression_or_null
component_choice_list ::=
	selector_name or_selector_name*
	"others"
extension_aggregate ::=
	"(" ancestor_part "with" record_component_association_list ")"
ancestor_part ::=
	expression
	subtype_mark
array_aggregate ::=
	positional_array_aggregate
	named_array_aggregate
positional_array_aggregate ::=
	"(" {index_expression ","}+ comma_others* ")"
comma_others ::=
	"," "others" arrow expression_or_null
named_array_aggregate ::=
	"(" {array_component_association ","}+ ")"
array_component_association ::=
	discrete_choice_list arrow expression_or_null
expression_or_null ::=
	expression
	"<>"
expression ::=
	relation and_or_xor_relation*
and_or_xor_relation ::=
	and_or_xor relation
and_or_xor ::=
	"and" "then"?
	"or" "else"?
	"xor"
relation ::=
	simple_expression relational_operator_simple_expression?
	simple_expression "not"? "in" range
	simple_expression "not"? "in" subtype_mark
relational_operator_simple_expression ::=
	relational_operator simple_expression
simple_expression ::=
	unary_adding_operator? term binary_adding_operator_term*
binary_adding_operator_term ::=
	binary_adding_operator term
term ::=
	factor multiplying_operator_factor*
multiplying_operator_factor ::=
	multiplying_operator factor
factor ::=
	primary starstar_primary?
	"abs" primary
	"not" primary
starstar_primary ::=
	"**" primary
primary ::=
	numeric_literal
	"null"
	string_literal
	aggregate
	name
	qualified_expression
	allocator
	"(" expression ")"
	if_expression
if_expression ::=
	"if" expression "then" expression elsif_expression* else_expression?
elsif_expression ::=
	"elsif" expression "then" expression
else_expression ::=
	"else" expression
logical_operator ::=
	"and"
	"or"
	"xor"
relational_operator ::=
	"="
	"/="
	"<"
	"<="
	">"
	">="
binary_adding_operator ::=
	"+"
	"-"
	(IN NL) "&" EX
unary_adding_operator ::=
	"+"
	"-"
multiplying_operator ::=
	"*"
	"/"
	"mod"
	"rem"
highest_precedence_operator ::=
	"**"
	"abs"
	"not"
type_conversion ::=
	subtype_mark "(" expression ")"
qualified_expression ::=
	subtype_mark SPOFF "'" expression_or_aggregate
expression_or_aggregate ::=
	"(" SPON expression ")"
	SPON aggregate
allocator ::=
	"new" subtype_indication
	"new" qualified_expression
sequence_of_statements ::=
	statement+
statement ::=
	label* unlabeled_statement
unlabeled_statement ::=
	simple_statement
	compound_statement
simple_statement ::=
	null_statement
	procedure_call_statement
	assignment_statement
	exit_statement
	goto_statement
	simple_return_statement
	entry_call_statement
	requeue_statement
	delay_statement
	abort_statement
	raise_statement
	code_statement
	pragma
compound_statement ::=
	if_statement
	case_statement
	loop_statement
	block_statement
	extended_return_statement
	accept_statement
	select_statement
null_statement ::=
	"null" semi
label ::=
	"<<" statement_identifier ">>"
statement_identifier ::=
	direct_name
assignment_statement ::=
	name colon_equals expression semi
if_statement ::=
	"if" condition "then" IN eol sequence_of_statements if_statement_elsif* if_statement_else? EX "end" "if" semi
if_statement_elsif ::=
	EX "elsif" condition "then" IN eol sequence_of_statements
if_statement_else ::=
	EX "else" IN eol sequence_of_statements
condition ::=
	expression
case_statement ::=
	"case" expression "is" IN blockeol case_statement_alternative+ EX "end" "case" blocksemi
case_statement_alternative ::=
	"when" discrete_choice_list arrow sequence_of_statements
loop_statement ::=
	loop_statement_identifier? iteration_scheme? "loop" IN eol sequence_of_statements EX "end" "loop" identifier? blocksemi
loop_statement_identifier ::=
	statement_identifier colon
iteration_scheme ::=
	"while" condition
	"for" loop_parameter_specification
loop_parameter_specification ::=
	defining_identifier "in" "reverse"? discrete_subtype_definition
block_statement ::=
	block_statement_identifier_colon? declare_declarative_part? "begin" IN eol handled_sequence_of_statements EX "end" identifier? unitsemi
block_statement_identifier_colon ::=
	statement_identifier colon
declare_declarative_part ::=
	"declare" IN eol declarative_part EX
exit_statement ::=
	"exit" name? exit_statement_when_condition? semi
exit_statement_when_condition ::=
	"when" condition
goto_statement ::=
	"goto" name semi
subprogram_declaration ::=
	overriding_indicator? subprogram_specification blocksemi
subprogram_specification ::=
	procedure_specification
	function_specification
procedure_specification ::=
	"procedure" defining_program_unit_name parameter_profile
function_specification ::=
	"function" defining_designator parameter_and_result_profile
designator ::=
	designator_parent_unit_name? identifier
	operator_symbol
designator_parent_unit_name ::=
	parent_unit_name "."
defining_designator ::=
	defining_program_unit_name
	defining_operator_symbol
defining_program_unit_name ::=
	defining_program_unit_name_parent? defining_identifier
defining_program_unit_name_parent ::=
	parent_unit_name "."
operator_symbol ::=
	string_literal
defining_operator_symbol ::=
	operator_symbol
parameter_profile ::=
	formal_part?
parameter_and_result_profile ::=
	formal_part? "return" subtype_or_access_definition
subtype_or_access_definition ::=
	null_exclusion? subtype_mark
	access_definition
formal_part ::=
	"(" parameter_specification semi_parameter_specification* ")"
semi_parameter_specification ::=
	";" parameter_specification
parameter_specification ::=
	defining_identifier_list colon parameter_type_specification
parameter_type_specification ::=
	mode null_exclusion? subtype_mark parameter_specification_default?
	access_definition parameter_specification_default?
parameter_specification_default ::=
	colon_equals default_expression
mode ::=
	"in"?
	"in" "out"
	"out"
subprogram_body ::=
	NL overriding_indicator? subprogram_specification "is" IN blockeol declarative_part EX "begin" IN eol handled_sequence_of_statements EX "end" designator? unitsemi
procedure_call_statement ::=
	prefix actual_parameter_part? semi
function_call ::=
	prefix function_call_component
function_call_component ::=
	actual_parameter_part
actual_parameter_part ::=
	"(" {parameter_association ","}+ ")"
parameter_association ::=
	parameter_association_selector_name explicit_actual_parameter
parameter_association_selector_name ::=
	selector_name arrow
explicit_actual_parameter ::=
	expression
simple_return_statement ::=
	"return" expression? semi
extended_return_statement ::=
	"return" defining_identifier colon "aliased"? return_subtype_indication extended_return_statement_expression? extended_return_statement_do? unitsemi
extended_return_statement_expression ::=
	colon_equals expression
extended_return_statement_do ::=
	"do" IN eol handled_sequence_of_statements EX "end" "return"
return_subtype_indication ::=
	subtype_indication
	access_definition
null_procedure_declaration ::=
	overriding_indicator? procedure_specification "is" "null" blocksemi
package_declaration ::=
	package_specification unitsemi
package_specification ::=
	NL "package" defining_program_unit_name "is" IN blockeol basic_declarative_item* EX package_specification_private? "end" package_specification_identifier?
package_specification_private ::=
	"private" IN eol basic_declarative_item* EX
package_specification_identifier ::=
	parent_name_dot? identifier
parent_name_dot ::=
	parent_unit_name "."
package_body ::=
	NL "package" "body" defining_program_unit_name "is" IN blockeol declarative_part EX package_body_statements? "end" package_body_identifier? unitsemi
package_body_statements ::=
	"begin" IN eol handled_sequence_of_statements EX
package_body_identifier ::=
	parent_name_dot? identifier
private_type_declaration ::=
	"type" defining_identifier discriminant_part? "is" blockeol private_type_declaration_tagged? "limited"? "private" blocksemi
private_type_declaration_tagged ::=
	"abstract"? "tagged"
private_extension_declaration ::=
	"type" defining_identifier discriminant_part? "is" blockeol "abstract"? private_extension_declaration_modifier? "new" subtype_indication private_extension_declaration_interface_list? "with" "private" blocksemi
private_extension_declaration_modifier ::=
	"limited"
	"synchronized"
private_extension_declaration_interface_list ::=
	"and" interface_list
overriding_indicator ::=
	"not"? "overriding"
use_clause ::=
	use_package_clause
	use_type_clause
use_package_clause ::=
	"use" {used_name ","}+ semi
used_name ::=
	name
use_type_clause ::=
	"use" "type" {used_subtype_mark ","}+ semi
used_subtype_mark ::=
	subtype_mark
renaming_declaration ::=
	object_renaming_declaration
	exception_renaming_declaration
	package_renaming_declaration
	subprogram_renaming_declaration
	generic_renaming_declaration
object_renaming_declaration ::=
	defining_identifier colon null_exclusion? subtype_mark "renames" name semi
	defining_identifier colon access_definition "renames" name semi
exception_renaming_declaration ::=
	defining_identifier colon "exception" "renames" name semi
package_renaming_declaration ::=
	NL "package" defining_program_unit_name "renames" name blocksemi
subprogram_renaming_declaration ::=
	overriding_indicator? subprogram_specification "renames" name blocksemi
generic_renaming_declaration ::=
	"generic" "package" defining_program_unit_name "renames" name blocksemi
	"generic" "procedure" defining_program_unit_name "renames" name blocksemi
	"generic" "function" defining_program_unit_name "renames" name blocksemi
task_type_declaration ::=
	"task" "type" defining_identifier known_discriminant_part? task_type_declaration_definition? blocksemi
task_type_declaration_definition ::=
	"is" IN blockeol task_type_declaration_definition_interface_list? task_definition EX
task_type_declaration_definition_interface_list ::=
	"new" interface_list "with"
single_task_declaration ::=
	"task" defining_identifier single_task_declaration_definition? unitsemi
single_task_declaration_definition ::=
	"is" IN blockeol single_task_declaration_definition_interface_list? EX task_definition
single_task_declaration_definition_interface_list ::=
	"new" interface_list "with"
task_definition ::=
	IN task_item* task_definition_private? EX "end" identifier?
task_definition_private ::=
	"private" IN eol task_item* EX
task_item ::=
	entry_declaration
	aspect_clause
	pragma
task_body ::=
	NL "task" "body" defining_identifier "is" IN blockeol declarative_part EX "begin" IN eol handled_sequence_of_statements EX "end" identifier? unitsemi
protected_type_declaration ::=
	NL "protected" "type" defining_identifier known_discriminant_part? "is" protected_type_declaration_interface_list? eol protected_definition unitsemi
protected_type_declaration_interface_list ::=
	"new" interface_list "with"
single_protected_declaration ::=
	"protected" defining_identifier "is" blockeol single_protected_declaration_interface_list? protected_definition unitsemi
single_protected_declaration_interface_list ::=
	"new" interface_list "with"
protected_definition ::=
	IN protected_operation_declaration* protected_definition_private? EX "end" identifier?
protected_definition_private ::=
	EX "private" IN eol protected_element_declaration*
protected_operation_declaration ::=
	subprogram_declaration
	entry_declaration
	aspect_clause
	pragma
protected_element_declaration ::=
	protected_operation_declaration
	component_declaration
protected_body ::=
	"protected" "body" defining_identifier "is" IN blockeol protected_operation_item* EX "end" identifier? unitsemi
protected_operation_item ::=
	subprogram_declaration
	subprogram_body
	entry_body
	aspect_clause
entry_declaration ::=
	overriding_indicator? "entry" defining_identifier entry_declaration_subtype? parameter_profile blocksemi
entry_declaration_subtype ::=
	"(" discrete_subtype_definition ")"
accept_statement ::=
	"accept" direct_name accept_statement_entry_index? parameter_profile accept_statement_statements? unitsemi
accept_statement_entry_index ::=
	"(" entry_index ")"
accept_statement_statements ::=
	"do" IN eol handled_sequence_of_statements EX "end" identifier?
entry_index ::=
	expression
entry_body ::=
	NL "entry" defining_identifier entry_body_formal_part entry_barrier "is" IN blockeol declarative_part EX "begin" IN eol handled_sequence_of_statements EX "end" identifier? unitsemi
entry_body_formal_part ::=
	entry_body_formal_part_specification? parameter_profile
entry_body_formal_part_specification ::=
	"(" entry_index_specification ")"
entry_barrier ::=
	"when" condition
entry_index_specification ::=
	"for" defining_identifier "in" discrete_subtype_definition
entry_call_statement ::=
	name actual_parameter_part? semi
requeue_statement ::=
	"requeue" name requeue_statement_with_abort? semi
requeue_statement_with_abort ::=
	"with" "abort"
delay_statement ::=
	delay_until_statement
	delay_relative_statement
delay_until_statement ::=
	"delay" "until" expression semi
delay_relative_statement ::=
	"delay" expression semi
select_statement ::=
	selective_accept
	timed_entry_call
	conditional_entry_call
	asynchronous_select
selective_accept ::=
	"select" IN eol guard? select_alternative selective_accept_or_alternative* selective_accept_else_alternative? EX "end" "select" unitsemi
selective_accept_or_alternative ::=
	EX "or" IN eol guard? select_alternative
selective_accept_else_alternative ::=
	"else" sequence_of_statements
guard ::=
	"when" condition arrow
select_alternative ::=
	accept_alternative
	delay_alternative
	terminate_alternative
accept_alternative ::=
	accept_statement sequence_of_statements?
delay_alternative ::=
	delay_statement sequence_of_statements?
terminate_alternative ::=
	"terminate" semi
timed_entry_call ::=
	"select" IN eol entry_call_alternative EX "or" IN eol delay_alternative EX "end" "select" unitsemi
entry_call_alternative ::=
	procedure_or_entry_call sequence_of_statements?
procedure_or_entry_call ::=
	procedure_call_statement
	entry_call_statement
conditional_entry_call ::=
	"select" IN eol entry_call_alternative EX "else" IN eol sequence_of_statements EX "end" "select" unitsemi
asynchronous_select ::=
	"select" IN eol triggering_alternative (EX EX) "then" "abort" IN eol abortable_part EX "end" "select" unitsemi
triggering_alternative ::=
	triggering_statement sequence_of_statements?
triggering_statement ::=
	procedure_or_entry_call
	delay_statement
abortable_part ::=
	sequence_of_statements
abort_statement ::=
	"abort" {abort_name ","}+ semi
abort_name ::=
	name
compilation ::=
	compilation_unit*
compilation_unit ::=
	context_clause library_item
	context_clause subunit
	pragma
library_item ::=
	"private"? library_unit_declaration
	library_unit_body
	"private"? library_unit_renaming_declaration
library_unit_declaration ::=
	subprogram_declaration
	package_declaration
	generic_declaration
	generic_instantiation
	pragma
library_unit_renaming_declaration ::=
	package_renaming_declaration
	generic_renaming_declaration
	subprogram_renaming_declaration
	pragma
library_unit_body ::=
	subprogram_body
	package_body
parent_unit_name ::=
	name
context_clause ::=
	context_item*
context_item ::=
	with_clause
	use_clause
with_clause ::=
	limited_with_clause
	nonlimited_with_clause
limited_with_clause ::=
	"limited" "private"? "with" {with_name ","}+ semi
with_name ::=
	name
nonlimited_with_clause ::=
	"private"? "with" {with_name ","}+ semi
body_stub ::=
	subprogram_body_stub
	package_body_stub
	task_body_stub
	protected_body_stub
subprogram_body_stub ::=
	overriding_indicator? subprogram_specification "is" "separate" blocksemi
package_body_stub ::=
	NL "package" "body" defining_identifier "is" "separate" blocksemi
task_body_stub ::=
	"task" "body" defining_identifier "is" "separate" blocksemi
protected_body_stub ::=
	"protected" "body" defining_identifier "is" "separate" blocksemi
subunit ::=
	"separate" "(" parent_unit_name ")" proper_body
exception_declaration ::=
	defining_identifier_list colon "exception" semi
handled_sequence_of_statements ::=
	sequence_of_statements handled_sequence_of_statements_exception?
handled_sequence_of_statements_exception ::=
	"exception" IN eol exception_handler+ EX
exception_handler ::=
	"when" exception_handler_specification? exception_choice or_exception_choice* arrow sequence_of_statements
exception_handler_specification ::=
	choice_parameter_specification colon
or_exception_choice ::=
	orbar exception_choice
choice_parameter_specification ::=
	defining_identifier
exception_choice ::=
	name
	"others"
raise_statement ::=
	"raise" semi
	"raise" name raise_statement_expression? semi
raise_statement_expression ::=
	"with" expression
generic_declaration ::=
	generic_subprogram_declaration
	generic_package_declaration
generic_subprogram_declaration ::=
	generic_formal_part subprogram_specification blocksemi
generic_package_declaration ::=
	generic_formal_part package_specification blocksemi
generic_formal_part ::=
	"generic" generic_formal_parameter_declaration_or_use_clause*
generic_formal_parameter_declaration_or_use_clause ::=
	generic_formal_parameter_declaration
	use_clause
	pragma
generic_formal_parameter_declaration ::=
	formal_object_declaration
	formal_type_declaration
	formal_subprogram_declaration
	formal_package_declaration
generic_instantiation ::=
	"package" defining_program_unit_name "is" generic_instantiation_clause
	overriding_indicator? "procedure" defining_program_unit_name "is" generic_instantiation_clause
	overriding_indicator? "function" defining_designator "is" generic_instantiation_clause
generic_instantiation_clause ::=
	"new" name generic_actual_part? blocksemi
generic_actual_part ::=
	"(" {generic_association ","}+ ")"
generic_association ::=
	generic_association_selector_name? explicit_generic_actual_parameter
generic_association_selector_name ::=
	selector_name arrow
explicit_generic_actual_parameter ::=
	expression
	name
	subtype_mark
formal_object_declaration ::=
	defining_identifier_list colon mode null_exclusion? subtype_mark formal_object_declaration_default? semi
	defining_identifier_list colon mode access_definition formal_object_declaration_default? semi
formal_object_declaration_default ::=
	colon_equals default_expression
formal_type_declaration ::=
	"type" defining_identifier discriminant_part? "is" formal_type_definition blocksemi
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
formal_private_type_definition ::=
	formal_private_type_definition_tagged? "limited"? "private"
formal_private_type_definition_tagged ::=
	"abstract"? "tagged"
formal_derived_type_definition ::=
	"abstract"? formal_derived_type_definition_modifier? "new" subtype_mark formal_derived_type_definition_interface_list?
formal_derived_type_definition_modifier ::=
	"limited"
	"synchronized"
formal_derived_type_definition_interface_list ::=
	and_interface_list? "with" "private"
and_interface_list ::=
	"and" interface_list
formal_discrete_type_definition ::=
	"(" "<>" ")"
formal_signed_integer_type_definition ::=
	"range" "<>"
formal_modular_type_definition ::=
	"mod" "<>"
formal_floating_point_definition ::=
	"digits" "<>"
formal_ordinary_fixed_point_definition ::=
	"delta" "<>"
formal_decimal_fixed_point_definition ::=
	"delta" "<>" "digits" "<>"
formal_array_type_definition ::=
	array_type_definition
formal_access_type_definition ::=
	access_type_definition
formal_interface_type_definition ::=
	interface_type_definition
formal_subprogram_declaration ::=
	formal_concrete_subprogram_declaration
	formal_abstract_subprogram_declaration
formal_concrete_subprogram_declaration ::=
	"with" subprogram_specification formal_concrete_subprogram_declaration_default? semi
formal_concrete_subprogram_declaration_default ::=
	"is" subprogram_default
formal_abstract_subprogram_declaration ::=
	"with" subprogram_specification "is" "abstract" subprogram_default? semi
subprogram_default ::=
	default_name
	"<>"
	"null"
default_name ::=
	name
formal_package_declaration ::=
	"with" "package" defining_identifier "is" "new" name formal_package_actual_part semi
formal_package_actual_part ::=
	"(" others_arrow? "<>" ")"
	generic_actual_part?
	"(" {formal_package_association ","}+ comma_others_arrow_null? ")"
others_arrow ::=
	"others" arrow
comma_others_arrow_null ::=
	"," "others" arrow "<>"
formal_package_association ::=
	generic_association
	selector_name arrow "<>"
aspect_clause ::=
	attribute_definition_clause
	enumeration_representation_clause
	record_representation_clause
	at_clause
local_name ::=
	direct_name
	direct_name SPOFF "'" attribute_designator SPON
library_unit_name ::=
	name
attribute_definition_clause ::=
	"for" local_name SPOFF "'" attribute_designator SPON "use" expression blocksemi
enumeration_representation_clause ::=
	"for" local_name "use" enumeration_aggregate blocksemi
enumeration_aggregate ::=
	array_aggregate
record_representation_clause ::=
	"for" local_name "use" IN eol "record" mod_clause? IN eol component_clause* EX "end" "record" blocksemi EX
component_clause ::=
	local_name "at" position "range" first_bit SP ".." SP last_bit semi
position ::=
	expression
first_bit ::=
	simple_expression
last_bit ::=
	simple_expression
code_statement ::=
	qualified_expression semi
restriction ::=
	identifier arrow_restriction_parameter_argument?
arrow_restriction_parameter_argument ::=
	arrow restriction_parameter_argument
restriction_parameter_argument ::=
	expression
delta_constraint ::=
	"delta" expression range_constraint?
at_clause ::=
	"for" direct_name "use" "at" expression semi
mod_clause ::=
	"at" "mod" expression semi

GrammarLabMaintained by Dr. Vadim Zaytsev a.k.a. @grammarware. Last updated in September 2015. []