Beruflich Dokumente
Kultur Dokumente
Unit 1 :- Introduction Unit 2 :- Assembler Unit 3 :- Loader And Linker Unit 4 :- Macros And Macro Processors Unit 5 :- Scanning And Parsing Unit 6 :- Compiler And Interpreter
About books
Textbook: Dhamdhere System Programming & Operrating System Aho,Ulman,Sethi, Compiler Construction
This course introduce the basic working principles of software and system administration.
Software
Application programs Word Processors, Email, Internet Browsers, Games Systems Software Compilers, Operating System
Hardware
CPU Memory I/O devices (mouse, keyboard, display, disks, networks, ..)
Application programming is the design, coding, and testing of processes it provide useful function to individuals and/or business and the processes are not related to the hardware they run on. Examples: Calendar program, spreadsheet program, game, checkbook program.
System Programming is the design, coding, and testing of processes that provide direct or indirect (through the operating system) control over the hardware utilized. Examples: device drivers, operating system interfaces (GUI), logon profiles, utility programs.
System Programming:-
Software
Application Software
System Software
Note :- The major goal of any system software is to provide the environment to write application software without which art application software cannot be executed.
Software Classification
Application Software
Application software is defined as a set of programs written in a specific any programming language to solve a particular problem. It is intended to support the operation and it is independent of the machine on which it is Operated. Eg. Accounting Software, Payroll System etc.
System Software
System software is defined as a set of Programs that creates the environment to facilitate working of an application software. Unlike application software, a system software purely depends on the machine on which it is operated.
E.g. Compilers, Assemblers, Operating System.
Need for system software System software controls some of the aspects of operation of a computer. The operation may be a File operation, I/O operation or Memory management and so on.
Translator :- Translator is the program that takes input program written in one language (source program) and output an program in another language (called as object or target program)
Source Program
Translator
Target Program
Loading is the process of bringing an executable file produced by the linker from the secondary storage to the primary storage in such a way that it can be executed by the operating system.
A macro processor is a program that copies a stream of text from one place to another Making a systematic set of replacements as it does so. Macro processors are often embedded in other programs, such as assemblers and compilers.
A compiler is a system software that converts a source language program into an equivalent target language program. It also validates the input program to be conforming to the source language specification. A compiler can be conceptually divided into a number of phases.
Lexical analysis. Syntax analysis. Intermediate code generation Target code generation Code optimization. Symbol table management. Error handling and recovery.
Editor is the utility used most by the program developers. The user creates the program using editor.
The tools that we have described so far help in writing grammatically correct programs. satisfying syntactic and semantic requirements of a language. However, these tools cannot catch any logical mistakes in the program.
Data
Source Program
Interpreter
Target Program
Machine
Application Software
It is concerned mainly with the solution of the problem and makes use of the computer as a software tool. The focus is on the application and not on the computer system. It does not depend on the structure of the machine on which it works. E.g. Banking System, Inventory System
System Software
It is intended to support the operation and makes use of the computer system. The focus is on the computer system and not on the application. It depends on the structure of the machine on which it is executed. E.g. Operating System. Compilers
The designer expresses the ideas in terms related to the application domain of the software. To implement these ideas, their description has to be interpreted in terms related to the execution domain of the computer system.
We use the term semantics to represent the rules of meaning of a domain, and the term semantic gap to represent the difference between the semantics of two domains. Semantic Gap
Application Domain
Execution Domain
A language processor is a software which bridges a specification or execution gap. Semantic gap :-The semantic gap has many consequences
Large development times Large development efforts Poor quality of software.
These issues are tackled by Software engineering through the use of methodologies and programming languages (PL) . Semantic Gap Execution Gap
Application Domain
PL Domain
Execution Domain
The languages in which these programs are written are called source language and target language, respectively.
Analysis of source statement consists of lexical, syntax and semantic analysis. Synthesis phase consists of two main activities.
Creation of data structures in the target program. Generation of target code.
SP
Analysis Phase Synthesis Phase
TP
Errors
Errors
It is the processing of every statement in a source program or its equivalent representation to perform a language processing function.
Intermediate representation :- It is a data structure that is
constructed from input data to a program and from which part or all of the output data of the program is constructed in turn. Block Diagram of IR
The compiler takes a source program written in high level language as an input Then converts it into a target assembly language. The assembler then takes this assembly code as input and produces a reloadable machine code as output. Then a program called loader is called for performing the task of loading and link editing. The task of loader is to perform the relocation of an object code.
Relocation of an object code means allocation of load time addresses which exist in the memory and placement of load time addresses and data in memory at proper locations. The link editor links the object modules and prepares a single module from several files of reloadable object modules to resolve the mutual references. These files may be library files and these library files may be referred by any program.
Creating a compiler is a critical task. Hence we can automate the process of building compiler by using automated tools for generating various phases of compiler. LEX and YACC are such tools.
The LEX is used for generating the lexical analyzer program for the compiler. YACC is used to generate the syntax analyzer program automatically. LEX or YACC generates a lexical analyzer or syntax analyzer respectively
Thus the use of LEX and YACC tools help in generating the lexical and syntax analyzers which ultimately enhances efficiency of compiler building.
Example 1.1: Figure 1.2 shows two language processors. The language processor of part (a) converts a C++ program into a C program, hence it is a preprocessor. The language processor of part (b) is a language translator for C++ since it produces a machine language program. In both cases the source program is in C++. The target programs are the C program and the machine language program, respectively.
The fundamental language processing activities can be divided into those that bridge the specification gap and those that bridge the execution gap. We name these activities as 1. Program generation activities 2. Program execution activities. A program generation activity aims at automatic generation of a program. The source language is a specification language of an application domain and the target language is typically a procedure oriented PL. A program execution activity organizes this execution of a program written in a PL on a computer system. Its source language could be a procedure oriented language or a problem oriented language.