Ah, I was wondering where that late upvote was coming from. I think my MarpaX::Languages::C::AST answer showcases the best of Perl (“glue language”) and Marpa to offer a concise – and more importantly: correct – solution to an otherwise difficult problem.
On the other hand it shows how fundamentally awkward it can be to work with a Marpa-generated AST. The SLIF offers the "bless" adverb, but only supports arrays as reference type. For a Marpa user, this causes problems when… 1. …wanting to use standard hash-based objects, or 2. …using more advanced object systems like Moose, Mouse, Moo, or p5-mop: external "bless"ings violate encapsulation. It is also a Perl 5-ism that does not translate well to other host languages. I am of the opinion that it might have been a better design choice to invoke the appropriate constructor instead of "bless"ing a reference (which would have had the side effect of forcing Jean-Damien to write handy accessors for MarpaX::Languages::C::AST…). Is it your opinion that this problem has a satisfactory solution by wrapping the constructors in "action"s, or do you concur that syntactic sugar like a "new" adverb could make the SLIF more expressive? As an aside, I am currently considering to write another tutorial in the spirit of “affordable languages”: The LLVM Kaleidoscope tutorial<http://llvm.org/docs/tutorial/index.html> spends a bit too much time writing a simplistic parser which could have been used on more interesting topics of language implementation. I went through the OCaml version of that tutorial some time ago, so it would be fun to use the Perl bindings this time, using Marpa for the parser. Am Donnerstag, 26. Dezember 2013 22:28:56 UTC+1 schrieb Jeffrey Kegler: > > On stackoverflow, someone asked how to find all the strings in a C > program<http://stackoverflow.com/questions/18428022/find-strings-in-source-code-by-using-regex-in-perl>. > > Amon has written two very nice tutorials in response. -- jeffrey > -- You received this message because you are subscribed to the Google Groups "marpa parser" group. To unsubscribe from this group and stop receiving emails from it, send an email to marpa-parser+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.