I looked at a way to start generating ASR using AST, but I would need some guidance to start off. I will be meeting with my mentor and starting to get some headway this week.
GSOC 2022 - LFortran - Implementing Generics Final report - Oshanath Rajawasam Mentors : Ondřej Čertík, Gagandeep Singh Overview This project was about implementing generics for LFortran. This project was implemented parallelly to the same project on LPython, so a lot of the same code is reused. The LPython counterpart was developed by Luthfan Lubis and it has progressed further than this project. Reason for the Project Functions and subroutines in Fortran have specific parameter types and return types associated with them. Since LFortran, at its core, is the same as Fortran, this is also the case for LFortran. This can be problematic when the application demands template-like structures. For example, when implementing a function to add 2 numbers, with current tools available, we would have to implement the same function for all data types it is intended to be used. But with templates, we can define the function once, and use it with any data type we w...
2022-06-25-progress report 2 I successfully rebased the Merge Request ( https://gitlab.com/lfortran/lfortran/-/merge_requests/1664 ) onto the latest main to work in the Generics syntax. There are some issues in the initial implementation. The AST generator recognizes the tokens and tries to generate the AST for the templates, but fails to include everything inside the template itself. For example the variables, functions inside the template does not get included in the AST. So I read through the Bison documentation and looked at the files 'ast.h', 'semantics.h' and tried to figure out how I can make the contents of the Template appear in the AST. This is still ongoing. Even though the necessary components have been added to the parser.yy file, they still have to be added to the semantics.h as well.
2022-08-06-progress report 8 This week I worked on the template instantiation syntax for the parser. It's posted in this pull request . It features a basic syntax for now. Then I rebased all my work on Ondrej's PRs to merge Function and Subroutine as well PR to implement ASR level templates based on Luthfan's work.
Comments
Post a Comment