This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc compile-time performance (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*

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]