Question: Compilation errors can be loosely divided into two categories: syntax errors and semantic errors. Syntax errors include missing or incorrectly placed tokens, such as the
Compilation errors can be loosely divided into two categories: syntax errors and semantic errors. Syntax errors include missing or incorrectly placed tokens, such as the missing right parenthesis in the arithmetic expression (2+3. Semantic errors include incorrect types in expressions and undeclared variables, such as the assignment x=2, where x is an array variable.
a.Give two more examples of errors of each kind in a language of your choice;
b.Pick a compiler with which you are familiar and determine if it lists all syntax errors before semantic errors or if syntax and semantic errors are intermixed. What implication does this have for the number of passes? Use a sample code to test your result. Show the name of your compiler, the example code, the compilation errors and your analysis result.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
