3.1 Language Translators

This is a mind map for translators dn

Commencez. C'est gratuit
ou s'inscrire avec votre adresse courriel
3.1 Language Translators par Mind Map: 3.1 Language Translators

1. 3.1.1 Define Syntax and Semantics

1.1. Syntax

1.1.1. The rules that govern how statements in computer programming language must be constructed.

1.1.2. Examples: Incorrectly spelling a keyword Using the wrong brackets Leaving off the matching bracket Leaving off the end statement symbol (;)

1.2. Semantics

1.2.1. The meaning conveyed by a collection of staments.

1.3. It is possible to write a syntactically correct statement that would be semantically wrong.

1.4. A computer can detect syntax errors. For example word processor checking spelling mistakes or a software compiler checking for syntax error. However, computers will never know the semantic meaning of what was written or programmed.

2. 3.1.2 High-level language translators

2.1. 2 types of computer languages

2.1.1. Low-level language

2.1.2. High-level language

2.2. Hardware only runs on machine code, which is represented by the 1's and 0's of binary code. Electrical circuits and magnetic storage devices only recognize this code.

2.3. Also known as Assembly Language. Each line of an assembler program corresponds to one of the machine code. However, one High-level language statement usually translates into many machine code statements.

2.4. Advantages:

2.4.1. They are portable (be able to run on different machines)

2.4.2. English-like/Easier to understand

2.4.3. Different languages are developed for different tasks

2.5. Examples:

2.5.1. FORTRAN(FORmula TRANslation Language) intended for mathematical and scientific programming

2.5.2. COBOL(Common Business-Oriented Language) for developing business and data-processing applications.

2.5.3. ALGOL(ALGOrithmic Language) introduced structured programming and led to the development of C and Pascal.

2.5.4. BASIC(Beginners All-purpose Symbolic Instruction Code) gave many an easy introduction to programming

2.5.5. Object Orientated Languages (SMALLTALK, C++ and Java) have taken structured programming one step further.

3. High-level vs Low-level

3.1. High level

3.1.1. One instruction = many machine code instructions

3.1.2. Portable, task-oriented

3.1.3. More english-like

3.2. Low level

3.2.1. One instruction = one machine code instruction

3.2.2. Machine specific, machine-oriented

3.2.3. Less easy to write and debug

4. Compilers

4.1. What are they?

4.1.1. Translational program that converts source code into object code

4.1.2. Converting HLL into an equivalent LLL so that it can be executed

4.1.3. Compiled object code can be executed by the computer

4.2. Process of compiling

4.2.1. Lexical analysis Remove all spaces and comments and look for reserved words such as do/while/if/etc. Compiler produces a new version of the code.

4.2.2. Syntax analysis Program is checked against the syntax rules (brackets match, do matches with while). Syntax errors are reported.

4.2.3. Code generation The machine code that will be run by the computer is created. Any standard library functions are linked into the final compiled program.

4.3. Compiler needs to be loaded into memory. Compiled code usually executes faster than an interpreted version of the same program. Can be moved across computers, however, source code cannot and may need some changes to be made.

4.4. Compiler vs Interpreter: Interpreter analyzes and executes each line of source code in succession without looking at the entire program while a compiler creates a completely new program that is executed. It does not stop at the first error and just reports the errors.

5. Interpreters

5.1. Translated high-level instructions that can be directly executed one by one.

5.2. Compiled programs run faster than interpreted ones

5.3. Advantages is that the line of code being interpreted is executed straight away

5.4. Programmers normally have access to IDEs which integrate editor, to create source code, and debugger, to remove bugs.

5.5. Summary: Converts source code into object code that can be executed. Compiled code can be executed without the compiler. However, object code can't be modified but source code that runs in an interpreter can be viewed.

6. Compiling Java

6.1. Java has a separate compiler and library of modules everywhere the source code is to be turned into machine language

6.2. Java is 'compiled' to an intermediate stage (Java bytecodes), which are a tokenised/compressed version of the original code. This is passed to an interpreter, Java Virtual Manager (JVM), which is written for every platform Java is to run on.

7. Software Development Tools

7.1. Make the development of certain software easier.

7.2. HTML Editor

7.2.1. Enables web pages to be created without needing to know or remember the syntax of a range of HTML instructions.

7.3. DBMS

7.3.1. Data Base Management Systems enable database to be created without needing to write specific code. Enable data dictionaries and files to be created, manages data, creates reports

7.4. CASE Tools

7.4.1. Computer Aided Software Engineering enable stages of system development cycle to be implemented and managed in an integrated manner. Tools include: summarizing initial requirements, developing flow diagrams, scheduling tasks, preparing documentation, etc.

7.5. Macros

7.5.1. Developed by recording a series of keystrokes which can be referenced later. Referencing may be provided by using a set of keystrokes, known as 'shortcut keys'. Saves time and effort by automating repetitive processes.