From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Engster Newsgroups: gmane.emacs.devel Subject: Re: Is intellisense features integration in Emacs technically possible? Date: Wed, 22 Jan 2014 19:34:36 +0100 Message-ID: <87ha8vq30j.fsf@engster.org> References: <1390269670.2888.14.camel@localhost.localdomain> <83zjmpf80o.fsf@gnu.org> <83vbxcfzaa.fsf@gnu.org> <87eh40fx9j.fsf@wanadoo.es> <87txcwotp2.fsf@engster.org> <8761pbga2p.fsf@wanadoo.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1390415691 32146 80.91.229.3 (22 Jan 2014 18:34:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 22 Jan 2014 18:34:51 +0000 (UTC) Cc: emacs-devel@gnu.org To: =?iso-8859-1?Q?=D3scar?= Fuentes Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 22 19:34:59 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W62dd-00064g-BB for ged-emacs-devel@m.gmane.org; Wed, 22 Jan 2014 19:34:57 +0100 Original-Received: from localhost ([::1]:36993 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W62dc-00045I-NX for ged-emacs-devel@m.gmane.org; Wed, 22 Jan 2014 13:34:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60099) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W62dS-0003uY-WA for emacs-devel@gnu.org; Wed, 22 Jan 2014 13:34:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W62dM-0007eX-V7 for emacs-devel@gnu.org; Wed, 22 Jan 2014 13:34:46 -0500 Original-Received: from randomsample.de ([5.45.97.173]:44798) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W62dM-0007eO-MG for emacs-devel@gnu.org; Wed, 22 Jan 2014 13:34:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomsample.de; s=a; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From; bh=ILqpg3MHJ719hdd69OtQj3rzqzKK+G89U8H1CHsu2yA=; b=Mv0zJA2nHJJHUfU2HOwKYnTdVlRiLvHzB06WTXjz9wwct/tMkfgrqv/pKf++Fa5lZ9fvc/DUp/gQ0PTe9nBgrD2apOojtxiEe4jCHBZmSRnGNkqw4xBA5nKJB5VykaMK; Original-Received: from dslc-082-083-061-166.pools.arcor-ip.net ([82.83.61.166] helo=spaten) by randomsample.de with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1W62dK-0004N3-S0; Wed, 22 Jan 2014 19:34:39 +0100 In-Reply-To: <8761pbga2p.fsf@wanadoo.es> (=?iso-8859-1?Q?=22=D3scar?= Fuentes"'s message of "Wed, 22 Jan 2014 19:12:14 +0100") User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux) Mail-Followup-To: =?iso-8859-1?Q?=D3scar?= Fuentes , emacs-devel@gnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 5.45.97.173 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:168912 Archived-At: =D3scar Fuentes writes: > David Engster writes: > >>> Writing a C++ parser and semantic analyzer from scratch requires several >>> man-years of work for world-class compiler writers. >> >> You don't need a full parser. For providing completions, it is >> sufficient to parse only a small subset of the code (declarations, most >> importantly). > > Even for providing completions you need semantic analysis. Of course you need that. Where did I say otherwise? I'm saying that when you get parsing of declarations right, and have some good heuristics to parse the local context, then this will suffice for most cases. Parsing code like this also has some advantages, mostly that it is more fault-tolerant. This is actually very important, since while you're coding, your code will often be syntactically wrong. > The parser turns to be insufficient on very simple cases: > > auto foo =3D bar(); > foo. ???? Well, type inference is hard. Currently, C++11 isn't on my agenda. But I'm confident simple cases like the above will be manageable. > The need for semantic analysis is unavoidable even on the "old" C++ 98: > > template struct Foo { > typedef T Type; > }; > > struct Bar { > int something() { > return 42; > } > }; > > void some_func() { > typename Foo::Type t; > t. ??? > } This will work after I've applied my template patch. -David