9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] OT: DTD to yacc spec?
@ 2004-02-19 17:47 Laura Creighton
  2004-02-19 18:25 ` kazumi iwane
  0 siblings, 1 reply; 8+ messages in thread
From: Laura Creighton @ 2004-02-19 17:47 UTC (permalink / raw)
  To: kiwane; +Cc: 9fans, lac

I know somebody who used pyRXP to do this.
http://www.reportlab.org/pyrxp.html

Unfortunately, I cannot remember who it was, but I can ask my
buddies at reportlab if it is of interest ....

Laura Creighton


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] OT: DTD to yacc spec?
  2004-02-19 17:47 [9fans] OT: DTD to yacc spec? Laura Creighton
@ 2004-02-19 18:25 ` kazumi iwane
  0 siblings, 0 replies; 8+ messages in thread
From: kazumi iwane @ 2004-02-19 18:25 UTC (permalink / raw)
  To: 9fans; +Cc: Laura Creighton

> I know somebody who used pyRXP to do this.
> http://www.reportlab.org/pyrxp.html

I regret that I don't speak python (yet!). Thank you anyway.

-- kazumi



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] OT: DTD to yacc spec?
  2004-02-19 16:31 kazumi iwane
  2004-02-19 17:08 ` plan9
@ 2004-02-20  2:44 ` boyd, rounin
  1 sibling, 0 replies; 8+ messages in thread
From: boyd, rounin @ 2004-02-20  2:44 UTC (permalink / raw)
  To: 9fans

> I've looked at several xml parsers and I found them all to
> be too general. They want to be all-encompassing parsers
> for any DTDs that are thrown at them.

oxymoron.

there are better ways.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] OT: DTD to yacc spec?
  2004-02-19 17:19   ` David Tolpin
@ 2004-02-19 18:23     ` kazumi iwane
  0 siblings, 0 replies; 8+ messages in thread
From: kazumi iwane @ 2004-02-19 18:23 UTC (permalink / raw)
  To: 9fans; +Cc: David Tolpin

> One of many tools in C which match your description is at
> http://flexml.sourceforge.net/ . There are also many others around.

Thank you for the info. FleXML seems most close to what I had in
mind. I will look into it. Why they had to use XML for action
definitions,
I don't know.

-- kazumi



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] OT: DTD to yacc spec?
  2004-02-19 17:08 ` plan9
  2004-02-19 17:19   ` David Tolpin
@ 2004-02-19 18:20   ` kazumi iwane
  1 sibling, 0 replies; 8+ messages in thread
From: kazumi iwane @ 2004-02-19 18:20 UTC (permalink / raw)
  To: 9fans; +Cc: plan9

> I guess this kind of thing is just a fallout from discussions that end
> up in "we have all these homegrown file formats for configuration,
> user preferences, application private data, ..., and it must be so
> much hassle keeping all of that coded up nicely; we need to clean this
> up pronto, and the only recognised way of doing it is by using XML;
> our life will become so much simpler, as there are so many tools out
> there to help with this." Sniff.

Sounds very familiar. We use XML only because everybody else
does. This silly reasoning hardly justifies the cost of dealing with
complexity forced upon us by XML parsers.

-- kazumi



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] OT: DTD to yacc spec?
  2004-02-19 17:08 ` plan9
