LWN.net Logo

LCA: Static analysis with GCC plugins

LCA: Static analysis with GCC plugins

Posted Jan 24, 2010 1:00 UTC (Sun) by njs (guest, #40338)
In reply to: LCA: Static analysis with GCC plugins by marcH
Parent article: LCA: Static analysis with GCC plugins

There exist exactly 3 real C++ parsers: Microsoft, GNU, and EDG. (Mathworks is almost certainly licensing from EDG.) Including proprietary options does broaden the field, but it's still pretty limited...

That said, it would certainly have been more short-term efficient for Mozilla to just license EDG for their instrumentation tools. I'm glad they didn't.


(Log in to post comments)

LCA: Static analysis with GCC plugins

Posted Jan 24, 2010 14:02 UTC (Sun) by marcH (subscriber, #57642) [Link]

> There exist exactly 3 real C++ parsers: Microsoft, GNU, and EDG.

Wow, this is a bold statement :-) Is C++ such a small world?

What about Sun compiler for instance? EDG lists it as a different "dialect".

> Mathworks is almost certainly licensing from EDG.

... by ruling out the two others?

In any case this is where the backend comes from:
http://pagesperso-orange.fr/Christele.Faure/AlainDeutsch....
This product existed years before Mathworks bought it.

LCA: Static analysis with GCC plugins

Posted Jan 24, 2010 20:34 UTC (Sun) by JoeBuck (subscriber, #2330) [Link]

Sun's compiler accepts a non-standard dialect, which they froze long ago and won't fix based on backward compatibility arguments. They provide two different "standard libraries", the default, broken one and a better one based on STLPort. Getting modern C++ code to pass Sun's compiler is a real chore.

LCA: Static analysis with GCC plugins

Posted Jan 25, 2010 0:59 UTC (Mon) by roc (subscriber, #30627) [Link]

IBM's C++ compiler also has its own front end.

Only 3 real C++ parsers

Posted Jan 29, 2010 16:47 UTC (Fri) by giraffedata (subscriber, #1954) [Link]

IBM's C++ compiler also has its own front end.

Meaning what (I don't know what a front end is)? Does it use one of the three stated real C++ parsers? Does it have its own parser which, like Sun's isn't real because it can't parse standard C++?

Only 3 real C++ parsers

Posted Jan 30, 2010 18:21 UTC (Sat) by nix (subscriber, #2304) [Link]

Front end: the thing which takes a high-level language (e.g. C++) and
yields a language-independent, relatively machine-independent
representation for optimization and translation into machine-dependent
form. (In recent versions of GCC, this intermediate representation is
GIMPLE).

(There is no formal name for this machine-independent part that I know of,
but I've always heard it referred to as the 'middle-end'. A thousand
toplogists may scream in pain but language doesn't need to make
sense. :) )

LCA: Static analysis with GCC plugins

Posted Jan 25, 2010 10:24 UTC (Mon) by dgm (subscriber, #49227) [Link]

>> There exist exactly 3 real C++ parsers: Microsoft, GNU, and EDG.

>Wow, this is a bold statement :-) Is C++ such a small world?

Well, how many _complete_ Java parsers do exist? How many C#?, Python? Perl?

LCA: Static analysis with GCC plugins

Posted Jan 25, 2010 15:30 UTC (Mon) by Cyberax (✭ supporter ✭, #52523) [Link]

I know at least 5 Java _compilers_. Granted, for Java 1.4, not 1.5. But still...

C++ parsers: A small world

Posted Jan 25, 2010 14:26 UTC (Mon) by dwheeler (guest, #1216) [Link]

Yes, it really is a small world for *real* C++ parsers. You might be able to add a few, but C++ is really painful to parse. Thus, most people try to use a pre-existing parser rather than rolling their own.

LCA: Static analysis with GCC plugins

Posted Jan 25, 2010 13:16 UTC (Mon) by epa (subscriber, #39769) [Link]

According to http://lwn.net/Articles/370843/, Microsoft licenses EDG's C++ parser, so that means only two exist.

LCA: Static analysis with GCC plugins

Posted Jan 25, 2010 13:59 UTC (Mon) by jwakely (subscriber, #60262) [Link]

IIUC they license it for tools within VS, but their compiler uses their own parser, not the EDG one.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds