PettitParser and Python
Hello guys I am learning PettitParser , I dowloaded the video tutorials of Tudor Girba (very good tutorial Tudor , well done ) and other documentation and I was wondering if a parser for Python already exists . I hope I am not asking something obvious. For my project I want to parse python types , that will be given to me as strings , to pharo objects. So that means parsing lists, dictionaries and other usual candidates. For example a python list is like '[1, 3, 50, [45, 'hello', 0.2], 63]' etc Anyone already worked on such problem ?
Hi, The challenge with Python parsing is dealing with whitespace properly. Jan Kurs was working on such a parser. I do not know how advanced it is. Jan? Cheers, Doru On Fri, Jan 9, 2015 at 7:30 PM, kilon alios <kilon.alios@gmail.com> wrote:
Hello guys I am learning PettitParser , I dowloaded the video tutorials of Tudor Girba (very good tutorial Tudor , well done ) and other documentation and I was wondering if a parser for Python already exists . I hope I am not asking something obvious.
For my project I want to parse python types , that will be given to me as strings , to pharo objects. So that means parsing lists, dictionaries and other usual candidates. For example a python list is like
'[1, 3, 50, [45, 'hello', 0.2], 63]'
etc
Anyone already worked on such problem ?
-- www.tudorgirba.com "Every thing has its own flow"
there is also the python.ast model which gives the ability to parse the python syntax ( I can use this model because of my communication bridge with python) which I can use but if there is something already done with petitparser I would love to take a look too. The documentation of module is in this link together with the structure of the python syntax https://docs.python.org/2/library/ast.html For now only python types concern me but I will need more as time passes. On Sat, Jan 10, 2015 at 8:32 PM, Tudor Girba <tudor@tudorgirba.com> wrote:
Hi,
The challenge with Python parsing is dealing with whitespace properly.
Jan Kurs was working on such a parser. I do not know how advanced it is. Jan?
Cheers, Doru
On Fri, Jan 9, 2015 at 7:30 PM, kilon alios <kilon.alios@gmail.com> wrote:
Hello guys I am learning PettitParser , I dowloaded the video tutorials of Tudor Girba (very good tutorial Tudor , well done ) and other documentation and I was wondering if a parser for Python already exists . I hope I am not asking something obvious.
For my project I want to parse python types , that will be given to me as strings , to pharo objects. So that means parsing lists, dictionaries and other usual candidates. For example a python list is like
'[1, 3, 50, [45, 'hello', 0.2], 63]'
etc
Anyone already worked on such problem ?
-- www.tudorgirba.com
"Every thing has its own flow"
On 10 January 2015 at 18:32, Tudor Girba <tudor@tudorgirba.com> wrote:
Hi,
The challenge with Python parsing is dealing with whitespace properly.
Jan Kurs was working on such a parser. I do not know how advanced it is. Jan?
Maybe one can take inspiration from http://www.cs.nott.ac.uk/~gmh/monparsing.pdf (see section 8) for handling the offside rule? PetitParser is, after all, a parser combinator library. frank
Cheers, Doru
On Fri, Jan 9, 2015 at 7:30 PM, kilon alios <kilon.alios@gmail.com> wrote:
Hello guys I am learning PettitParser , I dowloaded the video tutorials of Tudor Girba (very good tutorial Tudor , well done ) and other documentation and I was wondering if a parser for Python already exists . I hope I am not asking something obvious.
For my project I want to parse python types , that will be given to me as strings , to pharo objects. So that means parsing lists, dictionaries and other usual candidates. For example a python list is like
'[1, 3, 50, [45, 'hello', 0.2], 63]'
etc
Anyone already worked on such problem ?
-- www.tudorgirba.com
"Every thing has its own flow"
Thierry goubier nicely helped us with a Parser (just parsing) python code with Smacc. I do not remember where we put the code. Stef Le 9/1/15 19:30, kilon alios a écrit :
Hello guys I am learning PettitParser , I dowloaded the video tutorials of Tudor Girba (very good tutorial Tudor , well done ) and other documentation and I was wondering if a parser for Python already exists . I hope I am not asking something obvious.
For my project I want to parse python types , that will be given to me as strings , to pharo objects. So that means parsing lists, dictionaries and other usual candidates. For example a python list is like
'[1, 3, 50, [45, 'hello', 0.2], 63]'
etc
Anyone already worked on such problem ?
Hi Kilon, Stef, the SmaCC python parser is in the SmaCC repository on github. It should be loaded if you use the development version of SmaCC. Thanks to past work on Python (and Damien and Jean-Baptiste help), there is a lot of python code samples to test it ;) But, as far as I know, the AST building code may not be complete. Thierry 2015-01-11 12:25 GMT+01:00 stepharo <stepharo@free.fr>:
Thierry goubier nicely helped us with a Parser (just parsing) python code with Smacc. I do not remember where we put the code.
Stef
Le 9/1/15 19:30, kilon alios a écrit :
Hello guys I am learning PettitParser , I dowloaded the video tutorials of Tudor Girba (very good tutorial Tudor , well done ) and other documentation and I was wondering if a parser for Python already exists . I hope I am not asking something obvious.
For my project I want to parse python types , that will be given to me as strings , to pharo objects. So that means parsing lists, dictionaries and other usual candidates. For example a python list is like
'[1, 3, 50, [45, 'hello', 0.2], 63]'
etc
Anyone already worked on such problem ?
Thank you I have taken a look at SmaCC looks very interesting I also found some documentation for it via the link in github so I will study it now and be back with any further question :) Its ok if the support is partial , something is always much better than nothing ;) On Sun, Jan 11, 2015 at 6:17 PM, Thierry Goubier <thierry.goubier@gmail.com> wrote:
Hi Kilon, Stef,
the SmaCC python parser is in the SmaCC repository on github.
It should be loaded if you use the development version of SmaCC. Thanks to past work on Python (and Damien and Jean-Baptiste help), there is a lot of python code samples to test it ;) But, as far as I know, the AST building code may not be complete.
Thierry
2015-01-11 12:25 GMT+01:00 stepharo <stepharo@free.fr>:
Thierry goubier nicely helped us with a Parser (just parsing) python code with Smacc. I do not remember where we put the code.
Stef
Le 9/1/15 19:30, kilon alios a écrit :
Hello guys I am learning PettitParser , I dowloaded the video tutorials of Tudor Girba (very good tutorial Tudor , well done ) and other documentation and I was wondering if a parser for Python already exists . I hope I am not asking something obvious.
For my project I want to parse python types , that will be given to me as strings , to pharo objects. So that means parsing lists, dictionaries and other usual candidates. For example a python list is like
'[1, 3, 50, [45, 'hello', 0.2], 63]'
etc
Anyone already worked on such problem ?
2015-01-11 18:42 GMT+01:00 kilon alios <kilon.alios@gmail.com>:
Thank you I have taken a look at SmaCC looks very interesting I also found some documentation for it via the link in github so I will study it now and be back with any further question :)
Please do :)
Its ok if the support is partial , something is always much better than nothing ;)
Well, I'd say the base is good; good enough that I'd use it professionally for a project... Except that I don't have such a project at the moment (no funding and too much to do on the ones which are paying), so this is why it is in that "partial" state. Thierry
On Sun, Jan 11, 2015 at 6:17 PM, Thierry Goubier < thierry.goubier@gmail.com> wrote:
Hi Kilon, Stef,
the SmaCC python parser is in the SmaCC repository on github.
It should be loaded if you use the development version of SmaCC. Thanks to past work on Python (and Damien and Jean-Baptiste help), there is a lot of python code samples to test it ;) But, as far as I know, the AST building code may not be complete.
Thierry
2015-01-11 12:25 GMT+01:00 stepharo <stepharo@free.fr>:
Thierry goubier nicely helped us with a Parser (just parsing) python code with Smacc. I do not remember where we put the code.
Stef
Le 9/1/15 19:30, kilon alios a écrit :
Hello guys I am learning PettitParser , I dowloaded the video tutorials of Tudor Girba (very good tutorial Tudor , well done ) and other documentation and I was wondering if a parser for Python already exists . I hope I am not asking something obvious.
For my project I want to parse python types , that will be given to me as strings , to pharo objects. So that means parsing lists, dictionaries and other usual candidates. For example a python list is like
'[1, 3, 50, [45, 'hello', 0.2], 63]'
etc
Anyone already worked on such problem ?
participants (5)
-
Frank Shearar -
kilon alios -
stepharo -
Thierry Goubier -
Tudor Girba