| 1. |
What is a compiler? What type of errors can be detected by it? How does it differ from an interpreter? |
|
Answer» A Compiler is a program that accepts a program written in a high level language and produces an object program. The types of errors detected by a compiler are: • Syntax errors -- The compiler cannot understand a program because it does not follow the syntax that is the rules and grammar of a particular language. Common syntax errors include • missing or misplaced ; or }, • missing return type for a procedure, • Missing or duplicate variable declaration. • Type errors that include • type mismatch on assignment, • type mismatch between actual and formal parameters. An interpreter is a program that appears to execute a source program as if it were machine language. |
|