Deep Into Pharo: PPExpressionParser

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Deep Into Pharo: PPExpressionParser

Sean P. DeNigris
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
Reply | Threaded
Open this post in threaded view
|

Re: Deep Into Pharo: PPExpressionParser

Tudor Girba-2
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
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.




--

"Every thing has its own flow"
Reply | Threaded
Open this post in threaded view
|

Re: Deep Into Pharo: PPExpressionParser

Sean P. DeNigris
Administrator
Thanks! I'm clear on how to use them, just not on why to choose one over the other...
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Deep Into Pharo: PPExpressionParser

Stéphane Ducasse
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.
>


Reply | Threaded
Open this post in threaded view
|

Re: Deep Into Pharo: PPExpressionParser

Stephan Eggermont-3
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

Reply | Threaded
Open this post in threaded view
|

Re: Deep Into Pharo: PPExpressionParser

NorbertHartl

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



Reply | Threaded
Open this post in threaded view
|

Re: Deep Into Pharo: PPExpressionParser

Stephan Eggermont-3
In reply to this post by Sean P. DeNigris
Norbert wrote:
>You may have a look at PParser>>#delimitedBy:

Thank you.

Stephan

Reply | Threaded
Open this post in threaded view
|

Re: Deep Into Pharo: PPExpressionParser

Damien Cassou
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

Reply | Threaded
Open this post in threaded view
|

Re: Deep Into Pharo: PPExpressionParser

Sean P. DeNigris
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
To unsubscribe from Deep Into Pharo: PPExpressionParser, click here.
NAML
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Deep Into Pharo: PPExpressionParser

Damien Cassou
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

Reply | Threaded
Open this post in threaded view
|

Re: Deep Into Pharo: PPExpressionParser

Stéphane Ducasse
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?


-------- Original message --------
From: "Damien Cassou [via Smalltalk]" <<a href="x-msg://1055/user/SendEmail.jtp?type=node&amp;node=4719909&amp;i=0" target="_top" rel="nofollow" link="external">[hidden email]>
Date: 11/07/2013 7:38 AM (GMT-05:00)
To: "Sean P. DeNigris" <<a href="x-msg://1055/user/SendEmail.jtp?type=node&amp;node=4719909&amp;i=1" target="_top" rel="nofollow" link="external">[hidden email]>
Subject: Re: Deep Into Pharo: PPExpressionParser


On Wed, Nov 6, 2013 at 12:41 PM, Sean P. DeNigris <<a href="x-msg://1055/user/SendEmail.jtp?type=node&amp;node=4719808&amp;i=0" target="_top" rel="nofollow" link="external">[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
To unsubscribe from Deep Into Pharo: PPExpressionParser, <a href="x-msg://1055/" target="_top" rel="nofollow" link="external">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.

Reply | Threaded
Open this post in threaded view
|

Re: Deep Into Pharo: PPExpressionParser

Damien Cassou
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

Reply | Threaded
Open this post in threaded view
|

Re: Deep Into Pharo: PPExpressionParser

Stéphane Ducasse
>
>> 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