From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Minor bug in cc-menus.el: cc-imenu-java-generic-expression does not match all Java 1.5+ function definitions. Date: Tue, 28 Jul 2009 13:42:46 +0200 Organization: Organization?!? Message-ID: <87ws5t3ufd.fsf@lola.goethe.zz> References: <5e3a506e0907180827k148fe0d1x34b89f1fedf6c79d@mail.gmail.com> <20090728101959.GA2295@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1248781402 23156 80.91.229.12 (28 Jul 2009 11:43:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Jul 2009 11:43:22 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 28 13:43:15 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MVl5P-0006PI-3t for ged-emacs-devel@m.gmane.org; Tue, 28 Jul 2009 13:43:15 +0200 Original-Received: from localhost ([127.0.0.1]:46246 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MVl5O-0003D6-H9 for ged-emacs-devel@m.gmane.org; Tue, 28 Jul 2009 07:43:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MVl5J-0003Bc-4n for emacs-devel@gnu.org; Tue, 28 Jul 2009 07:43:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MVl5G-000385-TC for emacs-devel@gnu.org; Tue, 28 Jul 2009 07:43:08 -0400 Original-Received: from [199.232.76.173] (port=36954 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MVl5G-00037t-Pw for emacs-devel@gnu.org; Tue, 28 Jul 2009 07:43:06 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:36418) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MVl5G-00048T-Ek for emacs-devel@gnu.org; Tue, 28 Jul 2009 07:43:06 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MVl5F-0001aG-IO for emacs-devel@gnu.org; Tue, 28 Jul 2009 07:43:05 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MVl5C-0001zZ-3R for emacs-devel@gnu.org; Tue, 28 Jul 2009 11:43:02 +0000 Original-Received: from p5b2c1b64.dip.t-dialin.net ([91.44.27.100]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 Jul 2009 11:43:02 +0000 Original-Received: from dak by p5b2c1b64.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 Jul 2009 11:43:02 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 57 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: p5b2c1b64.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:RVQJgg1ziUIHhZuVEBi3Zv79ZOc= X-Detected-Operating-System: by mx20.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:113282 Archived-At: Alan Mackenzie writes: > sorry about the delay replying - I'm the guy who does the CC Mode > things, and sadly there's only one of me at the moment. > > On Sat, Jul 18, 2009 at 08:27:10AM -0700, Nathaniel Flath wrote: >> I was using Imenu, and noticed that it currently doesn't recognize Java >> functions with either: >> Generics e.g : public List foo() { ... >> or annotated arguments, e.g : public void foo( @NonNull bar ) { > > CC Mode has got a bit behind in handline C++ templates and Java generics > (which are essentially the same thing from Emacs's point of view). > There's quite a bit of work to be done on updating Java Mode's support > for recent enhancements to the language. > > > Misusing "<" and ">" as template/generic delimiters was an egregious > "design" decision by the C++ people, It was actually a design decision by the Ada people. Ada uses <...> for constraints in lots of contexts, and generics parameters are constraints. It was abysmally stupid to let C++ templates look like Ada generics, in particular since C++ has << and >> operators. But then C++ syntax is a collection of stupidities, parseable only by hand-written recursive descent parsers and they still tend to get the corner cases wrong (while human readers tend to get surprised by quite more cases). And it is already stupid to have a preprocessor with a different syntax, but that particular stupidity is inherited. C++ is an attempt to cram not only everything that can be somehow made to fit into the functionality, but also into the syntax. And that's insane. > There are pieces of C++ code which need a compiler (or some equivalent > tool) to distinguish "less than" from "template start". There might > also be similar Java code, I'm not sure. As a result, syntactic > analysis of C++ (and maybe Java) code which contains "<" and ">" is > either difficult or impossible in the general case. And nowadays, >> for ending two nested template parameter sets is supposed to be handled properly by the compiler. Making the problem still more complex. In a well-designed language, recognizing syntactic elements does not need much context. Nobody wants to read computer languages in the style of classic Greek where a single sentence spreads itself over more than one page and happens not to actually have a verb predicate, so you go back and forth until you finally manage to make sense of the nested somewhat arbitrary constructs. If I wanted to do that, I would learn German. Oh, wait... -- David Kastrup