Closed aamironline closed 2 years ago
Hi @aamironline
Thanks for your kind words. I am the current maintainer of pigeon and I am happy to provide you with some hints and links you might find helpful in your endeavor.
.peg
. Therefore I usually have a file ending on _helper.go
, where all the helper functions are located, that are called from the code generated by pigeon. In the .peg
file, I normally only have short statements like return xyz(arg1, arg2)
. The return values of xyz
match the expectation of pigeon, that is they return an interface{}
and an error
.Over all, I feel like you might find a lot of inspiration in https://github.com/breml/logstash-config/blob/master/logstash_config.peg
An other good example is https://github.com/bytesparadise/libasciidoc/blob/master/pkg/parser/parser.peg
Use the two links in the Wiki to find more examples.
Wow, what a detailed response! Thank you so much. I'll try your suggestions and provide my progress in this thread. Thanks again 👍🏻
Hello,
Hope you are doing great! Thank you very much for developing such a wonderful library.
For one of our project (https://github.com/maniartech/x/), we are developing expression evaluator in Golang. We have used expr library for now. But would like to replace with our own evaluator/parser. We do not want to write from the scratch. The pigeon seems to provide perfect solution for our requirements. This seems to be easy. I started with changing calculator parser provided with the pigeon library. However, it is not working out.
I am new to PEG ecosystem, can anyone help me develop this parser! I am open to start a new MIT licensed open source project for this expression evaluator.
Thanks and Regards.
The expression evaluator has got following syntax!