Lexical Analyzer For if statement

C program to design a lexical analyzer for if statement :

Tokens have to be identified and its respective attributes have to be printed.

LEXEMES TOKEN
If <1,1>
variable-name <2,#address>
numeric-constant <3,#address>
; <4,4>
( <5,0>
) <5,1>
{ <6,0>
} <6,1>
> <62,62>
>= <620,620>
< <60,60>
<= <600,600>
! <33,33>
!= <330,330>
= <61,61>
== <610,610>

C SOURCE CODE :

 
OUTPUT :

lexical analyzer for if statement

Leave a Reply

Your email address will not be published. Required fields are marked *