Compiler Design

50 articles in this topic

Run-Time Environment in Compiler Design: Activation Records, Access Links, and Worked Examples

Learn how code, static data, heap, and stack work together at run time. Follow worked examples for recursion depth, stack bytes, and nonlocal access.

Updated 8 Aug 20266 min readCompiler Design

Lexical Analysis in Compiler Design: Tokens, Patterns, and DFA-Based Scanning with Worked Examples

Learn how a scanner turns source characters into tokens, how token patterns become DFAs, and how longest match, lookahead, and token-counting questions work.

Updated 6 Aug 20266 min read55 viewsCompiler Design

Intro to Compilers (Compiler Design): The Six Phases Traced with Worked Examples

Follow position = initial + rate * 60 through lexical, syntax and semantic analysis, intermediate code, optimisation, and target code. The worked trace turns six memorised phase names into one visible pipeline.

Updated 3 Aug 20265 min read153 viewsCompiler Design

Intermediate Code Generation in Compiler Design: Three-Address Code, Quadruples, Triples and Worked Examples

Learn how a compiler produces intermediate code, represents it as quadruples or triples, removes repeated work with a DAG, and handles control flow.

Updated 1 Aug 20266 min read110 viewsCompiler Design

Grammar and CFG in Compiler Design: Complete Guide with Worked Examples

Build grammar and CFG concepts from the formal definition to parse trees, parser-ready transformations and LL(1), using one expression grammar throughout.

Updated 29 Jul 20266 min readCompiler Design

Compiler Design for GATE: Syllabus Areas, Weightage Pattern and How to Prepare

See what GATE Compiler Design covers, where practice questions concentrate, how to solve a complete FIRST/FOLLOW example, and which topics to study first.

Updated 27 Jul 20264 min readCompiler Design

Closures in JavaScript Explained: Lexical Scope, the Loop Trap and Interview Questions

Go beyond the one-line closure definition. Predict a private counter, understand why var timers print 3 three times, and learn the two standard fixes.

Updated 24 Jul 20266 min readCompiler Design

Phases of a Compiler for GATE: One Statement Traced Through Every Phase

Follow position = initial + rate * 60 through all six compiler phases. Each step shows the exact artifact, error class and hand-off that GATE can test.

Updated 29 Jul 20266 min readCompiler Design

LL(1) Parsing Table Construction for GATE

Build an LL(1) table cell by cell, test it for conflicts, and see how left recursion and common prefixes break predictive parsing.

Updated 20 Jul 20266 min read264 viewsCompiler Design

First and Follow in Compiler Design: Step-by-Step Computation with Solved GATE Examples

First and Follow sets computed as a fixed-point algorithm: the full rule set, two grammars solved pass by pass, the nullable-symbol trap, and how GATE tests them in LL(1) and SLR(1) questions.

Updated 18 Jul 20267 min read367 viewsCompiler Design

SLR, CLR and LALR Parsers Compared for GATE: LR Item Sets, Conflicts and Parser Power

All three LR parsers built on one shared grammar: canonical item sets, why SLR(1) hits a shift/reduce conflict that CLR(1) and LALR(1) survive, the 10-vs-14 state count, the reduce/reduce drill grammar, and the exact question patterns GATE uses to test parser power.

Updated 18 Jul 20266 min read170 viewsCompiler Design

Syntax-directed translation and code optimization in compilers explained

The back end of a compiler is where a parse tree stops being a grammar exercise and starts becoming a program that runs fast. Two ideas carry most of the weight there: syntax-directed translation, which attaches meaning and code to the grammar, and code optimization, which rewrites that code to do the same work with fewer instructions. Both are heavily tested and both reward understanding the mechanics rather than memorising names.

Updated 29 Jul 20266 min readCompiler Design