244 lines
5.7 KiB
Plaintext
244 lines
5.7 KiB
Plaintext
================================================================================
|
|
with clauses
|
|
================================================================================
|
|
|
|
with Ada.Text_IO, System; -- multiple names, and fully qualified
|
|
limited with Ada; -- limited with
|
|
private with Ada;
|
|
limited private with Ada;
|
|
use Ada.Text_IO, System;
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(compilation
|
|
(compilation_unit
|
|
(with_clause
|
|
(name_list
|
|
(name
|
|
(identifier)
|
|
(identifier))
|
|
(name
|
|
(identifier)))))
|
|
(comment)
|
|
(compilation_unit
|
|
(with_clause
|
|
(name_list
|
|
(name
|
|
(identifier)))))
|
|
(comment)
|
|
(compilation_unit
|
|
(with_clause
|
|
(name_list
|
|
(name
|
|
(identifier)))))
|
|
(compilation_unit
|
|
(with_clause
|
|
(name_list
|
|
(name
|
|
(identifier)))))
|
|
(compilation_unit
|
|
(use_clause
|
|
(name_list
|
|
(name
|
|
(identifier)
|
|
(identifier))
|
|
(name
|
|
(identifier))))))
|
|
|
|
=====
|
|
Case insensitive
|
|
=====
|
|
|
|
PACkaGe P1 Is
|
|
enD;
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(compilation
|
|
(compilation_unit
|
|
(package_specification
|
|
(name
|
|
(identifier)))))
|
|
|
|
================================================================================
|
|
multiple compilation units
|
|
================================================================================
|
|
|
|
package P1 is
|
|
package Nested is
|
|
end Nested;
|
|
end P1;
|
|
|
|
private package Child.P2 is -- comment to be ignored
|
|
private
|
|
end;
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(compilation
|
|
(compilation_unit
|
|
(package_specification
|
|
(name
|
|
(identifier))
|
|
(package_specification
|
|
(name
|
|
(identifier))
|
|
(name
|
|
(identifier)))
|
|
(name
|
|
(identifier))))
|
|
(compilation_unit
|
|
(package_specification
|
|
(name
|
|
(identifier)
|
|
(identifier))
|
|
(comment))))
|
|
|
|
=========
|
|
body
|
|
=========
|
|
|
|
package body Child.P2 is
|
|
package body Nested is
|
|
begin
|
|
null;
|
|
end Nested;
|
|
begin
|
|
null;
|
|
end Child.P2;
|
|
|
|
---
|
|
(compilation
|
|
(compilation_unit
|
|
(proper_body
|
|
(package_body
|
|
(name
|
|
(identifier)
|
|
(identifier))
|
|
(non_empty_declarative_part
|
|
(declarative_item_pragma
|
|
(proper_body
|
|
(package_body
|
|
(name
|
|
(identifier))
|
|
(handled_sequence_of_statements
|
|
(sequence_of_statements
|
|
(statement
|
|
(simple_statement
|
|
(null_statement)))))
|
|
(name
|
|
(identifier))))))
|
|
(handled_sequence_of_statements
|
|
(sequence_of_statements
|
|
(statement
|
|
(simple_statement
|
|
(null_statement)))))
|
|
(name
|
|
(identifier)
|
|
(identifier))))))
|
|
|
|
================================================================================
|
|
separate
|
|
================================================================================
|
|
|
|
separate (Child) package body P2 is
|
|
end;
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
(compilation
|
|
(compilation_unit
|
|
(subunit
|
|
(name
|
|
(identifier))
|
|
(proper_body
|
|
(package_body
|
|
(name
|
|
(identifier)))))))
|
|
|
|
==========================
|
|
private types
|
|
=========================
|
|
|
|
package P is
|
|
type A is private;
|
|
type B is abstract synchronized new C with private;
|
|
type C is abstract tagged limited private with Size => 8;
|
|
end;
|
|
|
|
-----------
|
|
|
|
(compilation
|
|
(compilation_unit
|
|
(package_specification
|
|
(name
|
|
(identifier))
|
|
(type_declaration
|
|
(private_type_declaration
|
|
(identifier)))
|
|
(type_declaration
|
|
(private_extension_declaration
|
|
(identifier)
|
|
(subtype_indication
|
|
(name
|
|
(identifier)))))
|
|
(type_declaration
|
|
(private_type_declaration
|
|
(identifier)
|
|
(aspect_specification
|
|
(aspect_mark_list
|
|
(aspect_association
|
|
(aspect_mark
|
|
(identifier))
|
|
(aspect_definition
|
|
(expression
|
|
(relation
|
|
(simple_expression
|
|
(term
|
|
(factor
|
|
(primary
|
|
(numeric_literal))))))))))))))))
|
|
|
|
==========
|
|
incomplete types
|
|
==========
|
|
|
|
package P is
|
|
private
|
|
type I;
|
|
type R (A : Integer);
|
|
type R2 (<>);
|
|
type T is tagged;
|
|
end;
|
|
|
|
--------------
|
|
|
|
(compilation
|
|
(compilation_unit
|
|
(package_specification
|
|
(name
|
|
(identifier))
|
|
(type_declaration
|
|
(incomplete_type_declaration
|
|
(identifier)))
|
|
(type_declaration
|
|
(incomplete_type_declaration
|
|
(identifier)
|
|
(discriminant_part
|
|
(known_discriminant_part
|
|
(discriminant_specification_list
|
|
(discriminant_specification
|
|
(defining_identifier_list
|
|
(identifier))
|
|
(name
|
|
(identifier))))))))
|
|
(type_declaration
|
|
(incomplete_type_declaration
|
|
(identifier)
|
|
(discriminant_part
|
|
(unknown_discriminant_part))))
|
|
(type_declaration
|
|
(incomplete_type_declaration
|
|
(identifier))))))
|
|
|