× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi, John:

Thanks for the corrections and for identifying those omissions etc. in my description of a proposed "filter" ...

I just wanted to get that idea out there, for anyone who might need to do something like that, and as you suggest, one could use an incremental approach to get it working and then "fine-tune" it as needed.

Mark

> On 5/19/2015 1:35 PM, John Yeung wrote:
On Tue, May 19, 2015 at 12:58 PM, Mark S Waterbury
<mark.s.waterbury@xxxxxxxxxxxxx> wrote:
You do not need the full "parser" for ILE RPG IV in order to strip out
comments.
Fully agree with that.

The rules for RPG IV comments are pretty simple:
Also agree. But it's not quite *as* simple as what you've presented.

You're missing things like the fact that columns 1 through 5 are
comments on most lines (not in compile-time array lines); some of the
rightmost columns (sometimes starting earlier than column 81) can be
comments, such as for various compiler directives and within
compile-time array lines. In the case of the compile-time arrays, the
comment columns are any columns beyond the defined size. Which could
be tricky if you are really trying to separate all possible comments
from noncomments, but for what we're discussing, compile-time arrays
are probably just as ignorable as full-line comments, so that's pretty
simple. (And for that matter, compiler directive lines are also
probably fully ignorable.)

And then the classic string issue: A double-slash inside a string
literal does not start a comment.

And Buck brings up embedded SQL.

Now, it's also true that you probably don't need to be 100% accurate
in your identification of comments. You can sort of build your filter
in stages, increasing your accuracy until the desired level, or until
the diminishing returns are too small for the additional effort
involved.

So I fully support the gist of Mark's post, just not all the specifics.

John Y.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.