Syntax Errors

Syntax errors are the easiest to find because they usually highlighted by the compiler or interpreter, i.e. the program that translates the program code checks for and notifies programmers of syntax errors. This type of error is caused by the failure of the programmer to use the correct grammatical rules of the language.

Syntax Error

Syntax errors are detected, and displayed, by the translator as it attempts to turn the source code program into object code. If a program has a syntax error it cannot be translated, and the program will not be executed.

Most compilers and interpreters try to highlight syntax errors where there seems to be a problem, however, this process is far from perfect and sometimes the compiler will indicate another line of code as having the problem rather than the line of code where the problem actually exists.

A common example of a syntax error is a spelling or typing mistake.

Next: Run-Time Errors