PC.net
HomeHome : Glossary : Definition
ShareShare

Syntax Error

Example: "The code could not be compiled because of a syntax error on line 231."

Syntax Error Image

A syntax error is an error in a program's source code. Software programs must follow strict syntax in order to be compiled into an executable application. If something does not conform to the (programming language's|programming_language) syntax, it will produce a syntax error.

Syntax errors are often small issues, sometimes limited to a single character. For example, a missing parenthesis or semicolon may produce a syntax error. The code below would produce a syntax error since there should be second right parenthesis after "C" for the if () statement.

if (A > (B+C) then D = TRUE;

Most modern IDEs check the source code for syntax errors in real-time, though some may catch syntax errors when the compiler runs. When running a script through an interpreter, a single syntax error may prevent the script from completing.

Published: 2009

Definition from the PC Glossary
https://pc.net/glossary/syntax_error
space