What is "parsing"?
-
I've read a definition that "parsing" is "grammar : to divide (a sentence) into grammatical parts and identify the parts and their relations to each other
: to study (something) by looking at its parts closely"In this Linux culture, is "parsing" just the observation of, or is it more the reading a piece of "echoed" data from a string of parameters such as from the status of a video feed. E.g. reading parameters and using those to build or input to some other function (concatenate)?
This word is used frequently, and I'm not sure exactly what is meant.
-
@louf In programming in general (not just Linux) parsing means to take a stream of input data, typically text, and break it apart into units of meaning.
The “parser” is what takes a command line string like
GET LAMP
or
mv filename newfile
and interprets it as commands with targets.
It applies equally to interpreting much longer sets of data, such as config files or even code.
-
@louf "Parsing" is not something specific to Linux culture. It's a datastream thing. You parse through data to make meaning of it.
An example is an XML parser. XML is a markup document language you can use to define basically any kind of data structure in a human-readable way. To use it in a piece of software you would then need a parser to walk through the document and put the necessary data in the correct data structures in memory for use with whatever the software was designed to do.
Basically, whenever you read a document from start to finish, you parse through it in a certain way to make sense of it. The parser knows what to look for (it has a recipe you could say) and what to do with the data when it recognizes things it expects to run into.
But as @rkoster points out, it can also be a command-line parser which is more comparable to your original grammar description.
I think the most concise description I could make of the word "parsing" is: Read arbitrary data and make sense of it using a known recipe.
-
@louf Parsing is about translating a block of text which follows a certain structure into something with a meaning for a program. It's not a "linux" thing, every time you open your web browser you are parsing something in html language.
-
Thanks, all. I know it's elementary, but I wanted to know how precisely or loosely the term was being used, and of human or computer context.
-
Wikipedia has an elaborate artikle about Parsing and its meaning in Computer Languages.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.