Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

It seems the executable test lexer does not perform any recovery. Is there some way I can test my results after recovery?

0
Posted

It seems the executable test lexer does not perform any recovery. Is there some way I can test my results after recovery?

0

Recovery is a very subjective fuzzy area. To test yours, just look at what you think is reasonable to do after you find each error. The goal is to detect as many errors as you can in one compile, with useful error messages whenever possible. You can compare your output to others in the class also. Choose any reasonable limit for the integer limit. Question: Should I perform some recovery from errors like if a newline is encountered in string then truncate the string at that point. In such case, what should my program return. If I return an ERROR, is there any way I can store the truncated string? Answer: Recovery is subjective. But, you could return the string as a string constant with the lexeme being the string you got until the newline. THen, start scanning again after the newline, and return whatever that matches, posibly another string constant because it is legal from then on. An alternative is to scan beyond the newline and grab the whole thing, deleting thenewline as one string

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123