Question: In c + + programming, help me make a lexical analyzer of a toy compiler that can turn the following sample input: int x; real
In c programming, help me make a lexical analyzer of a toy compiler that can turn the following sample input:
int x;
real y;
x ;
y x ;
if x then x ; else x ;
while x
x x ;
x ;
Into the following sample output:
MOVI x
MULTI xt
CONVR tt
ADDR tt
MOVR ty
LTI xt
JMPF t
MOVI x
JMP
MOVI x
LTI xt
JMPF t
ADDI xt
MOVI tx
JMP
MOVI x
In the image is the information that my teacher gave me however, I only need to complete the lexical analyzer section of this toy compiler:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
