3.37K viewsCompiler Design
5
0 Comments

I have to create a lexical analyzer in c++. There should be a input.txt file and an output.txt file for output the result.

Input.txt file contains some code as follows:

int main()

{

int a,b;

float sum;

double num;

sum=a+b;

return sum;

}

Output File Should be like:

Keyword List:

int

int

float

double

return

Variable List:

a-int

b-int

sum-float

num-double

Special Symblo List:

(-First Bracket

)-Closing Bracket

{-Second Bracket

,-Comma

;-Semicolon

Changed status to publish
error: Content is protected !!