Im trying to program a lexical analyzer in C/C++ I really just need help putting the switch cases in line so that when the lexeme is found in my file the token will be printed showing what lexemes are in the file

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter9: Using Classes And Objects
Section: Chapter Questions
Problem 9E
icon
Related questions
Question
100%

Im trying to program a lexical analyzer in C/C++

I really just need help putting the switch cases in line so that when the lexeme is found in my file the token will be printed showing what lexemes are in the file

 

Lexeme
YATHVA "I
==
;
Token
ASSIGN_OP
LESSER OP
GREATER OP
EQUAL OP
NEQUAL_OP
LEQUAL_OP
GEQUAL OP
SEMICOLON
Lexeme
+
++
--
(
)
Token
ADD_OP
SUB_OP
MULT_OP
DIV_OP
INC_OP
DEC_OP
LEFT_PAREN
RIGHT_PAREN
{
}
Lexeme
read
write
while
do
<variable name>
<integer>
Token
LEFT_CBRACE
RIGHT CBRACE
KEY_READ
KEY_WRITE
KEY WHILE
KEY_DO
IDENT
INT_LIT
Transcribed Image Text:Lexeme YATHVA "I == ; Token ASSIGN_OP LESSER OP GREATER OP EQUAL OP NEQUAL_OP LEQUAL_OP GEQUAL OP SEMICOLON Lexeme + ++ -- ( ) Token ADD_OP SUB_OP MULT_OP DIV_OP INC_OP DEC_OP LEFT_PAREN RIGHT_PAREN { } Lexeme read write while do <variable name> <integer> Token LEFT_CBRACE RIGHT CBRACE KEY_READ KEY_WRITE KEY WHILE KEY_DO IDENT INT_LIT
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
ADT and Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT