Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!oitnews.harvard.edu!purdue!haven.umd.edu!hecate.umd.edu!bloom-beacon.mit.edu!spool.mu.edu!uwm.edu!newsfeeds.sol.net!mr.net!news-feed.inet.tele.dk!sn.no!hermod.uio.no!nntp.uio.no!news.apfel.de!news-fra1.dfn.de!news-koe1.dfn.de!news.dfn.de!news.uni-bielefeld.de!news
From: Clemens Meier <clmeier@lili6.lili.uni-bielefeld.de>
Subject: Re: Parser for C that outputs a prolog representation?
Sender: news@hermes.hrz.uni-bielefeld.de (News Administrator)
Message-ID: <q9ohesmurr.fsf@lili6.lili.uni-bielefeld.de>
Date: Tue, 14 Jan 1997 10:11:04 GMT
References: <32DA5E36.261F@pascal.dra.hmg.gb>
Nntp-Posting-Host: lili6.lili.uni-bielefeld.de
Organization: Universitaet Bielefeld, Linguistik und Literaturwissenschaft, Germany
X-Newsreader: Gnus v5.3/Emacs 19.34
Lines: 32


Hello!

Mark Hewitt <M.A.Hewitt@pascal.dra.hmg.gb> writes:

> I know this is a long shot but does anyone have a program that
> will parse a file written in the C programming language and 
> produce a representation of it in Prolog term structures.

This is probably not what you wanted to read (no program or
reference to it), and I know it's a lot of work writing one
but IIRC, there's a BNF grammar of the C language in one of
the appendages of the New Testament (Kernighan & Richie, 2nd
Ed.) which should (IMHO) translate more or less straightforward
into a Prolog parser for C. You have to write it down, though,
and there's a lot of it, since C's not a toy language.

Hope this is helpful.

CU

Clemens

PS: BTW: It's probably better to pipe your programs through
    cpp(1) first, if you don't want to emulate all this
    #defining and #including.

-----------------------------------------------------------------------------
When there is useful information which [your]   clmeier@lili.uni-bielefeld.de
program can send to the terminal but not get                    Clemens Meier
at itself, your customers start to say very    GO C++ 3$ UL L+>+++ E++>+++ P-
unkindly things about you.       R.A.O'Keefe   N++ R+>+++ G'''' b++ TWERPS+++
