Hi, GCC list! Apologies if this isn't the right place to ask, but it seems like a good place to find experts on C++ and Java syntax. If there's a better place to ask, would somebody give me a pointer, please.
I'm the maintainer of Emacs's CC Mode, which includes modes for C, C++, Java, etc. Currently, C++ templates are not handled 100% accurately by C++ mode - neither are generics in Java mode, for that matter. I want to fix this. My knowledge of C++ is moderate rather than comprehensive. So, the question: is it possible to identify with 100% certainty, PURELY SYNTACTICALLY (i.e. without access to the compiler's symbol table), when "< ... >" is a pair of template (C++) or generic (Java) brackets? I'm thinking of things like foo (a < b, c > d); I think this is unambiguously a function call with 2 parameters, the expressions "a < b" and "c > d". It cannot be be one with 1 parameter beginning with the template invocation "a < b , c >". Or can it? I believe that a pair of template brackets cannot enclose a semicolon, for example. Another related question: although there is no maximum bound on how far apart template/generic brackets can be, I believe that in practice, they are never that far apart (a few hundred bytes max, perhaps). Is this, in fact, the case? A cc: to [EMAIL PROTECTED] would be most appreciated. Thanks in advance for any and all help! -- Alan Mackenzie (Nuremberg, Germany).