Lexical Analysis – CompilerPritesh
Compiler takes high level human readable program as input and convert it into the lower level code.This conversion takes place using different phases.First phase of compiler is lexical analysis.
Must Read : [What is Compiler ?]
Different phases of compilers :
- Analysis Phase
- Synthesis Phase
1.Analysis Phase :
Lexical Analysis Phase :
- Lexical Analyzer is First Phase Of Compiler.
- Input to Lexical Analyzer is “Source Code“
- Lexical Analysis Identifies Different Lexical Units in a Source Code.
- Different Lexical Classes or Tokens or Lexemes
- Example : sum = num1 + num2 ;
- Lexical Analyzer is also called “Linear Phase” or “Linear Analysis” or “Scanning“
- Individual Token is also Called Lexeme
- Lexical Analyzer’s Output is given to Syntax Analysis.