comp.lang.ada
 help / color / mirror / Atom feed
From: "Ira D. Baxter" <idbaxter@semdesigns.com>
Subject: Re: C question (was: Ada & C)
Date: 2000/01/18
Date: 2000-01-18T00:00:00+00:00	[thread overview]
Message-ID: <s88nh9ljeh672@corp.supernews.com> (raw)
In-Reply-To: yec4scde1mk.fsf@king.cts.com

If you have the right parser technology, parsing C is not hard and you
don't need the symbol table immediately.   GLR parsing handles problems
like typedef names by proposing multiple parses: in this case, one
assuming its a typedef name, and the other assuming its a conventional
identifier.
Which can be resolved later, of course, with the symbol table.

We offer reengineering tools that not only parse C, but C++, Ada95,
Fortran95,
you name it using this technology.   See
http://www.semdesigns.com/Products/DMS/DMSToolkit.html.

I would expect C2ADA to not be very easy.   Pointer casts and arithmetic
are a bitch to translate.


Keith Thompson wrote in message ...
>dvdeug@x8b4e53cd.dhcp.okstate.edu (David Starner) writes:
>> On Wed, 12 Jan 2000 23:38:47 GMT, Ted Dennison <dennison@telepath.com>
wrote:
>> >> [c2ada not working well]
>> >Hmmm. This sounds like a good application for OpenToken. It currently
>> >only ships with Java and Ada syntaxes, but a C syntax shouldn't be too
>> >tough for someone with an ANSI C standard handy to cobble together. I
>> >actually thought C would be the *first* syntax someone submitted, but up
>> >to now no one seems to have been that interested in C. :-)
>> ANSI C's a bit of a bear to parse, or so I've heard.
>
>Indeed.  The biggest problem is typedef names.  When a typedef is in
>scope, the name of the typedef has to be treated as a distinct token,
>not as an identifier -- unless it's a new declaration of the same
>name.  Thus you have to have feedback from the symbol table to the
>parser.  Ick.
>
>--
>Keith Thompson (The_Other_Keith) kst@cts.com  <http://www.ghoti.net/~kst>
>San Diego Supercomputer Center           <*>  <http://www.sdsc.edu/~kst>
>Welcome to the last year of the 20th century.
>






  reply	other threads:[~2000-01-18  0:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-08  0:00 Ada & C A.J. Werner
2000-01-09  0:00 ` Robert L. Klungle
2000-01-09  0:00   ` Brian Rogoff
2000-01-09  0:00     ` Ehud Lamm
2000-01-09  0:00       ` Brian Rogoff
2000-01-10  0:00         ` Larry Kilgallen
2000-01-12  0:00         ` C question (was: Ada & C) Wes Groleau
2000-01-12  0:00           ` David Starner
2000-01-12  0:00             ` Ted Dennison
2000-01-13  0:00               ` David Starner
2000-01-13  0:00                 ` Ted Dennison
2000-01-14  0:00                   ` David Starner
2000-01-16  0:00                 ` Keith Thompson
2000-01-18  0:00                   ` Ira D. Baxter [this message]
2000-01-18  0:00                     ` Charles Hixson
2000-01-18  0:00                       ` Gautier
2000-01-10  0:00   ` Ada & C tmoran
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox