Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2019-12-03 Thread Sean P. DeNigris
Steffen Märcker wrote > I can send you that code. Awesome. I'll email you. Although, I wonder how relevant this is given your answers down below. Are there many grammars available in Xtreams syntax to make this useful? Also, what is the license? Can I add it somewhere on GH under MIT (with attribu

Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2019-12-02 Thread Steffen Märcker
Dear Sean, thanks for bringing this up and for the interesting link [1]. I'll have a look. Meanwhile, I am still on both lists. ;-) Steffen Märcker wrote I wrote a PetitParserGenerator that takes the DSL and builds a PetitParser. I don't know how I could've missed this gem! I hope Steffen

Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2019-12-01 Thread Sean P. DeNigris
I rediscovered this thread while pondering an (existential?!) problem: Why do we keep having to write, and rewrite, and rewrite, ad infinitum, parsers for well known domains like rfc specs? The parser world in many ways feels like a modern post-"Tower of Babel". I was really excited about the rev

Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2018-10-22 Thread Steffen Märcker
Hi, my current shot is to subclass IdentityDictionary with NildentityDictionary. The class checks on indexed access whether the key is nil. If so, storing/retrival uses a singleton Object as key (stored in instance variable NIL := Object new). I needed to override at least: >>at:ifAbsen

Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2018-10-22 Thread James Foster
We will have the same issue porting PP2 to GemStone and look forward to suggestions. > On Oct 22, 2018, at 4:40 AM, Steffen Märcker wrote: > > Hi Jan, > > I am trying to port PP2 to VW and managed to get most of the tests green. =) > Some of the remaining test failures occur in > > PP2Debugg

Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2018-10-22 Thread Steffen Märcker
Hi Jan, I am trying to port PP2 to VW and managed to get most of the tests green. =) Some of the remaining test failures occur in PP2DebuggingStrategy>>cacheIfNeeded:debugResult: where a result of nil is to be stored in an IdentityDictionary. But in VW Dictionaries do not accept nil as a k

Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2018-10-13 Thread Jan Kurš
HI Steffen, Thanks for the report, number pleases me :) Speaking of tool for porting, I was recently showed this one, I don't have any experience with it: https://github.com/ObjectProfile/Pharo2VW Speaking of character ranges, there is currently available: #letter asPParser (to recognize charact

Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2018-10-13 Thread Steffen Märcker
Hi, I gave PetitParser 2 a try and I am pretty impressed by the results, please see the updated table below. =) Again, that's pure parsing and Array-based AST-building. Moving to PP2 was indeed as easy as sending #asPParser and working around character ranges ($a - $z). Is there a preferr

Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2018-10-11 Thread Steffen Märcker
Hi, I tried it some more times and things are different now: - image appeared to lock up (1st) - no network traffic at all (2nd) - image unresponsive, loading successful after 2 minutes (3rd) Call me a fool, but I didn't do anything different. Notably, it succeeded each time in 7.0. =) There i

Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2018-10-11 Thread Jan Kurš
I run PP2 on travis [1], seems Pharo 6.1 loads all configurations, both on linux and mac. Pharo 5, Pharo 6.0 got broken, why is build configuration so hard :'( I don't know, how can I support you. I myself had to gave up on some tools, because I failed to load them. There is no specific reason to

Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2018-10-11 Thread PBKResearch
Kenny -Original Message- From: Pharo-users On Behalf Of Steffen Märcker Sent: 11 October 2018 16:11 To: pharo-users@lists.pharo.org Subject: Re: [Pharo-users] [vwnc] Parsing in Smalltalk I am using MacOS 10.13.6 and the 32bit VM: Pharo 6.0 Latest update: #60546 ... the String in abo

Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2018-10-11 Thread Steffen Märcker
Reading the code of PetitParser, I wonder why PPRepeatingParser initializes 'max' with SmallInteger maxVal instead of some notion of infinity, like Float infinity (and PP2RepeatingNode as well). If I understand the code correctly, PParser>>min: fails if the number of repetitions exceeds Sma

Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2018-10-11 Thread Steffen Märcker
I am using MacOS 10.13.6 and the 32bit VM: Pharo 6.0 Latest update: #60546 ... the String in about is wrong, it should be 6.1. I installed it via the launcher as "Official Distribution: Pharo 6.1 - 32Bit (stable)" I just noticed, that the sources file is missing from vms/private/6521/, too.

Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2018-10-11 Thread Sean P. DeNigris
Steffen Märcker wrote > I did the following: > 1) Download and start Pharo 6.1 stable via the launcher. > 2b) Attempt to install PP2 via the scripts from GitHub: > Metacello new > baseline: 'PetitParser2'; > repository: 'github://kursjan/petitparser2'; > load. >

Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2018-10-11 Thread Steffen Märcker
Can you give more details? IIRC I have PP2 loaded in several 6. I did the following: 1) Download and start Pharo 6.1 stable via the launcher. 2a) Attempt to install PetitParser2 via the CatalogBrowser: "Information There was an error while trying to install PetitParser2. Installatio

Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2018-10-11 Thread Sean P. DeNigris
Steffen Märcker wrote > 1. PP2 does not load into Pharo 6.1 stable. Can you give more details? IIRC I have PP2 loaded in several 6.1 images. - Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2018-10-11 Thread Steffen Märcker
Dear Jan, I just tried to use PP2 but ran into two issues: 1. PP2 does not load into Pharo 6.1 stable. 2. I use #- to create character classes but was not able to find the equivalent in PP2 yet. There should be no fundamental issue with porting PP2 to VW. As far as I know, there is an autom

Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2018-10-05 Thread Jan Kurš
#memoized is one of the most efficient and hardest optimizations. It cannot be done efficiently in an automated way. It depends on input. Best way is to identify repeated invocation of the same parser combinator at the same position for a typical input, pp2 has a tooling support for this, I wrote a

Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2018-10-05 Thread Steffen Märcker
Hi Doru! I assume that you tried the original PetitParser. PetitParser2 offers the possibility to optimize the parser (kind of a compilation), and this provides a significant speedup: https://github.com/kursjan/petitparser2 Would you be interested in trying this out? Yes, I'd like to give

Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2018-10-05 Thread Steffen Märcker
Hi Ben! Thanks for your report Steffen. Nice to see such comparisons even when a bit apples & oranges. Will you be implementing those "additional verification and normalization steps" ? It seems they have an exponential or power impact on times. I certainly will. Meanwhile, I have some more pr

Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2018-10-05 Thread Serge Stinckwich
If you have done a PRISM PP parser, maybe you can contribute it to the PP community. Thank you. On Thu, Oct 4, 2018 at 9:47 PM Steffen Märcker wrote: > I gave Xtreams-Parsing and PetitParser a shot and like to share my > findings.[*] > > The task was to parse the modelling language of the probab

Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2018-10-04 Thread Tudor Girba
Hi, Interesting experiment. Thanks for sharing! I assume that you tried the original PetitParser. PetitParser2 offers the possibility to optimize the parser (kind of a compilation), and this provides a significant speedup: https://github.com/kursjan/petitparser2 Would you be interested in tryi

Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2018-10-04 Thread Ben Coman
Am .10.2018, 20:14 Uhr, schrieb Steffen Märcker : > Dear all, > > I have two questions regarding parsing frameworks. > > 1) Do you have any insights on the performance of SmaCC VS Xtreams > Parsing VS PetitParser? > 2) Has anybody started to port PetitParser 2 from Pharo to VW? Is it > worth the ef

Re: [Pharo-users] [vwnc] Parsing in Smalltalk

2018-10-04 Thread Steffen Märcker
I gave Xtreams-Parsing and PetitParser a shot and like to share my findings.[*] The task was to parse the modelling language of the probabilistic model checker PRISM. I've written a grammer of about 130 definitions in the Xtreams DSL, which is close to Bryan Fords syntax. To avoid doing it