From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5f6125e9594f9968 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.205.122.65 with SMTP id gf1mr2933003bkc.2.1338898649430; Tue, 05 Jun 2012 05:17:29 -0700 (PDT) Path: e27ni16118bkw.0!nntp.google.com!news1.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!news.musoftware.de!wum.musoftware.de!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Brian Drummond Newsgroups: comp.lang.ada Subject: Re: Ada to C translator for small microcontrollers Date: Tue, 5 Jun 2012 12:17:28 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <2424259e-cf1c-408e-a57e-f2c948087186@i2g2000vbv.googlegroups.com> <4fba349b$0$6560$9b4e6d93@newsspool4.arcor-online.net> <7ad13453-fea5-4b3a-9a93-306302f073da@googlegroups.com> Mime-Version: 1.0 Injection-Date: Tue, 5 Jun 2012 12:17:28 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="3/9i4eU3tV30IAhXHAPg/g"; logging-data="12143"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18dPDURMOhBwTOW29P/Y593hlF/qnlWSNU=" User-Agent: Pan/0.135 (Tomorrow I'll Wake Up and Scald Myself with Tea; GIT 30dc37b master) Cancel-Lock: sha1:qQSc/ISICvuObP7sbYiUrlIDDgk= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: 2012-06-05T12:17:28+00:00 List-Id: On Tue, 05 Jun 2012 02:18:11 -0700, kalvin.news wrote: > As Niklas Holsti suggested sometime above, the translation from GNAT IR > to C might be the easiest way. I thought about this, and as there exists > a GNAT Ada Pretty Printer, and if I have understood it correctly, it > uses GNAT IR for recreating the source code. This might be the easiest > way to create the translator, as rewriting the source code formatting > rules to produce C source instead. Any comments on this possible > approach? For the C back-end, it might be worth looking at an old version of f2c, (from before it became g77 or gfortran) to see how some other-language constructs were translated into c. It's probably not pretty, but I remember it as being a fairly small program. - Brian