|
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 outFully agree with that.
comments.
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 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.