Remove comments in SAL-Code with CDK

forum.cdk (2000-2005) & forum.td.cdk (2005-2010)
Volker

Remove comments in SAL-Code with CDK

Post by Volker » 10 Sep 2007, 18:23

 Posted by:  Volker 

Hi everybody,

has anybody an idea how to remove any comment in a SAL-File with CDK?
We have the problem that we cannot compile the APP anymore because of known
limitations.
The compiler does not know SAM_User anymore :-)
I think I can work around it with reducing the outline after merging all the
included libs in one file and then removing the comments.

TD4.1 PTF2.

Thanks in advance!!!!
Volker.

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2069
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Remove comments in SAL-Code with CDK

Post by Jeff Luther » 10 Sep 2007, 19:17

 Posted by:  Jeff Luther 

I see 2 ways to do this, Volker:
1 - use the CDK's IsComment() to parse through the outline. Read the file
as input, and build a copy as output. If you find a comment, ignore it,
else write to the output.

2 - If your app files are in text format (and not indented text), it may
be easier to write a little utility to read the APT files and look for
something like:
.head 4 - ! this is a comment

That is, the "!" char. will be at the same position for each .head line.
Again, read the input file line by line, and if the 12th char. (pos. 11,
since the chars. count as zero-origin), then ignore the line, else write
to an output file. Be careful, though that the following is possible:

.head 5 - Call ...
.head 4 - ! this is a comment
with another line
.head 4 + If ...

That is, this, comment is on > 1 line, so you'd need to be sure to ignore
lines once you have a comment until the next line starts with ".head ".

Best Regards,
Jeff @ PC Design
info. & samples: www.JeffLuther.net/gupta/

Volker

Remove comments in SAL-Code with CDK

Post by Volker » 11 Sep 2007, 07:53

 Posted by:  Volker 

Thanks, Jeff!
Goog ideas!

Return to “td.cdk”

Who is online

Users browsing this forum: [Ccbot] and 0 guests