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

Example parsers with specific Token data structure vs Chr #29

Closed
MyBox42 opened this issue Jul 19, 2022 · 3 comments
Closed

Example parsers with specific Token data structure vs Chr #29

MyBox42 opened this issue Jul 19, 2022 · 3 comments

Comments

@MyBox42
Copy link

MyBox42 commented Jul 19, 2022

Hi,

First of all would like to share how amazing this library looks. Have been working with ANTLR for years and am trying to move to a more functional approach to parsing. Also I'd like to use a pure java DSL vs parser generators as it helps so much with the developper experience (IDE integrations, no pre-compile phase to generate stuff, etc.).

I spent a few hours trying to develop a minimal parser for a small language, and the largest issue I have found so far was the inherent LL(1) parsing limitations. From one of your comments earlier, trying to come-up with a pre-analysis phase that would generate a stream of tokens (as opposed to just individual chars, a token would be a string and meta data such as whether this is a language reserved word, a user defined symbol etc.) and hoping this will help with the LL(1) parsing issues.

As I am developing this, I wonder if you had any resource/documentation available that would explain how to work with a specific Token data strructure vs Chr? At first glance, seems like the lib is pretty generic, so that would mean Input < Token >, Parser<Token, SomeType> etc., but would really love to go through examples if there were any available

Also would like to know if you are planning on extending this library or making it more known, that's a gem!

thanks for this library and the great work again

@jon-hanson
Copy link
Member

I've added an example grammar/parser that parses a sequence of tokens here.

@MyBox42
Copy link
Author

MyBox42 commented Oct 8, 2022

Thank you so much for this - Really appreciate the feedback. Exactly the example I was looking for, all the best

@jon-hanson
Copy link
Member

No problem, closing this issue.

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

No branches or pull requests

2 participants