Go Back   Scooter Forums > Beyond Compare 3 Discussion > File Formats vs. Rules
Register FAQ Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 08-Nov-2011, 12:43 PM
kengrubb kengrubb is offline
Enthusiast
 
Join Date: Jan 2006
Location: Olympia, WA, USA
Posts: 20
Default Another COBOL Source Code Comparison Issue

I'm using BC3 and the factory default for COBOL Source. I've discovered an Unimportant Difference, and I don't know why it's Unimportant. I inserted some spaces into a paragraph name, which is very definitely NOT Unimportant.

;^>

Before
Code:
000000             CLOSE-ACCTL-EXIT.
After
Code:
000000             CLOSE-     ACCTL-EXIT.
__________________
Ken Grubb
Puyallup, WA
Reply With Quote
  #2  
Old 08-Nov-2011, 03:28 PM
Aaron Aaron is offline
Team Scooter
 
Join Date: Oct 2007
Location: Madison, WI
Posts: 5,416
Default

Hello Ken,

Our default COBOL file format would detect that whitespace as whitespace text. By default, whitespace is not important.

Should that whitespace be swallowed by one of our other grammar element definitions? Or should whitespace be important? You can easily enable the later in the Text Compare's Session menu -> Session Settings, Importance tab, and then checking (checked items are Important) the default text: embedded whitespace, and optionally leading and trailing whitespace.
__________________
Aaron P Scooter Software
Reply With Quote
  #3  
Old 08-Nov-2011, 04:01 PM
kengrubb kengrubb is offline
Enthusiast
 
Join Date: Jan 2006
Location: Olympia, WA, USA
Posts: 20
Default

Hmmm. This is a subtle nuance.

A difference in whitespace (1 space versus 2 or 20 or whatever) would be Unimportant.

However, a change in whitespace (meaning the addition of whitespace where there was none, or the removal of whitespace where it existed) would be Important.

I'm not sure how to represent that in the grammar.
__________________
Ken Grubb
Puyallup, WA
Reply With Quote
  #4  
Old 08-Nov-2011, 06:40 PM
Michael Bulgrien Michael Bulgrien is offline
Carpal Tunnel
 
Join Date: Oct 2007
Location: Pennsylvania
Posts: 1,766
Default

Personally I agree that a difference in embedded whitespace and the insertion of whitespace where none exists on the other side are two different scenarios and should be separately configurable. I agree that the whitespace in your example is significant. I also agree that you should not have to make embedded whitespace important to get it to show up.

In my opinion, the importance tab should have an additional category called "Inserted whitespace" that is important by default.
__________________
BC v3.3.5 build 15075
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Reply With Quote
  #5  
Old 09-Nov-2011, 01:01 PM
Aaron Aaron is offline
Team Scooter
 
Join Date: Oct 2007
Location: Madison, WI
Posts: 5,416
Default

Hello Ken,

So the above change would be unimportant if the whitespace was increased or decreased, but is important going from none to some, or some to none?
__________________
Aaron P Scooter Software
Reply With Quote
  #6  
Old 10-Nov-2011, 02:26 PM
kengrubb kengrubb is offline
Enthusiast
 
Join Date: Jan 2006
Location: Olympia, WA, USA
Posts: 20
Default

Hi Aaron,

Perfectly stated.
__________________
Ken Grubb
Puyallup, WA
Reply With Quote
  #7  
Old 21-Nov-2011, 09:28 AM
Aaron Aaron is offline
Team Scooter
 
Join Date: Oct 2007
Location: Madison, WI
Posts: 5,416
Default

Hello Ken,

Would it be possible to get a specific example file emailed to support@scootersoftware.com ? Please also include a link back to this forum thread for our reference?

Would "CLOSE-ACCTL-EXIT" be an identifier? One solution would be to add it as an Identifier grammar.
__________________
Aaron P Scooter Software
Reply With Quote
  #8  
Old 23-Nov-2011, 10:53 AM
kengrubb kengrubb is offline
Enthusiast
 
Join Date: Jan 2006
Location: Olympia, WA, USA
Posts: 20
Default

Well, that probably would not work. In this example, CLOSE-ACCTL-EXIT is a paragraph name, and in the non-COBOL world that's approximately equivalent to a function name or subroutine name. It could be any combination of A-Z, a-z, 0-9, dash (-), underscore (_) in some COBOL variants, and perhaps other characters as well.
__________________
Ken Grubb
Puyallup, WA
Reply With Quote
  #9  
Old 23-Nov-2011, 12:40 PM
Aaron Aaron is offline
Team Scooter
 
Join Date: Oct 2007
Location: Madison, WI
Posts: 5,416
Default

Hello Ken,

What if you define a new grammar element, Identifier, and match the regular expression:
[_A-Za-z][_A-Za-z0-9-]*

If marked as important, the line should then detect is has an important difference (though no particular text will be red), and blue if both lines have whitespace (variable amount) in the same location.

This would assume a digit or dash cannot be the first character. Would that match with COBOL standards? If you have any reference material, we would appreciate it.
__________________
Aaron P Scooter Software
Reply With Quote
  #10  
Old 23-Nov-2011, 04:22 PM
kengrubb kengrubb is offline
Enthusiast
 
Join Date: Jan 2006
Location: Olympia, WA, USA
Posts: 20
Default

That does appear to work. I used it without the underscore for my variant of COBOL (Unisys 2200).

[A-Za-z][A-Za-z0-9-]*

As for COBOL reference material, it will vary from one platform to the next. There are a couple of major differences and several minor differences between the various dialects of COBOL.

One of the major differences, for HP NonStop COBOL and OpenCOBOL, would be a Comment pattern of ^\*.* and no Line Numbers. I suspect COBOL.NET would also fall under this standard.

Also, COBOL 74 and COBOL 85 standards have different keyword lists. The BC3 COBOL keyword list appears to be COBOL 85, but with some of the hardware specific nuances included.
__________________
Ken Grubb
Puyallup, WA
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 10:06 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.