Apr
16
2009
What Is Parsing?
Author: mprokesAlpha Edition!, e-mail spelling/grammer/topic suggestions to mattprokes@gmail.com

The Professional Developer Series
Volume 2, Web Development
Chapter 1.3 Web Development Today
Page: #13
What does it mean to parse something?
The term parse will be used frequently throughout this book. So lets just give a quick run through of parsing, and why it is necessary in web development today. As wikipedia states, parsing is the action of analysis.
We as humans parse things every day, for instance you as a reader are able to parse (or read) the english language. As a result, a reader is able to store data, and learn things from reading. Computers are no different, they are also able to read as well (in this case xml) through their programming, and then take that data that has been processed, and do something useful with it (what ever that may be).
The action of processing and understanding data which a computer receives, and doing something useful with it is the definition of parsing. The XML language is already parsed by many many languages, so the hard part is done. Once xml is parsed though, the computer still does need instructions on what to do with that data. So even though xml date may have been parsed and is readily available, that doesn’t mean that the computer knows what to do with that data yet.
The action of reading data is part of the parsing process called “processing data”, or “analyzing data”; and since most of today’s applications are driven by data, they do a ton of this. During the processing stage of parsing the computer may build a “representation” of the data in its own language, this is called a “data model”.
The computer may also decide to take action or “execute” on some of the data it finds while processing. All this is determined by the programmer, and many programmers make a good career out of just writing parsers to help computers understand all the different languages out there.
There are several different ways of parsing data; summarizing, there are techniques like pattern matching (Regular Expressions) as well as more recently matching hierarchical features (XPath), and many of the API’s out there designed to parse things like XML. Some are a combination of both (Antlr), regardless parsing will be a fundamental part of your career. You need it for things like validating data, and reading data which you receive; so if you have a bit of time, I suggest learning Regular Expressions or XPath.
