Re: [Pharo-users] PetitParser question

2019-01-30 Thread Tudor Girba
Great. I am happy you found a solution :) Cheers, Doru > On Jan 30, 2019, at 3:37 PM, Konrad Hinsen wrote: > > Tudor Girba writes: > >> Would this not work: > > It works. And as much as I hate to admit it, my version of yesterday was > very similar except ... that it lacked a set of parenth

Re: [Pharo-users] PetitParser question

2019-01-30 Thread Konrad Hinsen
Tudor Girba writes: > Would this not work: It works. And as much as I hate to admit it, my version of yesterday was very similar except ... that it lacked a set of parentheses :-( > Please note that I used PetitParser2 for this one because it also > addresses the failure message issue you raise

Re: [Pharo-users] PetitParser question

2019-01-29 Thread Tudor Girba
Hi, > On Jan 29, 2019, at 7:04 PM, Konrad Hinsen wrote: > > Tudor Girba writes: > >> But, does it solve your problem? > > Not yet. Not sure it will. Would this not work: p := (#digit asPParser separatedBy: ($+ asPParser / $- asPParser) trim) ==> [:tokens | | result | resu

Re: [Pharo-users] PetitParser question

2019-01-29 Thread Konrad Hinsen
Tudor Girba writes: > But, does it solve your problem? Not yet. Not sure it will. >> More generally, there seems to be a bug in how PetitParser handles >> PPFailure return values. The actually reported error is always different >> from what is passed to PPFailure. I love software ;-) > > What d

Re: [Pharo-users] PetitParser question

2019-01-29 Thread Tudor Girba
Hi, > On Jan 29, 2019, at 6:31 PM, Konrad Hinsen wrote: > > Hi Doru, > > Thanks for pointing out the use case in XML, which gave me an > opportunity to play around with this with almost no > effort. Unfortunately there seems to be a bug in how PPXmlParser > constructs the PPFailure message > (

Re: [Pharo-users] PetitParser question

2019-01-29 Thread Konrad Hinsen
Hi Doru, Thanks for pointing out the use case in XML, which gave me an opportunity to play around with this with almost no effort. Unfortunately there seems to be a bug in how PPXmlParser constructs the PPFailure message (freshly reported: https://github.com/moosetechnology/PetitParser/issues/38).

Re: [Pharo-users] PetitParser question

2019-01-27 Thread Tudor Girba
Hi Konrad, A somewhat similar issue is present in an XML grammar: the closing element must match the opening element. In PPXmlGrammar, you have a condition that matches it and throws a failure otherwise: element "[39] element::= EmptyElemTag | STag content ETag"

Re: [Pharo-users] PetitParser question

2019-01-27 Thread Konrad Hinsen
Dear Tomo, This post might help you. In case of PetitParser2, it's PP2Failure instead of PPFailure. https://stackoverflow.com/questions/15371334/how-can-a-petitparser-parse-rule-signal-an-error That's indeed a possible solution: parse for arbitrary operators, and then add a test for equality

Re: [Pharo-users] PetitParser question

2019-01-26 Thread tomo
Dear Konrad, This post might help you. In case of PetitParser2, it's PP2Failure instead of PPFailure. https://stackoverflow.com/questions/15371334/how-can-a-petitparser-parse-rule-signal-an-error Best Regards, --- tomo -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

[Pharo-users] PetitParser question

2019-01-26 Thread Konrad Hinsen
Dear parsing experts, I have been working on a medium-size parser using the PetitParser framework, which so far has been a very productive environment. But now I have a problem to which I could not find the solution in "Deep into Pharo", nor by searching around in the code. One of my production

Re: [Pharo-users] PetitParser Question

2018-03-06 Thread Asbath via Pharo-users
--- Begin Message --- OK, Thanks, Asbath On 06/03/2018 08:43, Julien wrote: Hello, I think this blogpost is a good place to start: https://www.lukas-renggli.ch/blog/petitparser-1 There is also the chapter about PetitParser in Deep Into Pharo: http://pharobooks.gforge.inria.fr/PharoByExam

Re: [Pharo-users] PetitParser Question

2018-03-05 Thread Julien
Hello, I think this blogpost is a good place to start: https://www.lukas-renggli.ch/blog/petitparser-1 There is also the chapter about PetitParser in Deep Into Pharo: http://pharobooks.gforge.inria.fr/PharoByExampleTwo-Eng/latest/PetitParser.pd

Re: [Pharo-users] PetitParser Question

2018-03-05 Thread Stephane Ducasse
Hi Asbath there is a chapter on Pillar in deep into pharo or the next book. You also have a chapter on the http://themoosebook.org Stef On Mon, Mar 5, 2018 at 7:26 PM, Asbath via Pharo-users wrote: > > > -- Forwarded message -- > From: Asbath > To: pharo-users@lists.pharo.org >

[Pharo-users] PetitParser Question

2018-03-05 Thread Asbath via Pharo-users
--- Begin Message --- Hi everybody, We are a group of students working on Pillar, and we notice that the Parser of Pillar is based on PetitParser Library. Then we want to know more about PetitParser !? Thanks, Asbath --- End Message ---

Re: [Pharo-users] PetitParser question parsing HTML meta tags

2017-04-05 Thread Paul DeBruicker
#x27;description']) > ifTrue: [descriptions addLast: (each attributeAt: > 'content')]]. > > it accepts messy HTML and produces an XML DOM tree from it. > >> Sent: Thursday, March 30, 2017 at 1:58 PM >> From: "PAUL DEBRUICKER"

Re: [Pharo-users] PetitParser question parsing HTML meta tags

2017-04-02 Thread monty
M > From: "PAUL DEBRUICKER" > To: "Any question about pharo is welcome" > Subject: [Pharo-users] PetitParser question parsing HTML meta tags > > This is kind of a "I'm tired of thinking about this and not making much > progress for the amount of tim

Re: [Pharo-users] PetitParser question parsing HTML meta tags

2017-03-31 Thread monty
from it. > Sent: Thursday, March 30, 2017 at 1:58 PM > From: "PAUL DEBRUICKER" > To: "Any question about pharo is welcome" > Subject: [Pharo-users] PetitParser question parsing HTML meta tags > > This is kind of a "I'm tired of thinking about this and

[Pharo-users] PetitParser question parsing HTML meta tags

2017-03-31 Thread Hartmut Krasemann
its easier this way (still in form of a script): parseHtmlPageForDescription: htmlString | parser endParser metaParser descriptionParser contentParser res1Parser res2Parser quoteParser nonQuoteParser | metaParser := ' parser := (metaParser, res1Parser, contentParser, res2Parser, endParse

Re: [Pharo-users] PetitParser question parsing HTML meta tags

2017-03-30 Thread Martin McClure
On 03/30/2017 10:58 AM, PAUL DEBRUICKER wrote: > I can't figure out how to change the startParser parser to accept the second > idiom. And maybe there's a better approach altogether. Anyway. If anyone > has any ideas on different approaches I'd appreciate learning them. This looks like a jo

[Pharo-users] PetitParser question parsing HTML meta tags

2017-03-30 Thread PAUL DEBRUICKER
This is kind of a "I'm tired of thinking about this and not making much progress for the amount of time I'm putting in question" but here it is: I'm trying to parse descriptions from HTML meta elements. I can't use Soup because there isn't a working GemStone port. I've got it to work with

[Pharo-users] PetitParser Question

2015-03-17 Thread James Foster
I’m following the example in the book (http://pharobooks.gforge.inria.fr/PharoByExampleTwo-Eng/latest/PetitParser.pdf , pp. 9-10) with a slight modification. I believe that the example evaluates things that have the