Answered step by step
Verified Expert Solution
Question
1 Approved Answer
RCONST: ( 2 3 . 5 ) SCONST: Please type the coordinates of three points RCONST: ( 1 5 . 2 5 ) ICONST: (
RCONST:
SCONST: "Please type the coordinates of three points"
RCONST:
ICONST:
RCONST:
SCONST: "The center of the circle through these points is
ICONST:
Lines:
Total Tokens:
Identifiers:
Integers:
Reals:
Strings:
INTEGERS:
REALS:
STRINGS:
Please type the coordinates of three points, The center of the circle through these points is This is the output im getting. The output i want is this:RCONST:
SCONST: "Please type the coordinates of three points"
RCONST:
ICONST:
ICONST:
RCONST:
SCONST: "The center of the circle through these points is
ICONST:
Lines:
Total Tokens:
Identifiers:
Integers:
Reals:
Strings:
INTEGERS:
REALS:
STRINGS:
"Please type the coordinates of three points", "The center of the circle through these points is and this is the file contents: "Please type the coordinates of three points"
'The center of the circle through these points is
It's not reading integer and it's giving me blank tokens Can you check my function.: this is my code: LexItem getNextTokenistream & in int & linenum
enum TokStateSTART INID ININT INSTRING, INCOMMENT, REAL ;
TokState lexstate START ;
string lexeme;
bool escaped false;
char ch;
Token tok ERR;
whileingetch
switchlexstate
case START:
ifch
linenum;
ifisspacech
continue;
lexemech;
ifisalphach ch
lexstateINID;
else if isdigitch
lexstateININT;
else if ch
auto s inpeek;
if isdigits
lexstateREAL;
continue;
else
lexeme s;
return LexItemERR lexeme, linenum;
else if ch ch
escapedfalse;
lexstateINSTRING;
continue;
else if ch && inpeekEOF && inpeek
lexstateINCOMMENT;
else
tokERR;
switch ch
case :
tok PLUS;
break;
case :
tok MINUS;
break;
case :
tokMULT;
break;
case :
tokDIV;
break;
case :
tokASSOP;
break;
case EQ:
if lexeme
tok EQ;
break;
case POW:
if lexeme
tokPOW;
break;
case :
tokGTHAN;
break;
case :
tokLTHAN;
break;
case CAT:
if lexeme
tokCAT;
break;
case :
tokCOMMA;
break;
case :
tokLPAREN;
if inpeek
lexstate INCOMMENT;
continue;
break;
case :
tok RPAREN;
break;
case :
tok DOT;
break;
case DCOLON:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started