Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Using (say) Parse::RecDescent to glean from a file

by sundialsvc4 (Abbot)
on Oct 10, 2010 at 14:52 UTC ( [id://864483]=note: print w/replies, xml ) Need Help??


in reply to Using (say) Parse::RecDescent to glean from a file

Okay, first of all, I had overlooked ... :*{ ... SAS::Parser.   Mea culpa on that one.

One thing that I know we’ll be doing is looking at the SQL statements that are issued.   Sometimes we are looking in a mixture of in-line code of different types.   (Over the years, many now long-gone programmers did things in different ways.)

The general notion that I have right now is that ... “somewhere in all this unpredictable mess is a particular string (of tokens) that I am looking for.” When and if I find it, I know that “this thing” has the following general structure, which I would now like to parse.   And, when I do parse it, I want to look for particular things and ignore the rest.

One strategy, of course, is to use regular expressions or what-not to carve out chunks of source-code that can then be subjected to a regular parser.   But there are two elements to that approach which give me pause:

  1. “Now I am writing, and maintaining, two sets of code that are jointly responsible for handling the file.
  2. Within each isolated chunk of code that I want to parse, I still fear that I would have to provide complete-and-correct grammar information.

So, from a parsing point-of-view, it is rather like looking for the good-stuff in a file chock-full of “syntax errors.”

(Kind of like the Gary Larson cartoon about “what a dog actually hears” ... blah blah blah blah dog food blah blah blah play catch blah blah blah ...   I want to be able to tell the computer about dog-food and games; about what I am truly interested in and nothing else.)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-25 13:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found