-- ada95_actions.gwa -- This file contains the decorated grammar for Ada95. The grammar is -- exactly the same as in ada95.gra. -- -- Created: 21 March 1995, A. Pappas -- 2.8 pragma = "PRAGMA" <+SPACE+> IDENTIFIER [ "(" {+ pragma_argument_association $ "," +} ")" ] ";". pragma_argument_association = [ IDENTIFIER "=>" ] ( expression ). pragmas_opt = { <+SET+> pragma }. -- 3.1 basic_declaration = type_declaration | object_declaration | subprogram_declaration | package_declaration | exception_declaration | generic_instantiation | subtype_declaration | number_declaration | abstract_subprogram_declaration | renaming_declaration | generic_declaration. defining_identifier = IDENTIFIER. -- 3.2.1 -> 3.3.1 type_declaration = full_type_declaration | incomplete_type_declaration | private_type_declaration | private_extension_declaration. full_type_declaration = "TYPE" <+SPACE+> defining_identifier <+SPACE+> [ known_discriminant_part <+SPACE+> ] "IS" <+INCR+> type_definition ";" <+DECR+> | task_type_declaration | protected_type_declaration. type_definition = <+SET+> enumeration_type_definition | integer_type_definition | real_type_definition | array_type_definition | record_type_definition | access_type_definition | derived_type_definition. -- 3.2.2 -> 3.3.2 subtype_declaration = "SUBTYPE" <+SPACE+> defining_identifier <+SPACE+> "IS" <+SPACE+> subtype_indication ";". subtype_indication = subtype_mark [ <+SPACE+> constraint ]. subtype_indication_b = constraint. subtype_mark = name. constraint = scalar_constraint | composite_constraint. scalar_constraint = range_constraint | digits_constraint | delta_constraint. composite_constraint = index_constraint | discriminant_constraint. -- 3.3.1 -> 3.2 object_declaration = defining_identifier_list ":" <+SPACE+> [ "ALIASED" <+SPACE+> ][ "CONSTANT" <+SPACE+> ] ( subtype_indication | array_type_definition ) [ <+SPACE+> ":=" <+SPACE+> expression ] ";" | single_task_declaration | single_protected_declaration. defining_identifier_list = {+ defining_identifier $ "," +}. -- 3.3.2 number_declaration = defining_identifier_list ":" <+SPACE+> "CONSTANT" <+SPACE+> ":=" <+SPACE+> expression ";". -- 3.4 derived_type_definition = [ "ABSTRACT" <+SPACE+> ] "NEW" <+SPACE+> subtype_indication [ record_extension_part ]. -- 3.5 range_constraint = "RANGE" <+SPACE+> range. range = range_attribute_reference | simple_expression <+SPACE+> ".." <+SPACE+> simple_expression. -- 3.5.1 enumeration_type_definition = "(" {+ enumeration_literal_specification $ "," <+SPACE+> +} ")". enumeration_literal_specification = defining_identifier | defining_character_literal. defining_character_literal = CHARACTER_LITERAL. -- 3.5.4 integer_type_definition = signed_integer_type_definition | modular_type_definition. signed_integer_type_definition = "RANGE" <+SPACE+> simple_expression <+SPACE+> ".." <+SPACE+> simple_expression. modular_type_definition = "MOD" <+SPACE+> expression. -- 3.5.6 real_type_definition = floating_point_definition | fixed_point_definition. -- 3.5.7 floating_point_definition = "DIGITS" <+SPACE+> expression [ <+SPACE+> real_range_specification ]. real_range_specification = "RANGE" <+SPACE+> simple_expression <+SPACE+> ".." <+SPACE+> simple_expression. -- 3.5.9 fixed_point_definition = ordinary_fixed_point_definition | decimal_fixed_point_definition. ordinary_fixed_point_definition = "DELTA" <+SPACE+> expression real_range_specification. decimal_fixed_point_definition = "DELTA" <+SPACE+> expression <+SPACE+> "DIGITS" expression [ <+SPACE+> real_range_specification ]. digits_constraint = "DIGITS" <+SPACE+> expression [ <+SPACE+> range_constraint ]. -- 3.6 array_type_definition = unconstrained_array_definition | constrained_array_definition. unconstrained_array_definition = "ARRAY" <+SPACE+> "(" {+ index_subtype_definition $ "," <+SPACE+> +} ")" <+SPACE+> "OF" <+SPACE+> component_definition. index_subtype_definition = subtype_mark <+SPACE+> "RANGE" <+SPACE+> "<>". constrained_array_definition = "ARRAY" <+SPACE+> "(" {+ discrete_subtype_definition $ "," <+SPACE+> +} ")" <+SPACE+> "OF" <+SPACE+> component_definition. discrete_subtype_definition = subtype_indication | range. component_definition = [ "ALIASED" <+SPACE+> ] subtype_indication. -- 3.6.1 index_constraint = "(" {+ discrete_range $ "," <+SPACE+> +} ")". -- discrete_range = subtype_indication | range. -- discrete_range = name [ subtype_indication_b ] -- | name range_attribute_reference_b -- | simple_expression ".." simple_expression. discrete_range = name ( [ subtype_indication_b ] | range_attribute_reference_b ) | simple_expression <+SPACE+> ".." <+SPACE+> simple_expression. discriminant_part = unknown_discriminant_part | known_discriminant_part. -- 3.7 unknown_discriminant_part = "(" "<>" ")". known_discriminant_part = "(" {+ <+SET+> discriminant_specification $ ";" +} ")". discriminant_specification = defining_identifier_list ":" <+SPACE+> ( subtype_mark | access_definition ) [ <+SPACE+> ":=" <+SPACE+> default_expression ]. default_expression = expression. -- 3.7.1 discriminant_constraint = "(" {+ discriminant_association $ "," <+SPACE+> +} ")". discriminant_association = [ {+ selector_name <+SPACE+> $ VERTICAL_BAR <+SPACE+> +} <+SPACE+> "=>" <+SPACE+> ] expression. -- 3.8 record_type_definition = [ [ "ABSTRACT" <+SPACE+> ] "TAGGED" <+SPACE+> ] [ "LIMITED" <+SPACE+> ] record_definition. record_definition = "RECORD" <+INCR+> component_list <+DECR+> "END" <+SPACE+> "RECORD" | "NULL" <+SPACE+> "RECORD". component_list = {+ <+SET+> component_item +} | { <+SET+> component_item } <+INCR, SET+> variant_part <+DECR+> | "NULL" ";" . component_item = component_declaration | representation_clause. component_declaration = defining_identifier_list ":" component_definition [ <+SPACE+> ":=" <+SPACE+> default_expression ] ";" . -- 3.8.1 variant_part = "CASE" <+SPACE+> direct_name <+SPACE+> "IS" <+INCR+> {+ <+SET+> variant +} <+DECR+> "END" <+SPACE+> "CASE" ";" . variant = "WHEN" <+SPACE+> discrete_choice_list <+SPACE+> "=>" <+INCR+> component_list <+DECR+>. discrete_choice_list = {+ discrete_choice $ <+SPACE+> VERTICAL_BAR +}. discrete_choice = expression | discrete_range | "OTHERS". -- 3.9.1 record_extension_part = "WITH" <+SPACE+> record_definition. -- 3.10 access_type_definition = access_to_object_definition | access_to_subprogram_definition. access_to_object_definition = "ACCESS" <+SPACE+> [ general_access_modifier <+SPACE+> ] subtype_indication. general_access_modifier = "ALL" | "CONSTANT". access_to_subprogram_definition = "ACCESS" <+SPACE+> [ "PROTECTED" <+SPACE+> ] ( "PROCEDURE" parameter_profile | "FUNCTION" parameter_and_result_profile ). access_definition = "ACCESS" <+SPACE+> subtype_mark. -- 3.10.1 incomplete_type_declaration = "TYPE" <+SPACE+> defining_identifier [ discriminant_part ] ";". -- 3.11 declarative_part = pragmas_opt { <+SET+> declarative_item pragmas_opt }. declarative_item = ( basic_declarative_item | body ). basic_declarative_item = basic_declaration | representation_clause | use_clause. body = proper_body | body_stub. proper_body = subprogram_body | package_body | task_body | protected_body. -- 4.1 name = ( direct_name | CHARACTER_LITERAL ) { explicit_dereference_b --| slice_b -- | indexed_component_b | selected_component_b | attribute_reference_b --| function_call_b -- | type_conversion_b | slice_b_or_function_call_b }. -- indexed_component_b and type_conversion_b are a subset of function_call_b direct_name = IDENTIFIER | operator_symbol. prefix = name. -- | implicit_dereference. explicit_dereference_b = "." "ALL". -- slice_or_function_call_b = -- "(" ( general_associations -- | simple_expression ".." simple_expression -- | subtype_mark range_constraint) ")". -- general_associations = -- {+ expression $ "," +} { "," selector_name "=>" expression } -- | {+ selector_name "=>" expression $ "," +}. -- -- 4.1.1 indexed_component_b = "(" {+ expression $ "," <+SPACE+> +} ")". -- 4.1.2 -- slice = prefix "(" discrete_range ")". -- slice_b = "(" discrete_range ")". -- slice_b = "(" ( name ( -- subtype_indication_b -- | range_attribute_reference_b ) -- | simple_expression ".." simple_expression -- ) ")". ---- slice_b without subtype_indication_b is included in function_call_b. -- 4.1.3 selected_component_b = "." selector_name. selector_name = IDENTIFIER | CHARACTER_LITERAL | operator_symbol. -- 4.1.4 attribute_reference_b = "'" attribute_designator. attribute_designator = IDENTIFIER [ "(" expression ")" ] | "ACCESS" | "DELTA" | "DIGITS". range_attribute_reference = prefix "'" range_attribute_designator. range_attribute_reference_b = "'" range_attribute_designator. range_attribute_designator = "RANGE" [ "(" expression ")" ]. -- 4.3 aggregate = ( record_aggregate | array_aggregate | extension_aggregate ). -- 4.3.1 record_aggregate = "(" <+INCR+> record_component_association_list <+DECR+> ")". record_component_association_list = {+ <+SET+> record_component_association $ "," +} | "NULL" <+SPACE+> "RECORD". record_component_association = [ component_choice_list <+SPACE+> "=>" <+SPACE+> ] expression. component_choice_list = {+ selector_name $ <+SPACE+> VERTICAL_BAR +} | "OTHERS". -- 4.3.2 extension_aggregate = "(" ancestor_part <+SPACE+> "WITH" <+INCR+> record_component_association_list <+DECR+> ")". ancestor_part = expression. -- | subtype_mark. -- 4.3.3 array_aggregate = positional_array_aggregate | named_array_aggregate. positional_array_aggregate = "(" <+INCR, SET+> expression "," {+ <+SET+> expression $ "," +} <+DECR+> ")" | "(" <+INCR+> {+ <+SET+> expression $ "," +} "," <+SET+> "OTHERS" <+SPACE+> "=>" <+SPACE+> expression <+DECR+> ")". named_array_aggregate = "(" <+INCR+> {+ <+SET+> array_component_association $ "," +} <+DECR+> ")". array_component_association = discrete_choice_list <+SPACE+> "=>" <+SPACE+> expression. -- 4.4 expression = {+ relation $ <+SPACE+> "AND" <+SPACE+> [ "THEN" <+SPACE+> ] | <+SPACE+> "OR" <+SPACE+> [ "ELSE" <+SPACE+> ] | <+SPACE+> "XOR" <+SPACE+> +}. relation = simple_expression ( [ <+SPACE+> relational_operator <+SPACE+> simple_expression ] | [ "NOT" <+SPACE+> ] "IN" <+SPACE+> ( range | subtype_mark ) ). simple_expression = [ unary_adding_operator ] {+ term $ <+SPACE+> binary_adding_operator <+SPACE+> +}. term = {+ factor $ <+SPACE+> multiplying_operator <+SPACE+> +}. factor = primary [ "**" primary ] | "ABS" <+SPACE+> primary | "NOT" <+SPACE+> primary. primary = NUMERIC_LITERAL | "NULL" | STRING_LITERAL | name [ qualified_expression_b ] | aggregate | "(" expression ")" | allocator. -- 4.5 relational_operator = "=" | "/=" | "<" | "<=" | ">" | ">=". binary_adding_operator = "+" | "-" | "&". unary_adding_operator = "+" | "-". multiplying_operator = "*" | "/" | "MOD" | "REM". -- 4.6 type_conversion_b = "(" ( expression ) ")" . -- 4.7 qualified_expression = subtype_mark qualified_expression_b. qualified_expression_b = "'" ( "(" expression ")" | aggregate ). -- 4.8 allocator = "NEW" <+SPACE+> ( subtype_indication | qualified_expression ). -- 5.1 sequence_of_statements = <+INCR+> pragmas_opt {+ <+SET+> statement +} pragmas_opt <+DECR+>. statement = { label <+SPACE+> } pragmas_opt ( simple_statement | compound_statement ). simple_statement = null_statement | assignment_statement | procedure_call_statement | exit_statement | return_statement -- | entry_call_statement -- is the same as procedure_call | goto_statement | requeue_statement | delay_statement | abort_statement | raise_statement | code_statement. compound_statement = if_statement | case_statement | loop_statement | block_statement | accept_statement | select_statement. null_statement = "NULL" ";". label = "<<" statement_identifier ">>". statement_identifier = direct_name. -- 5.2 assignment_statement = name <+SPACE+> ":=" <+SPACE+> expression ";". -- 5.3 if_statement = "IF" <+SPACE+> condition <+SPACE+> "THEN" sequence_of_statements { <+SET+> "ELSIF" <+SPACE+> condition <+SPACE+> "THEN" sequence_of_statements } [ <+SET+> "ELSE" sequence_of_statements ] <+SET+> "END" <+SPACE+> "IF" ";". condition = expression. -- Must be a boolean_expression. -- 5.4 case_statement = "CASE" <+SPACE+> expression <+SPACE+> "IS" <+INCR+> {+ <+SET+> case_statement_alternative +} <+DECR, SET+> "END" <+SPACE+> "CASE" ";". case_statement_alternative = "WHEN" <+SPACE+> discrete_choice_list <+SPACE+> "=>" sequence_of_statements. -- 5.5 loop_statement = [ statement_identifier ":" <+SPACE+> ] [ iteration_scheme <+SPACE+> ] "LOOP" sequence_of_statements <+SET+> "END" <+SPACE+> "LOOP" [ <+SPACE+> IDENTIFIER ] ";". iteration_scheme = "WHILE" <+SPACE+> condition | "FOR" <+SPACE+> loop_parameter_specification. loop_parameter_specification = defining_identifier <+SPACE+> "IN" <+SPACE+> [ "REVERSE" <+SPACE+> ] discrete_subtype_definition. -- 5.6 block_statement = [ statement_identifier ":" <+SET+> ] [ "DECLARE" <+INCR+> declarative_part <+DECR+> ] begin_end [ <+SPACE+> IDENTIFIER ] ";". begin_end = <+SET+> "BEGIN" handled_sequence_of_statements "END". -- 5.7 exit_statement = "EXIT" [ <+SPACE+> name] [ "WHEN" <+SPACE+> condition ] ";". -- 5.8 goto_statement = "GOTO" <+SPACE+> name ";". -- 6.1 subprogram_declaration = subprogram_specification ";". abstract_subprogram_declaration = subprogram_specification "IS" <+SPACE+> "ABSTRACT" ";". subprogram_specification = "PROCEDURE" <+SPACE+> defining_program_unit_name parameter_profile | "FUNCTION" <+SPACE+> defining_designator parameter_and_result_profile. designator = [ parent_unit_name "." ] IDENTIFIER | operator_symbol. defining_designator = defining_program_unit_name | defining_operator_symbol. defining_program_unit_name = [ parent_unit_name "." ] defining_identifier. operator_symbol = STRING_LITERAL. defining_operator_symbol = operator_symbol. parameter_profile = [ formal_part ]. parameter_and_result_profile = [ formal_part <+SPACE+> ] "RETURN" <+SPACE+> subtype_mark. formal_part = "(" <+INCR+> {+ <+SET+> parameter_specification $ ";" +} <+DECR+> ")". parameter_specification = defining_identifier_list ":" <+SPACE+> (mode subtype_mark | access_definition ) [ <+SPACE+> ":=" <+SPACE+> default_expression ]. mode = [ "IN" <+SPACE+> ] [ "OUT" <+SPACE+> ]. -- 6.3 subprogram_body = subprogram_specification <+SPACE+> "IS" <+INCR+> declarative_part <+DECR+> begin_end [ <+SPACE+> designator ] ";". -- 6.4 procedure_call_statement = name [ actual_parameter_part ] ";". -- function_call = name | prefix actual_parameter_part. -- = name [ actual_parameter_part ]. -- function_call_b = actual_parameter_part. -- = "(" [ selector_name "=>" ] expression -- { "," [ selector_name "=>" ] expression } ")". -- = "(" ( expression -- { "," [ selector_name "=>" ] expression } -- | selector_name "=>" expression -- { "," [ selector_name "=>" ] expression } -- ) ")" actual_parameter_part = "(" <+INCR+> {+ <+SET+> parameter_association $ "," +} <+DECR+> ")". parameter_association = [ selector_name <+SPACE+> "=>" <+SPACE+> ] explicit_actual_parameter. explicit_actual_parameter = expression. slice_b_or_function_call_b = "(" <+INCR, SET+> ( expression ( subtype_indication_b | range_attribute_reference_b | <+SPACE+> ".." <+SPACE+> simple_expression | { "," <+SET+> [ selector_name <+SPACE+> "=>" <+SPACE+> ] expression } ) | selector_name <+SPACE+> "=>" <+SPACE+> expression { "," <+SET+> [ selector_name <+SPACE+> "=>" <+SPACE+> ] expression } ) <+DECR+> ")". -- is unfortunately a superset of slice_b OR function_call_b, because -- expression is a superset of name. -- 6.5 return_statement = "RETURN" [ <+SPACE+> expression ] ";". -- 7.1 package_declaration = package_specification ";". package_specification = "PACKAGE" <+SPACE+> defining_program_unit_name <+SPACE+> "IS" <+INCR+> pragmas_opt { <+SET+> basic_declarative_item pragmas_opt } <+DECR+> [ "PRIVATE" <+INCR+> pragmas_opt { <+SET+> basic_declarative_item pragmas_opt } <+DECR+> ] <+SET+> "END" <+SPACE+> [ [ parent_unit_name "." ] IDENTIFIER ]. -- 7.2 package_body = "PACKAGE" <+SPACE+> "BODY" <+SPACE+> defining_program_unit_name <+SPACE+> "IS" <+INCR+> declarative_part <+DECR, SET+> [ "BEGIN" handled_sequence_of_statements ] "END" <+SPACE+> [ [ parent_unit_name "." ] IDENTIFIER ] ";" <+LINE+>. -- 7.3 private_type_declaration = "TYPE" <+SPACE+> defining_identifier <+SPACE+> [ discriminant_part <+SPACE+> ] "IS" <+SPACE+> [ [ "ABSTRACT" <+SPACE+> ] "TAGGED" <+SPACE+> ] [ "LIMITED" <+SPACE+> ] "PRIVATE" ";". private_extension_declaration = "TYPE" <+SPACE+> defining_identifier <+SPACE+> [ discriminant_part <+SPACE+> ] "IS" <+SPACE+> [ "ABSTRACT" <+SPACE+> ] "NEW" <+INCR, SET+> subtype_indication <+SPACE+> "WITH" <+SPACE+> "PRIVATE" ";" <+DECR+>. -- 8.4 use_clause = use_package_clause | use_type_clause. use_package_clause = "USE" <+SPACE+> {+ name $ "," <+SPACE+> +} ";". use_type_clause = "USE" <+SPACE+> "TYPE" {+ subtype_mark $ "," <+SPACE+> +} ";". -- 8.5 renaming_declaration = object_renaming_declaration | exception_renaming_declaration | package_renaming_declaration | subprogram_renaming_declaration | generic_renaming_declaration. -- 8.5.1 object_renaming_declaration = defining_identifier ":" <+SPACE+> subtype_mark "RENAMES" <+SPACE+> name ";". -- 8.5.2 exception_renaming_declaration = defining_identifier ":" "EXCEPTION" <+SPACE+> "RENAMES" <+SPACE+> name ";". -- 8.5.3 package_renaming_declaration = "PACKAGE" <+SPACE+> defining_program_unit_name "RENAMES" <+SPACE+> name ";". -- 8.5.4 subprogram_renaming_declaration = subprogram_specification <+SPACE+> "RENAMES" <+SPACE+> name ";". -- 8.5.5 generic_renaming_declaration = "GENERIC" <+SPACE+> ( "PACKAGE" | "PROCEDURE" | "FUNCTION" ) <+SPACE+> defining_program_unit_name <+SPACE+> "RENAMES" <+SPACE+> name ";". -- 9.1 task_type_declaration = "TASK" <+SPACE+> [ "TYPE" <+SPACE+> ] defining_identifier [ known_discriminant_part <+SPACE+> ] [ "IS" <+SPACE+> pragmas_opt task_definition ] ";". single_task_declaration = "TASK" <+SPACE+> defining_identifier [ "IS" <+SPACE+> pragmas_opt task_definition ] ";". task_definition = { task_item } [ "PRIVATE" { task_item } ] "END" [ <+SPACE+> IDENTIFIER ]. task_item = entry_declaration | representation_clause. task_body = "TASK" <+SPACE+> "BODY" <+SPACE+> defining_identifier "IS" <+INCR+> declarative_part <+DECR+> begin_end [ <+SPACE+> IDENTIFIER ] ";" <+LINE+>. -- 9.4 protected_type_declaration = "PROTECTED" <+SPACE+> "TYPE" <+SPACE+> defining_identifier <+SPACE+> [ known_discriminant_part <+SPACE+> ] "IS" <+INCR+> pragmas_opt protected_definition ";" <+DECR+>. single_protected_declaration = "PROTECTED" <+SPACE+> defining_identifier "IS" <+INCR+> pragmas_opt protected_definition ";" <+DECR+>. protected_definition = { <+SET+> protected_operation_declaration } [ "PRIVATE" <+INCR+> { <+SET+> protected_element_declaration } <+DECR+> ] "END" [ <+SPACE+> IDENTIFIER ]. protected_operation_declaration = subprogram_declaration | entry_declaration | representation_clause. protected_element_declaration = protected_operation_declaration | component_declaration. protected_body = "PROTECTED" <+SPACE+> "BODY" defining_identifier <+SPACE+> "IS" <+INCR+> { <+SET+> protected_operation_item } <+DECR, SET+> "END" [ <+SPACE+> IDENTIFIER ] ";". protected_operation_item = subprogram_declaration | subprogram_body | entry_body | representation_clause. -- 9.5.2 entry_declaration = "ENTRY" <+SPACE+> defining_identifier [ "(" discrete_subtype_definition ")" ] parameter_profile ";". accept_statement = "ACCEPT" <+SPACE+> direct_name [ "(" entry_index ")" ] parameter_profile [ "DO" handled_sequence_of_statements "END" [ <+SPACE+> IDENTIFIER ] ] ";". entry_index = expression. entry_body = "ENTRY" <+SPACE+> defining_identifier <+INCR+> entry_body_formal_part <+SET+> entry_barrier <+SPACE+> "IS" <+INCR+> declarative_part <+DECR, DECR+> begin_end [ <+SPACE+> IDENTIFIER ] ";". entry_body_formal_part = [ "(" entry_index_specification ")" ] parameter_profile. entry_barrier = "WHEN" <+SPACE+> condition. entry_index_specification = "FOR" <+SPACE+> defining_identifier <+SPACE+> "IN" discrete_subtype_definition. -- 9.5.3 entry_call_statement = name [ actual_parameter_part ] ";". -- 9.5.4 requeue_statement = "REQUEUE" <+SPACE+> name [ <+SPACE+> "WITH" <+SPACE+> "ABORT" ] ";". -- 9.6 delay_statement = delay_until_statement | delay_relative_statement. delay_until_statement = "DELAY" <+SPACE+> "UNTIL" <+SPACE+> expression ";". delay_relative_statement = "DELAY" <+SPACE+> expression ";". -- 9.7 select_statement = selective_accept | timed_entry_call | conditional_entry_call | asynchronous_select. -- 9.7.1 selective_accept = "SELECT" <+SPACE+> [ guard ] select_alternative { "OR" <+SPACE+> [ guard ] select_alternative } [ "ELSE" sequence_of_statements <+SET+> ] "END" <+SPACE+> "SELECT" ";" . guard = "WHEN" <+SPACE+> condition <+SPACE+> "=>" <+SPACE+>. select_alternative = accept_alternative | delay_alternative | terminate_alternative. accept_alternative = accept_statement [ sequence_of_statements <+SET+> ]. delay_alternative = delay_statement [ sequence_of_statements <+SET+> ]. terminate_alternative = "TERMINATE" ";" . -- 9.7.2 timed_entry_call = "SELECT" <+SPACE+> entry_call_alternative "OR" <+SPACE+> delay_alternative "END" <+SPACE+> "SELECT" ";" . entry_call_alternative = entry_call_statement [ sequence_of_statements <+SET+> ]. -- 9.7.3 conditional_entry_call = "SELECT" <+SPACE+> entry_call_alternative "ELSE" sequence_of_statements <+SET+> "END" <+SPACE+> "SELECT" ";". -- 9.7.4 asynchronous_select = "SELECT" <+SPACE+> triggering_alternative "THEN" <+SPACE+> "ABORT" <+SPACE+> abortable_part "END" <+SPACE+> "SELECT" ";". triggering_alternative = triggering_statement [ sequence_of_statements <+SET+> ]. triggering_statement = entry_call_statement | delay_statement. abortable_part = sequence_of_statements <+SET+>. -- 9.8 abort_statement = "ABORT" {+ <+SPACE+> name +}. -- 10.1.1 compilation = pragmas_opt { compilation_unit <+SET+> pragmas_opt }. compilation_unit = context_clause pragmas_opt ( library_item | subunit ) . library_item = [ "PRIVATE" ] ( library_unit_declaration | library_unit_renaming_declaration ) | library_unit_body. library_unit_declaration = subprogram_declaration | package_declaration | generic_declaration | generic_instantiation. library_unit_renaming_declaration = package_renaming_declaration | generic_renaming_declaration | subprogram_renaming_declaration. library_unit_body = subprogram_body | package_body. parent_unit_name = name. -- 10.1.2 context_clause = { context_item <+SET+> pragmas_opt }. context_item = with_clause | use_clause. with_clause = "WITH" <+SPACE+> {+ name $ "," <+SPACE+> +} ";". -- 10.1.3 body_stub = subprogram_body_stub | package_body_stub | task_body_stub | protected_body_stub. subprogram_body_stub = subprogram_specification "IS" <+SPACE+> "SEPARATE" ";" . package_body_stub = "PACKAGE" <+SPACE+> "BODY" <+SPACE+> defining_identifier "IS" <+SPACE+> "SEPARATE" ";" . task_body_stub = "TASK" <+SPACE+> "BODY" <+SPACE+> defining_identifier "IS" <+SPACE+> "SEPARATE" ";" . protected_body_stub = "PROTECTED" <+SPACE+> "BODY" <+SPACE+> defining_identifier <+SPACE+> "IS" <+SPACE+> "SEPARATE" ";" . subunit = "SEPARATE" "(" parent_unit_name ")" proper_body . -- 11.1 exception_declaration = defining_identifier_list ":" <+SPACE+> "EXCEPTION" ";" . -- 11.2 handled_sequence_of_statements = sequence_of_statements [ <+SET+> "EXCEPTION" <+INCR+> {+ exception_handler +} <+DECR+>] <+SET+>. exception_handler = <+SET+> "WHEN" <+SPACE+> [ choice_parameter_specification ":" <+SPACE+> ] {+ exception_choice <+SPACE+> $ VERTICAL_BAR <+SPACE+> +} "=>" sequence_of_statements. choice_parameter_specification = defining_identifier. exception_choice = name | "OTHERS". -- 11.3 raise_statement = "RAISE" [ <+SPACE+> name ] ";" . -- 12.1 generic_declaration = generic_subprogram_declaration | generic_package_declaration. generic_subprogram_declaration = generic_formal_part subprogram_specification ";". generic_package_declaration = generic_formal_part package_specification ";". generic_formal_part = "GENERIC" { generic_formal_parameter_declaration | use_clause } . generic_formal_parameter_declaration = formal_object_declaration | formal_type_declaration | formal_subprogram_declaration | formal_package_declaration. -- 12.3 generic_instantiation = "PACKAGE" <+SPACE+> defining_program_unit_name <+SPACE+> "IS" <+SPACE+> ( "NEW" | "PROCEDURE" | "FUNCTION" ) <+SPACE+> name [ generic_actual_part ] ";" | "PROCEDURE" <+SPACE+> defining_program_unit_name <+SPACE+> "IS" <+SPACE+> "NEW" <+SPACE+> name [ generic_actual_part ] ";" | "FUNCTION" <+SPACE+> defining_designator <+SPACE+> "IS" <+SPACE+> "NEW" <+SPACE+> name [ generic_actual_part ] ";". generic_actual_part = "(" {+ generic_association $ "," +} ")". generic_association = [ selector_name <+SPACE+> "=>" <+SPACE+> ] explicit_generic_actual_parameter. explicit_generic_actual_parameter = expression. -- | name | subtype_mark. -- 12.4 formal_object_declaration = defining_identifier_list ":" <+SPACE+> mode <+SPACE+> subtype_mark [ <+SPACE+> ":=" <+SPACE+> default_expression ] ";". -- 12.5 formal_type_declaration = "TYPE" <+SPACE+> defining_identifier [ discriminant_part ] "IS" <+SPACE+> formal_type_definition ";" . 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. -- 12.5.1 formal_private_type_definition = [ [ "ABSTRACT" <+SPACE+> ] "TAGGED" <+SPACE+> ] [ "LIMITED" <+SPACE+> ] "PRIVATE". formal_derived_type_definition = [ "ABSTRACT" <+SPACE+> ] "NEW" <+SPACE+> subtype_mark [ "WITH" <+SPACE+> "PRIVATE"]. -- 12.5.2 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" "<>". -- 12.5.3 formal_array_type_definition = array_type_definition. -- 12.5.4 formal_access_type_definition = access_type_definition. -- 12.6 replaced subprogram_default formal_subprogram_declaration = "WITH" <+SPACE+> subprogram_specification [ "IS" <+SPACE+> ( name | "<>" ) ] ";". subprogram_default = default_name | "<>". default_name = name. -- 12.7 formal_package_declaration = "WITH" <+SPACE+> "PACKAGE" <+SPACE+> defining_identifier "IS" <+SPACE+> "NEW" <+SPACE+> name <+SPACE+>formal_package_actual_part ";". formal_package_actual_part = "(" "<>" ")" | [ generic_actual_part ]. -- 13.1 representation_clause = attribute_definition_clause | enumeration_representation_clause | record_representation_clause | at_clause. local_name = direct_name | direct_name "'" attribute_designator | name. -- 13.3 attribute_definition_clause = "FOR" <+SPACE+> local_name "'" attribute_designator <+SPACE+> "USE" ( expression ) ";". -- 13.4 enumeration_representation_clause = "FOR" <+SPACE+> local_name <+SPACE+> "USE" <+INCR, SET+> enumeration_aggregate ";" <+DECR+>. enumeration_aggregate = array_aggregate. -- 13.5.1 record_representation_clause = "FOR" <+SPACE+> local_name <+SPACE+> "USE" "RECORD" [ <+SPACE+> mod_clause ] <+INCR+> { <+SET+> component_clause <+DECR+> } "END" <+SPACE+> "RECORD" ";". component_clause = local_name <+SPACE+> "AT" <+SPACE+> position <+SPACE+> "RANGE" first_bit <+SPACE+> ".." <+SPACE+> last_bit ";". position = expression. first_bit = simple_expression. last_bit = simple_expression. -- 13.8 code_statement = qualified_expression ";". -- 13.12 -- J.3 delta_constraint = "DELTA" <+SPACE+> expression [ <+SPACE+> range_constraint ]. -- J.7 at_clause = "FOR"<+SPACE+> direct_name <+SPACE+> "USE" "AT" <+SPACE+> expression ";". -- J.8 mod_clause = "AT" <+SPACE+> "MOD" <+SPACE+> expression ";".