3.1 Language Translators

Get Started. It's Free
or sign up with your email address
3.1 Language Translators by Mind Map: 3.1 Language Translators

1. 3.1.2 High-level language translators

1.1. 2 types of computer languages

1.1.1. Low-level language

1.1.2. High-level language

1.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.

1.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.

1.4. Advantages:

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

1.4.2. English-like/Easier to understand

1.4.3. Different languages are developed for different tasks

1.5. Examples:

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

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

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

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

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

2. High-level vs Low-level

2.1. High level

2.1.1. One instruction = many machine code instructions

2.1.2. Portable, task-oriented

2.1.3. More english-like

2.2. Low level

2.2.1. One instruction = one machine code instruction

2.2.2. Machine specific, machine-oriented

2.2.3. Less easy to write and debug

3. Interpreters

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

3.2. Compiled programs run faster than interpreted ones

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

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

3.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.

4. 3.1.1 Define Syntax and Semantics

4.1. Syntax

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

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

4.2. Semantics

4.2.1. The meaning conveyed by a collection of staments.

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

4.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.

5. Compilers

5.1. What are they?

5.1.1. Translational program that converts source code into object code

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

5.1.3. Compiled object code can be executed by the computer

5.2. Process of compiling

5.2.1. Lexical analysis

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

5.2.2. Syntax analysis

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

5.2.3. Code generation

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

5.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.

5.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.

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.

7.4.1.1. 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.