From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.devel Subject: Re: Make peg.el a built-in library? Date: Thu, 10 Nov 2022 06:25:55 +0100 Message-ID: References: <875yvtbbn3.fsf@ericabrahamsen.net> <877d07a16u.fsf@localhost> <87tu3asg2r.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/w5EYAc660E+RJll" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39355"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 10 06:27:15 2022 Return-path: 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 ) id 1ot05q-000A2T-R6 for ged-emacs-devel@m.gmane-mx.org; Thu, 10 Nov 2022 06:27:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ot04q-0000h1-Fo; Thu, 10 Nov 2022 00:26:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ot04p-0000gS-1O for emacs-devel@gnu.org; Thu, 10 Nov 2022 00:26:11 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ot04c-00053v-5O for emacs-devel@gnu.org; Thu, 10 Nov 2022 00:26:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:To:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=3W5wsoG2jvPN0bIOCLcsOcssgIvBejV6x/zk3N10Epc=; b=hChDkiQ0F+KrvWlRIZBuItOyku nMd4UxBpp57KgmrQdbeL95Y+3leBHRMzNseQYFOGszgxtd/Ug5YyZL1gxPFkmgW7rdvzk3KFTgmHU jfVTnkQEWQ0Qm3Ajz4yvYxL1e7m1sWxLVZSIqQVAmmYUvC4NvLQMKaNBjPaLz6Qb4e0/M4g2731AS e1CAI+S1rVGEnGNYTlQ6JantA2QRi0djGcYU6hWJJub6j13MhApF3siIU630xFE6wwDTOqztWsHac bHesD6JSND5NBAAXvD7Tv2C2cXYHBwZVSl3UiKvpbV6S+lC/sJenMTc6wQw48UCyA8gTxm0kuwUen 5zwlVJ+g==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.94.2) (envelope-from ) id 1ot04Z-0006Ho-Hx for emacs-devel@gnu.org; Thu, 10 Nov 2022 06:25:55 +0100 Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de 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, SPF_HELO_NONE=0.001, SPF_PASS=-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." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:299453 Archived-At: --/w5EYAc660E+RJll Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 09, 2022 at 11:04:48PM -0500, Richard Stallman wrote: > [[[ 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. ]]] >=20 > Would someone like to tell me in 10 lines what job peg.el does? PEG (Parsing Expression Grammars [1]) is a grammar notation which can be automatically translated into a parser (think regular expressions). The notation is actually similar to that of regexps. The main difference is that the "alternative" operator is an "ordered" choice instead of an ambiguous choice. To compensate for this, the notation provides for a (potential) lookahead mechanism, which, in the naive implementation would lead to exponential running time in the worst case. The canonical implementation (nicknamed "packrat") addresses that by memoizing. Basically they can do what a recursive descent parser can, are thus slightly more powerful than regexps. They lead to nice little grammars, but they do take some practice to be useful. Cheers --=20 t --/w5EYAc660E+RJll Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCY2yLXQAKCRAFyCz1etHa RonSAJ0aTLmz5s1spf/zkZdP6SkiBuG9sQCfaHEksTmVB8Vm0EkikG3K26pq+sI= =K3nE -----END PGP SIGNATURE----- --/w5EYAc660E+RJll--