THYAGARAJU GOWDA –DEPT OF CSE
CS303
Compiler Design
(4-0-0) 4
Course Objectives: i. Describe the steps and algorithms used by language translators. ii. Recognize the underlying formal models such as finite state automata, push-down automata and their connection to language definition through regular expressions and grammars. iii. Discuss the effectiveness of optimization. iv. Explain the impact of a separate compilation facility and the existence of program libraries on the compilation process. Course Outcomes: At the end of the course student should be able to: i. Understand how the design of a compiler requires most of the knowledge acquired during their study(PO→A ) ii. Develop a firm and enlightened grasp of concepts learned earlier in their study like higher level programming, assemblers, automata theory, and formal languages, languages, languages specifications, data structure and algorithms, operating systems(PO→ AD) iii. Apply the ideas, the techniques, and the knowledge acquired for the purpose of other software design(PO→BCG ) iv. Working skills in theory and application of finite state machines, recursive descent, production rules, parsing, and language semantics. (PO→ AD) v. Know about the powerful compiler generation tools, which are useful to the other noncompiler applications(PO→E) Prerequisites: Students must have the prerequisite knowledge on the following topics: i) Formal Languages ii) system programming Contents: 1) Introduction: Different Phases of Compilers, Comparison of Compilers and Interpreters. Top-down Parsing: RDP and Predictive parsing. 10 Hrs 2) Bottom-up Parsing: Simple LR, More powerful LR parsers ( LR(0), SLR, LALR), ambiguous grammars. 6 Hrs 3) Intermediate Code Generation and Optimizations: Syntax-directed translation; Syntaxdirected translation schemes, Variants of syntax trees; Three-address code; Types and declarations; Translation of expressions; Type checking; Control flow; Back patching; Switch statements; Intermediate code for procedures. Various techniques of machine independent optimization. 8 Hrs 4) Run-Time Environments: Storage Organization; Stack allocation of space; Access to nonlocal data on the stack; Heap management; Introduction to garbage collection. 6 Hrs III Year B.E. (CSE): 2012 - 13
1
THYAGARAJU GOWDA –DEPT OF CSE 5) Code Generation: Issues in the design of Code Generator; The Target language; Addresses in the target code; Basic blocks and Flow graphs; Optimization of basic blocks; A Simple Code Generator. 6 Hrs 6) Ancillary Code Processing Techniques: Generic description of Assembler, Loader, Linker and Macro’s. • Assemblers: Basic Assembler Features & Functions, Assembler Design Operations One-Pass Assembler, Multi-Pass Assembler. 6 Hrs • Loaders and Linkers: Basic Loader Functions - Design of Loaders and Linkers 4 Hrs • Macro Processor: Design of Macro Processors. 2 Hrs Books: 1) Alfred V Aho, Monica S. Lam, Ravi Sethi, Jeffrey D Ullman- Compilers- Principles, Techniques and Tools, 2nd edition, Addison-Wesley, 2007. 2) D.M.Dhamdhere- System Programming and Operating Systems, 2nd revised edition, Tata McGraw - Hill, 2009 reprint. 3) Charles N. Fischer, Richard J. leBlanc, Jr.- Crafting a Compiler with C, Pearson Education, 2008. 4) Andrew W Apple- Modern Compiler Implementation in C, Cambridge University Press, 2004.
III Year B.E. (CSE): 2012 - 13
2
THYAGARAJU GOWDA –DEPT OF CSE
CS304
System Software Laboratory
(0-0-3) 1.5
Course Objectives: i. To acquire the implementation knowledge of System Software concepts and FAFL grammar concepts through UNIX supported tools Lex and Yacc. ii. To acquire the knowledge of retrieval of the information in the static files and manipulate the contents of files using scripting languages iii. Implementation of file handling concepts and process concepts iv. Implement the Concept of Parsers v. Implement the concepts of System software Course Outcomes: At the end of the course student should be able to: i. To simulate the different modules of compiler (PO→B) ii. To demonstrate the system software module (PO→B) iii. Integration of different system or compiler tasks to produce workable system model. (PO→ C) iv. Verify and validate the simulated modules against the existing once. (PO→E) Prerequisites: Students must have the prerequisite knowledge on the following topics: i) Knowledge of Unix System & Shell Programming ii) C/C++ languages Contents: 1) At least three scripts in Lex and three scripts in Yacc 9 Hrs 2) At least two shell scripts covering the administrative files handling in UNIX like knowing number of users in the system and displaying the some user attributes 6 Hrs 3) At least 2 programs on files using C/C++ and 2 programs on process using C/C++. 9 Hrs 4) Any two parser implementation 6 Hrs 5) Any two concepts of System Software like assemblers, macros etc. 6 Hrs
III Year B.E. (CSE): 2012 - 13
3