Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are Parse::Yapp, Parse::Lex or Marpa::R2 still used?

Tags:

parsing

perl

I would like to write simple parser in Perl that mainly provide an additional layer over an existing language. I was looking at Parse::Yapp, Parse::Lex or even Marpa::R2, but the only concrete example is always the same: a simple calculator that does 43 * 8 + 1. I cannot easily find any other examples so I am wondering if these packages are still a good choice to implement a parser.

Are Parse::Yapp, Parse::Lex or Marpa::R2 still a good solution over a hand-rolled approach?

Where can I find more examples and documentation on these modules? The CPAN pages are usually pretty empty

like image 234
nowox Avatar asked Jul 01 '15 08:07

nowox


2 Answers

For small simple parser jobs like this sort of thing, I wrote Parser::MGC. Your particular case of numerical expression evaluation is likely some variant of one of the examples, namely

https://metacpan.org/source/PEVANS/Parser-MGC-0.13/examples/eval-expr.pl

like image 157
LeoNerd Avatar answered Sep 29 '22 18:09

LeoNerd


Marpa::R2 is in heavy and increasing use. IBM advertises their use of it: https://www.ibm.com/developerworks/community/blogs/jalvord/entry/sitworld_itm_situation_audit?lang=en Metacpan lists ~30 direct dependences and there are indirect dependences from those. There are open-source C, ECMAScript parsers. There's more stuff listed on the web site: http://savage.net.au/Marpa.html#Applications

like image 31
Jeffrey Kegler Avatar answered Sep 29 '22 19:09

Jeffrey Kegler