Syntax error
Encyclopedia
In computer science
Computer science
Computer science or computing science is the study of the theoretical foundations of information and computation and of practical techniques for their implementation and application in computer systems...

, a syntax error refers to an error in the syntax of a sequence of characters or tokens that is intended to be written in a particular programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

.

For compiled language
Compiled language
A compiled language is a programming language whose implementations are typically compilers , and not interpreters ....

s syntax errors occur strictly at compile-time
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...

. A program will not compile until all syntax errors are corrected. For interpreted language
Interpreted language
Interpreted language is a programming language in which programs are 'indirectly' executed by an interpreter program. This can be contrasted with a compiled language which is converted into machine code and then 'directly' executed by the host CPU...

s, however, not all syntax errors can be reliably detected until run-time, and it is not necessarily simple to differentiate a syntax error from a semantic error
Logic error
In computer programming, a logic error is a bug in a program that causes it to operate incorrectly, but not to terminate abnormally . A logic error produces unintended or undesired output or other behavior, although it may not immediately be recognized as such.Logic errors occur in both compiled...

; many don't try at all.

A syntax error may also occur when an invalid equation is entered into a calculator
Calculator
An electronic calculator is a small, portable, usually inexpensive electronic device used to perform the basic operations of arithmetic. Modern calculators are more portable than most computers, though most PDAs are comparable in size to handheld calculators.The first solid-state electronic...

. This can be caused, for instance, by opening brackets without closing them, or less commonly, entering several decimal points in one number.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK