Re: standard intermediate representation for C/C++ ?

macrakis@osf.org (Stavros Macrakis)
Fri, 15 May 1992 17:38:43 GMT

          From comp.compilers

Related articles
[2 earlier articles]
Re: standard intermediate representation for C/C++ ? martin@CS.UCLA.EDU (1992-05-07)
Re: standard intermediate representation for C/C++ ? sdm@cs.brown.edu (1992-05-08)
Re: standard intermediate representation for C/C++ ? root@grok19.columbiasc.NCR.COM (Dave Howell) (1992-05-11)
Re: standard intermediate representation for C/C++ ? dalamb@qucis.queensu.ca (1992-05-13)
Re: standard intermediate representation for C/C++ ? rascal@verdix.com (1992-05-14)
Re: standard intermediate representation for C/C++ ? bevan@computer-science.manchester.ac.uk (Stephen J Bevan) (1992-05-15)
Re: standard intermediate representation for C/C++ ? macrakis@osf.org (1992-05-15)
Re: standard intermediate representation for C/C++ ? mjordan@src.dec.com (1992-05-15)
Re: standard intermediate representation for C/C++ ? bevan@computer-science.manchester.ac.uk (Stephen J Bevan) (1992-05-16)
Re: standard intermediate representation for C/C++ ? kendall@centerline.com (1992-05-27)
| List of all articles for this month |

Newsgroups: comp.compilers
From: macrakis@osf.org (Stavros Macrakis)
Keywords: C, UNCOL
Organization: OSF Research Institute
References: 92-05-065 92-05-095
Date: Fri, 15 May 1992 17:38:43 GMT

John says:


      Can you really do a DIANA-like thing for C? I'd think that the syntactic
      messiness introduced by the preprocessor would make it awfully hard to
      come up with anything that was simultaneously easier to handle than the
      original source and didn't lose something significant in
      translation.


C macros are lexical macros rather than syntax macros, so in general a
Diana-like representation isn't feasible. However, if you're willing to
restrict yourself to syntactically well-formed macro bodies (you forbid ##
and, e.g., "#define BEGIN {"), you should be able to manage. This is done
by the ANDF producer (front end), in order to support installer (back end)
macro expansion, which is necessary for platform-dependent macro
expansion.


I can't see how to get around expanding syntactically ill-formed
macros, though.


-s
[I was more worried about things like typedef inside #if which can have
pervasive and rather messy effects, e.g. a particular name may be a scalar
or an array depending on preprocessor values. And can you tell us more about
experience with ANDF? -John]
--


Post a followup to this message

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