0% found this document useful (0 votes)
63 views16 pages

Unit 2 Cs 150

The document provides an overview of computer programming languages. It discusses: - The need for programming languages due to machine language being difficult for humans to understand and use directly. - What a programming language is - an artificial language created to instruct computers using vocabulary and rules of grammar. - The different types of programming languages including low-level languages close to machine code like assembly, and high-level languages that are more abstract and portable between systems. - The common features that all programming languages share, such as data storage, control structures, operators, functions/procedures, exception handling and more. - The five generations of programming languages - from machine code and assembly languages as first/second

Uploaded by

wazmanzambia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views16 pages

Unit 2 Cs 150

The document provides an overview of computer programming languages. It discusses: - The need for programming languages due to machine language being difficult for humans to understand and use directly. - What a programming language is - an artificial language created to instruct computers using vocabulary and rules of grammar. - The different types of programming languages including low-level languages close to machine code like assembly, and high-level languages that are more abstract and portable between systems. - The common features that all programming languages share, such as data storage, control structures, operators, functions/procedures, exception handling and more. - The five generations of programming languages - from machine code and assembly languages as first/second

Uploaded by

wazmanzambia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

UNIT 2

COMPUTER PROGRAMMING LANGUAGES

Need For Programming Languages


As stated earlier, computers carry out their operations in the language of 1s and 0s, which makes
their operations different from the perception of humans. This language is called machine
language.
Machine computations are low level, full of details about the inner workings of the machine.
Machine language is a collection of very detailed instructions that control the computer’s internal
circuitry. Machine language is the native language of the computer; it is the notation to which the
computer responds directly. For example a machine language code might look like this;
000000101111001010
000000101111110010
000000110011101010
The above code adds the numbers in locations 10 and 11 and stores the result in location 12. This
should be quite difficult to interpret not so? How can you tell which number represent the
addition instruction? This requires a lot of effort. This is exactly what the machine understands.
Each different type of CPU has its own unique machine language. Programs in machine
language are usually unintelligible at the lowest level, since they consist only of 0s and 1s.
Programming languages were invented to make machines easier to use. They are tools for
instructing machines. Programming languages are used for specifying, organizing, and reasoning
about computations.

What Is A Programming Language


A programming language is a notation for specifying a sequence of operations to be carried out
by a computer. Programming languages are artificial languages created to tell the computer what
to do. They consist of vocabulary and a set of rules to write programs.
Tip: think of a programming language the same way you think of the different languages you
know e.g English, Bemba, French. Each of these languages can be used to make the same
instructions but not using the same grammar. That is the idea behind programming languages!!!

A programming language has a vocabulary and set of grammatical rules for instructing a
computer to perform specific tasks. The term programming language usually refers to high-level
languages, such as BASIC, C, C++, COBOL, FORTRAN, Ada, and Pascal. These are quite
advanced languages, at least above machine code, because they are able to use languages which
can readily be perceived by humans. Just as people speak many languages, you should
understand there are different kinds of programming languages.

Types Of Programming Languages:


There are many different languages that can be used to program a computer. Computer
languages can be classified as first, second and third generation languages. Usually, a program
will be written in some language whose instruction set is more compatible with human languages
and human thought processes. Such a language is called a high-level language e.g. Pascal, Visual
Basic, C++, and Java etc. programming languages can be said to fall into two categories;
I. Low level languages (LLL) and
II. High level languages (HLL)
As a rule, a single instruction in a high-level language will be equivalent to several instructions
in machine language. This greatly simplifies the task of writing complete, correct programs. Low
level languages refer first to machine language. It being low is in comparison to human
languages. It can be said to be quite low, which means far from human language. Lying between
machine languages and high-level languages are languages called assembly languages. Assembly
language is also regarded to be a low level language. One notable feature of low level languages
is that they are machine specific, which is in contrast with high level languages as will be
discussed later.
There is quite a variety of high level languages. Take some time however in the next frame to
understand the common features among the different programming languages.

Common Features Of Programming Languages


Every programming language has core features. These features have evolved over a period,
depending on the purpose the languages were created for and the market they targeted. All
programming languages have common core set of common features. Implementation of these
core set of features varies from language to language. The history of the language will give us an
idea of the market the languages were intended for.
Here is a list of the common features:

