Parsing is a process of converting formatted text into a data structure. A data structure type can be any suitable representation of the information engraved in the source text.
Tree type is a common and standard choice for XML parsing, HTML parsing, JSON parsing, and any programming language parsing. The output tree is called Parse Tree or Abstract Syntax Tree. In HTML context, it is called Document Object Model (DOM).
A CSV file parsing can result in a List of List of values or a List of Record objects.
Graph Type is a choice for natural language parsing.
A piece of program that does parsing is called Parser.
How it works?
Parser analyses source text against the format* prescribed. If source text does not match against format error is thrown or returned.
If source text does not match against format error is thrown or returned.
If matches then “data structure” is returned.
*format is coded inside the parser.
Format is the DNA of a parser.