Skip to content

Instantly share code, notes, and snippets.

@Thirumalai-Shaktivel
Last active August 22, 2021 04:47
Show Gist options
  • Save Thirumalai-Shaktivel/c2a1aaa5239e792e499eaa8942987519 to your computer and use it in GitHub Desktop.
Save Thirumalai-Shaktivel/c2a1aaa5239e792e499eaa8942987519 to your computer and use it in GitHub Desktop.
GSoC Work Product [Fortran-lang] [2021]

Google Summer of Code 2021 Final Report

Student: Thirumalai Shaktivel
Project: LFortran: Finish AST generation
Organisation: Fortran-lang
Mentor: Ondřej Čertík

Overview of Work Done

The main objective of this project is to make sure that all the grammar rules defined are exposed to AST(Abstract Syntax Tree) level. There were many other goals such as solving the issues labelled parser and fmt (converts preserved AST nodes back to Fortran source code).

Added missing parser grammar rules and AST nodes:

Some grammar rules were not defined in the parser. After adding them, we created AST nodes related to those grammar rules, defined macros, used them in the parser to expose those nodes to the AST level and added tests to make sure everything works correctly as expected. Following are the implemented grammar rules and AST nodes:

  • Coarrays
  • Comments, Semicolon, and EndOfLine
  • Block data, Select Type and Select Rank Constructs
  • Entry, Sync Team, Sync Images, and Sync Memory statements
  • Data, Common, Flush, Computed GoTo, Endline, and Critical statements
  • BOZ, Forall single and multiline statements

Refactoring the AST nodes and macros:

Some grammar rules are defined but are not exposed to the AST level. Following are some of those which have been refactored:

  • Declaration Attributes
  • Block construct
  • Enum, derived type, and use statements
  • ErrorStop and Stop statements
  • Subroutine Call, Event Post, Event Wait, and Sync All statements

List of Issues created for the Completion of AST generation
GSoC weekly report: LFortran: GSoC Student Progress (Thirumalai Shaktivel, AST project)

Other Contributions:

LFortran released its new version during my GSoC period. We came across many bugs and issues. The best part is that we fixed every bug that was reported:

My commits during GSoC:

$ git shortlog -ns --since="5 months ago"
  1254  Ondřej Čertík
   457  Gagandeep Singh
   438  Thirumalai Shaktivel     <--
    88  Rohit Goswami
    55  Dominic Poerio
    20  Andrew Best

Future Contribution

I plan on contributing to LFortran as much as possible after the GSoC period. Following are the tasks to perform:

  • Implement rest of the missing statements or constructs with reference to the Fortran 2018 standards.
  • Work on reported trivia issues.
  • Fix the existing parser and fmt issues.
  • Regularly interact with the community members by reviewing the MR, discussing the ideas, implementing the same.

Thanks...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment