Jump to content

Syntax analysis

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Gogodidi (talk | contribs) at 00:41, 18 September 2005. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Syntax analysis is a process in compilers that recognizes the structure of programming languages. It is also known as parsing. Afet lexical analysis, it is much easier to write and use a parser, as the langauge is far simpler.

Context-free grammar is usually used for describing the structure of languages and BNF notation is typical to define that grammar. Grammatical tokens include numerical constants and literal strings and control structures such as assignments, conditions and loops.


Programs or code that do parsing are called called parsers. Yacc (yet another compiler compiler) is a program that generates parsers in the C programming language.

See also: lexical analysis