From: Xah Lee <xahlee@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: how to use parsing expressing grammar
Date: Tue, 3 Mar 2009 14:05:39 -0800 (PST) [thread overview]
Message-ID: <067151a4-b892-4e9a-8600-e2dcd92cb0ad@v18g2000pro.googlegroups.com> (raw)
In-Reply-To: mailman.2299.1236115586.31690.help-gnu-emacs@gnu.org
On Mar 3, 9:59 am, Mike Mattie <codermat...@gmail.com> wrote:
> On Tue, 03 Mar 2009 17:34:41 +0000
>
> Leo <sdl....@gmail.com> 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.
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:
• 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
∑ http://xahlee.org/
☄
next prev parent reply other threads:[~2009-03-03 22:05 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <6b8a1070-1a89-48b0-9287-343b673b5758@a29g2000pra.googlegroups.com>
[not found] ` <m27i5yygi5.fsf@gmail.com>
[not found] ` <m2k59ywtj2.fsf@gmail.com>
[not found] ` <b3203a8b-324f-440f-98a9-653c8d582c7c@y1g2000pra.googlegroups.com>
2008-12-20 8:42 ` how to use parsing expressing grammar Xah Lee
2008-12-20 9:34 ` Helmut Eller
2008-12-20 21:41 ` Xah Lee
2008-12-21 9:49 ` Helmut Eller
2009-03-03 17:34 ` Leo
2009-03-03 17:59 ` Mike Mattie
[not found] ` <mailman.2299.1236115586.31690.help-gnu-emacs@gnu.org>
2009-03-03 22:05 ` Xah Lee [this message]
2009-03-03 23:52 ` W Dan Meyer
2009-03-04 0:35 ` Miles Bader
2009-03-05 6:55 ` Mike Mattie
2009-03-05 6:18 ` Mike Mattie
2009-03-05 16:38 ` Mike Mattie
2009-03-06 8:53 ` Helmut Eller
2008-12-20 22:27 ` Xah Lee
2008-12-21 11:24 ` Helmut Eller
2008-12-23 23:21 ` ashishnkadakia
2008-12-17 11:53 Xah Lee
2008-12-18 3:43 ` Kevin Rodgers
[not found] ` <mailman.3007.1229571828.26697.help-gnu-emacs@gnu.org>
2008-12-18 9:24 ` Xah Lee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=067151a4-b892-4e9a-8600-e2dcd92cb0ad@v18g2000pro.googlegroups.com \
--to=xahlee@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).