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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4fe319e8a983326a X-Google-Attributes: gid103376,public From: "Ira D. Baxter" Subject: Re: C question (was: Ada & C) Date: 2000/01/18 Message-ID: #1/1 X-Deja-AN: 574194742 References: <3878D189.80E1CCB4@gte.net> <387CE6DC.4DFDDFC4@ftw.rsc.raytheon.com> <85ipn5$7pu2@news.cis.okstate.edu> <85j3a5$r3p$1@nnrp1.deja.com> <85j4r7$9qe1@news.cis.okstate.edu> Organization: Posted via Supernews, http://www.supernews.com X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Newsgroups: comp.lang.ada X-Complaints-To: newsabuse@supernews.com Date: 2000-01-18T00:00:00+00:00 List-Id: 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 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 >San Diego Supercomputer Center <*> >Welcome to the last year of the 20th century. >