dha / hq9plus-in-perl6

hq9+ interpreter written in Perl 6
2 stars 0 forks source link

Add a grammar/actions example too? #1

Open MattOates opened 9 years ago

MattOates commented 9 years ago

Might be nice to show a grammar and actions solution too so people can ramp up their knowledge towards something that is very extensible and general. I knocked up a quick version you might want to play with: https://gist.github.com/MattOates/1b12a5f3ae46bce03c60

dha commented 9 years ago

I haven't really looked at the grammar and action features of Perl 6 so far, so the only problem I see with your implementation is that you actually provide a way of accessing the value of the accumulator. :-) Otherwise, looks like it would be a valuable addition. When I get a chance, I'll learn some more about grammars and actions and look at it again.

Thanks!

MattOates commented 9 years ago

Updated the example for you, to get a handle on grammars and actions this advent blog post might be helpful https://perl6advent.wordpress.com/2009/12/21/day-21-grammars-and-actions/

dha commented 9 years ago

Thanks!