Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Parse

by grinder (Bishop)
on Aug 08, 2001 at 23:25 UTC ( #103183=note: print w/ replies, xml ) Need Help??

in reply to What does the word "parse" mean?

Parsing means determining the syntactic structure of an expression, that is written according to the rules of a certain grammar. Suppose you are writing a calculator. You are fed a string like 17*(6+3/7)+sqrt(90+20/2). In order to evaluate that expression (and I don't mean just feeding it to eval), you have to parse it according to the rules of the grammar, which might be the BODMAS rule (brackets of division, multiplication, addition & subtraction).

To parse that expression, you have to break it down into tokens (17, *, (, 6, +...) and verify that it adheres to the rules. Having done that, you can then start to process the data.

You usually parse something that can be very free-form in nature. For instance, you don't really parse the format of Unix's /etc/passwd password file, because it has a very rigid definition. Fields are delimited by colons, and each field has a precise defined purpose. You do, on the other hand, have to parse an SQL statement.

g r i n d e r

Comment on Re: Parse
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://103183]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2015-12-01 05:48 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (794 votes), past polls