It seems the executable test lexer does not perform any recovery. Is there some way I can test my results after recovery?
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
- It seems the executable test lexer does not perform any recovery. Is there some way I can test my results after recovery?
- Did the results of the test being evaluated influence the decision to perform the reference standard?
- Did the diagnostic test results influence the decision to perform the reference standard?