-
Notifications
You must be signed in to change notification settings - Fork 84
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
Handwritten parser vs. yecc-generated parser #2
Comments
Good work, to me the yecc-based is much cleaner! A couple notes on the .yrl one:
|
I agree that yecc is cleaner but one of the advantages of the elixir version is that anyone can understand and contribute to it because you don't have to learn yet another parser language. |
@ericmj that was the main reason I wrote the Elixir version too. It's also true that yecc has a very simple grammar and is very easy to understand (you have to know a little bit about CF grammars maybe, but it's nothing complicated). I think the yecc version is cleaner but also "safer" in the sense that it's less prone to cause subtle bugs since the grammar definition is very concise and straightforward. If that means giving up some possible contributors, maybe it's worth it. Keep also in mind that the current versions of both parsers only handle |
@ericmj plus the grammar will be simpler to the point it will be easier to contribute to a grammar syntax you don't know than a complex hand-written grammar in Elixir. :) |
I'm closing this since I merged #3, introducing a |
@josevalim and I have been discussing whether to use a handwritten parser or a yecc-generated parser for
.po
files. Initially, I was in favour of using yecc in order to have a very declarative and easy-to-understand grammar. After implementing a first version of the parser using yecc, I gave implementing a handwritten parser a try and it was practically just as easy.Since I couldn't decide which way was the best one, I pushed both implementation to my fork so that we can decide together.
Please note that both parsers require (a lot) of polishing, in particular the yecc-based one since I'm not sure that stuffing the
.yrl
file in asrc
directory is the right way to go.I'm looking forward to your opinions!
The text was updated successfully, but these errors were encountered: