From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eric Ludlam Newsgroups: gmane.emacs.devel Subject: Re: progmodes/project.el and search paths Date: Fri, 14 Aug 2015 07:52:15 -0400 Message-ID: <55CDD66F.2080005@siege-engine.com> References: <55BE209F.1000009@siege-engine.com> <55BE509B.2080307@yandex.ru> <55BEC1B5.6060204@gmail.com> <86twsgfiuc.fsf@stephe-leake.org> <87mvy2kjxa.fsf@esperi.org.uk> <86si7t11li.fsf@stephe-leake.org> <87lhdkzmdv.fsf@isaac.fritz.box> <86pp2wzcaa.fsf@stephe-leake.org> <877fp3z8i7.fsf@isaac.fritz.box> <86bnefyu0b.fsf@stephe-leake.org> <87k2t0yfz9.fsf@isaac.fritz.box> <86tws4wrar.fsf@stephe-leake.org> <87egj8y0wi.fsf@isaac.fritz.box> <87lhdf1k2a.fsf@esperi.org.uk> <55CC880C.4010008@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1439553165 25942 80.91.229.3 (14 Aug 2015 11:52:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Aug 2015 11:52:45 +0000 (UTC) Cc: Stephen Leake , emacs-devel@gnu.org To: Dmitry Gutov , Nix , David Engster Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 14 13:52:29 2015 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 1ZQDX9-0007KE-3B for ged-emacs-devel@m.gmane.org; Fri, 14 Aug 2015 13:52:27 +0200 Original-Received: from localhost ([::1]:45760 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQDX7-0003gh-To for ged-emacs-devel@m.gmane.org; Fri, 14 Aug 2015 07:52:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQDX3-0003fL-J7 for emacs-devel@gnu.org; Fri, 14 Aug 2015 07:52:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZQDX0-00038Z-B2 for emacs-devel@gnu.org; Fri, 14 Aug 2015 07:52:21 -0400 Original-Received: from mail-vk0-f47.google.com ([209.85.213.47]:36371) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZQDX0-00038V-6X for emacs-devel@gnu.org; Fri, 14 Aug 2015 07:52:18 -0400 Original-Received: by vkbf67 with SMTP id f67so28407906vkb.3 for ; Fri, 14 Aug 2015 04:52:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=8vAdaZ+HX5XAFxBPRPUZt4QVwKwrIY3tbCEX/if//q8=; b=VpK42hcABLOhGPNOgUeeO4/8ky5J4KX/wf1HpcV1ujplCedYRlqleybMVrmh1xarRD fsKBqLbPYxpFQFy92ITBB7P68kWUJpG2jeAsoOKnbBY8mdJKW05o4/+fq6Qe4E5Z6Crg sRRd0TtvzxyIoGuQyz7RD/mnsYDgIuf6FzpeBS8NjlbQVDJxDr676r+1HrIbX3XzVudW wHqMUh5Kmyj35Nbs/MZ6fjXql4S8SnWiAmPKDidHpjM0hBr/05l2Wf4/bp3B4Yq+MgCL KaYYOtR6pL588DnpMPvpdtrQhJP+6ALZvR6YUrN6CZ/1p7F/L8/kPEx6LkWQB1TTtzEC YxTg== X-Received: by 10.52.176.105 with SMTP id ch9mr32446119vdc.45.1439553137422; Fri, 14 Aug 2015 04:52:17 -0700 (PDT) Original-Received: from [192.168.1.202] (pool-71-184-198-118.bstnma.fios.verizon.net. [71.184.198.118]) by smtp.googlemail.com with ESMTPSA id sd2sm1239404vdb.18.2015.08.14.04.52.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Aug 2015 04:52:16 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 In-Reply-To: <55CC880C.4010008@yandex.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.213.47 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:188792 Archived-At: On 08/13/2015 08:05 AM, Dmitry Gutov wrote: > On 08/13/2015 02:53 PM, Nix wrote: >> (This is a fairly >> strong argument *against* relying on the compiler, in fact -- we'll >> always want something like Semantic, because we can tell it to be less >> pedantic in its parsing, recover as much as possible from every parse >> error, and so on.) > > Can we? > > I'm guessing Semantic has at most one level of being "less pedantic", > and implementing several of them, as well as support for those in > grammars, wouldn't be trivial. While Semantic does have an implementation of Bison as it's core for some languages, it is quite unlike most compilers. You can think of it has having 4 ways of handling errors the grammar author doesn't have to put effort into: 1) Lexical 'block' symbols The lexer can identify blocks, which would normally be handled by the parser. This is because Emacs has built in block matching that is quite good. This lets the parser completely ignore anything in { code } blocks or ( paramater lists ) unless it is important. As long as your block indicators match up, it doesn't matter how crappy your code is. 2) Parsers don't check types, etc as they go, and are flexible about the symbols they accept. This means you can get irrational tags. This is for a combination of handling incomplete code, speed (less to do) and because most folks just go an run their compiler at some point anyway. 3) Iterative parsing, so each invocation of the parser only executes across a single tag. This means that if parsing fails, we just move forward one lexical token and try again. This lets the parser just wash over anything it doesn't get. 4) Incremental parser Emacs watches you edit, tracks your changes, and matches it up against previously parsed tags. If things are 'broken' in the code you edit, but you didn't touch the boundaries of the other nearby tags, it lets it be until next time. This means all the previously captured data is available for use, including the active broken tag you might be editing. It also has the typical bison error handling, but that tends not to be necessary. In summary; Semantic can extract useful data out of pretty badly trashed code, and track your changes while you edit in a robust way. Eric