vermouth-martinize icon indicating copy to clipboard operation
vermouth-martinize copied to clipboard

(re-)Implement GMX RTP parser using lark-parser

Open pckroon opened this issue 3 years ago • 2 comments

This PR (re) implements the RTP parser using the lark-parser parsing framework, where the file grammar is separated from the interpretation. If we like this style we'll use this to parse FF files as well, after we redo that file format.

This PR is a draft because it's main purpose is to foster some discussion. It also requires more extensive testing. On top of that there is one TODO left regarding the generation of 1-4 pairs between hydrogens, and docstrings are missing.

@fgrunewald what's your opinion/take on this? The main advantages/disadvantages that I see are the following: + The grammar and syntax are explicitly defined, which helps documentation + It's faster than the SectionLineParser (but I haven't quantified this) + When we implement the FF format as well we can start inheriting/including grammar from the other files, which makes the syntax more uniform + It'll allow us to write more complex things for e.g. the JSON parts of the FF format, relaxing the need for quotes and such. See #175 - We need to redo the parsers. Again. - The interpreter logic is not always as clearly depicted as with the sectionlineparser, but that may also be because I'm not good at working with abstract syntax trees.

pckroon avatar Apr 08 '21 10:04 pckroon