Re: xml as intermediate representation

Jeff Kenton <jeffrey.kenton@comcast.net>
22 Sep 2005 23:47:38 -0400

          From comp.compilers

Related articles
xml as intermediate representation khurana.tanuj@gmail.com (tanuj) (2005-09-17)
Re: xml as intermediate representation Juergen.Kahrs@vr-web.de (=?ISO-8859-1?Q?J=FCrgen_Kahrs?=) (2005-09-17)
Re: xml as intermediate representation jeffrey.kenton@comcast.net (Jeff Kenton) (2005-09-22)
Re: xml as intermediate representation touati@prism.uvsq.fr (TOUATI Sid) (2005-09-22)
Re: xml as intermediate representation kers@hpl.hp.com (Chris Dollin) (2005-09-23)
Re: xml as intermediate representation vidar.hokstad@gmail.com (Vidar Hokstad) (2005-09-23)
Re: xml as intermediate representation demakov@ispras.ru (Alexey Demakov) (2005-09-27)
Re: xml as intermediate representation vidar.hokstad@gmail.com (Vidar Hokstad) (2005-09-27)
Re: xml as intermediate representation touati@prism.uvsq.fr (TOUATI Sid) (2005-09-30)
| List of all articles for this month |

From: Jeff Kenton <jeffrey.kenton@comcast.net>
Newsgroups: comp.compilers
Date: 22 Sep 2005 23:47:38 -0400
Organization: Compilers Central
References: 05-09-078
Keywords: practice
Posted-Date: 22 Sep 2005 23:47:38 EDT

tanuj wrote:
> I am writing a compiler as a part of my course project and wanted to
> use xml as an intermediate representation language. All the coding is
> being done in C.


Why use XML? The only value I can see is that it's easy to eyeball
your IR, and you could get that by writing a routine to dump the IR in
some convenient format (which you should have anyway).


But the drawbacks to using XML far outweigh the minor convenience.
First, it's too verbose for anything but toy programs. Second, if you
are planning to manipulate it in C, you're going to need a
corresponding C representation for it internally.


I would guess you chose XML because you want to play with XML. That
suggests that you really want two projects: a compiler project, which
you should do with appropriate tools, and an XML project that's
completely separate.


jeff


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.