MCA 243 Compiler Design Notes from Unnati Educations run to 85 pages across 4 units, with 50 solved short-answer questions, 40 long-answer practice questions, 7 Lex, YACC, C and assembly programs and 12 diagrams. They follow the GGSIPU MCA scheme for affiliated institutes, for the batch admitted 2025-26 onwards.
Written by Prateek Talwar, Founder, Unnati Educations · Reviewed by Ritik Rawat, B.Tech, Senior Full Stack Developer · Checked against MCA Scheme of Examination and Detailed Syllabus, A.S. 2025-26 (ipu.ac.in) · Updated 14 October 2026 · Editorial policy
Scheme: MCA scheme 2025-26 (affiliated institutes) | Applies to: batch admitted 2025-26 onwards | Verified against: syllmcaaff050825900p.pdf (BoS 28 Jul 2025, AC Sub Committee 1 Aug 2025), checked 13 Oct 2026
MCA 243 Compiler Design at a glance: GGSIPU MCA Sem 3 credits, units and exam pattern
MCA 243 is one of eleven Core Elective III options in the third semester. It sits with the other GGSIPU MCA Semester 3 papers; its listed pre-requisites are a programming language and Theory of Computation.
| Code and title | MCA-243 Compiler Design |
|---|---|
| Course and semester | MCA, Semester 3, Core Elective III (choose any one) |
| Credits and weekly hours | 3 credits; L 3, T/P nil |
| Marks | 100: 40 internal + 60 end-term |
| Pass mark | 40 out of 100 (scheme note 9); see GGSIPU Ordinance 11 |
| End-term pattern | Q1 compulsory, short-answer, whole syllabus, 12 marks; then one of two questions per unit, 12 marks each (12 + 48 = 60 marks) |
| Units and teaching hours | 4 units: 13 + 10 + 10 + 10 = 43 hours |
| Paired lab | MCA-267 Lab based on Core Elective III (Compiler Design Lab), L 0, P 2, 1 credit |
Verify these values in the official MCA syllabus PDF (syllmcaaff050825900p.pdf): Semester 3 scheme on page 6, pass mark on page 8, MCA-243 on pages 154 to 156.
MCA 243 Compiler Design Notes unit-wise: 50 solved short-answer questions and 7 programs across 4 units
These MCA 243 Compiler Design IPU notes run from page 4 to 85; every unit closes with short-answer and long-answer questions and a quick revision table. The official PDF numbers units only, so titles are the notes' own. Notes for every other MCA paper sit on the GGSIPU MCA notes page. Pages 7, 37, 52 and 77, one per unit, are in the sample PDF above.
MCA 243 Unit 1: Introduction, Lexical Analysis and Top-Down Parsing
Unit 1 (pages 4 to 24) covers the six phases and symbol table, CFGs, ambiguity, left recursion and left factoring, registers of Mano's basic computer and the 8086, a two-pass assembler, input buffering with sentinels, Lex/Flex, recursive descent, FIRST and FOLLOW, LL(1) tables and operator precedence parsing. It has 11 topic sections, 12 solved short-answer and 9 long-answer questions, 4 programs and 2 diagrams.
| Function | id | + | * | $ |
|---|---|---|---|---|
| f (stack top) | 4 | 2 | 4 | 0 |
| g (input) | 5 | 1 | 3 | 0 |
Quick look: precedence functions f and g for id, +, * and $ that replace the relation table (from page 21)
- Function
- f (stack top)
- id
- 4
- +
- 2
- *
- 4
- $
- 0
- Function
- g (input)
- id
- 5
- +
- 1
- *
- 3
- $
- 0
Check: f(+) = 2 < g(*) = 3, so + yields to *; f(*) = 4 > g(+) = 1, so * reduces first.
MCA 243 Unit 2: Bottom-Up Parsing and Syntax Directed Definitions
Unit 2 (pages 25 to 44) covers handles, shift-reduce conflicts, the LR parser model, LR(0) items, CLOSURE and GOTO, and full SLR, CLR and LALR tables. YACC/Bison builds a desk calculator from calc.y and calc.l; then come SDDs, dependency graphs, S- and L-attributed definitions and both evaluation styles. It has 14 topic sections, 12 short-answer and 9 long-answer questions, 3 programs and 4 diagrams.
| Basis | SLR(1) | CLR(1) | LALR(1) |
|---|---|---|---|
| Reduce placed on | FOLLOW(A) | Exact lookahead | Union of merged lookaheads |
| Power | Least | Most | Between the two |
| Used in | Teaching tools | Rarely (size) | YACC, Bison |
Quick look: SLR vs CLR vs LALR (from page 33)
- Basis
- Reduce placed on
- SLR(1)
- FOLLOW(A)
- CLR(1)
- Exact lookahead
- LALR(1)
- Union of merged lookaheads
- Basis
- Power
- SLR(1)
- Least
- CLR(1)
- Most
- LALR(1)
- Between the two
- Basis
- Used in
- SLR(1)
- Teaching tools
- CLR(1)
- Rarely (size)
- LALR(1)
- YACC, Bison
MCA 243 Unit 3: Type Checking, Intermediate Code and Code Optimization
Unit 3 (pages 45 to 66) is the longest unit. It covers type expressions, structural and name equivalence, coercion, overloading and polymorphism; translation of declarations, array assignments, if and while, boolean expressions with backpatching and procedure calls; then basic blocks, DAGs, loops, reaching definitions, live variables, available expressions and aliases. It has 22 topic sections, 13 short-answer and 11 long-answer questions and 3 diagrams.
| Overloading | Polymorphism (parametric) |
|---|---|
| Different code for each type | Same code works for all types |
| Resolved at compile time by argument types | Uses type variables and unification |
| Finite set of types | Potentially infinite set of types |
Example: + for int and float | Example: length : ∀α. list(α) → integer |
Quick look: overloading compared with parametric polymorphism (from page 50)
- Overloading
- Different code for each type
- Polymorphism (parametric)
- Same code works for all types
- Overloading
- Resolved at compile time by argument types
- Polymorphism (parametric)
- Uses type variables and unification
- Overloading
- Finite set of types
- Polymorphism (parametric)
- Potentially infinite set of types
- Overloading
- Example:
+for int and float - Polymorphism (parametric)
- Example:
length : ∀α. list(α) → integer
MCA 243 Unit 4: Code Generation, Run Time System and Error Recovery
Unit 4 (pages 67 to 85) covers code generator design issues, instruction costs, next-use, descriptors with getReg, graph colouring, code from DAGs, Sethi-Ullman labeling, peephole optimisation, code-generator generators; then activation trees and records, parameter passing, symbol tables, heap allocation, garbage collection and panic-mode recovery. It has 21 topic sections, 13 short-answer and 11 long-answer questions and 3 diagrams.
| Method | Value of a printed |
|---|---|
| Call by value (copies; a untouched) | 2 |
| Call by reference (x and y alias a) | 6 |
| Copy-restore (y = 5 copied back last) | 5 |
| Call by name (a = 3, then a + a) | 6 |
Quick look: one call, four answers; f(a, a) with a = 2, where f does x = x + 1; y = y + x (from page 79)
- Method
- Call by value (copies; a untouched)
- Value of a printed
- 2
- Method
- Call by reference (x and y alias a)
- Value of a printed
- 6
- Method
- Copy-restore (y = 5 copied back last)
- Value of a printed
- 5
- Method
- Call by name (a = 3, then a + a)
- Value of a printed
- 6
Quadruples, triples and indirect triples in intermediate code: excerpt from page 52 of the MCA 243 notes
Excerpt from page 52
Page 52 takes one expression, a = b * -c + b * -c, and stores its three-address code in three different ways. The code itself is six instructions: t1 = minus c, t2 = b * t1, t3 = minus c, t4 = b * t3, t5 = t2 + t4, a = t5.
(a) Quadruples
A quadruple has four fields: op, arg1, arg2 and result. Because every temporary has an explicit name, an optimiser can move instructions around freely without breaking anything.
| # | op | arg1 | arg2 | result |
|---|---|---|---|---|
| 0 | minus | c | t1 | |
| 1 | × | b | t1 | t2 |
| 2 | minus | c | t3 | |
| 3 | × | b | t3 | t4 |
| 4 | + | t2 | t4 | t5 |
| 5 | = | t5 | a |
Quadruples for a = b * -c + b * -c
- #
- 0
- op
- minus
- arg1
- c
- arg2
- result
- t1
- #
- 1
- op
- ×
- arg1
- b
- arg2
- t1
- result
- t2
- #
- 2
- op
- minus
- arg1
- c
- arg2
- result
- t3
- #
- 3
- op
- ×
- arg1
- b
- arg2
- t3
- result
- t4
- #
- 4
- op
- +
- arg1
- t2
- arg2
- t4
- result
- t5
- #
- 5
- op
- =
- arg1
- t5
- arg2
- result
- a
(b) Triples
A triple keeps only op, arg1 and arg2. There is no result field: a later instruction refers to an earlier result by its position, written in brackets such as (0). This saves space, but if you move one instruction, every reference to it has to change.
| # | op | arg1 | arg2 |
|---|---|---|---|
| (0) | minus | c | |
| (1) | × | b | (0) |
| (2) | minus | c | |
| (3) | × | b | (2) |
| (4) | + | (1) | (3) |
| (5) | = | a | (4) |
Triples for the same expression
- #
- (0)
- op
- minus
- arg1
- c
- arg2
- #
- (1)
- op
- ×
- arg1
- b
- arg2
- (0)
- #
- (2)
- op
- minus
- arg1
- c
- arg2
- #
- (3)
- op
- ×
- arg1
- b
- arg2
- (2)
- #
- (4)
- op
- +
- arg1
- (1)
- arg2
- (3)
- #
- (5)
- op
- =
- arg1
- a
- arg2
- (4)
(c) Indirect triples
Indirect triples add a separate list of pointers that gives the execution order. On page 52 the instruction list runs from 35 to 40, and each entry points to one triple, (0) to (5). To reorder the code, the optimiser shuffles only this pointer list; the triples themselves never change.
Which one to remember
Quadruples use four fields and are the easiest to move. Triples use three fields and are the most compact. Indirect triples are triples plus a pointer list, so they keep the space saving and still allow reordering.
MCA 243 exam corner: 50 short-answer and 40 long-answer questions by unit
Short-answer questions are answered in 2 to 4 lines; long-answer questions are practice prompts that point back to the unit's worked sections.
| Unit | Short-answer (solved) | Long-answer (practice) | Programs |
|---|---|---|---|
| Unit 1 | 12 | 9 | 4 |
| Unit 2 | 12 | 9 | 3 |
| Unit 3 | 13 | 11 | 0 |
| Unit 4 | 13 | 11 | 0 |
| Total | 50 | 40 | 7 |
MCA 243 notes: question and program count per unit
- Unit
- Unit 1
- Short-answer (solved)
- 12
- Long-answer (practice)
- 9
- Programs
- 4
- Unit
- Unit 2
- Short-answer (solved)
- 12
- Long-answer (practice)
- 9
- Programs
- 3
- Unit
- Unit 3
- Short-answer (solved)
- 13
- Long-answer (practice)
- 11
- Programs
- 0
- Unit
- Unit 4
- Short-answer (solved)
- 13
- Long-answer (practice)
- 11
- Programs
- 0
- Unit
- Total
- Short-answer (solved)
- 50
- Long-answer (practice)
- 40
- Programs
- 7
The MCA 243 notes solve 50 short-answer questions and set 40 long-answer practice questions across 4 units, plus 7 programs with their code.
One question per unit, with answer pointers:
- Unit 1: Differentiate token, lexeme and pattern. Pointer: pattern is the rule (
letter(letter|digit)*), lexeme the matched text (count), token the pair<id, 4>. - Unit 2: How is an LALR parser obtained from CLR? Pointer: merge LR(1) item sets with identical cores and union their lookaheads; merging can add reduce/reduce conflicts, never shift/reduce.
- Unit 3: What is backpatching? Pointer: jumps go out with empty targets in truelist and falselist, filled later by
backpatch(list, label). - Unit 4: What is the labeling algorithm? Pointer: leftmost leaf 1, other leaf 0; an interior node takes max(l1, l2) if they differ, l1 + 1 if equal; the root gives the minimum registers.
More practice sits in the MCA 243 important questions.
Who writes and checks the MCA 243 Compiler Design notes?
- Prateek Talwar, author of these notes: Founder, Unnati Educations; Associate Company Secretary (ACS), ICSI, membership no. 58704, since 15 May 2019; B.Com, University of Delhi (School of Open Learning), 2012. Author profile
- Ritik Rawat, subject reviewer for the parsing tables, Lex and YACC programs and code-generation examples: Senior Full Stack Developer, Unnati Educations; B.Tech.
Mapped to the MCA scheme for affiliated institutes in force from 2025-26. The 2026-27 edition has 85 pages: 68 topic sections, 7 programs, 12 diagrams and four quick revision tables. Last updated 14 October 2026, under our editorial policy.
The same team prepares GGSIPU important questions for every course.
Do the MCA 243 notes cover the full GGSIPU syllabus?
Yes. Every topic in the four official units of MCA-243 has its own section in the notes; LR(k) is taught through LR(1), the CLR parser.
| Official unit | Official topics | Where in the notes | Status |
|---|---|---|---|
| Unit I | Concept of Compilers, Phases, Grammar (CFG), Registers of Microprocessor, Assembly Language | Unit 1, s. 1-5, p. 5-12 | Covered |
| Unit I | Lexical Analysis with Lex/Flex; Recursive Decent, Operator Precedence and LL(1) Parsers | Unit 1, s. 6-11, p. 12-21 | Covered |
| Unit II | SLR, LR(k), LALR Parsers; YACC or Bison | Unit 2, s. 1-7, p. 26-36 | Covered (LR(k) as LR(1) / CLR) |
| Unit II | SDD attributes, Dependency Graph, Evaluation Order, L- and S-Attributed | Unit 2, s. 8-14, p. 36-42 | Covered |
| Unit III | Type System and Expressions, Equivalence, Conversion, Overloading, Polymorphism | Unit 3, s. 1-5, p. 46-50 | Covered |
| Unit III | Intermediate Code: Declarations, Assignments, Control Flow, Boolean, Procedure Calls | Unit 3, s. 6-12, p. 50-57 | Covered |
| Unit III | Code Optimization: Basic Blocks, Loops, Data Flow Analysis, Aliases | Unit 3, s. 13-22, p. 57-63 | Covered |
| Unit IV | Code Generation: Register Allocation, DAGs, Peephole, Code Generator Generators | Unit 4, s. 1-12, p. 68-76 | Covered |
| Unit IV | Run Time System (Activation Records, Parameters, Symbol Table, Allocation); Error Recovery | Unit 4, s. 13-21, p. 76-82 | Covered |
MCA 243 official syllabus mapped to the notes (section and page)
- Official unit
- Unit I
- Official topics
- Concept of Compilers, Phases, Grammar (CFG), Registers of Microprocessor, Assembly Language
- Where in the notes
- Unit 1, s. 1-5, p. 5-12
- Status
- Covered
- Official unit
- Unit I
- Official topics
- Lexical Analysis with Lex/Flex; Recursive Decent, Operator Precedence and LL(1) Parsers
- Where in the notes
- Unit 1, s. 6-11, p. 12-21
- Status
- Covered
- Official unit
- Unit II
- Official topics
- SLR, LR(k), LALR Parsers; YACC or Bison
- Where in the notes
- Unit 2, s. 1-7, p. 26-36
- Status
- Covered (LR(k) as LR(1) / CLR)
- Official unit
- Unit II
- Official topics
- SDD attributes, Dependency Graph, Evaluation Order, L- and S-Attributed
- Where in the notes
- Unit 2, s. 8-14, p. 36-42
- Status
- Covered
- Official unit
- Unit III
- Official topics
- Type System and Expressions, Equivalence, Conversion, Overloading, Polymorphism
- Where in the notes
- Unit 3, s. 1-5, p. 46-50
- Status
- Covered
- Official unit
- Unit III
- Official topics
- Intermediate Code: Declarations, Assignments, Control Flow, Boolean, Procedure Calls
- Where in the notes
- Unit 3, s. 6-12, p. 50-57
- Status
- Covered
- Official unit
- Unit III
- Official topics
- Code Optimization: Basic Blocks, Loops, Data Flow Analysis, Aliases
- Where in the notes
- Unit 3, s. 13-22, p. 57-63
- Status
- Covered
- Official unit
- Unit IV
- Official topics
- Code Generation: Register Allocation, DAGs, Peephole, Code Generator Generators
- Where in the notes
- Unit 4, s. 1-12, p. 68-76
- Status
- Covered
- Official unit
- Unit IV
- Official topics
- Run Time System (Activation Records, Parameters, Symbol Table, Allocation); Error Recovery
- Where in the notes
- Unit 4, s. 13-21, p. 76-82
- Status
- Covered
Official source: MCA Scheme of Examination and Detailed Syllabus, A.S. 2025-26 onwards. The syllabus lists the operator precedence parser under top-down parsing; page 20 of the notes teaches it there and explains it works as a shift-reduce parser.
Every course in GGSIPU notes is mapped to its official PDF in the same way.
How to write MCA 243 answers: parsing tables, three-address code and register descriptors
Most MCA 243 answers are built, not described. The notes' exam tips say what each answer needs on paper.
- SLR table questions (Unit 2): show the augmented grammar, the canonical collection of LR(0) items with the GOTO diagram, the FOLLOW sets and the final table. Add parsing moves only if asked.
- YACC questions (Unit 2): write both
calc.yandcalc.l, list the compile commands, and explain$$,$1,%leftandyyerror. - Intermediate code (Unit 3): write the three-address code first, then the quadruple, triple and indirect triple tables.
- Simple code generator (Unit 4): show the register and address descriptors after every step for
t = a − b, u = a − c, v = t + u, a = d, d = v + u. - Parameter passing (Unit 4): show the working for each method; the different answers prove you understand aliasing.
Worked example: count the tokens in printf("Total = %d", score); (page 13)
- List them one by one:
printf(id),(, the string literal"Total = %d",,,score(id),)and;. - That is 7 tokens.
- Keywords, identifiers, constants, literals, operators and each punctuation symbol count separately; white space and comments do not.
For the 12-mark Q1, keep each part to a definition plus one example, as the solved short answers do. Practise this format on GGSIPU MCA important questions.
MCA 243 and the GGSIPU MCA Sem 3 papers it connects to
Paired lab: MCA-267, Lab based on Core Elective III, runs as Compiler Design Lab (0-2-1) for students who pick MCA 243; its outcomes are on our GGSIPU MCA syllabus page. Lab notes for it are not out yet.
The lab outcomes build on the theory here:
- Assembly programs: Unit 1 section 5.
- Lex scanners: Unit 1 sections 6 and 7.
- YACC parsers: Unit 2 section 7.
- Other parsers: Unit 1 sections 8 to 11.
- Intermediate code generation: Unit 3 sections 6 to 12.
In the GGSIPU MCA Sem 3 Compiler Design notes, Unit 4's flow graphs, DAGs and graph colouring lean on MCA-201 Design and Analysis of Algorithms, and Unit 1 recalls automata from MCA-118 Theory of Computations (Semester 2).
Other Semester 3 papers:
- Core: MCA-201 Design and Analysis of Algorithms; MCA-203 Artificial Intelligence and Machine Learning.
- Core Elective II: one of MCA-205 to MCA-225 (eleven papers, e.g. MCA-219 Distributed Systems).
- Core Elective III alternatives: MCA-227 Web Intelligence and Big Data, 229 Flutter and Dart, 231 Service Oriented Architecture, 233 Multimedia Technologies, 235 Internet of Things, 237 Soft Computing, 239 Software Quality Management, 241 Digital Image Processing, 245 Parallel Computing, 247 Numerical and Scientific Computing.
- Open Elective II: one of MCA-249 Research Methodology, MCA-251 Operational Research, MCA-253 Cyber Security and Cyber Laws, MCA-255 e-Content Development.
- Labs MCA-261, 263, 265, 267; MCA-269 Minor Project III; NUES MCA-271 Entrepreneurship Mindset, MCA-273 Professional Proficiency III.
MCA 243 Compiler Design notes FAQs
How do I get the full MCA 243 notes?
Message us on WhatsApp at 9899436384 using the Get Full Notes button. The full MCA 243 notes come only as a printed book with all 85 pages and 4 units; they are not available as a PDF. Delivery takes 5 to 7 days at most, depending on your location. Price and payment details are shared on WhatsApp, and you can check the sample PDF first.
What is the passing mark for MCA 243 Compiler Design?
MCA 243 is marked out of 100: 40 internal and 60 end-term. The MCA scheme of examination states pass marks as 40%, which is 40 out of 100, for every paper. End-term minimums, re-appear and results follow GGSIPU Ordinance 11, which governs the programme; check its latest version on ipu.ac.in before your exam, as we do not state grace rules.
Is MCA 243 compulsory in MCA Semester 3?
No. MCA 243 is one of eleven Core Elective III papers, and you choose one. Scheme note 3 says an elective needs at least 20 students for classes; with fewer, it can still be offered, but you complete it through a MOOC on SWAYAM or a similar platform and sit the institute's evaluation to earn the 3 credits.
Which MCA 243 unit is the longest in the notes?
Unit 3, Type Checking, Intermediate Code and Code Optimization: pages 45 to 66, 22 topic sections, 13 solved short-answer and 11 long-answer questions. It also has the most numerical-style work, from three-address code tables and DAGs for basic blocks to data-flow equations solved in bit-vector form, so give it the most revision time before the end-term exam.
Do the MCA 243 notes include Lex and YACC programs?
Yes, 7 programs. Unit 1 has a Lex line, word and character counter, a Lex token recogniser for a C subset, a recursive descent parser in C and an assembly program adding two numbers. Unit 2 has the YACC desk calculator (calc.y, calc.l) and an L-attributed SDD in a recursive descent parser, each with its code written out.
Which scheme and batch do the MCA 243 notes follow?
They follow the MCA Scheme of Examination and Detailed Syllabus for affiliated institutes, approved by the BoS of USIC&T on 28 July 2025 and effective from 2025-26. That covers students admitted in 2025-26 onwards, who meet MCA-243 as a Semester 3 Core Elective III paper; older schemes may differ in units, marks and paper codes.
Get the full MCA 243 Compiler Design Notes on WhatsApp
The full notes are a printed book, not a PDF. The Compiler Design notes in English cover all 4 units in 85 pages.
| Part | Pages |
|---|---|
| Cover and index | 1 to 3 (3) |
| Unit 1: Introduction, Lexical Analysis and Top-Down Parsing | 4 to 24 (21) |
| Unit 2: Bottom-Up Parsing and SDDs | 25 to 44 (20) |
| Unit 3: Type Checking, Intermediate Code and Optimization | 45 to 66 (22) |
| Unit 4: Code Generation, Run Time System and Error Recovery | 67 to 85 (19) |
Pages per unit in the printed MCA 243 notes book
- Part
- Cover and index
- Pages
- 1 to 3 (3)
- Pages
- 4 to 24 (21)
- Pages
- 25 to 44 (20)
- Pages
- 45 to 66 (22)
- Pages
- 67 to 85 (19)
Inside: 50 solved short-answer questions, 40 long-answer questions, 7 programs and 12 diagrams. Order on WhatsApp, where price and payment details are shared. Delivery: within 5 to 7 days at most; the exact time may vary with your location.
Order the printed MCA 243 Compiler Design Notes book on WhatsApp (4 units, 85 pages)
Unnati Educations is an independent education provider based in Vikaspuri, Delhi. We are not affiliated with, authorised by, or endorsed by Guru Gobind Singh Indraprastha University (GGSIPU). 'GGSIPU' and 'IPU' are used only to describe the syllabus our notes follow. For official information, visit ipu.ac.in.
Ready for the full notes?
Discuss coverage and delivery with our team.