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" == Robert Dewar <> writes:

>> Parsing C/C++ require semantic actions, so some semantic analysis
>> is inherently part of parsing C/C++.

Robert> No, that's certainly incorrect, it is perfectly possible to
Robert> create a context free grammar that represents a superset of
Robert> C++ in the conventional manner. 

The sentence is correct, but I fail to make practical sense of it: we
use deterministic parsing methods, and we certainly don't parse the
whole CFG set.  Bison will soon be able to address CFG via GLR, but
for the time being, you have to do with LALR(1).

Additionally, you can't say that C++, or even C, are CFG, for

        foo (bar);

can be a function call or a variable declaration, depending upon the
context.  There are definitely not CFG.  But I can see your point with
`superset' here, although `superset' is certainly not a very useful
concept, given that `.*' is also a superset of C++, and better yet: of
all the languages GCC supports and will support (yeah!  a single
simple parser for all of them :).

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