Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Intel Customer Support will be observing the Martin Luther King holiday on Monday, Jan. 17, and will return on Tues. Jan. 18.
For the latest information on Intel’s response to the Log4j/Log4Shell vulnerability, please see Intel-SA-00646

Generating AST with ifort

MReza
Beginner
297 Views

Hello!

   I wonder if it is possible to generate abstract syntax tree (ast) files with ifort?

 

Many thanks

0 Kudos
3 Replies
mecej4
Black Belt
231 Views

As far as I know, the answer is no. There is no requirement that a specific compiler use an AST or a similar representation in order to do its job.

After the transition to LLVM is complete, the IFX compiler may use an AST representation, but whether an ordinary user would be allowed to dump that AST is again questionable.

If it were available, what would you do with it?

MReza
Beginner
198 Views

I would like to extract a component from a large Fortran application (i.e. a climate model). In a similar work (KGEN: A Python Tool for Automated Fortran Kernel Generation and Verification), I noticed they use AST information to collect the call graph of the component. AST can apparently help with data flow analysis as well. Without an AST, is there any alternative solution to collect such information (for example, call graph, global variables, shared variables, def-use information) from Intel Fortran compiler?

Arjen_Markus
Valued Contributor III
221 Views

You could have a look at LFortran - it is a compiler under development, but currently quite capable of providing an AST. See https://gitlab.com/lfortran/lfortran

 

Reply