Key takeaways
- FIRST and FOLLOW, LL(1) tables and LR item sets are the core numericals of every paper.
- Practise three-address code, quadruples and triples on the same expression.
- Each section has exam tips and formula boxes, and the last page lists the most asked practice questions.
- These are original Uncodemy revision notes, not official university notes; check your own syllabus.
About these Compiler Design handwritten notes
This page offers Uncodemy's Compiler Design notes as a free handwritten-style PDF. Compiler Design explains how source code is translated into machine code, phase by phase, from scanning characters to generating optimised instructions. The notes are written in short points with neat tables, labelled diagrams, boxed formulas and exam tips, so you can revise a full unit in one sitting instead of reading a long textbook chapter.
Please note: these are original Uncodemy revision notes. They follow the common syllabus that most Indian universities share for this subject, but they are not official university notes. Check your own university syllabus and add anything it lists that is missing here.
What's inside the Compiler Design notes
The PDF is arranged in 8 sections plus a final page of most asked practice questions. The sections follow the usual unit order of a Compiler Design syllabus, so you can map them to your own units quickly. Here is what each section covers.
Introduction and phases of a compiler
Compiler vs interpreter, the analysis and synthesis phases, and one statement traced through every phase with the symbol table alongside.
Lexical analysis
Tokens, lexemes and patterns, regular expressions for tokens, input buffering and how to count tokens in a C fragment.
Syntax analysis (top-down parsing)
Parser types, removing left recursion and left factoring, FIRST and FOLLOW with a solved example, and building and checking an LL(1) table.
Bottom-up parsing
Shift-reduce parsing, LR(0) items with an example, and SLR, LALR and CLR parsers compared, including shift-reduce and reduce-reduce conflicts.
Syntax-directed translation
Synthesised and inherited attributes, S-attributed and L-attributed definitions, and annotated parse trees.
Intermediate code generation
Three-address code for a = b * -c + b * -c, and its representation as quadruples, triples and indirect triples.
Runtime environment and symbol table
Activation records, storage allocation strategies, parameter passing and symbol table organisation.
Code optimisation and code generation
Basic blocks and flow graphs, constant folding, common subexpression elimination, dead code and loop optimisation, and issues in code generation.
Most asked questions (practice)
Ten exam-style questions, from token counting to identifying basic blocks and optimisation.
How to use handwritten notes to revise Compiler Design
Compiler Design is numerical-heavy. Read the rules in the notes once, then spend most of your time solving grammars by hand.
- Copy the FIRST and FOLLOW rules onto one card and apply them to three new grammars.
- Build one LL(1) table and one SLR table completely, and mark any conflict you find.
- Write three-address code, quadruples and triples for two expressions of your own.
- Split a short program into basic blocks and draw the flow graph.
A simple three-pass method works well with handwritten notes. In the first pass, read one section and underline only what you do not already know. In the second pass, close the notes and write the definitions, diagrams and steps for that section on a blank sheet, then compare and correct in a different colour. In the third pass, a day or two later, answer two or three exam-style Compiler Design questions in timed conditions using only memory. Add your own examples and doubts in the margins so the PDF becomes your personal revision copy.
Formulas, diagrams and definitions to memorise
- The phases of a compiler in order, with the symbol table and error handler connected to every phase.
- Rules for computing FIRST and FOLLOW, including the epsilon cases.
- The LL(1) condition: no cell of the parsing table has more than one entry.
- The rule for removing immediate left recursion: A -> A alpha | beta becomes A -> beta A' and A' -> alpha A' | epsilon.
- The difference between quadruples, triples and indirect triples, shown on one expression.
Common mistakes that cost marks
- Forgetting to put the end marker $ in FOLLOW of the start symbol.
- Adding epsilon to FOLLOW sets; FOLLOW never contains epsilon.
- Counting comments or whitespace as tokens in token counting questions.
- Not stating which conflict (shift-reduce or reduce-reduce) makes a grammar fail SLR.
Exam focus: Compiler Design topics that carry the most marks
Compiler Design marks come mostly from parsing numericals, with phases and optimisation as regular theory questions.
- FIRST and FOLLOW, LL(1) table construction and LL(1) checks.
- LR(0) items, SLR, LALR and CLR comparison and conflicts.
- Three-address code, quadruples and triples.
- Phases of a compiler, basic blocks and optimisation techniques.
Typical long questions
- Explain the phases of a compiler with an example statement.
- Remove left recursion and left factor a given grammar.
- Find FIRST and FOLLOW sets and construct the LL(1) parsing table.
- Construct the LR(0) item sets and SLR table for a small grammar.
- Compare SLR, LALR and CLR parsers.
- Write three-address code, quadruples and triples for an expression.
- Explain five code optimisation techniques with examples.
Marks per question change between universities and years, so confirm the pattern on a recent official paper. In long answers, start with a definition, add a labelled diagram or table, explain the steps and finish with an example or comparison. Underline the key term in each answer and leave a line between steps, because examiners mark faster when the structure is easy to see.
A 7-day revision plan for Compiler Design
- Day 1: Introduction and phases of a compiler, Lexical analysis.
- Day 2: Syntax analysis (top-down parsing), Bottom-up parsing.
- Day 3: Syntax-directed translation, Intermediate code generation.
- Day 4: Runtime environment and symbol table.
- Day 5: Code optimisation and code generation.
- Day 6: redo the numericals: token counting, FIRST and FOLLOW, one LL(1) table, one SLR table and one set of quadruples and triples.
- Day 7: answer the most asked practice questions at the end of the notes from memory, then solve one official previous year paper in three hours and mark the units that cost you time.
Keep a single sheet of formulas, definitions and diagrams from the notes for the last hour before the exam, and do not start new topics on the final day.
Who these notes are for
- B.Tech CSE and IT students preparing for the semester Compiler Design exam.
- MCA students with compiler construction in their syllabus.
- GATE CS aspirants revising lexical analysis, parsing and SDT basics.
- Students who want to understand how programming languages and interpreters work.
The notes are a revision aid, not a first textbook. If a Compiler Design topic is new to you, learn it from your prescribed book or class lectures first, then come back to the notes to compress and revise it. For practice, pair them with the Compiler Design Important Questions PDF page and your university's official previous year papers. If your syllabus has a topic that is not covered here, you can ask for it through the handwritten notes request page linked below.
Download Compiler Design Handwritten Notes PDF
Compiler Design Handwritten Notes PDF (Free)
The PDF carries the same content as this page in a clean, print-ready layout, so you can read it offline and keep it for revision.
7 pages · 253 KB · PDF · Updated 5 Nov 2026