From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christian Johansson <christian@cvj.se> Newsgroups: gmane.emacs.devel Subject: Re: New package emacs-parser-generator Date: Sun, 28 Nov 2021 08:22:48 +0100 Message-ID: <BB24B3F3-C0A3-4669-8A4F-68FD56A0EFD3@cvj.se> References: <83mtloyd9e.fsf@gnu.org> Mime-Version: 1.0 (1.0) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39160"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii <eliz@gnu.org> Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 28 08:24:20 2021 Return-path: <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org> Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>) id 1mrEXr-000A3M-Fy for ged-emacs-devel@m.gmane-mx.org; Sun, 28 Nov 2021 08:24:19 +0100 Original-Received: from localhost ([::1]:42762 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org>) id 1mrEXq-0001N1-Jv for ged-emacs-devel@m.gmane-mx.org; Sun, 28 Nov 2021 02:24:18 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <christian@cvj.se>) id 1mrEWV-00087r-Nj for emacs-devel@gnu.org; Sun, 28 Nov 2021 02:22:55 -0500 Original-Received: from mailrelay4-3.pub.mailoutpod1-cph3.one.com ([46.30.212.13]:40604) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <christian@cvj.se>) id 1mrEWT-0002O8-5C for emacs-devel@gnu.org; Sun, 28 Nov 2021 02:22:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cvj.se; s=20191106; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version:from: content-transfer-encoding:content-type:from; bh=TnpBGJkuNo6B9g2XmAxDEm7/Fs+7UPBfg4eXG5l2tg4=; b=RMtAzQls0mL464svdbkkg04jIr0vKVcyrlLD5DgbCSi0eA/8mXsDZVTEFcwilO+4L9Yk+hH4vgMvk 1lsj1+aB4SUDPrtD0zysqM+zwLJsCWviHka/HaKHW203O4MMoHJR9HWdFMiC6EPxjdXDVsKn+a1Q47 cv+9kcwbb1y3OYsGKyMc5Goj1UxhYIkIuYfed46y6P72/wbdygl4JbN0kWdh58Py0VZyGy1dCeSDTK L5bpGJ1wCxAzRx8evyLtKhjkwly3qS/EWrcqr1BJy2Xm2XLimfDrio5ZAGXi7AKAyDhtWB3t0Us6i/ fGRR8BrVEMGMbdYoaNO7pFHmZ/B8VJQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cvj.se; s=rsa1; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version:from: content-transfer-encoding:content-type:from; bh=TnpBGJkuNo6B9g2XmAxDEm7/Fs+7UPBfg4eXG5l2tg4=; b=jQiZl+l+SBIvVcX+b3z/SJA6AI3tcWPypTUtv/HBo9GMXBLcUH3Nzy0dnBiF4//s6iAzi950Zw9Tj AKryvumnYMAa2y+EEbXzT05+vy7od9WXtZZZLtIspKu/mot/BRKxbadyfJa8HIITO3gRlOjE50vxOD aR5Ov+jj+PDQ19/fpjRIgkODgEOTs7lAXEKv6VM5aEn4yEkva8JnC1yKb9RjSre6R8O1eTKuUwOpBf gUwp0RO8DOH1Ju8qXa+ae8lSJ9mxN0FaV+RiCtSoZT5Wyw6+WwlaVnGPA4U27/BwLOLetVdabvDkAm 8/6hJ4keH/8YdwuzSZ7xqZb7ptivnCA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=cvj.se; s=ed1; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version:from: content-transfer-encoding:content-type:from; bh=TnpBGJkuNo6B9g2XmAxDEm7/Fs+7UPBfg4eXG5l2tg4=; b=NO5lNGkNatBh7ilCbyrKZ/PW7UmW9NVMLWFbmh9c4IHycoS7D/Em6zMfJnHt17vKnZqkJUPcl1y/9 RXI5empDw== X-HalOne-Cookie: 442c8d929ea6774a18ce9a0964a6a3e670716bc8 X-HalOne-ID: fd87d142-501b-11ec-ae05-d0431ea8bb10 Original-Received: from smtpclient.apple (c188-150-212-230.bredband.tele2.se [188.150.212.230]) by mailrelay4.pub.mailoutpod1-cph3.one.com (Halon) with ESMTPSA id fd87d142-501b-11ec-ae05-d0431ea8bb10; Sun, 28 Nov 2021 07:22:49 +0000 (UTC) In-Reply-To: <83mtloyd9e.fsf@gnu.org> X-Mailer: iPhone Mail (19A404) Received-SPF: none client-ip=46.30.212.13; envelope-from=christian@cvj.se; helo=mailrelay4-3.pub.mailoutpod1-cph3.one.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." <emacs-devel.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-devel>, <mailto:emacs-devel-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/emacs-devel> List-Post: <mailto:emacs-devel@gnu.org> List-Help: <mailto:emacs-devel-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-devel>, <mailto:emacs-devel-request@gnu.org?subject=subscribe> Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" <emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org> Xref: news.gmane.io gmane.emacs.devel:280374 Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/280374> Hi, I believe tree-sitter is not suitable for proper parsing (it does not suppor= t LR(1) for example) It is good for fast syntax coloring with approximate / good enough parsing Regards Christian > 28 nov. 2021 kl. 08:02 skrev Eli Zaretskii <eliz@gnu.org>: >=20 > =EF=BB=BF >>=20 >> Date: Sat, 27 Nov 2021 22:40:45 +0100 >> From: Christian Johansson <christian@cvj.se> >>=20 >> I have started on a parser generator library for Emacs that currently=20 >> can generate canonical LR(k) parsers as stand-alone elisp files. I'm=20 >> using it for the automatically generated PHP 8.0 parser in phps-mode. A=20= >> difference between my library and the built-in Wisent parser generator=20= >> is that it can handle e-identifiers (like %empty), context sensitive=20 >> precedence (like %prec) and global precedence rules (not sure if Wisent=20= >> does support that) >>=20 >> In the future I have planned on implementing more parsing algorithms in=20= >> this library like LL(k) and LALR(k) >=20 > Thanks. I believe the plan is to use Tree-sitter for the jobs for > which a parser is needed. But we also want to have an API that could > accommodate other parsers into the same framework. So I think it > would be good if you cooperate with Yuan Fu <casouri@gmail.com>, who > is working on Tree-sitter integration, so that the API for using a > parser could be a common one.