Welcome to Westonci.ca, your ultimate destination for finding answers to a wide range of questions from experts. Join our Q&A platform to connect with experts dedicated to providing precise answers to your questions in different areas. Our platform provides a seamless experience for finding reliable answers from a network of experienced professionals.

Consider the following code:
Token LexicalAnalyzer: : GetToken()
input . GetChar(c);
switch (c) {
case '=':
input . GetChar(c);
if (c = = '=') {
tmp . token_type = EQEQ;
} else if (c = = ' <') {
tmp . token_type = EQLT; }
else if (c = = '>') {
tmp . token_type = EQGT; } else
tmp . token_type = ERROR;
return tmp;
default:
tmp . token_type = ERROR;
return tmp;
1. In the code, input.GetChar() gets the next character from standard input. If GetToken() is called four times, which of the following inputs will return a token whose type is ERROR?
A. ========
A. =<======
B. ===>====
C. =====<==
D. ======<=
2. If GetToken() is called four times on input <==<==, how many times is ERROR returned?
a. 0
b. 1
c. 2
d. 3


Sagot :

Answer:

return tmp;

default:

tmp . token_type = ERROR;

return tmp;

1. In the code, input.GetChar() gets the next character from standard input. If GetToken() is called four times, which of the following inputs will return a token whose type is ERROR?

A. ========

A. =<======

B. ===>====

C. =====<==

D. ======<=

Thank you for choosing our platform. We're dedicated to providing the best answers for all your questions. Visit us again. Thank you for visiting. Our goal is to provide the most accurate answers for all your informational needs. Come back soon. Thank you for trusting Westonci.ca. Don't forget to revisit us for more accurate and insightful answers.