Use this tag for code that parses its input, or that is source for a parser generator such as yacc or lex.


Parsing is the process of analysing a string of symbols, either in natural language or in computer languages, conforming to the rules of a formal grammar. It's the process your compiler or interpreter goes through to extract meaning from your code. It is also how your browser translates the HTML of this page to a DOM, and in turn to graphics on your screen.

Parser generators

There are tools that generate code for parsers given a grammar file. Most notable is the Yacc + Lex combo.



  • Within computer science, the term is used in the analysis of computer languages, referring to the syntactic analysis of the input code into its component parts in order to facilitate the writing of compilers and interpreters.
  • Within computational linguistics the term is used to refer to the formal analysis by a computer of a sentence or other string of words into its constituents, resulting in a parse tree showing their syntactic relation to each other, which may also contain semantic and other information.