Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [photran] Fortran parser to track the connection between Fortran 'classes' or file I/O

On 1/17/07, Patrick Beck <pbeck@xxxxxxxxxxxxx> wrote:

means I get a view how classes are connected to each other. Anyway, I am
looking for a Fortran parser which reads Fortran source code and produces an
output file where I can track/follow the connection between 'classes' (if it
would be OO Fortran) or also some file I/O.

Fortran 2003 supports objects, but earlier versions of Fortran don't.
Though there might be a compiler our there that supports Fortran 2003
(does anybody know?), none of the compilers we use support it yet, and
Photran does not yet support it, though we expect it to eventually.
So, you instead want to look for connections between modules and
between procedures, because that is what Fortran programmers use now.

You are right, Photran's parser isn't documented.  It is, however,
fairly easy to follow.  It produces an abstract syntax tree and you
ought to be able to write Java code that will visit this tree to do
what you want.  Jeff Overbey is the author of the parser (and the AST,
and most of Photran) so the best way to find out what you need is to
talk to Jeff.  I suggest a phone call or Skype session while you are
both looking at code.

-Ralph Johnson


Back to the top