Compiler Design

7 articles in this topic

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 15 Jul 20265 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 14 Jul 20265 min readCompiler 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 14 Jul 20267 min readCompiler 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 14 Jul 20266 min readCompiler 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. Let us build them up in order.

Updated 14 Jul 20265 min readCompiler Design

Parsing in Compiler Design: Top-Down and Bottom-Up Explained

Parsing in compiler design for GATE CS: FIRST and FOLLOW sets, LL(1) predictive parsing, LR and SLR shift-reduce, plus a worked parse table and trace.

Updated 14 Jul 20265 min readCompiler Design

Lexical Analysis in Compiler Design: Tokens, Patterns and Lexemes Explained

Lexical analysis in compiler design for GATE CS: phases of a compiler, tokens, patterns and lexemes, regex to DFA scanners, input buffering and symbol tables.

Updated 14 Jul 20265 min read53 viewsCompiler Design