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

Consider using a real language parser to parse MI output #75

Open
barisione opened this issue Aug 13, 2022 · 1 comment
Open

Consider using a real language parser to parse MI output #75

barisione opened this issue Aug 13, 2022 · 1 comment

Comments

@barisione
Copy link
Collaborator

Describe the bug
Currently, we use regular expressions to parse the GDB MI output. In #72 (review) Chad suggested we used a proper parser to do it:

NIce, this is much better!

Should we consider writing a grammar to simplify this more? Someone did this in rust for pygdbmi -- https://github.com/JP3BGY/gdbmi/blob/master/src/gdbmi_output.pest

We could use lark which has implementation in other languages for the same source .lark grammar.

I'm not keen to write a grammar (it's not something I've done since univeristy!) but, as we already have one we could use, this is a good idea.

To Reproduce
N/A

Expected behavior
No visible change to users (apart from performance improvements probably).

Screenshots
N/A

Please complete the following information:

  • OS: All
  • pygdbmi version (pip freeze output): master pre-0.10.0.3.

Additional context
N/A

@cs01
Copy link
Owner

cs01 commented Aug 13, 2022

Thanks for filing the issue. This is low priority as it’s not clear the trade offs would be worth it, but I thought it was an interesting idea.

It is unclear if there would be performance benefits (if we used a more performant language like rust there would be for sure).

It would reduce the amount of code we have to maintain, but then maybe make it difficult to fix bugs or have others contribute fixes since grammars have a higher learning curve than the parser.

@barisione barisione changed the title Use a real language parser to parse MI output Consider usi a real language parser to parse MI output Aug 14, 2022
@barisione barisione changed the title Consider usi a real language parser to parse MI output Consider using a real language parser to parse MI output Aug 14, 2022
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

2 participants