2 High Level and Translators
2 High Level and Translators
1
Characteristics of high languages include:
o It reflects the type of problem solved rather than the features of the
machine.
o It is machine independent.
o They require one to be obey a set of rules when writing the program.
2
High level languages can be classified
into the following categories;
o Procedural/ structured languages (third generation language)
o Object-Oriented languages.
o Natural languages
3
PROCEDURAL/ STRUCTURED LANGUAGES
(THIRD GENERATION LANGUAGE)
o They are designed to express the logic and procedure of a problem.
o Though the syntax of the languages may be different, they use English-like
commands that are easy to follow. Examples include BASIC, COBOL,
FORTRAN, C and Pascal.
4
Problem-Oriented/Fourth Generation
Languages
o Are used to solve specific problems and includes query languages, report
generators and Application generators which have simple English like
syntax rules.
o A single statement of the 4GL can perform the same task as multiple line
of a third-generation language.
o They concentrate on what you want to do rather than how you are going
to do it.
o They present the programmer with more programming tools, such as
command buttons, forms, textboxes etc.
o The programmer simply selects graphical objects called controls on the
screen, and then uses them to create designs on a form by dragging a
mouse pointer.
o 4GL languages include SQL, Dbase 3+ and FoxPro.
5
OBJECT-ORIENTED LANGUAGES
o The major objective of object-oriented approach is extending the capabilities of
procedure language by including data element in program design.
o OOP ties data more closely to the functions that operate on it and protects it
from accidental modification from other functions.
o OOP languages include C++, C#, Object Delphi Pascal, Java among others.
6
EVENT-DRIVEN PROGRAMMING
LANGUAGES
o It is a programming paradigm in which the flow of the program is
determined by events such as user actions (mouse clicks,
movements, key presses).
7
INTERNET PROGRAMMING
LANGUAGES
o Languages used to design websites and manipulate data entered
via a web form.
8
MOBILE APPLICATION
PROGRAMMING LANGUAGES
o Used to develop application software for handheld devices as
personal digital assistant and mobile phones.
9
NATURAL LANGUAGES (FIFTH
GENERATION)
o They are designed to make a computer to behave like an expert and
solve problems.
o The languages are able to make a computer solve a problem for the
programmer; hence, he/she does not spend a lot of time in coming up
with the solution.
12
LANGUAGE TRANSLATORS
o Each language needs its own translator. Generally, there are 3 types of
language translators:
1. Assembler
2. Interpreter
3. Compiler.
14
ASSEMBLER
Functions:
1.It checks whether the instructions written are valid, and identifies any errors in
the program.
2.It assigns memory locations to the names the programmer uses. E.g., the
Assembler keeps a table of these names so that if an instruction refers to it, the
Assembler can easily tell the location to which it was assigned.
o The Interpreter takes one line of the source program, translates it into a
machine instruction, and then it is immediately executed by the CPU.
o The translated line is not stored in the computer memory. Therefore, every
time the program is needed for execution, it has to be translated.
16
COMPILER
17
Compiler Cont’d…
o For a given machine, each language requires its own Compiler.
18
FUNCTIONS OF A COMPILER
o It identifies the proper order of processing, so as to execute the process
as fast as possible & minimize the storage space required in memory.
o It allocates space in memory for the storage locations defined in the
program to be executed.
o It reads each line of the source program & converts it into machine
language.
o It checks for Syntax errors in a program. If there are no syntax errors, it
generates machine code equivalent to the given program.
o It combines the program (machine) code generated with the appropriate
subroutines from the library.
19
PROGRAMMING METHODOLOGY
Bottom-up methodology
20
TOP-DOWN METHODOLOGY
o A top-down approach (is also known as step-wise design) is
essentially the breaking down of a system to gain insight into its
compositional sub-systems.
21
Top-Down Cont’d…
o Top-down-design starts with a description of the overall system
and usually consists of a hierarchical structure which contains
more detailed descriptions of the system at each lower level.
22
BOTTOM-UP METHODOLOGY
23