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

At 12:38 -0400 2002/05/20, Robert Dewar wrote:
>Compilers can do MUCH better than people think.

Yes, but if the language depends on a lot of structured context
information, that isn't easy.

>A lot depends on the behavior of the compiler.

So it depends on the language as well.

>As an example, if you see an end or } that is malformed or unexpected, then
>it is quite important to try to figure out the structure. This is much harder
>in C++ than in Ada, but not impossible.

The problem in C++ is that if one say mistypes say a class name in its
definition, a lot of subsequent code becomes meaningless to the compiler to
catch: The context information that it is a class name is lost. Catching a
missed "}" is a relatively simple problem to that as the meaning of "{"
does not change with context (like the language type that a name belongs

>A lot of people are used to the kind of error messages that come from fairly
>naive bottom up automatic parsers like YACC. You can do a *LOT* better than
>this if you take the effort.

I don't think it has to do with the bottom-up parsing algorithms itself,
but the question how to develop a general theory that can take care of
context and semantic information and feed that into the error handling
system of the generated parser. -- The Berkeley folks seems to do some
research on that.

  Hans Aberg

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