1. A place for storing data. Arrays are advanced storing data facility. Also known as data
structures.
2. Rules for writing programs in that programming language
3. Control statements – which are building blocks for logic implementation.
4. Most programming languages of today support Object Oriented Programming (OOP). So,
constructs to implement like features Class declaration, objects, inheritance,
polymorphism and constructors are included.
5. Every language has operators. Operators are used execute mathematical operations.
6. All languages include facility to write programs, functions and procedures. Incidentally,
this is the place where you write your programs. Functions return values after execution,
whereas procedures simply execute programs.
7. All programs include facility to write libraries. Libraries are themselves programs, which
can be used in other programs.
8. All languages support exception handling. This feature is helpful to identify errors and
generate appropriate messages.
9. All languages include built in functionalities, provided as classes and functions. These
classes help to write better programs.
10. All languages include a compiler and memory handling features. These are implemented
in different ways by the person(s) who developed the language.

Programming languages are very much like the languages we speak.


What differentiate them are the rules of ‘grammar’

Development Of Programming Languages


Programming languages can also be classified by levels or generations. Lower-level languages
are the oldest while high level generations are newer and advanced. The five generations of
programming languages are:
 Machine languages
 Assembly languages
 Procedural languages
 Problem-oriented languages
 Natural languages
Take note that the first two are low level languages while the last three are high level languages.
Let’s examine each of these generations.
Machine Languages: the First Generation

A machine language consists of the numeric codes for the operations that a particular computer
can execute directly. The codes are strings of 0s and 1s, or binary digits (“bits”), which are
frequently converted both from and to hexadecimal (base 16) for human viewing and
modification. Machine language instructions typically use some bits to represent operations, such
as addition, and some to represent operands, or perhaps the location of the next instruction.
Machine language is difficult to read and write, since it does not resemble conventional
mathematical notation or human language, and its codes vary from computer to computer.
Assembly language is one level above machine language. It uses short mnemonic codes for
instructions and allows the programmer to introduce names for blocks of memory that hold data.
One might thus write “add pay, total” instead of “0110101100101000” for an instruction that
adds two numbers. (Hemmendinger, 2015). Machine code programs are very efficient, but
obviously difficult to write.

Assembly Languages: the Second Generation


According to Hemmendinger (2015), assembly language is designed to be easily translated into
machine language. Although blocks of data may be referred to by name instead of by their
machine addresses, assembly language does not provide more sophisticated means of organizing
complex information. Like machine language, assembly language requires detailed knowledge of
internal computer architecture. It is useful when such details are important, as in programming a
computer to interact with input/output devices (printers, scanners, storage devices, and so forth).

The following are some observable facts about assembly language

 Assembly languages use abbreviation or mnemonics such as ADD that are automatically
converted to the appropriate sequence of 1s and 0s
 Assembly languages are much easier to use than machine language, but still more
difficult to use than higher level languages
 These tend to be hardware dependent, but very efficient
This is a second level programming language. It is a variant of machine language in which
names and symbols take the place of the actual codes for machine operations , values and storage
locations , making individual instructions more readable

What are the differences between machine languages and assembly


language? Which one is easier? What makes it simpler? Which one
would result into more code than the other, which one is more
efficient than the other?
High-level Languages: Third Generation
These are considered portable languages because they are not tied specifically to certain
hardware like machine and assembly languages. This implies that you can write a program on
one machine, and transfer the same program on another machine and it will run successfully.
High level languages are not tied to a specific machine. These languages are also referred to as
procedural languages. This is because of the fact that they are designed to express the logic
procedures to solve general problems.
Examples of languages in this generation include Cobol, Basic, Fortran, and C++, Basic, Pascal,
C e.t.c. Depending on the language, the source code is translated into machine code using an
interpreter or a compiler. (you will soon learn about compilers and interpreters). Once compiled,
the program code can be stored as the object code, which is then saved to be run over and over
(without going through the compile process each time). Pascal, Cobol, and Fortran use
compilers.
An interpreter does a similar process, only the translated code is not saved – each time the
program is run, it is interpreted into machine code and run again. The Basic programming
language uses an interpreter.
Take note that each language can use either an interpreter or a compiler.

Q1 List at least 20 commonly used programming languages.

