gcc compile-time performance

Gabriel Dos Reis gdr@codesourcery.com
Sat May 18 07:37:00 GMT 2002


dewar@gnat.com (Robert Dewar) writes:

| > Parsing C/C++ require semantic actions, so some semantic analysis is
| > inherently part of parsing C/C++.
| 
| No, that's certainly incorrect, it is perfectly possible to create a
| context free grammar that represents a superset of C++ in the conventional
| manner.

1) As a mathematician, I do not dimunish the value of *existential*
   proofs.

2) As a practician, I do value constructive proofs and solutions over
   existential proofs (yes, I'm a constructivist).

3) Once you've created a context free to represent a (very) large
   superset -- which is not necessary a conformant superset -- you
   have to increase the semantic analysis tools in order to project
   the superset on the appropriate standard set.  In order words,
   you're increasing the semantic analysis time.  And if your previous
   analysis is that that part is really time consumnig, I've yet to
   see concrete proof to the effect you're gaining anything.

The bottom-line is that even though you may abstractly conceive a
context free grammar of a superset of C++, in order to porperly
parse staandard C/C++ you have to embed semantic actions.  In essence,
the current parser is trying to do exactly what you're mentioning; and
in effect we see where we get with it.

-- Gaby



More information about the Gcc mailing list