FAQ: PP 3: Semantic Analyzer
Questions:
Answers:
- My compiler generates the correct error messages for the sample code, but it underlines different parts of the source code. Is this a problem?
- My compiler generates the correct error messages for the sample code, but it doesn't output them in the same order. Is this a problem?
- The specification states that the parameter list and local variable set are in two separate scopes. Does that mean a local variable can shadow a parameter?
- Do we have to check for circular inheritance?
- For PP2, we added switch statements and postfix increment and decrement operators. What should we do with them?
Answers:
- My compiler generates the correct error messages for the sample code, but it underlines different parts of the source code. Is this a problem? [top]
No. The grading script ignores those "^^^" underline marks. As long as your compiler finds all the errors that are there (and only those errors) and issues the right error message(s), you are fine.
- My compiler generates the correct error messages for the sample code, but it doesn't output them in the same order. Is this a problem? [top]
No. The grading script will sort the error messages before doing a diff.
- The specification states that the parameter list and local variable set are in two separate scopes. Does that mean a local variable can shadow a parameter? [top]
void marcia(int jan) {
string jan;
}
Yep, the inner jan shadows the other one. - Do we have to check for circular inheritance? [top]
It does not make sense to allow a pair of mutual extends, but your compiler does not have to check for this.
- For PP2, we added switch statements and postfix increment and decrement operators. What should we do with them? [top]
Those additions were PP2-specific, and should be pulled from your parser.y file. We wanted you to write some of your own classes beyond the ones we gave you, so we had you add recognition of switch, case, default, ++,, and --. While they're neat and all, it is not imperative they remain in the Decaf subset implemented by PP3. PP4 will drop some other constructs.
CS143 Resources
- Announcements
- Schedule and Handouts
- Staff Info / Office Hours
- Email Archive
- Project FAQs
- Coding Guidelines
- Submission Instructions
- Lecture Videos
Outside Resources
Command References