Q2 Find out the kind of translator that is used by each of them.

Q3 Compare the advantages and disadvantages of each. Under what


circumstances will each one will be better than the others?

Problem-oriented Languages: the Fourth Generation


Problem-oriented languages (aka 4GLs – 4th generation languages) are very high level languages
designed to make it easy for people to write programs. These are designed to tackle specific
problems, such as financial or statistical analysis, data storage, and such. For example,
 IFPS (Interactive Financial Planning System) is used to create financial models
 Many 4GLs are part of DBMS systems.
In this generation we find such languages as the following;

Query Languages
 Query languages enable non-programmers to use certain easily understood
commands to search and generate reports from a database
 Structured Query Language (SQL) is one of the most widely used query languages
Application Generators
 An application generator (aka program coder) is a program that provides modules
of prewritten code.
 Programmers can quickly create a program by referencing the appropriate modules
 MS Access has a report generation application and a Report Wizard for quickly
creating reports
Because they are easier to use compared to 3rd generation languages, 4th generation languages are
called Very High Level Languages.

Natural Languages and Visual Programming: the Fifth Generation


 A 5th GL is a computer language that incorporates the concepts of artificial intelligence
to allow direct human communication.
 These languages would enable a computer to learn and to apply new information as
people do.
 Visual programming languages are also included in 5GLs, such as Microsoft’s Visual
Basic. Such languages have proved to be easier to use. You do not need to struggle to
create a user interface in visual basic compared to other lower generation languages.
Such languages are somewhat close to the thinking and language of human, and hence
the term Natural Languages.

The following diagram can help you to have an overview of the programming languages

Figure 2.1programming languages illustrated (Beal, 1995)


Machine language is the language that interacts directly with the hardware. This explains why it
is suppose to be machine specific. Assembly language is quite close to hardware and hence is
also machine specific.
By now you have a good understanding of programming languages. Let’s take a close look at
high level languages and what is involved in executing their programs in terms of compiling and
interpreting.
HIGHER LEVEL LANGUAGES
These have replaced machine and assembly language in all areas of programming. Programming
languages were designed to be high level. A language is high level if it is independent of the
underlying machine. Portability is another term for machine independence; a language is
portable if programs in the language can be run on different machines with little or no change.
Furthermore, the rules for programming in a particular high-level language are much the same
for all computers, so that a program written for one computer can generally be run on many
different computers with little or no alteration. Thus, we see that a high-level language offers
three significant advantages over machine language: simplicity, uniformity and portability. Lying
above high-level languages are languages called fourth-generation languages (usually
abbreviated 4GL). 4GLs are far removed from machine languages and represent the class of
computer languages closest to human languages.
The question of which language is best is one that consumes a lot of time and energy among
computer professionals. Every language has its strengths and weaknesses. For example,
FORTRAN is a particularly good language for processing numerical data, but it does not lend
itself very well to organizing large programs. Pascal is very good for writing well-structured and
readable programs, but it is not as flexible as the C programming language. C++ embodies
powerful object-oriented features, but it is complex and difficult to learn.
The choice of which language to use depends on the type of computer the program is to run on,
what sort of program it is, and the expertise of the programmer. Regardless of what language you
use, you eventually need to convert your program into machine language so that the computer
can understand it.

Need For a Translator


A program that is written in a high level language must, however, be translated into machine
language before it can be executed. So a small program (which comes with every programming
Language) comes into picture which is called as translator which converts High level language
into low level language and vice – a - versa.
There are two types of translators: Interpreters and Compilers.
A Translator is itself a computer program. It accepts a program written in a high-level language
as input, and generates a corresponding machine-language program as output. The original high-
level program is called the source program.

Interpreters
Interpreters, proceed through a program by translating and then executing single instructions or
small group of instructions. An Interpreter takes a program and its input at the same time. It
translates the program, implementing operations as it encounters them, and doing input/output as
necessary. One main advantage of an interpreter is that execution as well as syntax errors are
detected as each statement is encountered, thus debugging is easier in interpreted languages.
With an interpreter, the language comes as an environment, where you type in commands at a
prompt and the environment executes them for you. For more complicated programs, you can
type the commands into a file and get the interpreter to load the file and execute the commands
in it. If anything goes wrong, many interpreters will drop you into a debugger to help you track
down the problem.