@ 2004-02-19 17:19   ` David Tolpin
  2004-02-19 18:23     ` kazumi iwane
  2004-02-19 18:20   ` kazumi iwane
  1 sibling, 1 reply; 8+ messages in thread
From: David Tolpin @ 2004-02-19 17:19 UTC (permalink / raw)
  To: 9fans

> >
> > I guess I am looking for a tool that can convert a DTD into
> > a good old yacc grammar spec (I would still need to provide
> > actions, though). Does anybody know of such a tool?
>
> Oh, how great it is to know that I'm not alone.  Ever since I have
> been exposed to XML and its parsers have I wondered about their
> weirdness.  They never looked like parsers to me, more like toolkits
> to help write a generic XML editor or display system.
>
> I would absolutely love to have a parser generator that takes a DTD or
> schema and produces a parser to read XML only for that one definition.
> All I have encountered so far are "validating" parsers that seem to
> make XML file interchange even harder, as the DTD or schema has to be
> provided from the outside.

An XML parser is like lex(1), it performs tokenization on the level
of XML. When you want a grammar-driven processing of an XML file,
you can convert DTD to a yacc grammar with awk and use an XML parser
to implement yylex.

Additionally a number of tools exists to generate code from schemata,
such as RelaxNGCC (http://relaxngcc.sourceforge.net/). Since Relaxб═NG
can be generated from DTD by Trang,
http://thaiopensource.com/relaxng/trang.html , it solves your problem.

One of many tools in C which match your description is at
http://flexml.sourceforge.net/ . There are also many others around.

David Tolpin
http://davidashen.net/


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [9fans] OT: DTD to yacc spec?
  2004-02-19 16:31 kazumi iwane
@ 2004-02-19 17:08 ` plan9
  2004-02-19 17:19   ` David Tolpin
  2004-02-19 18:20   ` kazumi iwane
  2004-02-20  2:44 ` boyd, rounin
  1 sibling, 2 replies; 8+ messages in thread
From: plan9 @ 2004-02-19 17:08 UTC (permalink / raw)
  To: 9fans

Apologies for keeping the off trackness.

kazumi writes:
> I've looked at several xml parsers and I found them all to
> be too general. They want to be all-encompassing parsers
> for any DTDs that are thrown at them.
>
> In my area of applications, however, systems exchange
> XML files conforming to a particular DTD; once the DTD
> is agreed upon, we need no generality. Instead we need
> speed and space efficiency.
>
> I guess I am looking for a tool that can convert a DTD into
> a good old yacc grammar spec (I would still need to provide
> actions, though). Does anybody know of such a tool?

Oh, how great it is to know that I'm not alone.  Ever since I have
been exposed to XML and its parsers have I wondered about their
weirdness.  They never looked like parsers to me, more like toolkits
to help write a generic XML editor or display system.

I would absolutely love to have a parser generator that takes a DTD or
schema and produces a parser to read XML only for that one definition.
All I have encountered so far are "validating" parsers that seem to
make XML file interchange even harder, as the DTD or schema has to be
provided from the outside.

I guess this kind of thing is just a fallout from discussions that end
up in "we have all these homegrown file formats for configuration,
user preferences, application private data, ..., and it must be so
much hassle keeping all of that coded up nicely; we need to clean this
up pronto, and the only recognised way of doing it is by using XML;
our life will become so much simpler, as there are so many tools out
there to help with this." Sniff.

Robby



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [9fans] OT: DTD to yacc spec?
@ 2004-02-19 16:31 kazumi iwane
  2004-02-19 17:08 ` plan9
  2004-02-20  2:44 ` boyd, rounin
  0 siblings, 2 replies; 8+ messages in thread
From: kazumi iwane @ 2004-02-19 16:31 UTC (permalink / raw)
  To: 9fans

I've looked at several xml parsers and I found them all to
be too general. They want to be all-encompassing parsers
for any DTDs that are thrown at them.

In my area of applications, however, systems exchange
XML files conforming to a particular DTD; once the DTD
is agreed upon, we need no generality. Instead we need
speed and space efficiency.

I guess I am looking for a tool that can convert a DTD into
a good old yacc grammar spec (I would still need to provide
actions, though). Does anybody know of such a tool?

-- kazumi



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-02-20  2:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-19 17:47 [9fans] OT: DTD to yacc spec? Laura Creighton
2004-02-19 18:25 ` kazumi iwane
  -- strict thread matches above, loose matches on Subject: below --
2004-02-19 16:31 kazumi iwane
2004-02-19 17:08 ` plan9
2004-02-19 17:19   ` David Tolpin
2004-02-19 18:23     ` kazumi iwane
2004-02-19 18:20   ` kazumi iwane
2004-02-20  2:44 ` boyd, rounin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).