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 attribution of course)?


Steffen Märcker wrote
> However, I moved away from Xtreams own PEG flavor to Bryan Ford's  
> original PEG syntax (close but more common)

Ah, interesting. I didn't realize that Xtreams used a custom PEG syntax. I
wonder why?!


Steffen Märcker wrote
>  From Bryan Ford's original PEG syntax:
> 1. Xtreams Grammer and Actor that build an Xtreams parser
> ...
> All three are available for VW in the Cincom's public repository:
> - Xtreasm-Parsing (8.2-3,stm): +PEG parser +some fixes to Xtreams parser

I'd certainly like to port that at some point, but I'm currently fairly
mystified about the best practice process. I just reached out to Pavel about
the Ring2 approach on which he spoke at ESUG. Do you have a documented
process or any pointers even?


Steffen Märcker wrote
> And 2, 3 for Pharo on GitHub, e.g.
> - https://github.com/kursjan/petitparser2/tree/master/PetitParser2-PEG

Great. I use PP2 a lot. So if IIUC, I can now feed a PEG-syntax grammar
string and have a PP2 parser generated for it?


Steffen Märcker wrote
> Speaking of, I just noticed that translator form Xtreams.PEG to PEG is  
> missing to complete the picture here. ;-)

Ah, yes that makes sense. Any idea how much effort would be involved?


Steffen Märcker wrote
> As far as I know, there is no BNF-like parser generator for Xtreams,  
> available.
> ...
> Is it an option for you to convert your BNF to PEG manually?

I'm not a parsing expert, so that may have been what I'm already doing and
I'm using the wrong terminology. I took the ABNF from rfc5322 [1] and
adapted it slightly [2] to be consumed by Xtreams [3]

[OT?]
As a final aside, I've been wondering if there's any way to generate
"hand-rolled" equivalent parsers from Xtreams, PP, etc. for use cases where
none of the libraries are available. I have in mind Pharo's MailMessage. It
doesn't seem like any full-featured parsing libraries will be integrated any
time soon, so the lowest levels use painful, duplication-riddled hand-rolled
parsers. It would be great to leverage all this great library tech to create
and reason about those...
[/OT]

Thanks for the discussion!

1. https://tools.ietf.org/html/rfc5322
2.
https://github.com/seandenigris/Xtreams-Pharo/blob/master/repository/Xtreams-Email.package/PEGParser.extension/class/grammarEmail.st
3.
https://github.com/seandenigris/Xtreams-Pharo/blob/master/repository/Xtreams-Email.package/PEGParserEmailTest.class/instance/setUp.st



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Reply via email to