Administrator
|
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 |
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: 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 <[hidden email]> wrote: After reading the PetitParser chapter, I'm not clear when one would subclass "Every thing has its own flow"
|
Administrator
|
Thanks! I'm clear on how to use them, just not on why to choose one over the other...
Cheers,
Sean |
In reply to this post by Sean P. DeNigris
On Nov 5, 2013, at 10:11 PM, Sean P. DeNigris <[hidden email]> 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. > |
In reply to this post by Sean P. DeNigris
Hi Sean,
In PetitDelphi, we defined a few convenience methods like plusFor:separatedByToken: that you might find useful. Stephan |
Am 06.11.2013 um 17:32 schrieb Stephan Eggermont <[hidden email]>: > Hi Sean, > > In PetitDelphi, we defined a few convenience methods > like plusFor:separatedByToken: that you might find useful. You may have a look at PParser>>#delimitedBy: Norbert |
In reply to this post by Sean P. DeNigris
Norbert wrote:
>You may have a look at PParser>>#delimitedBy: Thank you. Stephan |
In reply to this post by Sean P. DeNigris
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 |
Administrator
|
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.html
Cheers,
Sean |
On Thu, Nov 7, 2013 at 5:31 PM, Sean P. DeNigris <[hidden email]> 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 |
In reply to this post by Sean P. DeNigris
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 <[hidden email]> wrote: Thanks, that's exactly what I was wondering. That would be a valuable clarification in the book. Is there an issue tracker? |
In reply to this post by Sean P. DeNigris
On Thu, Nov 7, 2013 at 5:31 PM, Sean P. DeNigris <[hidden email]> 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 |
>
>> Thanks, that's exactly what I was wondering. That would be a valuable >> clarification in the book. > > > Book updated. Please buy a new copy :-). $) Stef |
Free forum by Nabble | Edit this page |