USING C++ or C , Note: This problem is designed to show you howDFA and PDA are used in Compilers. DFA is used for finding thetokens (Problem 1) and PDA for syntax (Problem 2
Part I – We have the following input file: (for foreign studentsthe name here are of well know comics)
larry = 27
curly = 19
moe = 8
groucho = 11
harpo = larry+curly
harpo = larry-curly
harpo = larry*curly
harpo = larry/curly
harpo = larry*curly+moe*groucho
We need to define a DFA which will give the output varioustokens. In this case, the identifiers will be larry, curly, moe ,groucho , and harpo. The operators will be /, +,
OR
OR