Compiler Design

28 articles in this topic

Symbol Table in Compiler Design: Errors, Passes and Worked Examples

Follow one scoped program from symbol-table insertion to type checking and error recovery, then see why a compiler phase is not the same thing as a pass.

Updated 3 Sep 20266 min readCompiler Design

Semantic Analysis and Syntax-Directed Translation: Worked Examples for GATE CS

Follow the compiler pipeline from symbol-table checks to attribute evaluation. Three worked examples trace an arithmetic expression, a declaration list, and postfix output.

Updated 1 Sep 20265 min readCompiler Design

Lexical Analysis and Tokens in Compiler Design: Worked Examples for GATE CS

See how a lexer turns source characters into tokens. The worked scan follows one complete line, builds symbol-table references, and exposes common traps.

Updated 31 Aug 20265 min readCompiler Design

CLR(1) Parser and Canonical LR(1) Items: Worked Closure, GOTO and Parse Table

Build a CLR(1) parser from one small grammar. Follow every closure, GOTO, table entry, and stack action until ccdd is accepted.

Updated 29 Aug 20265 min readCompiler Design

Compiler Design for GATE: A 6-Week Topic-by-Topic Study Plan

Follow a fixed eight-hour weekly clock through compiler phases, parsing, translation, runtime storage, optimisation and mixed revision.

Updated 29 Aug 20265 min readCompiler Design

Derivation and Recursion in CFG: Leftmost, Rightmost and Worked Examples

Follow three exact derivations to separate sentential forms from sentences, see how recursion behaves, and remove immediate left recursion without changing the language.

Updated 26 Aug 20265 min readCompiler Design

Basic Blocks, Loops and Optimization Methods in Compiler Design: A Worked Example

Follow one three-address-code fragment from leader identification to a natural loop, then verify how invariant motion and strength reduction preserve its result.

Updated 24 Aug 20266 min readCompiler Design

Left Factoring in Compiler Design: Prefix Rules, Worked Grammars and Exam Traps

Learn how to find a useful common prefix, factor a grammar to a fixed point, preserve empty suffixes, and test what the result does and does not prove.

Updated 23 Aug 20265 min readCompiler Design

SSA and Control Flow in Compiler Design: Dominators, Phi Nodes and a Worked CFG

Build SSA as one connected process. This worked compiler-design example goes from a six-block CFG to dominators, phi placement, renaming and return value 3.

Updated 21 Aug 20266 min readCompiler Design

Formal Grammar and Chomsky Hierarchy for GATE: Worked Derivations and Classification

Learn formal grammar from G=(V,T,P,S), derive aaabbb, classify Types 3 to 0, and prove why id+id*id is ambiguous before practising quick checks.

Updated 19 Aug 20266 min readCompiler Design

Top-Down Parsing in Compiler Design: Recursive Descent, LL(1), FIRST and FOLLOW with Worked Examples

Learn top-down parsing from grammar preparation to predictive parsing, with one expression grammar carried through every calculation and trace.

Updated 17 Aug 20267 min readCompiler Design

Semantic Analysis and SDT in Compiler Design: Attributes, Worked Examples, and How GATE Tests It

Learn how semantic analysis validates meaning, how SDDs and SDTs evaluate attributes, and how to trace two common exam-style problems to their final answers.

Updated 15 Aug 20266 min readCompiler Design