ctags with Fortran 90

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
E Programmer
Posts: 38
Joined: Thu Apr 07, 2005 7:07 pm

ctags with Fortran 90

Post by E Programmer »

I am writing Lahey Fortran code using standard Fortran 90
File extensions are .F90, but the code is an extension to Fortran 77 whose file extensions are .FOR

CTAGS is set to handle fortran code under the .FOR extension

I edited the environment variable to read

Code: Select all

CTAGS=--langmap=fortran:+.f90
I can now run

Code: Select all

ctags *.f90
at the DOS prompt and get a TAGS file.

However, if I
1) touch all the fortran files
2) delete TAGS
3) select menu item TAGS--UPDATE

Then
1) Zeus generate a xxx.zbi file
2) but no TAGS file.

I don't get an error from Zeus, there seems to be a pause and it returns.
If I leave the TAGS file generated manually in place, Zeus does not seem to be using it since none of the + signs appear (as they once did for a .for file).

If I look at a dump of the .zbi file, it has the subroutine names mixed in
If I look at the TAGS file, it has a nice sorted list of the subroutine names

Is there a way to see the ctags command line? I would hope it is something like what I gave above, or maybe a list of the files in the workspace.

Ideas?
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

The command line listed in the following posting:

http://www.zeusedit.com/forum/viewtopic.php?t=34

But you make the command line display by renaming the xtags.exe file. If Zeus has trouble running the tagger it will pop up an error dialog containing the command line run it tried to run.

But the problem is this case more likely than not related to the xtags.dll file :(

The xtags.dll takes the markers produced by ctags.exe maps them to Zeus browser items. These are the flags Zeus is expecting [/B]ctags.exe[/B] to produce for the Fortran file type:

Code: Select all

// --fortran-types=[+|-]kinds
//         b  block data
//         c  common blocks
//         e  entry points
//         f  functions
//         i  interfaces
//         k  type components
//         l  labels
//         L  local and common block variables [off]
//         m  modules
//         n  namelists
//         p  programs
//         s  subroutines
//         t  derived types
//         v  module variables
And this is how the xtags.dll maps these ctags flags to the Zeus browser items:

Code: Select all

switch (details.szKind.charAt(0))
      {
        case 'b':
          type = Tag_Variable;
          break;

        case 'c':
          //-- distinguish forth class and fortran common
          type = (details.szKind.charAt(1) == 'l') ? Tag_Class : Tag_Import;
          break;

        case 'm':
          //-- distinguish forth method and fortran module
          type = (details.szKind.charAt(1) == 'e') ? Tag_Method : Tag_Package;
          break;

        case 'e':
        case 'f':
        case 'p':
        case 's':
          type = Tag_Function;
          break;

        case 'i':
          type = Tag_Interface;
          break;

        case 'k':
        case 'l':
        case 'C':
          type = Tag_Macro;
          break;

        case 't':
          type = Tag_Typedef;
          break;

        case 'v':
        case 'V':
          type = Tag_Variable;
          break;
      }
      break;
If you post some sample fortran code to this post that contains some or all of these ctags flags I would be quite happy to take a closer look at the xtags.dll and see if it is at fault.

Cheers Jussi
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Then
1) Zeus generate a xxx.zbi file
2) but no TAGS file.
You will never find a tags file. The reason is Zeus generates the tags into a temp file, copies the tags information into the zbi file and then deletes the temp file. The zbi file is browser information file for the entire project and contains the tags information for each and every file in that project.
If I leave the TAGS file generated manually in place, Zeus does not seem to be using it since none of the + signs appear (as they once did for a .for file).

The browser display is read from the the zbi file and not from any tags file.

I ran a simple test by adding a few simple fortran files to a project/workspace and at least for the tagging seemed to work fine. While the workspace was open the class browser was populated with the fortran function names and global variables.

Cheers Jussi
Post Reply