Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Fortran parser

dan789
Beginner
958 Views

May be its not the best place to ask this question, but why not to try:)

Has anybody met a free-source- or a commercially available solution to perform a run-time Fortran parsing.What I need, is that a user enters a simple (5-10 lines) Fortran code into a notepad-like GUI element of my program, the code is being analyzed and the corresponding actions are being performed. (In my case the user-entered code is just some mathematical equations, but may include also the IF-ENDIF and DO-ENDDO blocks). I know, there are such things for C parsing. May be something like this exists for Fortran?
Thank you in advance!
0 Kudos
5 Replies
Paul_Curtis
Valued Contributor I
958 Views
There are many parsing codes for fortran and fortran-like statements. Do a Google search on "Fortran equation parsing code" (no point inrepeating google results here, but you're only a few clicks from code samples). I recall several threads on this in comp.lang.fortran, and possibly here as well.
0 Kudos
dan789
Beginner
958 Views
Well, Wilton. it's a nice parser, but it's only for mathematical expressions, not including Fortran statements like IF and DO
0 Kudos
durisinm
Novice
958 Views
I'm not sure what your definition of parsing is, but you may be able to use the compiler itself to do what you want. Write code that takes the statements entered into the GUI and then creates a new process to compile, link, and execute them. At my previous job I supported an application that did this with the CVF compiler, and I believe that you should also be able to do it with IVF.

Mike D.
0 Kudos
Reply