Deep Into Pharo: PPExpressionParser
After reading the PetitParser chapter, I'm not clear when one would subclass PPCompositeParser vs. using PPExpressionParser. What are the tradeoffs / use cases? Also, can the book be improved or is that the final version? Thanks. ----- Cheers, Sean -- View this message in context: http://forum.world.st/Deep-Into-Pharo-PPExpressionParser-tp4719454.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
Hi, PPExpressionParser is not meant to be subclassed. Read the class comment to see how to use it. PPCompositeParser is meant to be subclassed and it offers a neat mapping between methods and variables to support caching of parsers. Take a look at the subclasses in the Moose image: http://www.moosetechnology.org/download/5.0 If you are at it, in the Moose image, you also get a dedicated browser (World menu / Moose / PetitParser browser) for manipulating subclasses of PPCompositeParser. Cheers, Doru On Tue, Nov 5, 2013 at 10:11 PM, Sean P. DeNigris <sean@clipperadams.com>wrote:
After reading the PetitParser chapter, I'm not clear when one would subclass PPCompositeParser vs. using PPExpressionParser. What are the tradeoffs / use cases? Also, can the book be improved or is that the final version? Thanks.
----- Cheers, Sean -- View this message in context: http://forum.world.st/Deep-Into-Pharo-PPExpressionParser-tp4719454.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
-- www.tudorgirba.com "Every thing has its own flow"
Thanks! I'm clear on how to use them, just not on why to choose one over the other... ----- Cheers, Sean -- View this message in context: http://forum.world.st/Deep-Into-Pharo-PPExpressionParser-tp4719454p4719556.h... Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
On Wed, Nov 6, 2013 at 12:41 PM, Sean P. DeNigris <sean@clipperadams.com> wrote:
Thanks! I'm clear on how to use them, just not on why to choose one over the other..
I would say you can instantiate a PPExpressionParser if you want to do a small parser for small task. Now, if you have a grammar that's composed of many parsers, I would subclass PPCompositeParser. -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." Winston Churchill
Thanks, that's exactly what I was wondering. That would be a valuable clarification in the book. Is there an issue tracker? -------- Original message -------- From: "Damien Cassou [via Smalltalk]" <ml-node+s1294792n4719808h36@n4.nabble.com> Date: 11/07/2013 7:38 AM (GMT-05:00) To: "Sean P. DeNigris" <sean@clipperadams.com> Subject: Re: Deep Into Pharo: PPExpressionParser On Wed, Nov 6, 2013 at 12:41 PM, Sean P. DeNigris <[hidden email]> wrote:
Thanks! I'm clear on how to use them, just not on why to choose one over the other..
I would say you can instantiate a PPExpressionParser if you want to do a small parser for small task. Now, if you have a grammar that's composed of many parsers, I would subclass PPCompositeParser. -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." Winston Churchill If you reply to this email, your message will be added to the discussion below: http://forum.world.st/Deep-Into-Pharo-PPExpressionParser-tp4719454p4719808.h... To unsubscribe from Deep Into Pharo: PPExpressionParser, click here. NAML ----- Cheers, Sean -- View this message in context: http://forum.world.st/Deep-Into-Pharo-PPExpressionParser-tp4719454p4719909.h... Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
On Thu, Nov 7, 2013 at 5:31 PM, Sean P. DeNigris <sean@clipperadams.com> wrote:
Thanks, that's exactly what I was wondering. That would be a valuable clarification in the book. Is there an issue tracker?
no issue tracker. We encourage people to change the text directly :-D -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." Winston Churchill
sean damien was the main lead behind the chapter so sync with him :) Stef On Nov 7, 2013, at 5:31 PM, Sean P. DeNigris <sean@clipperadams.com> wrote:
Thanks, that's exactly what I was wondering. That would be a valuable clarification in the book. Is there an issue tracker?
-------- Original message -------- From: "Damien Cassou [via Smalltalk]" <[hidden email]> Date: 11/07/2013 7:38 AM (GMT-05:00) To: "Sean P. DeNigris" <[hidden email]> Subject: Re: Deep Into Pharo: PPExpressionParser
On Wed, Nov 6, 2013 at 12:41 PM, Sean P. DeNigris <[hidden email]> wrote:
Thanks! I'm clear on how to use them, just not on why to choose one over the other..
I would say you can instantiate a PPExpressionParser if you want to do a small parser for small task. Now, if you have a grammar that's composed of many parsers, I would subclass PPCompositeParser.
-- Damien Cassou http://damiencassou.seasidehosting.st
"Success is the ability to go from one failure to another without losing enthusiasm." Winston Churchill
If you reply to this email, your message will be added to the discussion below: http://forum.world.st/Deep-Into-Pharo-PPExpressionParser-tp4719454p4719808.h... To unsubscribe from Deep Into Pharo: PPExpressionParser, click here. NAML Cheers, Sean
View this message in context: Re: Deep Into Pharo: PPExpressionParser Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
On Thu, Nov 7, 2013 at 5:31 PM, Sean P. DeNigris <sean@clipperadams.com> wrote:
Thanks, that's exactly what I was wondering. That would be a valuable clarification in the book.
Book updated. Please buy a new copy :-). -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." Winston Churchill
On Nov 5, 2013, at 10:11 PM, Sean P. DeNigris <sean@clipperadams.com> wrote:
After reading the PetitParser chapter, I'm not clear when one would subclass PPCompositeParser vs. using PPExpressionParser. What are the tradeoffs / use cases? Also, can the book be improved or is that the final version? Thanks.
The book is to be improved please help :)
----- Cheers, Sean -- View this message in context: http://forum.world.st/Deep-Into-Pharo-PPExpressionParser-tp4719454.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
participants (4)
-
Damien Cassou -
Sean P. DeNigris -
Stéphane Ducasse -
Tudor Girba