From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 960A11381F3 for ; Mon, 23 Sep 2013 07:17:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 25A4AE09AA; Mon, 23 Sep 2013 07:17:00 +0000 (UTC) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 30B9BE09AA for ; Mon, 23 Sep 2013 07:16:58 +0000 (UTC) Received: by mail-vc0-f172.google.com with SMTP id hu8so1957131vcb.31 for ; Mon, 23 Sep 2013 00:16:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=nqyqJiPhfMGh5Sol4W9B0GZ+bc+C+a+lnGuFQvcXAIc=; b=a56VK9f0OnRwEySnovKIdjFccIhHVZ4SqV01lVSCOyTJm8+V4IaIfsNQ+ep8sFqexk li3P9gJQ9bQHlIugBvmHb3ntjODPOjBGBjLPLxnXtvh3YO8QULF68JwyKr6DUpskMjZF 36jnK/3NebXs8rMlVbRDYZIosALQbA4jK+Elwk9xJlDhlA3r4e2hpXPPetfoxSi4JUPi yqdTFRG3FrGY2SwX6KiwahYBd0zZQ8Vthv9gwI0xeY12+pKkhjgDWvV+BIuKKi9jCXxu vm28PzAHoAo0lIsaz6i3Qw7HarVfUzLEWCSe5bYseq7epaS38mxdil5uZSp5A9MDVjC4 hxZg== Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Package Manager Specification discussions X-BeenThere: gentoo-pms@gentoo.org X-BeenThere: gentoo-pms@lists.gentoo.org Reply-To: gentoo-pms@lists.gentoo.org MIME-Version: 1.0 X-Received: by 10.52.27.243 with SMTP id w19mr16642767vdg.3.1379920618285; Mon, 23 Sep 2013 00:16:58 -0700 (PDT) Received: by 10.58.189.131 with HTTP; Mon, 23 Sep 2013 00:16:58 -0700 (PDT) Date: Mon, 23 Sep 2013 14:16:58 +0700 Message-ID: Subject: [gentoo-pms] [gentoo-pms-abnf] Generation of regex from ABNF! From: Walter To: gentoo-pms@lists.gentoo.org Content-Type: multipart/alternative; boundary=20cf307cfd6845a40104e707ce61 X-Archives-Salt: 9d3fc106-1dfb-4007-b56c-5ed4a1028e30 X-Archives-Hash: 334bcc2a508bea1eaa1cd13b8b789a70 --20cf307cfd6845a40104e707ce61 Content-Type: text/plain; charset=ISO-8859-1 Hear ye, formalistic entity definition fans! Aforementioned evil project to interpret the PMS docs and recast them unofficially as a go-to formal grammar has advanced to its next stage of world domination! (Complete no-show by the forecast army of worker-gnomes notwithstanding.) As of a few minutes ago, thanks to some quirky ruby, almost-correct* regular expressions can now be generated for each of the various identifiers, which could be used in any tools. >From a transparency/maintenance perspective it may be preferable to generate these for any package-related tools since it means everyone is sourcing their grammar - without error prone manual processes - from the same single point of truth, removing an entire class of bugs. Code @ https://github.com/globalcitizen/gentoo-pms-abnf Related bug @ https://bugs.gentoo.org/show_bug.cgi?id=456892 (full of unbelievers) - Walter * 'Almost correct' because entities like "a" are not officially allowed in ABNF, but desirable in spec for readability and ease of editing. An intermediate script is thus needed prior to regex generation to simply convert strings in to escaped entities ('%xxx' IIRC) to get properly solid output. Easy one but I'm otherwise disposed today. --20cf307cfd6845a40104e707ce61 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hear ye, formalistic entity definition fans= !

Aforementioned evil project to interpret the PMS docs and re= cast them unofficially as a go-to formal grammar has advanced to its next s= tage of world domination! (Complete no-show by the forecast army of worker-= gnomes notwithstanding.)

As of a few minutes ago, thanks to some quirky ruby, almost-correct* re= gular expressions can now be generated for each of the various identifiers,= which could be used in any tools.

From a transparency/maintenance p= erspective it may be preferable to generate these for any package-related t= ools since it means everyone is sourcing their grammar - without error pron= e manual processes - from the same single point of truth, removing an entir= e class of bugs.

Code @ htt= ps://github.com/globalcitizen/gentoo-pms-abnf
Related bug= @ https://bug= s.gentoo.org/show_bug.cgi?id=3D456892 (full of unbelievers)

- Walter

* 'Almost correct' becau= se entities like "a" are not officially allowed in ABNF, but desi= rable in spec for readability and ease of editing. An intermediate script i= s thus needed prior to regex generation to simply convert strings in to esc= aped entities ('%xxx' IIRC) to get properly solid output. Easy one = but I'm otherwise disposed today.
--20cf307cfd6845a40104e707ce61--