Please enable JavaScript.
Coggle requires JavaScript to display documents.
Program Construction - Coggle Diagram
Program Construction
compilers
A compiler translates a source code program into machine code and creates an executable file that can be run in future without the need for recompilation. There are four main stages of compilation:
-
Syntax analysis
tokens are checked to see if they match spelling and grammar expected, using standard language definitions. This is done by parsing each token to determine if it uses the correct syntax for the programming language
-
-
-
Advantages of a compiler
a compiled program runs faster than an interpreted program, as it has already been checked for errors
the executable file may be saved on disk and run as many times as required without being recompiled.
-
compiled code cannot be listed and altered, so protects ownership
However, they can be more complex to code than an interpreter
Interpreters
An interpreter analyses the source code statement by statement as execution proceeds, interpreting the meaning of each statement and calling routines to carry out each instruction.
-
-
-
However, as an interpreter only checks code that is being used, portions may go untested and still have errors
Introduction
Computers need direct instructions, called programs, to tell that what to do
humans and computers communicate in completely different languages we communicate in English and computers communicate in binary
we learn to program using python in high level programming languages. It is called a high-level language because the instructions for it are closer to a form that we as humans understand
for a computer to understand code it has to be in a translated in a form the computer understands. the computer understands 90 and 1s ). The code a computer can understand is called a low-level language
Assemblers
-
An assembler is a program that converts assembly language program into executable code that the processor can execute this is done by converting the assembly instructions into opcode and a operand
opcode is short for operation code and is a single instruction that can be executed by the CPU In machine language it is a binary or hexadecimal
Translators
Computers can only execute binary machine code instructions. A program written in another language must be converted into machine code before the program can be run.
We use the term ‘translators’ to cover all the types of software that convert code from one form to another. Compilers, interpreters and assemblers are all types of translators.
-
-