From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Contributing LLVM.org patches to gud.el Date: Thu, 12 Feb 2015 12:34:31 -0500 Message-ID: References: <87mw4rxkzv.fsf@fencepost.gnu.org> <20150208001527.GA30292@thyrsus.com> <20150209150411.1f0f4e4f@jabberwock.cb.piermont.com> <20150211111722.181a2201@jabberwock.cb.piermont.com> <20150211183700.04ec0613@jabberwock.cb.piermont.com> Reply-To: rms@gnu.org NNTP-Posting-Host: plane.gmane.org Content-Type: text/plain; charset=Utf-8 X-Trace: ger.gmane.org 1423762517 4166 80.91.229.3 (12 Feb 2015 17:35:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Feb 2015 17:35:17 +0000 (UTC) Cc: esr@thyrsus.com, dak@gnu.org, monnier@iro.umontreal.ca, slewsys@gmail.com, emacs-devel@gnu.org To: "Perry E. Metzger" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 12 18:35:06 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 1YLxfN-0008Ae-U1 for ged-emacs-devel@m.gmane.org; Thu, 12 Feb 2015 18:35:06 +0100 Original-Received: from localhost ([::1]:51514 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLxfN-0002Rb-3Y for ged-emacs-devel@m.gmane.org; Thu, 12 Feb 2015 12:35:05 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLxer-0001jq-Ix for emacs-devel@gnu.org; Thu, 12 Feb 2015 12:34:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YLxeq-0001pi-OR for emacs-devel@gnu.org; Thu, 12 Feb 2015 12:34:33 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54579) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YLxeq-0001pd-Lf for emacs-devel@gnu.org; Thu, 12 Feb 2015 12:34:32 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1YLxep-0002jf-6Y; Thu, 12 Feb 2015 12:34:31 -0500 In-reply-to: <20150211183700.04ec0613@jabberwock.cb.piermont.com> (perry@piermont.com) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::e 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:182965 Archived-At: [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > It might not per se necessary that Emacs have access to the AST in > textual form. If GCC or part of GCC could be called as a library from > within Emacs to access the AST via an API, that might be sufficient. I am sure that can be done. As has been said, GCC does not generate the parse tree for the whole program, or even a whole function. I initially thought of doing it that way, but it used a lot of memory, so I made it generate RTL from each expression tree and then throw the tree away. It doesn't make trees for statements at all. At least, that's how it worked for C. So it would first be necessary to make the parser generate and keep the full trees, instead of generating RTL. I think the term "AST" means a tree that corresponds precisely to the syntax. The GCC tree structure does not correspond precisely to the syntax; the parser makes some simplifications and expansions itself. So the tree is not really an AST. This shouldn't affect completion though. -- Dr Richard Stallman President, Free Software Foundation 51 Franklin St Boston MA 02110 USA www.fsf.org www.gnu.org Skype: No way! See stallman.org/skype.html.