what is parsing in programming

11 months ago 23
Nature

Parsing is the process of analyzing text to determine if it belongs to a specific language or not. In programming, parsing is the process of converting formatted text into a data structure. A parser is a program that is usually part of a compiler and receives input in the form of sequential source program instructions, interactive online commands, markup tags, or some other defined interface. Parsers break the input they get into parts such as the nouns (objects), verbs (methods), and their attributes or options. The output of parsing is a structural representation of the input while checking for correct syntax. The parsing process can be divided into two phases: scanning and syntactic analysis. Scanning is the process of breaking the input into tokens, while syntactic analysis is the process of analyzing the tokens to determine if they form a valid structure. The use of parsers varies by input. In the case of data languages, a parser is often found as the file reading facility of a program, such as reading in HTML or XML text. In the case of programming languages, a parser is a component of a compiler.