Quote:
Originally Posted by stereologist
...another term that is often misused is the term parse. People often say things like "parse the input for the phone number". Parse means to find the relationships between the parts. Scanning and searching are not parsing. Parsing human languages requires determining the relationship between words....
|
In 30+ years of programming, the only context I've ever heard "parse" used was in compilers, interpreters, and certain computer games that needed to "read" text input from the player.
In all these contexts [pun intended] there was an algorithm that collected the ASCII (typically one letter at time) and determined if there was a sequence of rules and/or filters that would render the input into an unambiguous sequence of internal commands and data items. This was "parsing". If the parsing succeeding in producing a valid sequence of commands (and data), then they were executed. Eventually, one of those commands was "Stop".
Having written such a compiler once, long ago, my favorite way of "parsing" was by using a Finite State Machine (FSM) -- as opposed to today's more popular Object Oriented Machine (OOM).
Technically, the FSM wasn't an algorithm because it did not HAVE to end; if your input source code went on forever, so would the compiler -- until it overran memory and crashed, of course. But practically speaking, there was always a "Stop" because humans can only write (and attempt to compile) source code of finite length. So, I guess it WAS an algorithm.