tree-sitter-ada/corpus/attributes.txt
Emmanuel Briot 0a52f6df01 various attempts to simplify grammar
Fixes handing of expression functions (for which the expression was
 identified as an aggregate)
Move conditional expressions out of 'aggregate', to conform with ARM and
 resolve the above amgiguity
Inline expression_list, which was resulting in a conflict with a
 record_component_association.
2022-12-07 18:32:50 +01:00

197 lines
7.7 KiB
Plaintext

================================================================================
Range attribute
================================================================================
procedure P is
A : MyArray (B'Range (1));
begin
for E in Arr'Range loop
null;
end loop;
for E in Arr'Range (1) loop
null;
end loop;
end;
--------------------------------------------------------------------------------
(compilation
(compilation_unit
(proper_body
(subprogram_body
(subprogram_specification
(procedure_specification
(name
(identifier))))
(non_empty_declarative_part
(declarative_item_pragma
(object_declaration
(defining_identifier_list
(identifier))
(subtype_indication
(name
(identifier))
(constraint
(index_constraint
(discrete_range
(range_g
(name
(identifier))
(tick)
(range_attribute_designator
(expression
(relation
(simple_expression
(term
(factor
(primary
(numeric_literal))))))))))))))))
(handled_sequence_of_statements
(sequence_of_statements
(statement
(compound_statement
(loop_statement
(iteration_scheme
(loop_parameter_specification
(identifier)
(discrete_subtype_definition
(range_g
(name
(identifier))
(tick)
(range_attribute_designator)))))
(sequence_of_statements
(statement
(simple_statement
(null_statement)))))))
(statement
(compound_statement
(loop_statement
(iteration_scheme
(loop_parameter_specification
(identifier)
(discrete_subtype_definition
(range_g
(name
(identifier))
(tick)
(range_attribute_designator
(expression
(relation
(simple_expression
(term
(factor
(primary
(numeric_literal))))))))))))
(sequence_of_statements
(statement
(simple_statement
(null_statement)))))))))))))
================================================================================
Reduction
================================================================================
procedure P is
X : Integer :=
[parallel for Val of M when Val > 100.0 => (Val, 1)]
'Reduce("+", 0);
begin
null;
end;
--------------------------------------------------------------------------------
(compilation
(compilation_unit
(proper_body
(subprogram_body
(subprogram_specification
(procedure_specification
(name
(identifier))))
(non_empty_declarative_part
(declarative_item_pragma
(object_declaration
(defining_identifier_list
(identifier))
(subtype_indication
(name
(identifier)))
(assign_value
(expression
(relation
(simple_expression
(term
(factor
(primary
(name
(attribute_reference
(reduction_attribute_reference
(value_sequence
(iterated_element_association
(iterator_specification
(identifier)
(name
(identifier))
(iterator_filter
(expression
(relation
(simple_expression
(term
(factor
(primary
(name
(identifier))))))
(relational_operator)
(simple_expression
(term
(factor
(primary
(numeric_literal)))))))))
(expression
(relation
(simple_expression
(term
(factor
(primary
(aggregate
(array_aggregate
(positional_array_aggregate
(expression
(relation
(simple_expression
(term
(factor
(primary
(name
(identifier))))))))
(expression
(relation
(simple_expression
(term
(factor
(primary
(numeric_literal))))))))))))))))))
(tick)
(reduction_attribute_designator
(identifier)
(reduction_specification
(name
(string_literal))
(expression
(relation
(simple_expression
(term
(factor
(primary
(numeric_literal))))))))))))))))))))))
(handled_sequence_of_statements
(sequence_of_statements
(statement
(simple_statement
(null_statement)))))))))