This is the mail archive of the
mailing list for the GCC project.
Re: gcc compile-time performance
- From: Gabriel Dos Reis <gdr at codesourcery dot com>
- To: dewar at gnat dot com (Robert Dewar)
- Cc: gcc at gcc dot gnu dot org, neil at daikokuya dot demon dot co dot uk, robertlipe at usa dot net
- Date: 18 May 2002 15:58:47 +0200
- Subject: Re: gcc compile-time performance
- Organization: CodeSourcery, LLC
- References: <20020518131640.0CB0AF2A59@nile.gnat.com>
email@example.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
1) As a mathematician, I do not dimunish the value of *existential*
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.