โ Compiler Design learning pathCompiler Design ยท Module 1 of 10
Introduction to compilers
What a compiler does and its phases.
๐ Key ideas
- A compiler translates a source program into a target program, usually machine code, and reports errors.
- An interpreter executes the source directly, statement by statement.
- Phases: lexical analysis, syntax analysis, semantic analysis, intermediate code, optimisation and code generation.
- The front end depends on the source language; the back end depends on the target machine.
- The symbol table and error handler are shared by all phases.
๐ก Real-life example: A compiler is like a translator who reads a whole book in Tamil and writes the English version; an interpreter translates a speech live, sentence by sentence.
CompilerTranslates a whole program to target code
InterpreterExecutes source statements directly
Front endPhases that depend on the source language
Symbol tableData structure storing identifiers and their attributes