"Explain and showing output of each phase of the compiler using given example f=a+b *c-d"
a) Lexical Analysis: Identifies tokens (f, =, a, +, b, *, c, -, d)
b) Syntax Analysis: Determines the structure of the code (f = ((a + (b * c)) - d))
c) Semantic Analysis: Checks for semantic correctness (Type compatibility, etc.)
d) Code Generation: Generates machine code or intermediate code