The advantage of this is that you can see the results of your commands immediately, and
mistakes can be corrected readily. The biggest disadvantage comes when you want to share your
programs with someone. They must have the same interpreter, or you must have some way of
giving it to them, and they need to understand how to use it. Also users may not appreciate being
thrown into a debugger if they press the wrong key! From a performance point of view,
interpreters can use up a lot of memory, and generally do not generate code as efficiently as
compilers.

It can however be said that, interpreted languages are the best way to start if you have not done
any programming before. This kind of environment is typically found with languages like Lisp,
Smalltalk, Perl and Basic.

Compilers
Compilers translate the entire program into machine language before executing any of the
instructions. Compilers translate source code into machine oriented target code called object
code. After source code is compiled into object code , no further references is made to the source
language.

First of all, you write your code in a file (or files) using an editor. You then run the compiler and
see if it accepts your program. If it did not compile, grit your teeth and go back to the editor; if it
did compile and gave you a program, you can run it either at a shell command prompt or in a
debugger to see if it works properly.

Program compilation is a complicated process. A compiler is a software program that translates a


high-level source language program into a form ready to execute on a computer. Early in the
evolution of compilers, designers introduced IRs (intermediate representations, also commonly
called intermediate languages) to manage the complexity of the compilation process. The use of
an IR as the compiler's internal representation of the program enables the compiler to be broken
up into multiple phases and components, thus benefiting from modularity.

An IR is any data structure that can represent the program without loss of information so that its
execution can be conducted accurately. It serves as the common interface among the compiler
components. Since its use is internal to a compiler, each compiler is free to define the form and
details of its IR, and its specification needs to be known only to the compiler writers. Its
existence can be transient during the compilation process, or it can be output and handled as text
or binary files.

The Importance of IRs to Compilers

An IR should be general so that it is capable of representing programs translated from multiple


languages. Compiler writers traditionally refer to the semantic content of programming
languages as being high. The semantic content of machine-executable code is considered low
because it has retained only enough information from the original program to allow its correct
execution. It would be difficult (if not impossible) to re-create the source program from its lower
form. The compilation process entails the gradual lowering of the program representation from
high-level human programming constructs to low-level real or virtual machine instructions
(figure 2.2). In order for an IR to be capable of representing multiple languages, it needs to be
closer to the machine level to represent the execution behavior of all the languages. Machine-
executable code is usually longer because it reflects the details of the machines on which
execution takes place.

Figure 2.2 Intermediate representation as an intermediate (Chow, 2013)

A well-designed IR should be translatable into different forms for execution on multiple


platforms. For execution on a target processor or CPU, it needs to be translated into the assembly
language of that processor, which usually is a one-to-one mapping to the processor's machine
instructions. Since there are different processors with different ISAs (instruction set
architectures), the IR needs to be at a higher level than typical machine instructions, and not
assume any special machine characteristic.

Using an IR enables a compiler to support multiple front ends that translate from different
programming languages and multiple back ends to generate code for different processor targets
(figure below). The execution platform can also be interpretive in the sense that its execution is
conducted by a software program or virtual machine. In such cases, the medium of execution can
be at a level higher than assembly code, while being lower or at the same level as the IR.

Figure 2.3 Main aim of intermediate representation (Chow, 2013)

Comparison Between Compilers And Interpreters


The repeated examination of the source program by an interpreter allows interpretation to be
more flexible than compilation. An interpreter directly runs the source program, so it can allow
program to be changed whenever required, to add features or correct errors.
Furthermore, an interpreter works with the source text, so it can pinpoint an error in the source
text and report it accurately. With a compiler all translation is completed before the object code
is run, which prevents the object file from being readily adapted as it runs.
It can also be observed that programs which are compiled run faster compared to those which are
interpreted. This is because the interpreter still does the translation during run time, as opposed
to the compiler which does no translation during runtime.

Key
 A compiler is a program that changes source code to object code
 An interpreter translates source code one line at a time and executes the instruction

Figure 2.4 Operation of the interpreter and compiler compared (source:wikepedia)


