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:
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.)