Language schools » Linguistics » Syntax » Syntax in computer science

Syntax in computer science

Syntax in computer science

Another meaning of the term syntax has been evolved in the field of computer science, especially in the subfield of programming languages, where the set of allowed reserved words and possible token order in a program is called the syntax of a language.

The syntax of computer languages is often at level-2 (ie, a context-free grammar) in the Chomsky hierarchy. As such the possible ordering of tokens is usually very restricted. The analysis of a program's syntax is usually performed using an automatically generated program known as a parser which often builds an abstract syntax tree.