Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Notes  >  Compiler Design  >  Overview of Language Processing System: Introduction to Compiler Design

Overview of Language Processing System: Introduction to Compiler Design | Compiler Design - Computer Science Engineering (CSE) PDF Download

Overview of Language Processing System

 

                         Overview of Language Processing System: Introduction to Compiler Design | Compiler Design - Computer Science Engineering (CSE)

Preprocessor

A preprocessor produces input to compilers. They may perform the following functions.
Macro processing:
A preprocessor may allow a user to define macros that are short hands for longer constructs.
 File inclusion: 
A preprocessor may include header files into the program text.
Rational preprocessor: 
These preprocessors augment older languages with more modern flow-of-control and data structuring facilities.
Language Extensions: 
These preprocessor attempts to add capabilities to the language by certain amounts to build-in macro
 

Compiler

The compiler is a translator program that translates a program written in (HLL) the source program and translates it into an equivalent program in (MLL) the target program. As an important part of a compiler is error showing to the programmer. 

                                  Overview of Language Processing System: Introduction to Compiler Design | Compiler Design - Computer Science Engineering (CSE)

Executing a program written n HLL programming language is basically of two parts. the source program must first be compiled translated into an object program. Then the results object program is loaded into a memory executed.

Question for Overview of Language Processing System: Introduction to Compiler Design
Try yourself:
What is the purpose of a preprocessor in a language processing system?
View Solution

 

Assembler

  • Programmers found it difficult to write or read programs in machine language. They begin to use a mnemonic (symbols) for each machine instruction, which they would subsequently translate into machine language. 
  • Such a mnemonic machine language is now called an assembly language. Programs known as assembler were written to automate the translation of assembly language into machine language.
  • The input to an assembler program is called the source program, the output is a machine language translation (object program).

Interpreter:

 An interpreter is a program that appears to execute a source program as if it were machine language.


                                                       
                                          Overview of Language Processing System: Introduction to Compiler Design | Compiler Design - Computer Science Engineering (CSE)

 

Languages such as BASIC, SNOBOL, LISP can be translated using interpreters. JAVA also uses interpreter. The process of interpretation can be carried out in following phases.
1. Lexical analysis
2. Syntax analysis
3. Semantic analysis
4. Direct Execution

Advantages: 

Modification of user program can be easily made and implemented as execution proceeds.

  •  Type of object that denotes various may change dynamically.
  • Debugging a program and finding errors is simplified task for a program used for interpretation.
  • The interpreter for the language makes it machine independent.

Disadvantages:

  •  The execution of the program is slower.
  •  Memory consumption is more. 
  •  Once the assembler procedures an object program, that program must be placed into memory and executed. 
  • The assembler could place the object program directly in memory and transfer control to it, thereby causing the machine language program to be executed. 
  • This would waste core by leaving the assembler in memory while the user’s program was being executed. Also, the program would have to retranslate his program with each execution, thus wasting translation time. 
  • To overcome this problem of wasted translation time and memory. System programmers developed another component called loader.
  • A loader is a program that places programs into memory and prepares them for execution.” It would be more efficient if subroutines could be translated into object form the loader could ”relocate” directly behind the user’s program. 
  • The task of adjusting programs o they may be placed in arbitrary core locations is called relocation. Relocation loaders perform four functions.

Question for Overview of Language Processing System: Introduction to Compiler Design
Try yourself:
What is the purpose of an assembler in programming?
View Solution


 

Translator

  •  A translator is a program that takes as input a program written in one language and produces as output a program in another language. Beside program translation, the translator performs another very important role, the error-detection. 
  • Any violation of d HLL specification would be detected and reported to the programmers. Important role of translator are:
    1 Translating the hll program input into an equivalent ml program.
    2 Providing diagnostic messages wherever the programmer violates specification of the hll.

Types of Translator

  •  Interpreter
  •  Compiler 
  •  preprocessor

List of Compiler

1. Ada compilers
2. ALGOL compilers
3. BASIC compilers
4. C# compilers
5. C compilers
6. C++ compilers
7. COBOL compilers
8. Java compilers

The document Overview of Language Processing System: Introduction to Compiler Design | Compiler Design - Computer Science Engineering (CSE) is a part of the Computer Science Engineering (CSE) Course Compiler Design.
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)
26 videos|66 docs|30 tests

Top Courses for Computer Science Engineering (CSE)

FAQs on Overview of Language Processing System: Introduction to Compiler Design - Compiler Design - Computer Science Engineering (CSE)

1. What is a language processing system?
Ans. A language processing system is a software tool or framework that is used to analyze and process human language. It involves various components such as lexical analysis, syntax analysis, semantic analysis, and code generation. The main purpose of a language processing system is to convert human-readable code or text into machine-readable instructions.
2. What is the role of a compiler in language processing?
Ans. A compiler is a key component of a language processing system. It is responsible for translating high-level programming languages into low-level machine code that can be directly executed by a computer. The compiler performs various tasks such as lexical analysis, syntax analysis, semantic analysis, optimization, and code generation. It helps in improving the efficiency and performance of the code.
3. What are the different phases involved in compiler design?
Ans. Compiler design involves several phases or stages, which are: 1. Lexical Analysis: This phase involves breaking the input code into tokens or lexemes. 2. Syntax Analysis: This phase checks the syntactical correctness of the code and builds a parse tree or an abstract syntax tree. 3. Semantic Analysis: This phase performs semantic checks and assigns meaning to the code. 4. Intermediate Code Generation: This phase generates an intermediate representation of the code. 5. Code Optimization: This phase optimizes the intermediate code to improve performance. 6. Code Generation: This final phase generates the target machine code.
4. What is the importance of compiler design in computer science engineering?
Ans. Compiler design is of great importance in computer science engineering for the following reasons: 1. Efficient Code Execution: Compilers help in translating high-level programming languages to machine code, optimizing it for efficient execution on a computer. 2. Language Development: Compiler design is crucial for developing new programming languages or extending existing ones. 3. Error Detection: Compilers perform various checks during the compilation process, helping in detecting and reporting errors in the code. 4. Performance Optimization: Compilers employ various optimization techniques to improve the performance of the code, resulting in faster execution and reduced resource utilization. 5. Portability: Compilers enable code to be written once and executed on different platforms, making software development more portable and flexible.
5. What is the difference between a compiler and an interpreter?
Ans. The main differences between a compiler and an interpreter are: 1. Execution: A compiler translates the entire source code into machine code before execution, whereas an interpreter translates and executes the code line by line. 2. Output: A compiler generates an executable file or binary code as output, which can be directly executed. An interpreter does not generate an executable file; it directly executes the code. 3. Performance: Compiled code tends to have better performance as it is optimized during the compilation process. Interpreted code may have slower execution due to the need for interpreting each line at runtime. 4. Portability: Compiled code is often platform-dependent, requiring specific versions for different operating systems. Interpreted code is generally more portable as the interpreter can run on different platforms. 5. Debugging: Debugging compiled code can be more challenging as it requires analyzing the machine code. Interpreted code is easier to debug as errors can be reported at the line of code being executed.
26 videos|66 docs|30 tests
Download as PDF
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

Overview of Language Processing System: Introduction to Compiler Design | Compiler Design - Computer Science Engineering (CSE)

,

Exam

,

video lectures

,

Important questions

,

MCQs

,

Overview of Language Processing System: Introduction to Compiler Design | Compiler Design - Computer Science Engineering (CSE)

,

Summary

,

Free

,

pdf

,

Overview of Language Processing System: Introduction to Compiler Design | Compiler Design - Computer Science Engineering (CSE)

,

Sample Paper

,

shortcuts and tricks

,

Objective type Questions

,

Semester Notes

,

Extra Questions

,

practice quizzes

,

ppt

,

mock tests for examination

,

Previous Year Questions with Solutions

,

past year papers

,

Viva Questions

,

study material

;