FAQ
Hi,

I have seen that wayland76 was playing with an XML Grammar on #perl6, so
I think that it was maybe the time to send what I already have done.

Maybe it should be a perl6.user posting, but as there is actualy no
working xml library available for perl 6 and it is a good test for how
it feel to write a grammar with the actual specification, I post it
here.

I simply started with the pseudo XML grammar from Moritz on his blog and
found myself reading the whole XML specification. I am definitively not
a XML specialist and have no experience with sax or libxml and simply
wanted to learn more about the perl 6 grammar syntax and features to be
able to anderstand STD.pm.

It's only a grammar for now without actions because a ran out of tuits.
It is using only tokens and no rules because at the time the overriding
of <ws> was not working properly.

But hey, it (mostly) works and is a good examle of what you can do today
with a perl 6 :)

Feel free to propose better way to do it :)

Search Discussions

  • Timothy S. Nelson at Aug 3, 2009 at 1:01 am

    On Fri, 31 Jul 2009, Raphael Descamps wrote:

    Hi,

    I have seen that wayland76 was playing with an XML Grammar on #perl6, so
    I think that it was maybe the time to send what I already have done.
    Raphael: I don't say any of this to discourage you, but to present
    alternatives to the list.

    Everyone: Just to note that, while I did essentially the same thing
    (starting with moritz's work, and going from there), When Krunen's grammar was
    pointed out to me, I used that instead:

    http://github.com/krunen/xml/tree/master

    However, Krunen's grammar has two bugs and no actions. One bug was an
    extraneous colon, and the other was something to do with comments, and was
    mentioned on #perl6, but I've forgotten it.

    However, my main reason for modifying it was that I needed actions for
    what I'm doing. So I'll keep working on that.

    The stuff I've done is here:

    http://github.com/wayland/Tree/tree/master

    :)


    ---------------------------------------------------------------------
    Name: Tim Nelson | Because the Creator is, |
    E-mail: wayland@wayland.id.au | I am |
    ---------------------------------------------------------------------

    ----BEGIN GEEK CODE BLOCK----
    Version 3.12
    GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V-
    PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI++++ D G+ e++>++++ h! y-
    -----END GEEK CODE BLOCK-----
  • Daniel Ruoso at Aug 4, 2009 at 7:35 pm

    Em Seg, 2009-08-03 às 11:04 +1000, Timothy S. Nelson escreveu:
    However, my main reason for modifying it was that I needed actions for
    what I'm doing. So I'll keep working on that.
    http://gist.github.com/161467

    just to tease :) -- this making the grammar closer to the XML spec...

    daniel
  • François Perrad at Aug 4, 2009 at 9:12 pm

    2009/8/3 Timothy S. Nelson <wayland@wayland.id.au>:
    On Fri, 31 Jul 2009, Raphael Descamps wrote:

    Hi,

    I have seen that wayland76 was playing with an XML Grammar on #perl6, so
    I think that it was maybe the time to send what I already have done.
    Raphael: I don't say any of this to discourage you, but to present
    alternatives to the list.

    Everyone: Just to note that, while I did essentially the same thing
    (starting with moritz's work, and going from there), When Krunen's grammar
    was pointed out to me, I used that instead:

    http://github.com/krunen/xml/tree/master

    However, Krunen's grammar has two bugs and no actions.  One bug was
    an extraneous colon, and the other was something to do with comments, and
    was mentioned on #perl6, but I've forgotten it.

    However, my main reason for modifying it was that I needed actions
    for what I'm doing.  So I'll keep working on that.

    The stuff I've done is here:

    http://github.com/wayland/Tree/tree/master

    :)
    Another version is at http://github.com/fperrad/xml/
    It's a pure Parrot implementation.
    The XML grammar (close to W3C REC) is written with PCT, ie. with Perl6 syntax

    François

    ---------------------------------------------------------------------
    Name: Tim Nelson                 | Because the Creator is,        |
    E-mail: wayland@wayland.id.au    | I am                           |
    ---------------------------------------------------------------------

    ----BEGIN GEEK CODE BLOCK----
    Version 3.12
    GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V- PE(+) Y+>++ PGP->+++
    R(+) !tv b++ DI++++ D G+ e++>++++ h! y-
    -----END GEEK CODE BLOCK-----

  • Raphael Descamps at Aug 6, 2009 at 2:10 pm

    Am Montag, den 03.08.2009, 11:04 +1000 schrieb Timothy S. Nelson:
    On Fri, 31 Jul 2009, Raphael Descamps wrote:

    Hi,

    I have seen that wayland76 was playing with an XML Grammar on #perl6, so
    I think that it was maybe the time to send what I already have done.
    Raphael: I don't say any of this to discourage you,
    Don't worry, you don't :)
    I'm happy to see that there is already different implementations
    available. In fact it's not surprising because the most blokers bugs and
    missing features of PGE have been solved.
    but to present
    alternatives to the list.
    I knew that Francois was working on it, but last time that I checked it,
    nothing was released.
    So thanks for the pointers, I will have a look at the different
    implementations.

    Raphael
  • Raphael Descamps at Aug 7, 2009 at 10:46 pm
    Hi,

    In the last few months, I tried to anderstand better Roles aka statefull
    traits, so I read differents traits papers about it. From the same
    research group, I also read about classboxes and found the concept
    interresting, particulary when combined with traits (roles).

    Please note that I am not a computer science guy, so I anderstand more
    or less the concepts but not the mathematical formal description.

    I tried to read the Synopse S11 and how modules will be working in Perl
    6: to be honest I still not really anderstand it :)

    As Perl 6 will be supporting multiple versions installed of the same
    module and also support import with lexical scoping, I was asking myself
    if it was possible to combine some of the interresting properties of
    classboxes like local rebinding, flattening property and the idea that
    import takes precedence over inheritance.

    I am absolutly not sure if it fit to the Perl 6 module concept as a
    whole, but I will be happy to read your comments and what you think
    about it.

    A few pointers:

    classboxes+traits introduction:
    http://scg.unibe.ch/archive/papers/Berg05dTraitsClassbox.pdf

    For an in depth description, you can also read the Ph.D. thesis:
    http://scg.unibe.ch/archive/phd/bergel-phd.pdf

    To develop the classbox concept, the autors also introduced a module
    calculus, which also help to describe the difference existing beetween
    different modules systems: (such a module calculus can also help to
    better anderstand the interaction beetween different languages):
    http://scg.unibe.ch/archive/papers/Berg05cModuleDiversity.pdf

    I will be on Holiday for the next 3 weeks and will probably be offline
    most of the time, so don't take a no reply for indifference. I know that
    it's not a good idea to propose something like that and disappear
    immediatly, but a saw that S11 was on a heavily rework phase and that it
    is now or never to open my mouth :)

    Raphael.
  • Raphael Descamps at Aug 7, 2009 at 11:13 pm

    I tried to read the Synopse S11 and how modules will be working in Perl
    6: to be honest I still not really anderstand it :)
    What may help me is to know where Perl 6 modules are to be placed in the
    module taxonomy used in the module calculus paper below.
    To develop the classbox concept, the autors also introduced a module
    calculus, which also help to describe the difference existing beetween
    different modules systems: (such a module calculus can also help to
    better anderstand the interaction beetween different languages):
    http://scg.unibe.ch/archive/papers/Berg05cModuleDiversity.pdf
    Raphael.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl6-language @
categoriesperl
postedJul 31, '09 at 6:33p
activeAug 7, '09 at 11:13p
posts7
users4
websiteperl6.org

People

Translate

site design / logo © 2021 Grokbase