Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor parsing library and split into separate project #291

Open
cmacmackin opened this issue Aug 16, 2019 · 4 comments
Open

Refactor parsing library and split into separate project #291

cmacmackin opened this issue Aug 16, 2019 · 4 comments

Comments

@cmacmackin
Copy link
Contributor

The current state of the parsing library is... not so great. It's very complicated and confusing and results in way too large a file in [ford/sourceform.py]. However, the functionality it implements is very useful and could allow for the development of static analysis tools, linters, etc. As such, we should ideally look towards refactoring this part of the code, simplifying it and reducing dependencies between the parts. The output should also be something more standard than the mess of Python objects it produces now (e.g., JSON, YAML, XML, or some other easily parsed and interpreted serialisation). This would be a major project but would be extremely worthwhile as it would result in the code being simpler, more maintainble, and more widely useable.

@cmacmackin
Copy link
Contributor Author

Some things to consider doing:

  • Change ford/reader.py to keep better track of locations in code, so these can be used in docs
  • Get rid of inheritance hierarchy in ford/sourceform.py? (Not sure it helps much...)
  • Change the IDs and output layout to be based off of slugs or hashes?
  • Consider relationship between parsing documentation comments and parsing code (i.e., static analysis doesn't need or want the former)
  • Think about some more general way of parsing documentation comments

@cmacmackin
Copy link
Contributor Author

Would Protocol Buffers be a good choice? Fast and powerful, but not human readable. However, I like the ability to define schemas!

@kc9jud
Copy link
Contributor

kc9jud commented Jul 14, 2021

I'll point out that there is also a parser in hansec/fortran-language-server. Is it possible that there is useful communication which should be happening between these projects?

@ZedThree
Copy link
Member

Yes, that's a nice tool, it would be good to see if there's a common parsing library we can work on. There's also the LLVM flang project, which is C++, but might also be a good foundation.

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

No branches or pull requests

3 participants