[Ometa] XML parser

Marcus Westin narcvs at gmail.com
Fri Aug 13 15:53:14 PDT 2010


Here's an implementation of XML parsing in ometa I was using a while back
for Fun:

http://github.com/marcuswestin/fun/blob/7bf60d3133274b02287b956ac6030351bc0=
0e729/parsers/xml.ometa

On Fri, Aug 13, 2010 at 5:19 PM, R=FCdiger Plantiko <
ruediger.plantiko at astrotexte.ch> wrote:

> Hi Alexandros,
>
> > URI/XML/HTTP thought I'd ask if anyone is aware of OMeta parser efforts
> in these areas,
>
> I also found an XML parser an interesting object for learning OMeta. See
> my work in progress under
>
> http://ruediger-plantiko.net/ometa
>
> Enter a string to be parsed in the left text field below the grammar, and
> hit "Interpretieren (ctrl+2)". You will get a kind of boolean reply -
> either you get the error message "match failed" in the message line on top
> of the grammar. Or you will get the reply "[Object object]" and no error -
> this is the case that the string matched the given rule. The result object
> is a structured JSon object that could be processed further. (If you want
> to see it live, you can inspect it in the debugger by placing a breakpoint
> on line 98 in myOmeta.js).
>
> For example, the string
>
> <?xml version=3D"1.0"?>
> <a b=3D"c"><d>e</d>f<g h=3D"i"/></a>
>
> would be parsed with the rule "document" to a JSon object of the form
>
> { name:"a",
>  atts:{b:"c",_length:1},
>  content:[
>    { name:"d",
>      atts:{_length:0},
>      content:["e"]
>      },
>    "f",
>    { name:"g",
>      atts:{h:"i",_length:1},
>      content:[]
>      }
>  }
>
> I think you get the idea... :-)
>
> And please don't sell it in the web, it's still work in progress :-)
>
> Kind regards,
> R=FCdiger
>
>
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~
> Dr. R=FCdiger Plantiko
> Bachwiesenstrasse 28
> CH-8405 Winterthur-Seen
>
> http://ruediger-plantiko.net
>
>
>
>
>
> _______________________________________________
> OMeta mailing list
> OMeta at vpri.org
> http://vpri.org/mailman/listinfo/ometa
>



-- =

My code http://github.com/marcuswestin
My latest http://twitter.com/marcuswestin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://vpri.org/pipermail/ometa/attachments/20100813/784aaa90/attachme=
nt.htm


More information about the OMeta mailing list