Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is parsing?

Parsing is something I come across a lot in development, but as a junior it is one of those things I assume I will get the hang of at some point, when it is needed. In my current project I've been told to find and use an HTML parser for a certain function, I have found a couple on the web.

But what does an HTML parser actually do? And what does it mean to parse an object?

like image 468
Grace Avatar asked Nov 24 '09 09:11

Grace


People also ask

What is parsing in simple terms?

To parse is to break up a sentence or group of words into separate components, including the definition of each part's function or form. The technical definition implies the same concept. Parsing is used in all high-level programming languages.

What is parsing in programming?

In computer science, parsing is the process of analysing text to determine if it belongs to a specific language or not (i.e. is syntactically valid for that language's grammar). It is an informal name for the syntactic analysis process.

What is parsing of data?

Data parsing is converting data from one format to another. Widely used for data structuring, it is generally done to make the existing, often unstructured, unreadable data more comprehensible.

What is the purpose of parsing?

Parsing, which is the process of identifying tokens within a data instance and looking for recognizable patterns. The parsing process segregates each word, attempts to determine the relationship between the word and previously defined token sets, and then forms patterns from sequences of tokens.


2 Answers

Parsing usually applies to text - the act of reading text and converting it into a more useful in-memory format, "understanding" what it means to some extent. So for example, an XML parser will take the sequence of characters (or bytes) and convert them into elements, attributes etc.

In some cases (particularly compilers) there's a separation between lexical analysis and syntactic analysis, so the real "understanding" part of the parser works on a sequence of tokens (identifiers, operators etc) rather than on the raw characters.

like image 132
Jon Skeet Avatar answered Oct 10 '22 21:10

Jon Skeet


Parsing is taking a set of data and extracting the meaningful information from it. With HTML parsing, you're looking to read some html and return a structured set of tags and text

like image 23
Adam Hopkinson Avatar answered Oct 10 '22 20:10

Adam Hopkinson