OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: Convertor wanted: C struct to XML schema

[ Lists Home | Date Index | Thread Index ]
  • From: "Joshua E. Smith" <jesmith@kaon.com>
  • To: Tan Yiping <tanyp@mail.conuco.cn.net>, xml-dev@ic.ac.uk
  • Date: Tue, 27 Jul 1999 09:51:52 -0400

I'm not aware of a tool like that, but if you want to write your own, I'd
offer this advice:

1) If the C structs don't exist yet, then write the structs in a simple
language of your own construction, then use Perl to spew forth *both* the C
structs and the XML Schema (and output Java, C++, and XML DTD while you're
at it! ;).  Or, if you can be sufficiently clear in the XML Schema, write
your structs in XML Schema, and spew forth C structs right from that.

2) If the C structs do already exist, you're going to have to parse them.
I had to do that once, and I ended up grabbing a public-domain C lint-like
program called "check" (I can probably figure out where it came from, but
it'll take some looking), munging it up to tolerate ANSI, and then adding
my own code to spew out the output I needed.  The BNF for just parsing
structs isn't very complicated, but in my case, the structs lived in C
header files with prototypes and lots of other stuff which the parser was
going to have to understand to get the stuff it needed.

Hope that helps.


-Joshua Smith


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS