Need a high-level API #4713
blakemcbride
started this conversation in
Ideas
Replies: 2 comments
-
I’ve argued against this elsewhere. We’re inviting trouble if we’re make it any simpler to start using it I think. On Oct 4, 2024, at 11:48, Blake McBride ***@***.***> wrote:
While working with the latest ANTLR, I've come to the following opinion: ANTLR provides a very powerful and functional toolkit. However, a higher-level API is sorely needed (without getting rid of the toolkit API). A great deal of, effectively, boilerplate code could be combined to make this higher-level API. It would make ANTLR far, far easier to use.
Some examples:
Why treat the lexer and parser as two different entities throughout when they're interrelated? Treat them as a unit.
Except for testing, why would anyone want errors printed to the console? Put them in a linked list and then provide a simple utility to dump them to the console when testing rather than the other way around.
Many, many more instances of stuff like this exist. You could easily create a high-level API that would make using ANTLR trivial rather than a pretty complex project.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
I agree! We wouldn't want more people using ANTLR! I assure you, it is possible to create a drastically simpler interface without losing any functionality! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
ANTLR provides a very powerful and functional toolkit. However, a higher-level API is sorely needed (without getting rid of the toolkit API). A great deal of, effectively, boilerplate code could be combined to make this higher-level API. It would make ANTLR far, far easier to use.
Some examples:
Why treat the lexer and parser as two different entities throughout when they're interrelated? Treat them as a unit. (You can still get to the individual parts through a unit API.)
Except for testing, why would anyone want errors printed to the console? Put them in a linked list and then provide a simple utility to dump them to the console when testing rather than the other way around.
Many, many more instances of stuff like this exist. You could easily create a high-level API that would make using ANTLR trivial rather than a pretty complex project.
Make this high-level API handle common use cases in very few lines of code and then give access for the ability to do more complex things.
I should be able to call a single method that could validate an input text and return a linked list of errors.
Beta Was this translation helpful? Give feedback.
All reactions