COBOL and References

Get help with the installation and running of the Zeus IDE. Please do not post bug reports or feature requests here. When in doubt post your question here.
Post Reply
pwdiener
Posts: 134
Joined: Wed Jul 11, 2007 3:45 pm

COBOL and References

Post by pwdiener »

Jussi,

Some time ago, we had a conversation about the references tag type, and how I thought it would be pretty useful, but we had no way to populate it. I've written a program that will produce tag records from the cross-reference data in a compile listing - I'll need to dust it off and tweak it a bit since I've changed jobs and COBOL compilers, but it worked well.

I've also recently realized that there are at least 2 very useful kinds of references that the tagger could produce for me - references to CALLed programs and references to COPY books (#include's). I'll have to do it, but I think it would be very simple to add regex's to the cobol.c module in Exuberant CTags to produce both the definition and reference tags.

With references, I think there are 2 basic things that would be valuable. First, similar to the tag search, would be a list of all the references to a particular tag, with the ability to navigate through the list. I haven't used it enough to be sure, but it seems like the existing tag search result box would be an excellent start on this. It would probably be useful to be able to expand and collapse references by file, but I realize that this kind of takes you away from the grid display used with tags.

Second, it would be useful to be able to display a tree of all the references to a particular tag or tag type. For example, the CALL tree of a workspace or a file would be useful, or the COPY tree.

Does any of this look do-able?

Bill Diener
jussij
Site Admin
Posts: 2461
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Hi Bill,
I've written a program that will produce tag records from the cross-reference data in a compile listing - I'll need to dust it off and tweak it a bit since I've changed jobs and COBOL compilers, but it worked well.

One option would be to change the Exuberant CTags utility to understand this file output (i.e. define a simple regex parser for it). Then this output file could be added to the Zeus workspace, meaning it would get automatically parsed by Exuberant CTags and any tags information that it contained would be automatically displayed on the Zeus class tree.
I'll have to do it, but I think it would be very simple to add regex's to the cobol.c module in Exuberant CTags to produce both the definition and reference tags.

If they can be define by regex's in Exuberant CTags then it should also be possible to get them to show in the Zeus class browser ;)
With references, I think there are 2 basic things that would be valuable. First, similar to the tag search
The tag search is fairly simple in that all it does is search all items in all databases for a name or part of a name.
a list of all the references to a particular tag
I think the search dialog will do this. Given a reference (i.e. a tag with a given name) the search will find all instances of that name within all the databases defined for the current document type.
with the ability to navigate through the list.

And the Tag search dialog will let you navigate the list.
I haven't used it enough to be sure, but it seems like the existing tag search result box would be an excellent start on this.

I am sure improvements are always possible ;)
It would probably be useful to be able to expand and collapse references by file, but I realize that this kind of takes you away from the grid display used with tags.

I am not quite sure what you mean by this :?

The references will already be group by file in the class browser (i.e all tags belong to a particular file and these are displayed in the Project Files folder of the Class Browser).

If you mean group files by reference, then yes this is much harder to achieve :(
Second, it would be useful to be able to display a tree of all the references to a particular tag or tag type. For example, the CALL tree of a workspace or a file would be useful, or the COPY tree.

One thing to remember is the class browser in Zeus gets it's tree structure from Exuberant CTags.

For example if you open this workspace: c:\Program Files\Zeus\zOxygen\example\xOxygen.zwi

If you then go to the class browser, in the Classes node there are many classes and each class can have many methods and varibales.

This relationship is defined by the results produced by Exuberant CTags (i.e. a method tag will have a class attibute defined).
Does any of this look do-able?

Looks pretty do-able to me ;)

Cheers Jussi
Post Reply