Question: (20 pts) Errors in a computer program can be classified according to when they are detected and, if they are detected at compile time, what
(20 pts) Errors in a computer program can be classified according to when they are detected and, if they are detected at compile time, what part of the compiler detects them. Using your favorite programming language, give an example of: (a) (5 pts) A lexical error, detected by the scanner. (b) (5 pts) A syntax error, detected by the parser. (c) (5 pts) A static semantic error, detected (at compile-time) by semantic analysis. (d) (5 pts) A dynamic semantic error, detected (at run-time) by code generated by the compiler.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
