KTU 2024 Scheme · Semester 6 · Program Core — Artificial Intelligence and Data Science
Compiler Construction (PBCRT604) Syllabus
Official KTU 2024 Scheme syllabus for Compiler Construction, Semester 6, Program Core — Artificial Intelligence and Data Science (Artificial Intelligence and Data Science).
Course Code
PBCRT604
Credits
4
Teaching Hours
3:0:0:1 (L:T:P:R)
CIE Marks
60
ESE Marks
40
Exam Duration
2 Hrs 30 Min
Prerequisites
None
Semester
Semester 6
Course Objective
To provide a comprehensive understanding of the compiler construction process through its phases — lexical analysis, parsing, semantic analysis, code generation and optimization — and to give project-based experience in using compiler construction tools for lexical analysis and parsing.
Module-wise Syllabus
Module 1
8 contact hoursIntroduction — compiler structure, overview of translation: the front end, the optimizer, the back end. Scanners — recognizing words, regular expressions, from regular expression to scanner: FSA (brush-up only), implementing scanners.
Module 2
10 contact hoursParsing — introduction, expressing syntax. Top-down parsing — transforming a grammar: eliminating left recursion, backtrack-free parsing, left-factoring to eliminate backtracking; recursive descent parsers; table-driven LL(1) parsers.
Module 3
13 contact hoursBottom-up parsing — shift-reduce parser, the LR(1) parsing algorithm, building LR(1) tables, errors in table construction, reducing the size of LR(1) tables. Intermediate representations — an IR taxonomy; graphical IRs — syntax-related trees, graphs; linear IRs — stack-machine code, three-address code, representing linear codes. Syntax-driven translation — translating expressions, translating control-flow statements.
Module 4
13 contact hoursCode generation — code shape: arithmetic operators, Boolean and relational operators, control-flow constructs (conditional execution, loops and iteration, case statements only), procedure calls. Code optimization — opportunities and scope of optimization; local optimization — local value numbering, tree-height balancing; regional optimization — superlocal value numbering, loop unrolling; global optimization — finding uninitialized variables with live sets, global code placement. Suggested projects: a recursive-descent mini-compiler for arithmetic expressions; a YACC-based calculator that generates and optimizes intermediate code.
Course Outcomes
- CO1Use lexical analysis techniques to build a scanner for a given language specification.
- CO2Construct parse trees for input programs using parsing algorithms and detect syntactic errors.
- CO3Develop semantic analysis techniques to check program correctness.
- CO4Build intermediate code representations by applying intermediate code generation techniques.
- CO5Optimize generated code using code optimization strategies to improve performance.
Assessment Pattern (CIE: 60 marks, ESE: 40 marks)
Continuous Internal Evaluation (CIE)
| Attendance | 5 |
| Project | 30 |
| Internal Examination 1 (Written) | 12.5 |
| Internal Examination 2 (Written) | 12.5 |
End Semester Examination (ESE)
Total 40 marks, 2 Hrs 30 Min. See the official KTU syllabus document for the exact Part A / Part B question pattern for this course.
Textbooks & Reference Books
Textbooks
- Engineering a Compiler — Keith D. Cooper, Linda Torczon (Elsevier Science, 3rd edition, 2023)
Reference Books
- Lex and YACC — John R. Levine, Tony Mason, Doug Brown (O'Reilly, 2nd edition, 1992)
- Compilers: Principles, Techniques and Tools — A. V. Aho, Ravi Sethi, J. D. Ullman (Addison Wesley, 2nd edition, 2010)
- Compiler Construction: Principles and Practice — Kenneth C. Louden (Thomson Learning, 1st edition, 2007)
- Compiler Design in C — Allen Holub (Prentice-Hall Software Series, 1st edition, 1990)
- Modern Compiler Implementation in C — Andrew W. Appel (Cambridge University Press, 2nd edition, 2004)
Frequently Asked Questions
How many credits is KTU Compiler Construction (PBCRT604)?
4 credits, with 3:0:0:1 (L:T:P:R) teaching hours per week, under the KTU 2024 Scheme.
How many modules are in the PBCRT604 syllabus?
4 modules, 44 total contact hours.
What is the CIE and ESE mark split for this course?
CIE (Continuous Internal Evaluation): 60 marks. ESE (End Semester Examination): 40 marks, 2 Hrs 30 Min. Total: 100 marks.
What are the recommended textbooks for PBCRT604?
Engineering a Compiler (Keith D. Cooper, Linda Torczon).
Is this syllabus specific to one branch, or common to others too?
This Semester 6 course is listed under Program Core — Artificial Intelligence and Data Science at KTU under the 2024 Scheme — check the course header above for which branches it's common to.
Need help with KTU Compiler Construction?
Learnizo offers live, 1-on-1 online tuition for KTU AI&DS subjects — matched to your exact module and semester.