Right Click to Search

Friday, July 23, 2024

Analysis Phase >> Lexical Analysis [ Phases of Compiler ]


Compiler : For Definition [ Click Here ]
Different phases of compilers :
  1. Analysis Phase
  2. Synthesis Phase
1.Analysis Phase :
Lexical Analysis Phase :
  1. Lexical Analyzer is First Phase Of Compiler. 
  2. Input to Lexical Analyzer is "Source Code"
  3. Lexical Analysis Identifies Different Lexical Units in a Source Code.
  4. Different Lexical Classes or Tokens or Lexemes
    • Identifiers
    • Constants
    • Keywords
    • Operators
  5. Example : sum = num1 + num2 ;


So Lexical Analyzer Will Produce Symbol Table -
TokenType
sumIdentifier
=Operator
num1Identifier
+Operator
num2Identifier
;Seperator
  1. Lexical Analyzer is also called "Linear Phase" or "Linear Analysis" or "Scanning"
  2. Individual Token is also Called Lexeme
  3. Lexical Analyzer's Output is given to Syntax Analysis.

Stumble
Delicious
Technorati
Twitter
Facebook

0 Comments:

Post a Comment

Your Feedback :This is Growing Site and Your Feedback is important for Us to improve the Site performance & Quality of Content.Feel Free to contact and Please Provide Name & Contact Email

 

Learn C Programming Copyright © 2010 LKart Theme is Designed by Lasantha, Free Blogger Templates