Re: [Pharo-users] what to use for simple parsing

2015-04-02 Thread p...@highoctane.be
Sure works. Regex '((XXX Logical Channel) ([0-9])) on (((Upstream)|(Downstream)) ([0-9])) on ((chassis) ([0-9])), ((slot) ([0-9])), ((mac) ([0-9]))' asRegex But in PP, things were more comple and there were a lot of them, so: line ^ temperatureStatusDescrEntry token asParser /

Re: [Pharo-users] what to use for simple parsing

2015-04-02 Thread p...@highoctane.be
On Thu, Apr 2, 2015 at 9:45 AM, kilon alios kilon.al...@gmail.com wrote: depends on your needs. I never used regex before , pharo regex was my first. I used on a specific case that was quite simple. I love its simplicity and its extremely compact syntax. Perfect fit for my needs, one very

Re: [Pharo-users] what to use for simple parsing

2015-04-02 Thread kilon alios
depends on your needs. I never used regex before , pharo regex was my first. I used on a specific case that was quite simple. I love its simplicity and its extremely compact syntax. Perfect fit for my needs, one very happy customer :) I think it depends on complexity of the parsing and how you

Re: [Pharo-users] what to use for simple parsing

2015-04-02 Thread kilon alios
I used Regex at first to do the job but it turned into an unholy mess (not that it couldn't parse what I needed) and PetitParser was there. it really depends how you approach this. For example in my case I quickly found out that would be insane to put everything in a single string, so I broke

Re: [Pharo-users] what to use for simple parsing

2015-04-02 Thread Damien Pollet
On 31 March 2015 at 17:17, Peter Uhnák i.uh...@gmail.com wrote: So at least to me PetitParser feels like a more practical regex library than Regex itself. In which use-cases is Regex less practical? I'm thinking it could get a builder with a PetitParser-like API in addition to the current

Re: [Pharo-users] what to use for simple parsing

2015-04-02 Thread Thierry Goubier
2015-04-02 11:49 GMT+02:00 p...@highoctane.be p...@highoctane.be: Sure works. Regex '((XXX Logical Channel) ([0-9])) on (((Upstream)|(Downstream)) ([0-9])) on ((chassis) ([0-9])), ((slot) ([0-9])), ((mac) ([0-9]))' asRegex But in PP, things were more comple and there were a lot of them,

Re: [Pharo-users] what to use for simple parsing

2015-04-02 Thread kilon alios
yeap you use what makes your life easier ;) On Thu, Apr 2, 2015 at 12:49 PM, p...@highoctane.be p...@highoctane.be wrote: Sure works. Regex '((XXX Logical Channel) ([0-9])) on (((Upstream)|(Downstream)) ([0-9])) on ((chassis) ([0-9])), ((slot) ([0-9])), ((mac) ([0-9]))' asRegex But in

Re: [Pharo-users] what to use for simple parsing

2015-04-01 Thread Martin Bähr
Excerpts from stepharo's message of 2015-04-01 23:00:11 +0200: May be this was a mistake to get regexp. Some people, when confronted with a problem, think I know, I'll use regular expressions. Now they have two problems. (jwz)

Re: [Pharo-users] what to use for simple parsing

2015-04-01 Thread stepharo
Le 31/3/15 17:17, Peter Uhnák a écrit : Thanks all, in the end I've used PetitParser and I was really surprised and happy how easy and far I've got with it. TBH using regular expressions in Pharo feels extremely uncomfortable to me compared to Perl or Ruby, but maybe that was design

Re: [Pharo-users] what to use for simple parsing

2015-03-31 Thread Peter Uhnák
Thanks all, in the end I've used PetitParser and I was really surprised and happy how easy and far I've got with it. TBH using regular expressions in Pharo feels extremely uncomfortable to me compared to Perl or Ruby, but maybe that was design decision by the author to not be too hacky. So at

Re: [Pharo-users] what to use for simple parsing

2015-03-31 Thread Damien Cassou
Peter Uhnák i.uh...@gmail.com writes: Hi, I would like to parse text like - id(param1, param2, ... paramX) id - id id - id - id is alphanumeric string, param is any string optionally enclosed in quotes (so both quoted and unquoted string is needed) I would start with streams

Re: [Pharo-users] what to use for simple parsing

2015-03-31 Thread Tudor Girba
Not to mention that you can also read it :) Doru On Tue, Mar 31, 2015 at 5:17 PM, Peter Uhnák i.uh...@gmail.com wrote: Thanks all, in the end I've used PetitParser and I was really surprised and happy how easy and far I've got with it. TBH using regular expressions in Pharo feels

Re: [Pharo-users] what to use for simple parsing

2015-03-28 Thread Martin Bähr
Excerpts from Thierry Goubier's message of 2015-03-28 08:46:46 +0100: I can answer for SmaCC. It would do the job, be very simple and fairly fast with a trick or two to handle the param unquoted string. could someone provide (or link to) a comparison between the major parsers? why are there

Re: [Pharo-users] what to use for simple parsing

2015-03-28 Thread kilon alios
PettitParser provides a more Pharo orientated syntax. SmaCC uses syntax very similar to regex. SmaCC comes with a lot of parser for programming languages. I chose SmaCC because a) the syntax is very compact and it allows me a bird's eye view over the overall syntax definition, but also more

[Pharo-users] what to use for simple parsing

2015-03-27 Thread Peter Uhnák
Hi, I would like to parse text like - id(param1, param2, ... paramX) id - id id - id - id is alphanumeric string, param is any string optionally enclosed in quotes (so both quoted and unquoted string is needed) I saw that there are many tools for parsing but since I have no experience in