Compiler Design

50 articles in this topic

Code Optimization Mistakes in Compiler Design: How to Avoid Losing GATE Marks

A rewrite that looks familiar is not necessarily safe. Trace six common optimization errors, learn why each one changes program meaning, and use a five-step check before accepting an answer.

Updated 22 Oct 20265 min readCompiler Design

Compiler Design Semester Guide: Trace One Program from Tokens to Target Code

Follow one assignment through lexical analysis, parsing, semantic checks, TAC, optimization and abstract target instructions, with every hand-off made visible.

Updated 18 Oct 20267 min readCompiler Design

Bottom-Up Parsing in Compiler Design: Shift-Reduce Trace, LR Items and Conflicts

Follow a nested-parentheses LR(0) parse from input to acceptance, derive every item set, and see why lookahead changes parser-family conflicts.

Updated 14 Oct 20265 min readCompiler Design

Intermediate Code Generation in Compiler Design: One Cross-Concept Worked Example

Carry one C-like fragment from its source facts to typed temporaries, three-address code, quadruples and a control-flow graph, with every value traced.

Updated 10 Oct 20266 min readCompiler Design

Intermediate Code Generation in Compiler Design: TAC, Backpatching and DAGs

Connect expressions, short-circuit control flow and local optimisation through a single worked translation, from source code to resolved TAC and a reusable DAG.

Updated 5 Oct 20265 min readCompiler Design

Ambiguous Grammars and Inherent Ambiguity: Worked CFG Examples for GATE

Learn what two derivations really prove, resolve expression ambiguity with precedence, and trace the classic inherently ambiguous language through aabbcc.

Updated 1 Oct 20266 min readCompiler Design

Simplification of CFG: Remove Epsilon, Unit and Useless Productions Step by Step

Simplify one context-free grammar from nine nonterminals to six. See each intermediate grammar, complete unit closures, symbol checks and final derivations.

Updated 26 Sep 20266 min readCompiler Design

Phases of Compiler Explained: Worked Example from Tokens to Target Code

Follow one four-line program through lexical, syntax and semantic analysis, then see its intermediate code optimized to a final stored value of 24.0.

Updated 24 Sep 20266 min readCompiler Design

Normal Forms and BNF in Compiler Design: CNF, GNF and Worked CFG Conversions

Separate grammar notation from production restrictions, then convert one CFG into CNF and GNF with exact derivations and rule-by-rule checks.

Updated 23 Sep 20266 min readCompiler Design

Intermediate Code Generation Across Compiler Concepts: Worked TAC, Quadruples and DAG Optimisation

Follow one parenthesised expression from source semantics to naive TAC, record layouts and a four-instruction DAG optimisation, with checks for safe reuse.

Updated 22 Sep 20265 min readCompiler Design

Activation Records and Function Calls: Stack Frames, Worked Trace and Exam Traps

Build a reliable stack-frame model with exact call, return, recursion and nested-procedure traces, plus a fully mapped 72-byte teaching layout.

Updated 20 Sep 20266 min readCompiler Design

Operator Precedence Parsing: Build the Table and Parse an Expression Step by Step

Build an operator-precedence table from a grammar, then use it to trace every shift and reduction for i+i*i.

Updated 19 Sep 20266 min readCompiler Design