-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add a possibility to parse the text and view how it was parsed #33
Comments
Ah! Thanks for this suggestion! If I'm understanding correctly, this might be a way to analyse input that conforms to the parsed grammar? Maybe you could help clarify the output. As a very simple example, if we used the dna grammar from the REAMDE:
Then we parsed an input string Something like this?
|
Yes.
Yes.
So, the idea is to see how the data entered by the user fits the grammar, what rules and how are satisfied. I would also suggest to make output be supported in different formats - in a human-readable one and in, for example, json, because if anyone wanted to create a gui for it, he would need it. |
Thanks @vityafx this does seem like it'd be a really nice addition. I'll see what I'm able to figure out and keep you posted. |
Just noticing, it would also be nice to have a possibility to navigate through them, not only see the output. For example, I am remembering the university course for implementing |
@vityafx I think exposing the AST would be a very valuable part a feature like this. I plan on incorporating that too, thanks for bringing it up! As far as timeline for progress on this work / series of features, it's likely that it'll be pushed back until January. |
Time flies like an arrow! I kicked around some work on building an out Earley parser on top of bnf, it seems like a promising solution but I don't know if I'm going to be able to incorporate anything anytime soon. Would welcome anyone who wants to take a stab. |
@vityafx The implementation for this has made it to the main branch, a release is being drafted now and will be published later today. Wowie, it was a long time coming! |
Indeed! I'll check out, thanks! |
When I was in the university there was a program for learning grammatics in the programming languages theory course. It was very useful for learners to see how the code was parsed in the grammar tree. Can we do the same thing? It must not be so hard, basically, we already have it while we output
Grammar
as a tree in the README file, the same thing is needed but with real data which could come not from the random generator but from the user input - this is how learners learn how to write grammar correctly.The text was updated successfully, but these errors were encountered: