From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: how to use parsing expressing grammar Date: Tue, 3 Mar 2009 14:05:39 -0800 (PST) Organization: http://groups.google.com Message-ID: <067151a4-b892-4e9a-8600-e2dcd92cb0ad@v18g2000pro.googlegroups.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> 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 1236245636 16039 80.91.229.12 (5 Mar 2009 09:33:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Mar 2009 09:33:56 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 05 10:35:11 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 1Lf9yu-0004bB-Pu for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Mar 2009 10:35:09 +0100 Original-Received: from localhost ([127.0.0.1]:45200 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lf9xZ-0003IL-Hr for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Mar 2009 04:33:45 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!v18g2000pro.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs,comp.lang.lisp Original-Lines: 90 Original-NNTP-Posting-Host: 24.6.175.142 Original-X-Trace: posting.google.com 1236117939 30375 127.0.0.1 (3 Mar 2009 22:05:39 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 3 Mar 2009 22:05:39 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v18g2000pro.googlegroups.com; posting-host=24.6.175.142; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:167267 comp.emacs:97912 comp.lang.lisp:262163 X-Mailman-Approved-At: Thu, 05 Mar 2009 04:32:50 -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:62608 Archived-At: 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-b= in/wiki/ParserCompiler > > I will be resuming the development soon. Please keep me in the loop on su= ch efforts. Folks, 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. 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.) 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. 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.) 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 ) 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... 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. 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.) Xah =E2=88=91 http://xahlee.org/ =E2=98=84