Libraries
If you had to create everything from scratch every time you wrote a program, it would be tedious
indeed. The same kind of functionality is often required in many programs—reading data from
the keyboard, for example, or displaying information on the screen. To address this,
programming languages tend to come supplied with considerable quantities of pre-written code
that provides standard facilities such as these, so you don’t have to write the code for them
yourself.
Standard code intended for use in any program is kept in a library. The library that comes with a
particular programming language is as important as the language itself, as the quality and scope
of the library can have a significant effect on how long it will take you to complete a given
programming task.
The object file produced by the compiler cannot be executed .If the source contains library
functions the code for these functions are not included in the object file. It is the job of the Linker
to integrate the code of the library functions with the object code into a single executable file.

Executable File
It is a file in a format that the computer can directly execute. Unlike source file, executable files
cannot be read by humans. To transform a source file into an executable file you need to pass it
through a compiler or assembler Example of Compiled Languages are C, C++. The translation of
a source program into object code is said to occur at translation time. Once translation is
complete the object code is run at a later time called run time. The object code created by the
compiler occupies more space than machine code .
Figure 2.5: Linking Libraries into an executable file

Program Languages Semantics And Syntax


Each programming language has a unique set of keywords (words that it understands) and a
special ‘grammar’ for organizing program instructions. Syntax of a computer language is the set
of rules that defines the combinations of symbols that are considered to be a correctly structured
document or fragment in that language. This applies both to programming languages, where the
document represents source code, and markup languages, where the document represents data.
The syntax of a language defines its surface form. Text-based computer languages are based on
sequences of characters, while visual programming languages are based on the spatial layout and
connections between symbols (which may be textual or graphical). Documents that are
syntactically invalid are said to have a syntax error. This is synonymous to the languages we
speak. If someone wants to ask for water, what do you expect them to say? “may I please have
some water”. This is grammatically correct. What about this, “I please some may water? have”.
This is grammatically incorrect. This is similar to a syntax error in a programming language.
Syntax – the form – is contrasted with semantics – the meaning. In programming languages,
semantic processing generally comes after syntactic processing, but in some cases semantic
processing is necessary for complete syntactic analysis, and these are done together
or concurrently. In a compiler, the syntactic analysis comprises the frontend, while semantic
analysis comprises the backend (and middle end, if this phase is distinguished).
Implementing a programming language means bridging the gap from the programmer's high-
level thinking to the machine's zeros and ones. If this is done in an efficient and reliable way,
programmers can concentrate on the actual problems they have to solve, rather than on the
details of machines. But understanding the whole chain from languages to machines is still an
essential part of the training of any serious programmer. It will result in a more competent
programmer, who will moreover be able to develop new languages. A new language is often the
best way to solve a problem, and less difficult than it may sound.

Computer language syntax is generally distinguished into three levels:

 Words – the lexical level, determining how characters form tokens;


 Phrases – the grammar level, narrowly speaking, determining how tokens form phrases;
 Context – determining what objects or variables names refer to, if types are valid, etc

Syntax versus semantics


The syntax of a language describes the form of a valid program, but does not provide any
information about the meaning of the program or the results of executing that program. The
meaning given to a combination of symbols is handled by semantics (either formal or hard-coded
in a reference implementation). Not all syntactically correct programs are semantically correct.
Many syntactically correct programs are nonetheless ill-formed, per the language's rules; and
may (depending on the language specification and the soundness of the implementation) result in
an error on translation or execution. In some cases, such programs may exhibit undefined
behavior. Even when a program is well-defined within a language, it may still have a meaning
that is not intended by the person who wrote it.

Explain more precisely what happens in the process of interpreting or


compiling a computer program.

Why is Java used in making applications for mobile phones, tablets


