Você está na página 1de 32

Ada Programming Language

Report by Mark Roland C. Alueta


Ada Programming Language

is a structured, statically typed, imperative, wide-spectrum, and


object-oriented high-level computer programming language,
extended from Pascal and other languages.
It has built-in language support for design-by-contract, extremely
strong typing, explicit concurrency, offering tasks, synchronous
message passing, protected objects, and non-determinism.
Ada improves code safety and maintainability by using the
compiler to find errors in favor of runtime errors.
BRIEF HISTORY
BRIEF HISTORY

Ada was originally designed by a team led by Jean Ichbiah of CII Honeywell Bull under
contract to the United States Department of Defense (DoD) from 1977 to 1983 to
supersede over 450 programming languages used by the DoD at that time.[9]
Ada was named after Ada Lovelace (18151852), who has been credited with being the
first computer programmer.
FEATURES

A language used by the US Military


Embedded and Real-time systems (weaponry, tanks)
Make bugs almost non-existent
COMMON USES

Avionics (Avian planes, Boeing Jets, specific jets)


Railway Systems (subways, metros, control synchronization
system)
Banking (security)
Military
Space Technology (ISS)
VERSIONS OF ADA

Ada 83 Jean Ichbiah & USA Department of Defense


Targeted: Embedded and Real-time programming
Ada 95 Tucker Taft
Added: Systems, Numerical, Financial programming and Objects
Ada 05 Tucker Taft
Added: Aggregates, Interfaces
Aga 12 Tucker Taft
Added: Dynamic Contracts, Tasking Improvements
DATA TYPES IN ADA
Data Types in Ada
(* An extended type specific to Stony Brook Ada95)

Data Type Storage Size Range


-2,147,483,648 to
Integer 4 bytes
2,147,483,647
Natural Size of Integer 0 to IntegerLast

Positive Size of Integer 1 to IntegerLast

Long_Integer * 8 bytes -2**63 to (2**63)-1


Data Types in Ada
(* An extended type specific to Stony Brook Ada95)

Data Type Storage Size Range

Short_Integer * 1 byte -128 to 127

Real numbers with an


Float, approximate range of 8.43E-37 to
4 bytes
Short_Float 3.37E+38 and an accuracy of
about 6 decimal digits
Real numbers with an
approximate range of 4.19E-307
Long_Float 8 bytes
to 1.67E+308 and an accuracy of
about 15 decimal digits

Long_Integer * 8 bytes -2**63 to (2**63)-1


Data Types in Ada
(* An extended type specific to Stony Brook Ada95)

Data Type Storage Size Range


An enumeration type
Boolean 1 byte with the values (False,
True)
A character in the ANSI (8-bit)
Character 1 byte character set

A character in the UNICODE


Wide_Character 2 bytes (16-bit) character set

Unsigned_Integer * 4 bytes 0 to 4,294,967,295


Data Types in Ada
(* An extended type specific to Stony Brook Ada95)

Data Type Storage Size Range

Integer values in the range of


Byte_Integer * 1 byte
-128 to 127

Integer values in the range of 0 to


Unsigned_Byte_Integer 1 byte
255

Integer values in the range of


Word_Integer * 2 bytes
-32768 to 32767

Integer values in the range of


Unsigned_Word_Integer * 2 bytes
0 to 65535
Data Types in Ada
(* An extended type specific to Stony Brook Ada95)

Data Type Storage Size Range


Integer values in the range of
Dword_Integer * 4 bytes
-2,147,483,648 to 2,147,483,647

Integer values in the range of 0 to


Unsigned_Dword_Integer * 4 bytes
4,294,967,295

Qword_Integer * 8 bytes -2**63 to (2**63)-1

An enumeration type with the


Byte_Boolean * 1 byte
values (False, True)
Data Types in Ada
(* An extended type specific to Stony Brook Ada95)

Data Type Storage Size Range

An enumeration type
Word_Boolean * 2 bytes with the values (False,
True)

An enumeration type with the


Dword_Boolean * 4 bytes values (False, True). Useful
when interfacing with C code.
OPERATORS IN ADA
LOGICAL OPERATORS

AND
OR
RELATIONAL OPERATORS

/= Not Equal

= Equal

< Less Than

<= Less Than or Equal To

> Greater Than

>= Greater Than or Equal To


ARITHMETIC AND OTHER OPERATORS
+ Add
- Subtract
& Concatenate
* Multiply
/ Divide
mod Modulus
rem Remainder
** Power
not Logical Not
abs Absolute Value
CONDITIONAL STATEMENTS
If-Else Statement

if condition then
statement;
else
other statement;
end if;
If-Else Statement

if condition then
statement;
elseif condition then
other statement;
elseif condition then
other statement;
else
another statement;
end if;
Case Statement

case X is
when 1 =>
Walk_The_Dog;
when 5 =>
Launch_Nuke_from_North_Korea;
when 8 =>
Finish_blended;
when others =>
Procrastinate;
end case;
UNCONDITIONALS
Return

return;

return Value;
Goto

goto Label;

<<Label>>
Statement;
LOOP STATEMENTS
Endless Loop

A_Label_for_Loop:
loop
Do_something;
end loop A_Label_for_Loop;
Loop with Condition at the beginning
(While Loop)

While_Loop:
while x <= 5 loop
x = x + 1;
end loop While_Loop;
Loop with condition at the end
(Until Loop/ Do While)

Until_Loop:
loop
x := x + 1;
exit Until_Loop when x > 5;
end loop Until_Loop;
Loop with Condition in the middle
(Exit Loop)

Exit_Loop:
loop
x := x + 1;
exit Exit_Loop when x > 5;
Do_Something;
end loop Exit_Loop;
For Loop

For_Loop:
for X in Integer range 1 .. 10 loop
Do_Something;
end loop For_Loop;
END

Você também pode gostar