From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mike Mattie Newsgroups: gmane.emacs.help Subject: Re: how to use parsing expressing grammar Date: Thu, 5 Mar 2009 08:38:06 -0800 Message-ID: <20090305083806.1ea2aeef@gmail.com> References: <6b8a1070-1a89-48b0-9287-343b673b5758@a29g2000pra.googlegroups.com> <098ddc5b-7074-41fb-a921-caee3bddddff@t39g2000prh.googlegroups.com> <91fa65a0-a7e7-4374-8f96-5786c8908615@w24g2000prd.googlegroups.com> <067151a4-b892-4e9a-8600-e2dcd92cb0ad@v18g2000pro.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1236319336 18249 80.91.229.12 (6 Mar 2009 06:02:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Mar 2009 06:02:16 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 06 07:03:31 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LfT9e-0004EL-5s for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Mar 2009 07:03:30 +0100 Original-Received: from localhost ([127.0.0.1]:42892 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LfT8I-00052A-Gr for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Mar 2009 01:02:06 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LfGaP-0003LB-3V for help-gnu-emacs@gnu.org; Thu, 05 Mar 2009 11:38:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LfGaM-0003Kb-S2 for help-gnu-emacs@gnu.org; Thu, 05 Mar 2009 11:38:16 -0500 Original-Received: from [199.232.76.173] (port=51856 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LfGaM-0003KX-LD for help-gnu-emacs@gnu.org; Thu, 05 Mar 2009 11:38:14 -0500 Original-Received: from wa-out-1112.google.com ([209.85.146.177]:8817) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LfGaL-0001UE-4a for help-gnu-emacs@gnu.org; Thu, 05 Mar 2009 11:38:13 -0500 Original-Received: by wa-out-1112.google.com with SMTP id k17so4324waf.26 for ; Thu, 05 Mar 2009 08:38:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:in-reply-to:references:x-mailer:mime-version :content-type:content-transfer-encoding; bh=IIwbPTXTeYdqwhAN7HZIf5nAcUjGqAD49OjmMZ6gMD4=; b=SlR2ClUvb3rQlxdQ3sdXpDsXWzwABdFD8doRe/jY2kWRjayG4lWy+8uiyeKsZkgXEx V3uszb6THyEAzc3JIzWTRKufy3W9Q1QRCk5ORfPtPzcZeKXTsd7Mqy3KlKz2rkmAKMqW AazC6KSlCWbL9ORtLHkzqL0HdV1J9CocHS308= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type:content-transfer-encoding; b=Qh2ekM7+0AB8b73xNzikBPXoqwQDcBntNgPI7iigsIHWVQsL0W+zxbqiAZQZfGZShE gTB5P2uQwIx2zrQvH5+j9lPfB8M6+OFOEdp8APGrXyDJsVcnS/xym1XDa6//9vMQM8cY 23RwQOAR2GYhBGQahDMFmWvO2Nxp1va37I7Fc= Original-Received: by 10.114.150.1 with SMTP id x1mr788341wad.93.1236271089677; Thu, 05 Mar 2009 08:38:09 -0800 (PST) Original-Received: from localhost (c66-235-1-45.sea2.cablespeed.com [66.235.1.45]) by mx.google.com with ESMTPS id j26sm105299waf.24.2009.03.05.08.38.09 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 05 Mar 2009 08:38:09 -0800 (PST) In-Reply-To: <067151a4-b892-4e9a-8600-e2dcd92cb0ad@v18g2000pro.googlegroups.com> X-Mailer: Claws Mail 3.7.0 (GTK+ 2.12.11; i686-pc-linux-gnu) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-Mailman-Approved-At: Fri, 06 Mar 2009 01:01:29 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:62647 Archived-At: On Tue, 3 Mar 2009 14:05:39 -0800 (PST) Xah Lee wrote: > On Mar 3, 9:59 am, Mike Mattie wrote: > > On Tue, 03 Mar 2009 17:34:41 +0000 > > > > Leo wrote: > > > On 2008-12-21 09:49 +0000, Helmut Eller wrote: > > > >> I'm pretty sure if you create it, more and more people will > > > >> join it. I'm very interested in PEG and think it is of critical > > > >> importance. > > > > > > I'll try to set up project at savannah. > > > > > I have seen the project on > > >http://savannah.nongnu.org/projects/emacs-peg. I wonder it might > > >be a > > > good idea to make a newsgroup on gmane to link to the mailing > > > list. It will make more Emacs users subscribe to it. > > > > > Best wishes, > > > > I was working on a PEG/CFG parser > > compiler:http://www.emacswiki.org/cgi-bin/wiki/ParserCompiler > > > > I will be resuming the development soon. Please keep me in the loop > > on such efforts. >=20 > Folks, >=20 > when you create a PEG parser, please please make it user oriented one, > so that any user of emacs familiar with regex find-replace will be > able to use PEG for find-replace. In particular, when doing find- > replace on nested text such as XML. >=20 > regex is powerful, but it doesn't do nested text. PEG comes to the > rescue. However, it needs to be regex-like, in the sense that the > program interface will be a simple source text and replacement text. > e.g. a function peg-replace that takes 2 args, pattern text, and text > source. The pattern text can be the region, buffer, or a filename, the > text source to work on can be similar. (thus, maybe peg-replace- > region, peg-replace-buffer, peg-replace-file etc.) >=20 > last time i was looking at PEG, i opted to try Helmut Eller's version > because it seems simpler. (mike's version is far more compiler geeking > incomprehensible) But still problematic to use. I got busy in other > things so i didn't continue on studying it, so i dropped out of this > thread (havn't read Helmut's last message in detail). Rather, i simply > want just to use it. Last in this thread, he mentioned about stacks > and i went huh... and just didn't have time to go further. >=20 > Regex is practically extremely useful, a tool every programer uses > today. However, regex cannot work with nested text such as XML/HTML, > which is used extensively, probably more so than any programing lang > or text. So, brigining regex power to html/xml will be a major impact > on not just emacs, but the whole programing industry. PEG, practically > speaking, is basically just the next generation of so-called regex. > Emacs can be the first to have such a feature. (existing PEG > implementations in various lang, at this point, as far as i know, are > all tech geeking toys, done by geekers interested in language parsing > and so on.) >=20 > Personally, i have huge need for regex that can work on html. > PEG is of course not just a regex replacement, but a BNF replacement > in the sense it is actually for machines to read. For these reasons > that's how i got heavily interested in PEG. (see: > =E2=80=A2 Pattern Matching vs Lexical Grammar Specification > http://xahlee.org/cmaci/notation/pattern_matching_vs_pattern_spec.html > ) >=20 > Please make your PEG in emacs with a regex-like API. Something any > emacs user familiar with regex will be able to use brainlessly. This > will be huge... >=20 > i had plans to open a mailing list and stuff... but got busy with > other things. I'll come back to this. But i hope you are convienced > about making PEG usable as a text-editing tool, as opposed to a tool > for computer scientist or compiler/parser writers. >=20 > Also, Mike & Helmut, please consider putting your code in goode code. > Google Code is very popular, probably today the most popular code > building service, and extremely easy to use, and from my studies > Google's products and services are all extremely high quality. It > would help a lot in your software at least in the marketing aspect if > you use Google Code. Also, open a google group is very useful and > popular. (yasnippet is a successful example for a emacs project on > google code. There are several others, including e.g. js2, ejacs, the > erlang one, etc.) Going into Savana or anything on FSF services tend > to be a dead end. (yeah, controversy, but whatever.) >=20 > Xah > =E2=88=91 http://xahlee.org/ >=20 > =E2=98=84 Making it simple to use is possible, and a goal. My project is not there yet. There are still some thorny issues to work out. Until then it will be very geeky :) Overcoming the use issue will IMHO require good documentation with *alot* of examples. When I am writing that I will let you know. Cheers, Mike Mattie