and other devices?
Lexical Analysis
Lexical analysis is the process of converting a sequence of characters into a sequence of tokens,
i.e. meaningful character strings. A program or function that performs lexical analysis is called
a lexical analyzer, lexer, tokenizer, or scanner, though "scanner" is also used for the first stage of
a lexer. A lexer is generally combined with a parser, which together analyze
the syntax of programming languages, such as in compilers, but also HTML parsers in web
browsers, among other examples.
Strictly speaking, a lexer is itself a kind of parser – the syntax of some programming languages is
divided into two pieces: the lexical syntax (token structure), which is processed by the lexer; and
the phrase syntax, which is processed by the parser. (Farrell, 1995)
Bytecode
Bytecode, also known as p-code (portable code), is a form of instruction set designed for
efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are
compact numeric codes, constants, and references (normally numeric addresses) which encode
the result of parsing and semantic analysis of things like type, scope, and nesting depths of
program objects. They therefore allow much better performance than direct interpretation of
source code.
The name bytecode stems from instruction sets which have one-byte opcodes followed by
optional parameters. Intermediate representations such as bytecode may be output
by programming language implementations to ease interpretation, or it may be used to reduce
hardware and operating system dependence by allowing the same code to run on different
platforms. Bytecode may often be either directly executed on a virtual machine (i.e. interpreter),
or it may be further compiled into machine code for better performance.
Since bytecode instructions are processed by software, they may be arbitrarily complex, but are
nonetheless often akin to traditional hardware instructions; virtual stack machines are the most
common, but virtual register machines have also been built. Different parts may often be stored
in separate files, similar to object modules, but dynamically loaded during execution

A bytecode program may be executed by parsing and directly executing the instructions, one at a
time. This kind of bytecode interpreter is very portable. Some systems, called dynamic
translators, or "just-in-time" (JIT) compilers, translate bytecode into machine language as
necessary at runtime: this makes the virtual machine hardware-specific, but doesn't lose the
portability of the bytecode itself. For example, Java and Smalltalk code is typically stored in
bytecoded format, which is typically then JIT compiled to translate the bytecode to machine code
before execution. This introduces a delay before a program is run, when bytecode is compiled to
native machine code, but improves execution speed considerably compared to direct
interpretation of the source code, normally by several magnitudes

Advantage of Byte Code

Because of its performance advantage, today many language implementations execute a program
in two phases, first compiling the source code into bytecode, and then passing the bytecode to the
virtual machine. There are bytecode based virtual machines of this sort
for Java, Python, PHP, Tcl, and Forth (however, Forth is not ordinarily compiled via bytecodes
in this way, and its virtual machine is more generic instead). The implementation
of Perl and Ruby 1.8 instead work by walking an abstract syntax tree representation derived from
the source code.

VIRTUAL MACHINE (JAVA VIRTUAL MACHINE)


A virtual machine is basically a Machine Within a Machine or An abstract computing machine,
or virtual machine. JVM is a platform-independent execution environment that converts
Javabytecode into machine language and executes it. Most programming languages compile
source code directly into machine code that is designed to run on a specific microprocessor
architecture or operating system, such as Windows or UNIX.
JVM -- a machine within a machine -- mimics a real Javaprocessor, enabling Java bytecode to be
executed as actions or operating system calls on any processor regardless of the operating
system. For example, establishing a socket connection from a workstation to a remote machine
involves an operating system call. Since different operating systems handle sockets in different
ways, the JVM translates the programming code so that the two machines that may be on
different platforms are able to connect. (Beal, 1995)

A JVM language is any language with functionality that can be expressed in terms of a valid
class file which can be hosted by the Java Virtual Machine. A class file contains Java Virtual
Machine instructions (or bytecode) and a symbol table, as well as other support information.

EXERCISE

Answer the following questions

1. What is a programming language?


2. Explain HLL and LLL highlighting the difference between the two
3. Explain why high level languages need a translator. Discuss the types of translators used
in high level languages
4. Explain why byte code is unique.
5. Discuss the common features of programming languages.
6. Discuss the two elements of programming languages: semantics and syntax
7. Discuss the five generations of programming languages.
UNIT SUMMARY

We have covered the following points in this unit;

 A programming language is a notation for specifying a sequence of operations to be


carried out by a computer. Programming languages are artificial languages created to tell
the computer what to do. They consist of vocabulary and a set of rules to write programs.
 A program that is written in a high level language must, however, be translated into
machine language before it can be executed.
 Compilers translate the entire program into machine language before executing any of the
instructions. Compilers translate source code into machine oriented target code called
object code After source code is compiled into object code, no further references are
made to the source language.
 Interpreters, proceed through a program by translating and then executing single
instructions or small group of instructions.
 Syntax of a computer language is the set of rules that defines the combinations of
symbols that are considered to be a correctly structured document or fragment in that
language.
 Semantics refers to the meaning of statements in a programming language.
 There are five generations of programming languages ie 1st ,2nd…5th generations.

You might also like