Question: Generates a matrix table and a lexical analyzer in C + + which can analyze the following lexemes ( One code per lexeme ) Feedback
Generates a matrix table and a lexical analyzer in C which can analyze the following lexemes One code per lexeme
Feedback Acknowledgment:
Comment
Another comment
Numbers in scientific notation:
e
e
You can base it on the following code:
sing namespace std;
#include
We define the transition matrix
of the other
int mInt
;
Function to remove the column from the matrix that corresponds to the character
int getColchar c
switch c
case :
case :
case :
case :
case :
case :
case :
case :
case :
case : return ; numbers to column
case :
case : return ; delimiters: space or end of string
default: return ; column "other"
int main
We read the string that we are going to evaluate
char string;
cout "Enter the string to evaluate: ;
cin string;
cout string endl;
int i ;
char aux; aux will be each character of the string
int state ; We start in state
int column ;
while state && state && i
aux stringi; we will process characters one by one
cout "string
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
