Grammar
Built in Grammar rules
with Ada; --Not required.
with
with
Accesses a package.
with <Package> ;
use
use
Scopes a package.
use <Package> ;
procedure
procedure
Creates a process for actions in the computer.
procedure <Name> [( <arguments> )] is
[<Declaration>]
begin <body>
end <Name>;
Example:
procedure Reset
(N: in out Integer) is
begin
N:=0;
end Reset;
Function
Function
Creates a process for building data in the computer.
function <Name> [( <arguments> )]
return <type> is
[<Declaration>]
begin <body>
end <Name>;
Example:
procedure Next
(N: in Integer) is
begin
return N+1;
end Reset;
declared chunk
declared chunk
A part of code, subdivided and scoped.
declare [<Declaration>]
begin <body>
end <Name>;
declaration
declaration
Variables and objects' construction. Declarations are read in order up-down.
<identifier> : <data_type>;
<identifier> : constant <data_type>;
<variable_1>, <variable_2> : <data_type>;
<identifier_list> : <data_type>;
basic types
basic types
The basic types in Ada.
Integer -- A set of Integer Numbers
Natural -- 0 and beyond
Positive --1 and beyond
1_000 2#0110_1010# 16#FC03# 11#A#
Float := 0.01 12.23_15
1.0e-3 1.2E-1
character := 'a' '3' nul
String := "String text"
String (1 .. 200)