ToolSphere
All tools

Compiler Design Lab

Compiler design tools grouped by topic, so you can jump to the part your course covers; each module brings together tools and worked guides for assignments and exam practice.

1. Lexical analysis

Lexical analysis turns source text into tokens: explore compiler phases and the lexer’s symbol-name table with the tools, and use the bootstrapping and error-handling guide for compiler context.

2. Parsing

Parsing checks how tokens fit a grammar: use the tools and worked guides to explore ambiguity, grammar rewriting, FIRST/FOLLOW, predictive, recursive-descent, LR and operator-precedence parsing, with CNF and CYK as related grammar practice.

3. Syntax-directed translation and intermediate code

Syntax-directed translation attaches computations to grammar rules: use the annotated-tree, infix conversion and intermediate-code tools to inspect attributes, syntax trees, DAGs, triples and quadruples, with the three-address-code guide for worked examples.

4. Run-time environments

Run-time environments organize procedure calls and storage: use the activation-record tool to trace recursion, control/access links and parameter passing, plus the hash-table simulator for separate symbol-table practice; this module has no dedicated guide yet.

5. Optimization and code generation

Optimization improves intermediate code before target-code generation: use the tools for basic blocks, flow edges, natural loops, data-flow sets, local, loop and peephole optimizations, register allocation and target instructions, with the Boolean-minimization guide as related practice.

Other labs

Frequently asked questions

Which compiler design topics are covered?

Five topic modules: phases of a compiler and lexical analysis; parsing (ambiguity, left recursion, FIRST and FOLLOW, LL(1), recursive descent, LR(0), SLR, LALR and CLR, operator precedence); SDT and three-address code; activation records; and basic blocks, data-flow analysis, optimization and code generation.

Do the tools show the working or only the answer?

The working. The LR parser shows every item set, table entry and parse step, FIRST and FOLLOW show each set, and the SDT tool draws the annotated parse tree with every attribute value.

Can I check my own grammar or code?

Yes. Every tool loads a textbook example first; replace it with your own grammar, expression or three-address code and the result updates as you type.